fix red color not showing for errorneous feeds

This commit is contained in:
Martin Rotter 2019-04-03 12:07:30 +02:00
parent 4d1c9810cd
commit 86a53e011b
2 changed files with 30 additions and 30 deletions

View File

@ -212,6 +212,8 @@ bool Feed::markAsReadUnread(RootItem::ReadStatus status) {
int Feed::updateMessages(const QList<Message>& messages, bool error_during_obtaining) { int Feed::updateMessages(const QList<Message>& messages, bool error_during_obtaining) {
QList<RootItem*> items_to_update; QList<RootItem*> items_to_update;
int updated_messages = 0; int updated_messages = 0;
if (!error_during_obtaining) {
bool is_main_thread = QThread::currentThread() == qApp->thread(); bool is_main_thread = QThread::currentThread() == qApp->thread();
qDebug("Updating messages in DB. Main thread: '%s'.", qPrintable(is_main_thread ? "true" : "false")); qDebug("Updating messages in DB. Main thread: '%s'.", qPrintable(is_main_thread ? "true" : "false"));
@ -243,16 +245,14 @@ int Feed::updateMessages(const QList<Message>& messages, bool error_during_obtai
items_to_update.append(getParentServiceRoot()->recycleBin()); items_to_update.append(getParentServiceRoot()->recycleBin());
} }
} }
}
if (error_during_obtaining) { else {
qCritical("There is indication that there was error during messages obtaining."); qCritical("There is indication that there was error during messages obtaining.");
} }
if (ok && !messages.isEmpty()) {
// Some messages were really added to DB, reload feed in model. // Some messages were really added to DB, reload feed in model.
items_to_update.append(this); items_to_update.append(this);
getParentServiceRoot()->itemChanged(items_to_update); getParentServiceRoot()->itemChanged(items_to_update);
}
return updated_messages; return updated_messages;
} }

View File

@ -56,7 +56,7 @@ QList<QAction*> StandardFeed::contextMenu() {
} }
QString StandardFeed::additionalTooltip() const { QString StandardFeed::additionalTooltip() const {
return Feed::additionalTooltip() + tr("Network status: %1\n" return Feed::additionalTooltip() + tr("\nNetwork status: %1\n"
"Encoding: %2\n" "Encoding: %2\n"
"Type: %3").arg(NetworkFactory::networkErrorText(m_networkError), "Type: %3").arg(NetworkFactory::networkErrorText(m_networkError),
encoding(), encoding(),