[kde-doc-english] [trojita] src/Gui: GUI: unbreak opening e-mails via a single click even without QStyle::SH_ItemView_ActivateItemOnSingleClick

Jan Kundrát jkt at flaska.net
Tue Mar 5 12:08:04 UTC 2013


Git commit f92c008a2187d5dba7eb547705deb197e0472739 by Jan Kundrát.
Committed on 05/03/2013 at 13:04.
Pushed by jkt into branch 'master'.

GUI: unbreak opening e-mails via a single click even without QStyle::SH_ItemView_ActivateItemOnSingleClick

fixes #609

M  +4    -17   src/Gui/Window.cpp
M  +0    -1    src/Gui/Window.h

http://commits.kde.org/trojita/f92c008a2187d5dba7eb547705deb197e0472739

diff --git a/src/Gui/Window.cpp b/src/Gui/Window.cpp
index 07fed94..4b1fb04 100644
--- a/src/Gui/Window.cpp
+++ b/src/Gui/Window.cpp
@@ -492,7 +492,7 @@ void MainWindow::createWidgets()
 
     connect(msgListWidget->tree, SIGNAL(customContextMenuRequested(const QPoint &)),
             this, SLOT(showContextMenuMsgListTree(const QPoint &)));
-    connect(msgListWidget->tree, SIGNAL(activated(const QModelIndex &)), this, SLOT(msgListActivated(const QModelIndex &)));
+    connect(msgListWidget->tree, SIGNAL(activated(const QModelIndex &)), this, SLOT(msgListClicked(const QModelIndex &)));
     connect(msgListWidget->tree, SIGNAL(clicked(const QModelIndex &)), this, SLOT(msgListClicked(const QModelIndex &)));
     connect(msgListWidget->tree, SIGNAL(doubleClicked(const QModelIndex &)), this, SLOT(msgListDoubleClicked(const QModelIndex &)));
     connect(msgListWidget, SIGNAL(requestingSearch(QStringList)), this, SLOT(slotSearchRequested(QStringList)));
@@ -705,22 +705,6 @@ void MainWindow::setupModels()
     m_addressBook = new AbookAddressbook();
 }
 
-void MainWindow::msgListActivated(const QModelIndex &index)
-{
-    Q_ASSERT(index.isValid());
-
-    if (qApp->keyboardModifiers() & Qt::ShiftModifier || qApp->keyboardModifiers() & Qt::ControlModifier)
-        return;
-
-    if (! index.data(Imap::Mailbox::RoleMessageUid).isValid())
-        return;
-
-    if (index.column() != Imap::Mailbox::MsgListModel::SEEN) {
-        m_messageWidget->messageView->setMessage(index);
-        msgListWidget->tree->setCurrentIndex(index);
-    }
-}
-
 void MainWindow::msgListClicked(const QModelIndex &index)
 {
     Q_ASSERT(index.isValid());
@@ -739,6 +723,9 @@ void MainWindow::msgListClicked(const QModelIndex &index)
         Imap::Mailbox::FlagsOperation flagOp = translated.data(Imap::Mailbox::RoleMessageIsMarkedRead).toBool() ?
                                                Imap::Mailbox::FLAG_REMOVE : Imap::Mailbox::FLAG_ADD;
         model->markMessagesRead(QModelIndexList() << translated, flagOp);
+    } else {
+        m_messageWidget->messageView->setMessage(index);
+        msgListWidget->tree->setCurrentIndex(index);
     }
 }
 
diff --git a/src/Gui/Window.h b/src/Gui/Window.h
index 25ba905..40557d5 100644
--- a/src/Gui/Window.h
+++ b/src/Gui/Window.h
@@ -122,7 +122,6 @@ private slots:
     void handleMarkAsDeleted(bool);
     void slotNextUnread();
     void slotPreviousUnread();
-    void msgListActivated(const QModelIndex &);
     void msgListClicked(const QModelIndex &);
     void msgListDoubleClicked(const QModelIndex &);
     void slotCreateMailboxBelowCurrent();


More information about the kde-doc-english mailing list