]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Check whether the global single-click/double-click setting has been changed during...
authorPeter Penz <peter.penz19@gmail.com>
Tue, 3 Feb 2009 18:40:59 +0000 (18:40 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Tue, 3 Feb 2009 18:40:59 +0000 (18:40 +0000)
CCMAIL: predator106@gmail.com
BUG: 175635
BUG: 175280

svn path=/trunk/KDE/kdebase/apps/; revision=920754

src/dolphindetailsview.cpp
src/dolphindetailsview.h
src/dolphiniconsview.cpp
src/dolphiniconsview.h

index 2b8583e139ca4737313bdf03eab86b1690864332..b9e499635979403b3639d6a4b94844e6b0346334 100644 (file)
@@ -149,8 +149,8 @@ DolphinDetailsView::DolphinDetailsView(QWidget* parent, DolphinController* contr
     setFocus();
     viewport()->installEventFilter(this);
 
-    connect(KGlobalSettings::self(), SIGNAL(kdisplayFontChanged()),
-            this, SLOT(updateFont()));
+    connect(KGlobalSettings::self(), SIGNAL(settingsChanged(int)),
+            this, SLOT(slotGlobalSettingsChanged(int)));
 
     m_useDefaultIndexAt = false;
 }
@@ -657,14 +657,23 @@ void DolphinDetailsView::requestActivation()
     m_controller->requestActivation();
 }
 
-void DolphinDetailsView::updateFont()
+void DolphinDetailsView::slotGlobalSettingsChanged(int category)
 {
+    Q_UNUSED(category);
+
     const DetailsModeSettings* settings = DolphinSettings::instance().detailsModeSettings();
     Q_ASSERT(settings != 0);
-
     if (settings->useSystemFont()) {
         m_font = KGlobalSettings::generalFont();
     }
+
+    disconnect(this, SIGNAL(clicked(QModelIndex)), m_controller, SLOT(triggerItem(QModelIndex)));
+    disconnect(this, SIGNAL(doubleClicked(QModelIndex)), m_controller, SLOT(triggerItem(QModelIndex)));
+    if (KGlobalSettings::singleClick()) {
+        connect(this, SIGNAL(clicked(QModelIndex)), m_controller, SLOT(triggerItem(QModelIndex)));
+    } else {
+        connect(this, SIGNAL(doubleClicked(QModelIndex)), m_controller, SLOT(triggerItem(QModelIndex)));
+    }
 }
 
 void DolphinDetailsView::updateElasticBandSelection()
index c81884ae9ad10aeebd49d10ac8e1d7f0a05ea66e..0cef8374148c4d6c7f385ba6d38209d25d316605 100644 (file)
@@ -66,7 +66,7 @@ protected:
     virtual bool eventFilter(QObject* watched, QEvent* event);
     virtual QModelIndex indexAt (const QPoint& point) const;
     virtual void setSelection(const QRect& rect, QItemSelectionModel::SelectionFlags command);
-    virtual void scrollTo (const QModelIndex & index, ScrollHint hint = EnsureVisible);
+    virtual void scrollTo(const QModelIndex& index, ScrollHint hint = EnsureVisible);
 
 private slots:
     /**
@@ -144,7 +144,7 @@ private slots:
 
     void requestActivation();
 
-    void updateFont();
+    void slotGlobalSettingsChanged(int category);
 
     /**
      * If the elastic band is currently shown, update the elastic band based on
index 885a49101e04b1f0d154874c349f34c6a52ec7f7..180caae22a376d8c03f776f8eedbe5f80fc9e036 100644 (file)
@@ -126,8 +126,8 @@ DolphinIconsView::DolphinIconsView(QWidget* parent, DolphinController* controlle
 
     setFocus();
 
-    connect(KGlobalSettings::self(), SIGNAL(kdisplayFontChanged()),
-            this, SLOT(updateFont()));
+    connect(KGlobalSettings::self(), SIGNAL(settingsChanged(int)),
+            this, SLOT(slotGlobalSettingsChanged(int)));
 }
 
 DolphinIconsView::~DolphinIconsView()
@@ -371,14 +371,23 @@ void DolphinIconsView::requestActivation()
     m_controller->requestActivation();
 }
 
-void DolphinIconsView::updateFont()
+void DolphinIconsView::slotGlobalSettingsChanged(int category)
 {
+    Q_UNUSED(category);
+
     const IconsModeSettings* settings = DolphinSettings::instance().iconsModeSettings();
     Q_ASSERT(settings != 0);
-
     if (settings->useSystemFont()) {
         m_font = KGlobalSettings::generalFont();
     }
+
+    disconnect(this, SIGNAL(clicked(QModelIndex)), m_controller, SLOT(triggerItem(QModelIndex)));
+    disconnect(this, SIGNAL(doubleClicked(QModelIndex)), m_controller, SLOT(triggerItem(QModelIndex)));
+    if (KGlobalSettings::singleClick()) {
+        connect(this, SIGNAL(clicked(QModelIndex)), m_controller, SLOT(triggerItem(QModelIndex)));
+    } else {
+        connect(this, SIGNAL(doubleClicked(QModelIndex)), m_controller, SLOT(triggerItem(QModelIndex)));
+    }
 }
 
 void DolphinIconsView::updateGridSize(bool showPreview, int additionalInfoCount)
index cc21e9aadd53792a980b775e46ad134895891ffa..76a369db987783ffea3a0298d4bee9be4fba2a1f 100644 (file)
@@ -75,7 +75,7 @@ private slots:
     void slotAdditionalInfoChanged();
     void setZoomLevel(int level);
     void requestActivation();
-    void updateFont();
+    void slotGlobalSettingsChanged(int category);
 
 private:
     /**