From 18e9d9dc32371aace7b91693db4712d6386362d0 Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Fri, 17 Jun 2016 07:43:29 +0200 Subject: [PATCH] Better newspaper view, faster viewing of msgs, bumped Qt to 5.7.0. --- resources/binaries | 2 +- resources/text/CHANGELOG | 4 ++++ rssguard.pro | 10 +++++----- src/core/messagesmodel.cpp | 24 ++++++++++++++++++++++++ src/core/messagesmodel.h | 6 ++++++ src/gui/feedmessageviewer.cpp | 5 ++++- src/gui/messagepreviewer.cpp | 4 ++-- src/gui/messagepreviewer.h | 2 ++ src/gui/messagesview.cpp | 2 -- 9 files changed, 48 insertions(+), 11 deletions(-) mode change 100644 => 100755 rssguard.pro diff --git a/resources/binaries b/resources/binaries index 8ce4c82c7..75fe8e091 160000 --- a/resources/binaries +++ b/resources/binaries @@ -1 +1 @@ -Subproject commit 8ce4c82c7ddbfd67e1509e8dd93e1a03a084b2bb +Subproject commit 75fe8e091b186711a5a7864f23ffea720a8832fe diff --git a/resources/text/CHANGELOG b/resources/text/CHANGELOG index e8874e42b..efe952d8b 100755 --- a/resources/text/CHANGELOG +++ b/resources/text/CHANGELOG @@ -6,6 +6,10 @@ Added: ▪ Default skin now uses Bootrstrap-powered look. ▪ Feed updates are now parallelized up to infinite number of threads. This speeds up speed of concurrent feed updates rapidly (more than 5 times). I was able to update about 160 feeds in 35 seconds. Note that this feature is still in experimental state. +Changed: +▪ Minimal Qt version bumped to 5.7.0 - this will lead to some betere features in the future. +▪ Updated miscellaneous libraries - MariadDB, openSSL. + Removed: ▪ All skins except default are removed because it is difficult for me to maintain all of them. Any user can pickup removed skin from repository, tweak it (it is easy) and send it to me and I will include it with next version of RSS Guard. ▪ Cmake dependency completely removed! diff --git a/rssguard.pro b/rssguard.pro old mode 100644 new mode 100755 index c8d40ecad..fa26f2208 --- a/rssguard.pro +++ b/rssguard.pro @@ -60,24 +60,24 @@ DEFINES *= QT_USE_QSTRINGBUILDER message(rssguard: Welcome RSS Guard qmake script.) -lessThan(QT_MAJOR_VERSION, 5)|lessThan(QT_MINOR_VERSION, 6) { - error(rssguard: At least Qt 5.6.0 is required.) +lessThan(QT_MAJOR_VERSION, 5)|lessThan(QT_MINOR_VERSION, 7) { + error(rssguard: At least Qt 5.7.0 is required.) } APP_NAME = "RSS Guard" APP_LOW_NAME = "rssguard" APP_LOW_H_NAME = ".rssguard" -APP_COPYRIGHT = "(C) 2011-2016 Martin Rotter" +APP_AUTHOR = "Martin Rotter" +APP_COPYRIGHT = "(C) 2011-2016 $$APP_AUTHOR" APP_VERSION = "3.3.0" APP_LONG_NAME = "$$APP_NAME $$APP_VERSION" -APP_AUTHOR = "Martin Rotter" APP_EMAIL = "rotter.martinos@gmail.com" APP_URL = "http://bitbucket.org/skunkos/rssguard" APP_URL_ISSUES = "http://bitbucket.org/skunkos/rssguard/issues" APP_URL_ISSUES_NEW_GITHUB = "https://github.com/martinrotter/rssguard/issues/new" APP_URL_ISSUES_NEW_BITBUCKET = "http://bitbucket.org/skunkos/rssguard/issues/new" APP_URL_WIKI = "https://bitbucket.org/skunkos/rssguard/wiki/Home" -APP_USERAGENT = "RSS Guard/3.3.0 (bitbucket.org/skunkos/rssguard)" +APP_USERAGENT = "RSS Guard/$$APP_VERSION (bitbucket.org/skunkos/rssguard)" APP_DONATE_URL = "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=XMWPLPK893VH4" isEmpty(PREFIX) { diff --git a/src/core/messagesmodel.cpp b/src/core/messagesmodel.cpp index f33df2542..bf1e6cc2b 100755 --- a/src/core/messagesmodel.cpp +++ b/src/core/messagesmodel.cpp @@ -88,6 +88,18 @@ void MessagesModel::loadMessages(RootItem *item) { fetchAllData(); } +bool MessagesModel::setMessageImportantById(int id, RootItem::Importance important) { + for (int i = 0; i < rowCount(); i++) { + int found_id = data(i, MSG_DB_ID_INDEX, Qt::EditRole).toInt(); + + if (found_id == id) { + return setData(index(i, MSG_DB_IMPORTANT_INDEX), important); + } + } + + return false; +} + bool MessagesModel::submitAll() { qFatal("Submitting changes via model is not allowed."); return false; @@ -263,6 +275,18 @@ bool MessagesModel::setMessageRead(int row_index, RootItem::ReadStatus read) { } } +bool MessagesModel::setMessageReadById(int id, RootItem::ReadStatus read) { + for (int i = 0; i < rowCount(); i++) { + int found_id = data(i, MSG_DB_ID_INDEX, Qt::EditRole).toInt(); + + if (found_id == id) { + return setData(index(i, MSG_DB_READ_INDEX), read); + } + } + + return false; +} + bool MessagesModel::switchMessageImportance(int row_index) { const QModelIndex target_index = index(row_index, MSG_DB_IMPORTANT_INDEX); const RootItem::Importance current_importance = (RootItem::Importance) data(target_index, Qt::EditRole).toInt(); diff --git a/src/core/messagesmodel.h b/src/core/messagesmodel.h index 243b6ad68..985274f7f 100755 --- a/src/core/messagesmodel.h +++ b/src/core/messagesmodel.h @@ -86,6 +86,12 @@ class MessagesModel : public QSqlTableModel { // Loads messages of given feeds. void loadMessages(RootItem *item); + public slots: + // NOTE: These methods DO NOT actually change data in the DB, just in the model. + // These are particularly used by msg browser. + bool setMessageImportantById(int id, RootItem::Importance important); + bool setMessageReadById(int id, RootItem::ReadStatus read); + private slots: // To disable persistent changes submissions. bool submitAll(); diff --git a/src/gui/feedmessageviewer.cpp b/src/gui/feedmessageviewer.cpp index 4580ca36d..85a1f5b20 100755 --- a/src/gui/feedmessageviewer.cpp +++ b/src/gui/feedmessageviewer.cpp @@ -237,7 +237,10 @@ void FeedMessageViewer::createConnections() { connect(m_messagesView, SIGNAL(currentMessageChanged(Message,RootItem*)), m_messagesBrowser, SLOT(loadMessage(Message,RootItem*))); connect(m_messagesView, SIGNAL(currentMessageRemoved()), this, SLOT(updateMessageButtonsAvailability())); connect(m_messagesView, SIGNAL(currentMessageChanged(Message,RootItem*)), this, SLOT(updateMessageButtonsAvailability())); - connect(m_messagesBrowser, SIGNAL(requestMessageListReload(bool)), m_messagesView, SLOT(reloadSelections(bool))); + connect(m_messagesBrowser, SIGNAL(markMessageRead(int,RootItem::ReadStatus)), + m_messagesView->sourceModel(), SLOT(setMessageReadById(int,RootItem::ReadStatus))); + connect(m_messagesBrowser, SIGNAL(markMessageImportant(int,RootItem::Importance)), + m_messagesView->sourceModel(), SLOT(setMessageImportantById(int,RootItem::Importance))); connect(m_feedsView, SIGNAL(itemSelected(RootItem*)), this, SLOT(updateFeedButtonsAvailability())); connect(qApp->feedUpdateLock(), SIGNAL(locked()), this, SLOT(updateFeedButtonsAvailability())); diff --git a/src/gui/messagepreviewer.cpp b/src/gui/messagepreviewer.cpp index f4ac159ed..80d3c1ec5 100755 --- a/src/gui/messagepreviewer.cpp +++ b/src/gui/messagepreviewer.cpp @@ -125,7 +125,7 @@ void MessagePreviewer::markMessageAsRead(int id, bool read) { QList() << *msg, read ? RootItem::Read : RootItem::Unread); - emit requestMessageListReload(false); + emit markMessageRead(msg->m_id, read ? RootItem::Read : RootItem::Unread); msg->m_isRead = read ? RootItem::Read : RootItem::Unread; } } @@ -149,7 +149,7 @@ void MessagePreviewer::switchMessageImportance(int id, bool checked) { RootItem::NotImportant : RootItem::Important)); - emit requestMessageListReload(false); + emit markMessageImportant(msg->m_id, msg->m_isImportant ? RootItem::NotImportant : RootItem::Important); msg->m_isImportant = checked; } } diff --git a/src/gui/messagepreviewer.h b/src/gui/messagepreviewer.h index 05f3b1fae..c85521a7f 100755 --- a/src/gui/messagepreviewer.h +++ b/src/gui/messagepreviewer.h @@ -52,6 +52,8 @@ class MessagePreviewer : public TabContent { void receiveMessageStatusChangeRequest(int message_id, MessageBrowserPage::MessageStatusChange change); signals: + void markMessageRead(int id, RootItem::ReadStatus read); + void markMessageImportant(int id, RootItem::Importance important); void requestMessageListReload(bool mark_current_as_read); private: diff --git a/src/gui/messagesview.cpp b/src/gui/messagesview.cpp index 35b2fe75a..ad767a0cd 100755 --- a/src/gui/messagesview.cpp +++ b/src/gui/messagesview.cpp @@ -477,8 +477,6 @@ void MessagesView::createNewspaperView(RootItem *selected_item, const QListmainForm()->tabWidget()->setCurrentIndex(index); - connect(prev, SIGNAL(requestMessageListReload(bool)), this, SLOT(reloadSelections(bool))); - prev->loadMessages(messages, selected_item); }