┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/dolphinpart.cpp9
-rw-r--r--src/dolphinview.cpp9
-rw-r--r--src/dolphinview.h6
3 files changed, 21 insertions, 3 deletions
diff --git a/src/dolphinpart.cpp b/src/dolphinpart.cpp
index 85ca9e473..05bc2216a 100644
--- a/src/dolphinpart.cpp
+++ b/src/dolphinpart.cpp
@@ -107,7 +107,7 @@ DolphinPart::DolphinPart(QWidget* parentWidget, QObject* parent, const QVariantL
this, SLOT(slotRequestUrlChange(KUrl)));
connect(m_view, SIGNAL(modeChanged()),
this, SIGNAL(viewModeChanged())); // relay signal
-
+
// Watch for changes that should result in updates to the
// status bar text.
connect(m_dirLister, SIGNAL(deleteItem(const KFileItem&)),
@@ -393,6 +393,13 @@ void DolphinPart::slotOpenContextMenu(const KFileItem& _item, const KUrl&)
if (addDel)
editActions.append(actionCollection()->action("delete"));
actionGroups.insert("editactions", editActions);
+
+ // Normally KonqPopupMenu only shows the "Create new" subdir in the current view
+ // since otherwise the created file would not be visible.
+ // But in treeview mode we should allow it.
+ if (m_view->itemsExpandable())
+ popupFlags |= KParts::BrowserExtension::ShowCreateDirectory;
+
}
// TODO: We should change the signature of the slots (and signals) for being able
diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp
index 25d0cc199..daadf7730 100644
--- a/src/dolphinview.cpp
+++ b/src/dolphinview.cpp
@@ -1310,7 +1310,7 @@ void DolphinView::pasteToUrl(const KUrl& url)
}
void DolphinView::updateZoomLevel(int oldZoomLevel)
-{
+{
const int newZoomLevel = ZoomLevelInfo::zoomLevelForIconSize(itemView()->iconSize());
if (oldZoomLevel != newZoomLevel) {
m_controller->setZoomLevel(newZoomLevel);
@@ -1321,10 +1321,15 @@ void DolphinView::updateZoomLevel(int oldZoomLevel)
KUrl::List DolphinView::simplifiedSelectedUrls() const
{
KUrl::List list = selectedUrls();
- if ((m_detailsView != 0) && m_detailsView->itemsExpandable()) {
+ if (itemsExpandable() ) {
list = KonqOperations::simplifiedUrlList(list);
}
return list;
}
+bool DolphinView::itemsExpandable() const
+{
+ return (m_detailsView != 0) && m_detailsView->itemsExpandable();
+}
+
#include "dolphinview.moc"
diff --git a/src/dolphinview.h b/src/dolphinview.h
index 910e324ea..d2d97aec2 100644
--- a/src/dolphinview.h
+++ b/src/dolphinview.h
@@ -334,6 +334,12 @@ public:
void setTabsForFilesEnabled(bool tabsForFiles);
bool isTabsForFilesEnabled() const;
+ /**
+ * Returns true if the current view allows folders to be expanded,
+ * i.e. presents a hierarchical view to the user.
+ */
+ bool itemsExpandable() const;
+
public slots:
/**
* Changes the directory to \a url. If the current directory is equal to