Merge pull request #60 from strider-paff-shell/chat

Chat
This commit is contained in:
Denio
2020-05-28 19:39:17 +02:00
committed by GitHub

View File

@@ -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