]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphincolumnview.cpp
Use Xesam ontology instead of NIE. Since Strigi uses Xesam and we have no mapping...
[dolphin.git] / src / dolphincolumnview.cpp
index 9724740008c5accdcca621b18b18b3e861d05c3a..231d86d92f8da006511ed64b3d47102779671b82 100644 (file)
@@ -48,7 +48,8 @@ DolphinColumnView::DolphinColumnView(QWidget* parent, DolphinController* control
     m_contentX(0),
     m_columns(),
     m_emptyViewport(0),
-    m_animation(0)
+    m_animation(0),
+    m_nameFilter()
 {
     Q_ASSERT(controller != 0);
 
@@ -59,21 +60,21 @@ DolphinColumnView::DolphinColumnView(QWidget* parent, DolphinController* control
     setFocusPolicy(Qt::NoFocus);
     setFrameShape(QFrame::NoFrame);
 
-    connect(this, SIGNAL(entered(const QModelIndex&)),
-            controller, SLOT(emitItemEntered(const QModelIndex&)));
     connect(this, SIGNAL(viewportEntered()),
             controller, SLOT(emitViewportEntered()));
     connect(controller, SIGNAL(zoomIn()),
             this, SLOT(zoomIn()));
     connect(controller, SIGNAL(zoomOut()),
             this, SLOT(zoomOut()));
-    connect(controller, SIGNAL(showHiddenFilesChanged(bool)),
-            this, SLOT(slotShowHiddenFilesChanged(bool)));
-    connect(controller, SIGNAL(showPreviewChanged(bool)),
-            this, SLOT(slotShowPreviewChanged(bool)));
     connect(controller, SIGNAL(activationChanged(bool)),
             this, SLOT(updateColumnsBackground(bool)));
 
+    const DolphinView* view = controller->dolphinView();
+    connect(view, SIGNAL(showHiddenFilesChanged()),
+            this, SLOT(slotShowHiddenFilesChanged()));
+    connect(view, SIGNAL(showPreviewChanged()),
+            this, SLOT(slotShowPreviewChanged()));
+
     connect(horizontalScrollBar(), SIGNAL(valueChanged(int)),
             this, SLOT(moveContentHorizontally(int)));
 
@@ -147,14 +148,17 @@ void DolphinColumnView::setRootUrl(const KUrl& url)
 
 void DolphinColumnView::setNameFilter(const QString& nameFilter)
 {
-    foreach (DolphinColumnWidget* column, m_columns) {
-        column->setNameFilter(nameFilter);
+    if (nameFilter != m_nameFilter) {
+        m_nameFilter = nameFilter;
+        foreach (DolphinColumnWidget* column, m_columns) {
+            column->setNameFilter(nameFilter);
+        }
     }
 }
 
 QString DolphinColumnView::nameFilter() const
 {
-    return activeColumn()->nameFilter();
+    return m_nameFilter;
 }
 
 KUrl DolphinColumnView::rootUrl() const
@@ -174,6 +178,7 @@ void DolphinColumnView::showColumn(const KUrl& url)
         if (column->url() == url) {
             // the column represents already the requested URL, hence activate it
             requestActivation(column);
+            layoutColumns();
             return;
         } else if (!column->url().isParentOf(url)) {
             // the column is no parent of the requested URL, hence
@@ -337,6 +342,7 @@ void DolphinColumnView::resizeEvent(QResizeEvent* event)
     QAbstractItemView::resizeEvent(event);
     layoutColumns();
     updateScrollBar();
+    assureVisibleActiveColumn();
 }
 
 void DolphinColumnView::zoomIn()
@@ -407,15 +413,17 @@ void DolphinColumnView::updateColumnsBackground(bool active)
     }
 }
 
-void DolphinColumnView::slotShowHiddenFilesChanged(bool show)
+void DolphinColumnView::slotShowHiddenFilesChanged()
 {
+    const bool show = m_controller->dolphinView()->showHiddenFiles();
     foreach (DolphinColumnWidget* column, m_columns) {
         column->setShowHiddenFiles(show);
     }
 }
 
-void DolphinColumnView::slotShowPreviewChanged(bool show)
+void DolphinColumnView::slotShowPreviewChanged()
 {
+    const bool show = m_controller->dolphinView()->showPreview();
     foreach (DolphinColumnWidget* column, m_columns) {
         column->setShowPreview(show);
     }