fix red color not showing for errorneous feeds
This commit is contained in:
parent
4d1c9810cd
commit
86a53e011b
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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(),
|
||||||
|
|
Loading…
Reference in New Issue