X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/362817d1834f2ada3ea4552a25fa39bbbb540f8c..d90da9a85ed554dbe347ec8af8ea596ad06bb729:/src/panels/folders/treeviewcontextmenu.cpp diff --git a/src/panels/folders/treeviewcontextmenu.cpp b/src/panels/folders/treeviewcontextmenu.cpp index daf14ab4a..fa8844dfa 100644 --- a/src/panels/folders/treeviewcontextmenu.cpp +++ b/src/panels/folders/treeviewcontextmenu.cpp @@ -105,34 +105,38 @@ void TreeViewContextMenu::open() } popup->addSeparator(); + } + + // insert 'Show Hidden Files' + QAction* showHiddenFilesAction = new QAction(i18nc("@action:inmenu", "Show Hidden Files"), this); + showHiddenFilesAction->setCheckable(true); + showHiddenFilesAction->setChecked(m_parent->showHiddenFiles()); + popup->addAction(showHiddenFilesAction); + connect(showHiddenFilesAction, SIGNAL(toggled(bool)), this, SLOT(setShowHiddenFiles(bool))); + + // insert 'Automatic Scrolling' + QAction* autoScrollingAction = new QAction(i18nc("@action:inmenu", "Automatic Scrolling"), this); + autoScrollingAction->setCheckable(true); + autoScrollingAction->setChecked(m_parent->autoScrolling()); + // TODO: Temporary disabled. Horizontal autoscrolling will be implemented later either + // in KItemViews or manually as part of the FoldersPanel + //popup->addAction(autoScrollingAction); + connect(autoScrollingAction, SIGNAL(toggled(bool)), this, SLOT(setAutoScrolling(bool))); + if (!m_fileItem.isNull()) { // insert 'Properties' entry QAction* propertiesAction = new QAction(i18nc("@action:inmenu", "Properties"), this); propertiesAction->setIcon(KIcon("document-properties")); connect(propertiesAction, SIGNAL(triggered()), this, SLOT(showProperties())); popup->addAction(propertiesAction); - - popup->addSeparator(); } - if (m_fileItem.isNull()) { - QAction* showHiddenFilesAction = new QAction(i18nc("@action:inmenu", "Show Hidden Files"), this); - showHiddenFilesAction->setCheckable(true); - showHiddenFilesAction->setChecked(m_parent->hiddenFilesShown()); - popup->addAction(showHiddenFilesAction); - connect(showHiddenFilesAction, SIGNAL(toggled(bool)), this, SLOT(setShowHiddenFiles(bool))); - - QAction* autoScrollingAction = new QAction(i18nc("@action:inmenu", "Automatic Scrolling"), this); - autoScrollingAction->setCheckable(true); - autoScrollingAction->setChecked(m_parent->autoScrolling()); - // TODO: Temporary disabled. Horizontal autoscrolling will be implemented later either - // in KItemViews or manually as part of the FoldersPanel - //popup->addAction(autoScrollingAction); - connect(autoScrollingAction, SIGNAL(toggled(bool)), this, SLOT(setAutoScrolling(bool))); - } - - foreach (QAction* action, m_parent->customContextMenuActions()) { - popup->addAction(action); + QList customActions = m_parent->customContextMenuActions(); + if (!customActions.isEmpty()) { + popup->addSeparator(); + foreach (QAction* action, customActions) { + popup->addAction(action); + } } QWeakPointer popupPtr = popup; @@ -205,7 +209,7 @@ void TreeViewContextMenu::showProperties() void TreeViewContextMenu::setShowHiddenFiles(bool show) { - m_parent->setHiddenFilesShown(show); + m_parent->setShowHiddenFiles(show); } void TreeViewContextMenu::setAutoScrolling(bool enable)