]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphindetailsview.cpp
Allow to adjust the maximum size for previews.
[dolphin.git] / src / dolphindetailsview.cpp
index f0d93425b6dab75407dfd908a530b08b44725b47..1cf68c2e2ce61a36646c0d55100e196e22cdd663 100644 (file)
@@ -57,7 +57,7 @@ DolphinDetailsView::DolphinDetailsView(QWidget* parent, DolphinController* contr
     connect(this, SIGNAL(clicked(const QModelIndex&)),
             controller, SLOT(triggerItem(const QModelIndex&)));
 
-   // apply the details mode settings to the widget
+    // apply the details mode settings to the widget
     const DetailsModeSettings* settings = DolphinSettings::instance().detailsModeSettings();
     assert(settings != 0);
 
@@ -81,6 +81,25 @@ bool DolphinDetailsView::event(QEvent* event)
         headerView->setStretchLastSection(false);
         headerView->setResizeMode(QHeaderView::ResizeToContents);
         headerView->setResizeMode(0, QHeaderView::Stretch);
+
+        // hide columns if this is indicated by the settings
+        const DetailsModeSettings* settings = DolphinSettings::instance().detailsModeSettings();
+        assert(settings != 0);
+        if (!settings->showDate()) {
+            hideColumn(KDirModel::ModifiedTime);
+        }
+
+        if (!settings->showPermissions()) {
+            hideColumn(KDirModel::Permissions);
+        }
+
+        if (!settings->showOwner()) {
+            hideColumn(KDirModel::Owner);
+        }
+
+        if (!settings->showGroup()) {
+            hideColumn(KDirModel::Group);
+        }
     }
 
     return QTreeView::event(event);