Properly reload individualy switched msg when changing importance - color of font did not change all the times.

This commit is contained in:
martinrotter 2017-05-11 06:22:38 +02:00
parent b99acea244
commit 73925b6452
3 changed files with 8 additions and 5 deletions

View File

@ -109,6 +109,7 @@ class FeedsModel : public QAbstractItemModel {
// Loads feed/categories from the database.
void loadActivatedServiceAccounts();
// Stops all accounts before exit.
void stopServiceAccounts();
// Reloads counts of all feeds/categories/whatever in the model.
@ -124,8 +125,6 @@ class FeedsModel : public QAbstractItemModel {
// Removes item with given index.
// NOTE: Also deletes item from memory.
void removeItem(const QModelIndex &index);
// Removes given item from the model/memory.
void removeItem(RootItem *deleting_item);
// Recycle bins operations.

View File

@ -399,6 +399,8 @@ bool MessagesModel::switchMessageImportance(int row_index) {
// Commit changes.
if (DatabaseQueries::markMessageImportant(database(), message.m_id, next_importance)) {
emit dataChanged(index(row_index, 0), index(row_index, MSG_DB_FEED_CUSTOM_ID_INDEX), QVector<int>() << Qt::FontRole);
return m_selectedItem->getParentServiceRoot()->onAfterSwitchMessageImportance(m_selectedItem,
QList<QPair<Message,RootItem::Importance> >() << pair);
}

View File

@ -59,6 +59,7 @@ class MessagesModel : public QSqlTableModel {
void updateDateFormat();
void reloadWholeLayout();
// Adds this new state to queue of sort states.
void addSortState(int column, Qt::SortOrder order);
// CORE messages manipulators.
@ -99,13 +100,14 @@ class MessagesModel : public QSqlTableModel {
void setupFonts();
void setupIcons();
// Fetches ALL available data to the model.
void fetchAllData();
// Direct SQL stuff.
QString orderByClause() const;
QString selectStatement() const;
QString formatFields() const;
// Fetches ALL available data to the model.
void fetchAllData();
// NOTE: These two lists contain data for multicolumn sorting.
// They are always same length. Most important sort column/order
// are located at the start of lists;