This commit is contained in:
Martin Rotter 2016-08-23 10:14:19 +02:00
parent 5873967102
commit f1532fc5a5
4 changed files with 13 additions and 4 deletions

View File

@ -9,6 +9,7 @@ Changed:
Fixed:
▪ RSS Guard was not launchable in Windows XP. (bug #53)
▪ RSS Guard crashed when switching msg status during feed updates. (bug #41)
3.3.3
—————

View File

@ -105,7 +105,11 @@ void FeedDownloader::oneFeedUpdateFinished(const QList<Message> &messages) {
<< QThread::currentThreadId() << "\'.";
if (!m_stopUpdate) {
int updated_messages = messages.isEmpty() ? 0 : feed->updateMessages(messages);
int updated_messages;
QMetaObject::invokeMethod(feed, "updateMessages", Qt::BlockingQueuedConnection,
Q_RETURN_ARG(int, updated_messages),
Q_ARG(QList<Message>, messages));
if (updated_messages > 0) {
m_results.appendUpdatedFeed(QPair<QString,int>(feed->title(), updated_messages));

View File

@ -149,6 +149,9 @@ void Feed::run() {
}
int Feed::updateMessages(const QList<Message> &messages) {
qDebug().nospace() << "Updating messages in DB. Main thread: " <<
(QThread::currentThread() == qApp->thread() ? "true." : "false.");
int custom_id = customId();
int account_id = getParentServiceRoot()->accountId();
bool anything_updated = false;

View File

@ -78,12 +78,13 @@ class Feed : public RootItem, public QRunnable {
QString url() const;
void setUrl(const QString &url);
int updateMessages(const QList<Message> &messages);
void updateCounts(bool including_total_count);
// Runs update in thread (thread pooled).
void run();
public slots:
void updateCounts(bool including_total_count);
int updateMessages(const QList<Message> &messages);
private:
// Performs synchronous obtaining of new messages for this feed.
virtual QList<Message> obtainNewMessages() = 0;