[kde-doc-english] [trojita] src/Gui: Do not delay marking messages as read when user doesn't want a delay

Jan Kundrát jkt at kde.org
Tue Dec 16 10:09:24 UTC 2014


Git commit 414c9d3b4af3f0772c69bd0cdf15890aeb06ea0a by Jan Kundrát.
Committed on 15/12/2014 at 18:21.
Pushed by gerrit into branch 'master'.

Do not delay marking messages as read when user doesn't want a delay

Thanks to Ed Tomlinson <edtoml at gmail.com> for reporting this on IRC. The
delay is actually already implemented within the MsgListView, so
delaying stuff even further here makes little sense now.

The 200ms was some arbitrary change made yars ago:

commit 6892cd36d22d9d1e7a84852bf9a31fe61f142f50
Author: Jan Kundrát <jkt at flaska.net>
Date:   Wed May 30 21:51:01 2012 +0200

    GUI: mark visited messages as read almost instantly

Change-Id: Idbe3a15d18ac1f0c881d0dc789bff2c91f6ae13b

M  +3    -3    src/Gui/MessageView.cpp

http://commits.kde.org/trojita/414c9d3b4af3f0772c69bd0cdf15890aeb06ea0a

diff --git a/src/Gui/MessageView.cpp b/src/Gui/MessageView.cpp
index eb5c32a..99cc96a 100644
--- a/src/Gui/MessageView.cpp
+++ b/src/Gui/MessageView.cpp
@@ -252,9 +252,9 @@ void MessageView::setMessage(const QModelIndex &index)
 
     if (m_netWatcher && m_netWatcher->effectiveNetworkPolicy() != Imap::Mailbox::NETWORK_OFFLINE
             && m_settings->value(Common::SettingsNames::autoMarkReadEnabled, QVariant(true)).toBool()) {
-        uint timeout = m_settings->value(Common::SettingsNames::autoMarkReadSeconds, QVariant(0)).toUInt() * 1000;
-        // the 200ms is there to allow quick navigation between messages without marking them as read
-        markAsReadTimer->start(qMax(200u, timeout));
+        // No additional delay is needed here because the MsgListView won't open a message while the user keeps scrolling,
+        // which was AFAIK the original intention
+        markAsReadTimer->start(m_settings->value(Common::SettingsNames::autoMarkReadSeconds, QVariant(0)).toUInt() * 1000);
     }
 }
 


More information about the kde-doc-english mailing list