KDE/kdevplatform/plugins/projectmanagerview

Andreas Pakulat apaku at gmx.de
Tue Jun 10 21:04:33 UTC 2008


SVN commit 819294 by apaku:

Obey KDE wide single/double click setting.

This poses a bit of a problem though, its now kind of hard to only select one file in the tree without opening it. The workaround the dolphin uses isn't going to work as we have to few space.

OTOH forcing double-click is also bad because then we need to disable editing of items via double clicking as it gets in the way otherwise.

Anybody with bright ideas how to solve this dilemma?

CCMAIL:kdevelop-devel at kdevelop.org

 M  +10 -3     projecttreeview.cpp  
 M  +1 -1      projecttreeview.h  


--- trunk/KDE/kdevplatform/plugins/projectmanagerview/projecttreeview.cpp #819293:819294
@@ -35,6 +35,7 @@
 #include <kmenu.h>
 #include <kdebug.h>
 #include <kurl.h>
+#include <kglobalsettings.h>
 #include <klocale.h>
 
 #include <interfaces/contextmenuextension.h>
@@ -60,7 +61,13 @@
     setSelectionMode( QAbstractItemView::ExtendedSelection );
 
     connect( this, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( popupContextMenu( QPoint ) ) );
-    connect( this, SIGNAL( doubleClicked( QModelIndex ) ), this, SLOT( slotActivated( QModelIndex ) ) );
+    if( KGlobalSettings::singleClick() )
+    {
+        connect( this, SIGNAL( clicked( QModelIndex ) ), this, SLOT( slotActivated( QModelIndex ) ) );
+    } else
+    {
+        connect( this, SIGNAL( doubleClicked( QModelIndex ) ), this, SLOT( slotActivated( QModelIndex ) ) );
+    }
 }
 
 void ProjectTreeView::setSelectionModel( QItemSelectionModel* newmodel )
@@ -154,7 +161,7 @@
     KDevelop::ProjectModel *ret;
     QAbstractProxyModel *proxy = qobject_cast<QAbstractProxyModel*>(model());
     ret=qobject_cast<KDevelop::ProjectModel*>( proxy->sourceModel() );
-    
+
 //     ret=qobject_cast<KDevelop::ProjectModel*>( model() );
     Q_ASSERT(ret);
     return ret;
@@ -266,8 +273,8 @@
         {
             menu.addAction( act );
         }
-        
 
+
         menu.addSeparator();
 
 
--- trunk/KDE/kdevplatform/plugins/projectmanagerview/projecttreeview.h #819293:819294
@@ -70,8 +70,8 @@
         void openProjectConfig();
 
     private:
+        class ProjectTreeViewPrivate* const d;
         KDevelop::IProject* m_ctxProject;
-        class ProjectTreeViewPrivate* const d;
 };
 
 #endif // KDEVPROJECTMANAGER_H




More information about the KDevelop-devel mailing list