Added some error loggings.

This commit is contained in:
Martin Rotter 2015-12-18 12:16:44 +01:00
parent b4982e5666
commit 31fdc92167
2 changed files with 11 additions and 0 deletions

View File

@ -29,6 +29,7 @@
#include <QPointer>
#include <QSqlQuery>
#include <QSqlError>
TtRssServiceEntryPoint::TtRssServiceEntryPoint(){
@ -101,6 +102,9 @@ QList<ServiceRoot*> TtRssServiceEntryPoint::initializeSubtree() {
roots.append(root);
}
}
else {
qWarning("TT-RSS: Getting list of activated accounts failed: '%s'.", qPrintable(query.lastError().text()));
}
return roots;
}

View File

@ -441,6 +441,9 @@ void TtRssServiceRoot::saveAccountDataToDatabase() {
updateTitle();
itemChanged(QList<RootItem*>() << this);
}
else {
qWarning("TT-RSS: Updating account failed: '%s'.", qPrintable(query.lastError().text()));
}
}
else {
// We are probably saving newly added account.
@ -449,6 +452,7 @@ void TtRssServiceRoot::saveAccountDataToDatabase() {
// First obtain the ID, which can be assigned to this new account.
if (!query.exec("SELECT max(id) FROM Accounts;") || !query.next()) {
qWarning("TT-RSS: Getting max ID from Accounts table failed: '%s'.", qPrintable(query.lastError().text()));
return;
}
@ -479,6 +483,9 @@ void TtRssServiceRoot::saveAccountDataToDatabase() {
setAccountId(id_to_assign);
updateTitle();
}
else {
qWarning("TT-RSS: Saving of new account failed: '%s'.", qPrintable(query.lastError().text()));
}
}
}