Commit 87115ecb authored by Martin Straka's avatar Martin Straka

Files: qCritica() instead of qDebug()

parent e8d4e6bd
......@@ -85,7 +85,7 @@ void Files::deleteExpiredFilesFromDbs(int days)
fDb = globFileDbsPtr->accessFileDb(globSet.dbsLocation, userName,
AccountListModel::globAccounts[userName].storeToDisk());
if (fDb == NULL) {
qDebug() << "ERROR: File database cannot open!" << userName;
qCritical() << "ERROR: File database cannot open!" << userName;
return;
}
msgIDList = fDb->cleanFilesInDb(days);
......@@ -97,7 +97,7 @@ void Files::deleteExpiredFilesFromDbs(int days)
msgDb = globMessageDbsPtr->accessMessageDb(globSet.dbsLocation,
userName, AccountListModel::globAccounts[userName].storeToDisk());
if (msgDb == NULL) {
qDebug() << "ERROR: Message database cannot open!";
qCritical() << "ERROR: Message database cannot open!";
return;
}
msgDb->beginTransaction();
......@@ -250,25 +250,25 @@ void Files::sendAttachmentsWithEmail(const QString &userName, qint64 msgId)
MessageDb *msgDb = globMessageDbsPtr->accessMessageDb(globSet.dbsLocation,
userName, AccountListModel::globAccounts[userName].storeToDisk());
if (msgDb == NULL) {
qDebug() << "ERROR: Message database cannot open!";
qCritical() << "ERROR: Message database cannot open!";
return;
}
if (!msgDb->getMessageDataForEmail(msgId, body, subject)) {
qDebug() << "ERROR: Message data mssing!";
qCritical() << "ERROR: Message data mssing!";
return;
}
FileDb *fDb = globFileDbsPtr->accessFileDb(globSet.dbsLocation,
userName, AccountListModel::globAccounts[userName].storeToDisk());
if (fDb == NULL) {
qDebug() << "ERROR: File database cannot open!";
qCritical() << "ERROR: File database cannot open!";
return;
}
QList<FileDb::FileData> filelist;
filelist = fDb->getFilesFromDb(msgId);
if (filelist.isEmpty()) {
qDebug() << "ERROR: File list is empty!";
qCritical() << "ERROR: File list is empty!";
return;
}
......@@ -280,7 +280,7 @@ void Files::sendAttachmentsWithEmail(const QString &userName, qint64 msgId)
foreach (const FileDb::FileData &file, filelist) {
QString fileName = file.filename;
if (fileName.isEmpty()) {
qDebug() << "ERROR: File name is empty!";
qCritical() << "ERROR: File name is empty!";
return;
}
fileName = writeFileToEmailDir(fileName, msgId,
......@@ -288,7 +288,6 @@ void Files::sendAttachmentsWithEmail(const QString &userName, qint64 msgId)
fileList.append(fileName);
addAttachmentToEmailMessage(emailMessage, file.filename,
file.content.toUtf8(), boundary);
qDebug() << fileName;
}
finishEmailMessage(emailMessage, boundary);
......@@ -313,11 +312,11 @@ void Files::deleteFileDb(const QString &userName)
fDb = globFileDbsPtr->accessFileDb(globSet.dbsLocation, userName,
AccountListModel::globAccounts[userName].storeToDisk());
if (fDb == NULL) {
qDebug() << "ERROR: File database open error!";
qCritical() << "ERROR: File database open error!";
return;
}
if (!globFileDbsPtr->deleteDb(fDb)) {
qDebug() << "ERROR: File database could not delete!";
qCritical() << "ERROR: File database could not delete!";
return;
}
......@@ -325,11 +324,11 @@ void Files::deleteFileDb(const QString &userName)
msgDb = globMessageDbsPtr->accessMessageDb(globSet.dbsLocation, userName,
AccountListModel::globAccounts[userName].storeToDisk());
if (msgDb == NULL) {
qDebug() << "ERROR: Message database cannot open!";
qCritical() << "ERROR: Message database cannot open!";
return;
}
if (!msgDb->setAttachmentsDownloaded(false)) {
qDebug() << "ERROR: Message data mssing!";
qCritical() << "ERROR: Message data mssing!";
return;
}
}
......@@ -346,7 +345,8 @@ void Files::vacuumFileDbs(void)
fDb = globFileDbsPtr->accessFileDb(globSet.dbsLocation, userName,
AccountListModel::globAccounts[userName].storeToDisk());
if (fDb == NULL) {
qDebug() << "ERROR: File database cannot open!" << userName;
qCritical() << "ERROR: File database cannot open!"
<< userName;
return;
}
fDb->vacuumFileDb();
......@@ -363,7 +363,7 @@ bool Files::deleteAttachmentsFromDb(const QString &userName, qint64 msgId)
fDb = globFileDbsPtr->accessFileDb(globSet.dbsLocation, userName,
AccountListModel::globAccounts[userName].storeToDisk());
if (fDb == NULL) {
qDebug() << "ERROR: File database cannot open!" << userName;
qCritical() << "ERROR: File database cannot open!" << userName;
return false;
}
......@@ -372,7 +372,7 @@ bool Files::deleteAttachmentsFromDb(const QString &userName, qint64 msgId)
msgDb = globMessageDbsPtr->accessMessageDb(globSet.dbsLocation,
userName, AccountListModel::globAccounts[userName].storeToDisk());
if (msgDb == NULL) {
qDebug() << "ERROR: Message database cannot open!";
qCritical() << "ERROR: Message database cannot open!";
return false;
}
return msgDb->setAttachmentDownloaded(msgId, false);
......@@ -622,7 +622,7 @@ void Files::sendEmail(const QString &emailMessage, const QStringList &fileList,
/* TODO -- Handle openUrl() return value. */
} else {
qDebug() << "Tmp file save error";
qWarning() << "Tmp file save error";
}
Q_UNUSED(subject);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment