diff options
| author | Peter Penz <[email protected]> | 2008-01-21 14:16:31 +0000 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2008-01-21 14:16:31 +0000 |
| commit | 1daef0dc52a18b03e2bc5b4ce85944356b6b5da3 (patch) | |
| tree | 7598d62b33b41758e83daaa035d29de3c8a03a9b /src/dolphinview.cpp | |
| parent | 37d4fa2d15d9a629298b1c4f93a50db5c2d607b2 (diff) | |
Cleanup: let the DolphinView be aware about the used action collection. This will allow us cleaning up some code in DolphinMainWindow and will make it easier sharing code with DolphinPart.
CCMAIL: [email protected]
svn path=/trunk/KDE/kdebase/apps/; revision=764347
Diffstat (limited to 'src/dolphinview.cpp')
| -rw-r--r-- | src/dolphinview.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp index 09dd153a0..819420210 100644 --- a/src/dolphinview.cpp +++ b/src/dolphinview.cpp @@ -62,7 +62,8 @@ DolphinView::DolphinView(QWidget* parent, const KUrl& url, KDirLister* dirLister, DolphinModel* dolphinModel, - DolphinSortFilterProxyModel* proxyModel) : + DolphinSortFilterProxyModel* proxyModel, + KActionCollection* actionCollection) : QWidget(parent), m_active(true), m_showPreview(false), @@ -122,6 +123,16 @@ 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() @@ -1026,6 +1037,11 @@ void DolphinView::slotDeleteFileFinished(KJob* job) } } +void DolphinView::createDir() +{ + KonqOperations::newDir(this, url()); +} + void DolphinView::cutSelectedItems() { QMimeData* mimeData = new QMimeData(); |
