]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinview.cpp
added settings module for 'Navigation', that can be used by Konqueror
[dolphin.git] / src / dolphinview.cpp
index 969da773dcd4e677444daa0f52851a16464df8b0..ae120777ad12b2a2d51662510bee1ac1be1029e5 100644 (file)
 #include "dolphindetailsview.h"
 #include "dolphin_detailsmodesettings.h"
 #include "dolphiniconsview.h"
-#include "dolphinsettings.h"
+#include "settings/dolphinsettings.h"
 #include "dolphin_generalsettings.h"
 #include "draganddrophelper.h"
 #include "folderexpander.h"
 #include "renamedialog.h"
-#include "tooltipmanager.h"
+#include "tooltips/tooltipmanager.h"
 #include "viewproperties.h"
 #include "zoomlevelinfo.h"
 
@@ -87,6 +87,7 @@ DolphinView::DolphinView(QWidget* parent,
     m_storedCategorizedSorting(false),
     m_tabsForFiles(false),
     m_isContextMenuOpen(false),
+    m_ignoreViewProperties(false),
     m_mode(DolphinView::IconsView),
     m_topLayout(0),
     m_controller(0),
@@ -455,6 +456,8 @@ void DolphinView::reload()
 
 void DolphinView::refresh()
 {
+    m_ignoreViewProperties = false;
+
     const bool oldActivationState = m_active;
     const int oldZoomLevel = m_controller->zoomLevel();
     m_active = true;
@@ -860,6 +863,12 @@ bool DolphinView::eventFilter(QObject* watched, QEvent* event)
         }
         break;
 
+    case QEvent::KeyPress:
+        if ((watched == itemView()) && (m_toolTipManager != 0)) {
+            m_toolTipManager->hideTip();
+        }
+        break;
+
     default:
         break;
     }
@@ -1153,6 +1162,10 @@ KUrl DolphinView::viewPropertiesUrl() const
 
 void DolphinView::applyViewProperties(const KUrl& url)
 {
+    if (m_ignoreViewProperties) {
+        return;
+    }
+
     if (isColumnViewActive() && rootUrl().isParentOf(url)) {
         // The column view is active, hence don't apply the view properties
         // of sub directories (represented by columns) to the view. The
@@ -1222,6 +1235,13 @@ void DolphinView::applyViewProperties(const KUrl& url)
         // the used zoom level of the controller must be adjusted manually:
         updateZoomLevel(oldZoomLevel);
     }
+
+    if (DolphinSettings::instance().generalSettings()->globalViewProps()) {
+        // During the lifetime of a DolphinView instance the global view properties
+        // should not be changed. This allows e. g. to split a view and use different
+        // view properties for each view.
+        m_ignoreViewProperties = true;
+    }
 }
 
 void DolphinView::createView()
@@ -1253,6 +1273,7 @@ void DolphinView::createView()
     Q_ASSERT(view != 0);
     view->installEventFilter(this);
     view->viewport()->installEventFilter(this);
+    setFocusProxy(view);
 
     if (m_mode != ColumnView) {
         // Give the view the ability to auto-expand its directories on hovering
@@ -1315,6 +1336,7 @@ void DolphinView::deleteView()
         // before deleting the view: Otherwise when having a split
         // view the other view will get the focus and will request
         // an activation (see DolphinView::eventFilter()).
+        setFocusProxy(0);
         setFocus();
 
         m_topLayout->removeWidget(view);