@@ -100,6 +100,20 @@ QList<ContactItem> FileSystem::readContactsOldFormat(QString file)
|
|||||||
in >> version;
|
in >> version;
|
||||||
qDebug() << "Read " << version << " Hush contacts from disk...";
|
qDebug() << "Read " << version << " Hush contacts from disk...";
|
||||||
qDebug() << "Detected old addressbook format";
|
qDebug() << "Detected old addressbook format";
|
||||||
|
if(in.status() == QDataStream::ReadCorruptData)
|
||||||
|
{
|
||||||
|
qDebug() << "Error reading contacts! ---> Your hush contacts from disk maybe corrupted";
|
||||||
|
QFile::rename(file, file + QString(".corrupted"));
|
||||||
|
QMessageBox::critical(
|
||||||
|
nullptr,
|
||||||
|
QObject::tr("Error reading contacts!"),
|
||||||
|
QObject::tr("Your hush contacts from disk maybe corrupted"),
|
||||||
|
QMessageBox::Ok
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
qDebug() << "Read " << version << " Hush contacts from disk...";
|
||||||
QList<QList<QString>> stuff;
|
QList<QList<QString>> stuff;
|
||||||
in >> stuff;
|
in >> stuff;
|
||||||
for (int i=0; i < stuff.size(); i++)
|
for (int i=0; i < stuff.size(); i++)
|
||||||
@@ -108,6 +122,9 @@ QList<ContactItem> FileSystem::readContactsOldFormat(QString file)
|
|||||||
contacts.push_back(contact);
|
contacts.push_back(contact);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
qDebug() << "Hush contacts readed from disk...";
|
||||||
|
}
|
||||||
|
|
||||||
_file.close();
|
_file.close();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user