diff --git a/src/librssguard/core/messagesmodel.cpp b/src/librssguard/core/messagesmodel.cpp index 090e7d4f4..aeddc4840 100644 --- a/src/librssguard/core/messagesmodel.cpp +++ b/src/librssguard/core/messagesmodel.cpp @@ -362,8 +362,6 @@ bool MessagesModel::setMessageRead(int row_index, RootItem::ReadStatus read) { } bool MessagesModel::setMessageReadById(int id, RootItem::ReadStatus read) { - int a = 5; - for (int i = 0; i < rowCount(); i++) { int found_id = data(i, MSG_DB_ID_INDEX, Qt::EditRole).toInt(); diff --git a/src/librssguard/gui/feedmessageviewer.cpp b/src/librssguard/gui/feedmessageviewer.cpp index f606f21e5..33a44331d 100644 --- a/src/librssguard/gui/feedmessageviewer.cpp +++ b/src/librssguard/gui/feedmessageviewer.cpp @@ -199,8 +199,8 @@ void FeedMessageViewer::createConnections() { #else connect(m_messagesView, &MessagesView::currentMessageRemoved, m_messagesBrowser, &MessagePreviewer::clear); connect(m_messagesBrowser, &MessagePreviewer::markMessageRead, m_messagesView->sourceModel(), &MessagesModel::setMessageReadById); - connect(m_messagesBrowser, &MessagePreviewer::markMessageImportant, m_messagesView->sourceModel(), - &MessagesModel::setMessageImportantById); + connect(m_messagesBrowser, &MessagePreviewer::markMessageImportant, + m_messagesView->sourceModel(), &MessagesModel::setMessageImportantById); #endif connect(m_messagesView, &MessagesView::currentMessageChanged, this, &FeedMessageViewer::displayMessage); diff --git a/src/librssguard/gui/messagepreviewer.h b/src/librssguard/gui/messagepreviewer.h index 2183272da..8ec6cb296 100644 --- a/src/librssguard/gui/messagepreviewer.h +++ b/src/librssguard/gui/messagepreviewer.h @@ -43,7 +43,6 @@ class MessagePreviewer : public QWidget { signals: void markMessageRead(int id, RootItem::ReadStatus read); void markMessageImportant(int id, RootItem::Importance important); - void requestMessageListReload(bool mark_current_as_read); private: void createConnections(); @@ -55,9 +54,7 @@ class MessagePreviewer : public QWidget { Ui::MessagePreviewer m_ui; Message m_message; QStringList m_pictures; - QPointer m_root; - QAction* m_actionMarkRead; QAction* m_actionMarkUnread; QAction* m_actionSwitchImportance; diff --git a/src/librssguard/gui/newspaperpreviewer.cpp b/src/librssguard/gui/newspaperpreviewer.cpp index 92632250d..82d875083 100644 --- a/src/librssguard/gui/newspaperpreviewer.cpp +++ b/src/librssguard/gui/newspaperpreviewer.cpp @@ -24,7 +24,9 @@ void NewspaperPreviewer::showMoreMessages() { auto* prev = new MessagePreviewer(this); QMargins margins = prev->layout()->contentsMargins(); - connect(prev, &MessagePreviewer::requestMessageListReload, this, &NewspaperPreviewer::requestMessageListReload); + connect(prev, &MessagePreviewer::markMessageRead, this, &NewspaperPreviewer::markMessageRead); + connect(prev, &MessagePreviewer::markMessageImportant, this, &NewspaperPreviewer::markMessageImportant); + margins.setRight(0); prev->layout()->setContentsMargins(margins); prev->setFixedHeight(300); diff --git a/src/librssguard/gui/newspaperpreviewer.h b/src/librssguard/gui/newspaperpreviewer.h index e8ca809bf..6e438dafd 100644 --- a/src/librssguard/gui/newspaperpreviewer.h +++ b/src/librssguard/gui/newspaperpreviewer.h @@ -30,7 +30,8 @@ class NewspaperPreviewer : public TabContent { void showMoreMessages(); signals: - void requestMessageListReload(bool mark_current_as_read); + void markMessageRead(int id, RootItem::ReadStatus read); + void markMessageImportant(int id, RootItem::Importance important); private: QScopedPointer m_ui; diff --git a/src/librssguard/gui/tabwidget.cpp b/src/librssguard/gui/tabwidget.cpp index 0129fc0df..34b3ce812 100644 --- a/src/librssguard/gui/tabwidget.cpp +++ b/src/librssguard/gui/tabwidget.cpp @@ -192,9 +192,9 @@ int TabWidget::addNewspaperView(RootItem* root, const QList& messages) #else NewspaperPreviewer* prev = new NewspaperPreviewer(root, messages, this); - connect(prev, &MessagePreviewer::markMessageRead, + connect(prev, &NewspaperPreviewer::markMessageRead, m_feedMessageViewer->messagesView()->sourceModel(), &MessagesModel::setMessageReadById); - connect(prev, &MessagePreviewer::markMessageImportant, + connect(prev, &NewspaperPreviewer::markMessageImportant, m_feedMessageViewer->messagesView()->sourceModel(), &MessagesModel::setMessageImportantById); #endif diff --git a/src/librssguard/gui/webbrowser.h b/src/librssguard/gui/webbrowser.h index 7c736d1e3..5c87478d9 100644 --- a/src/librssguard/gui/webbrowser.h +++ b/src/librssguard/gui/webbrowser.h @@ -79,7 +79,6 @@ class WebBrowser : public TabContent { void markMessageRead(int id, RootItem::ReadStatus read); void markMessageImportant(int id, RootItem::Importance important); - void requestMessageListReload(bool mark_current_as_read); private: void initializeLayout(); @@ -100,7 +99,6 @@ class WebBrowser : public TabContent { QAction* m_actionForward; QAction* m_actionReload; QAction* m_actionStop; - QList m_messages; QPointer m_root; };