diff options
| author | David Faure <[email protected]> | 2008-01-21 19:08:52 +0000 |
|---|---|---|
| committer | David Faure <[email protected]> | 2008-01-21 19:08:52 +0000 |
| commit | c00478bbc1001d10dcfc04e9b0ea251620837e85 (patch) | |
| tree | 59d238add8e6b240e672bf039fc9ec5fc58c7e1b /src/dolphinview.cpp | |
| parent | f9aeb825c605ec4ca8b95aae0be1b441ca8ceb91 (diff) | |
Revert the moving of the action to the DolphinView instance, this doesn't work with splitted views.
(Each view would need its own action collection, but then DolphinView would have to become
a KXMLGUIClient, and the GUI would flicker when switching views).
Instead, use the same solution as the other shared actions: static method in DolphinView (for now),
slot in the mainwindow (and for the more complex actions than this one, shared code in DolphinView)
svn path=/branches/KDE/4.0/kdebase/apps/; revision=764429
Diffstat (limited to 'src/dolphinview.cpp')
| -rw-r--r-- | src/dolphinview.cpp | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp index 4a1fbb927..138971360 100644 --- a/src/dolphinview.cpp +++ b/src/dolphinview.cpp @@ -19,8 +19,6 @@ ***************************************************************************/ #include "dolphinview.h" -#include <ktoggleaction.h> -#include <kactioncollection.h> #include <QApplication> #include <QClipboard> @@ -30,6 +28,7 @@ #include <QTimer> #include <QScrollBar> +#include <kactioncollection.h> #include <kcolorscheme.h> #include <kdirlister.h> #include <kfileitemdelegate.h> @@ -43,6 +42,7 @@ #include <kmimetyperesolver.h> #include <konqmimedata.h> #include <konq_operations.h> +#include <ktoggleaction.h> #include <kurl.h> #include "dolphindropcontroller.h" @@ -61,8 +61,7 @@ DolphinView::DolphinView(QWidget* parent, const KUrl& url, KDirLister* dirLister, DolphinModel* dolphinModel, - DolphinSortFilterProxyModel* proxyModel, - KActionCollection* actionCollection) : + DolphinSortFilterProxyModel* proxyModel) : QWidget(parent), m_active(true), m_showPreview(false), @@ -128,16 +127,6 @@ DolphinView::DolphinView(QWidget* parent, applyViewProperties(url); m_topLayout->addWidget(itemView()); - - Q_ASSERT(actionCollection != 0); - if (actionCollection->action("create_dir") == 0) { - // This action doesn't appear in the GUI, it's for the shortcut only. - // KNewMenu takes care of the GUI stuff. - KAction* newDirAction = actionCollection->addAction("create_dir"); - newDirAction->setText(i18n("Create Folder...")); - connect(newDirAction, SIGNAL(triggered()), SLOT(createDir())); - newDirAction->setShortcut(Qt::Key_F10); - } } DolphinView::~DolphinView() @@ -1149,11 +1138,6 @@ void DolphinView::slotPreviewJobFinished(KJob* job) m_previewJob = 0; } -void DolphinView::createDir() -{ - KonqOperations::newDir(this, url()); -} - void DolphinView::cutSelectedItems() { QMimeData* mimeData = new QMimeData(); @@ -1263,4 +1247,14 @@ KAction* DolphinView::createDeleteAction(KActionCollection* collection) return deleteAction; } +KAction* DolphinView::createNewDirAction(KActionCollection* collection) +{ + // This action doesn't appear in the GUI, it's for the shortcut only. + // KNewMenu takes care of the GUI stuff. + KAction* newDirAction = collection->addAction("create_dir"); + newDirAction->setText(i18n("Create Folder...")); + newDirAction->setShortcut(Qt::Key_F10); + return newDirAction; +} + #include "dolphinview.moc" |
