Better newspaper view, faster viewing of msgs, bumped Qt to 5.7.0.

This commit is contained in:
Martin Rotter 2016-06-17 07:43:29 +02:00
parent dd1cf90e37
commit 18e9d9dc32
9 changed files with 48 additions and 11 deletions

@ -1 +1 @@
Subproject commit 8ce4c82c7ddbfd67e1509e8dd93e1a03a084b2bb
Subproject commit 75fe8e091b186711a5a7864f23ffea720a8832fe

View File

@ -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!

10
rssguard.pro Normal file → Executable file
View File

@ -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) {

View File

@ -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();

View File

@ -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();

View File

@ -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()));

View File

@ -125,7 +125,7 @@ void MessagePreviewer::markMessageAsRead(int id, bool read) {
QList<Message>() << *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;
}
}

View File

@ -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:

View File

@ -477,8 +477,6 @@ void MessagesView::createNewspaperView(RootItem *selected_item, const QList<Mess
TabBar::Closable);
qApp->mainForm()->tabWidget()->setCurrentIndex(index);
connect(prev, SIGNAL(requestMessageListReload(bool)), this, SLOT(reloadSelections(bool)));
prev->loadMessages(messages, selected_item);
}