summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Penz <peter.penz19@gmail.com>2011-02-09 20:37:01 (GMT)
committerPeter Penz <peter.penz19@gmail.com>2011-02-09 20:37:01 (GMT)
commit6bb8f5ba17be70237972f805e54b3d6491bb6574 (patch)
tree4bbda661824e297c7ab16396dbdedf3f8053b1d0
parent4caa285c065ea362ae52d93a567680513d8beb2a (diff)
Fix regression that creating a sub-folder is not possible
BUG: 265714
-rw-r--r--dolphin/src/dolphincontextmenu.cpp4
-rw-r--r--dolphin/src/dolphinmainwindow.cpp2
-rw-r--r--dolphin/src/dolphinnewfilemenu.cpp6
-rw-r--r--dolphin/src/dolphinnewfilemenu.h2
4 files changed, 8 insertions, 6 deletions
diff --git a/dolphin/src/dolphincontextmenu.cpp b/dolphin/src/dolphincontextmenu.cpp
index 2239afc..7fecdfa 100644
--- a/dolphin/src/dolphincontextmenu.cpp
+++ b/dolphin/src/dolphincontextmenu.cpp
@@ -240,12 +240,14 @@ void DolphinContextMenu::openItemContextMenu()
if (m_selectedItems.count() == 1) {
if (m_fileInfo.isDir()) {
// setup 'Create New' menu
- DolphinNewFileMenu* newFileMenu = new DolphinNewFileMenu(m_popup, m_mainWindow);
+ DolphinNewFileMenu* newFileMenu = new DolphinNewFileMenu(m_mainWindow);
const DolphinView* view = m_mainWindow->activeViewContainer()->view();
newFileMenu->setViewShowsHiddenFiles(view->showHiddenFiles());
newFileMenu->checkUpToDate();
newFileMenu->setPopupFiles(m_fileInfo.url());
newFileMenu->setEnabled(selectedItemsProperties().supportsWriting());
+ connect(newFileMenu, SIGNAL(fileCreated(KUrl)), newFileMenu, SLOT(deleteLater()));
+ connect(newFileMenu, SIGNAL(directoryCreated(KUrl)), newFileMenu, SLOT(deleteLater()));
KMenu* menu = newFileMenu->menu();
menu->setTitle(i18nc("@title:menu Create new folder, file, link, etc.", "Create New"));
diff --git a/dolphin/src/dolphinmainwindow.cpp b/dolphin/src/dolphinmainwindow.cpp
index fcc41f0..6477f8f 100644
--- a/dolphin/src/dolphinmainwindow.cpp
+++ b/dolphin/src/dolphinmainwindow.cpp
@@ -1412,7 +1412,7 @@ void DolphinMainWindow::setActiveViewContainer(DolphinViewContainer* viewContain
void DolphinMainWindow::setupActions()
{
// setup 'File' menu
- m_newFileMenu = new DolphinNewFileMenu(this, this);
+ m_newFileMenu = new DolphinNewFileMenu(this);
KMenu* menu = m_newFileMenu->menu();
menu->setTitle(i18nc("@title:menu Create new folder, file, link, etc.", "Create New"));
menu->setIcon(KIcon("document-new"));
diff --git a/dolphin/src/dolphinnewfilemenu.cpp b/dolphin/src/dolphinnewfilemenu.cpp
index c7ffb78..14379a3 100644
--- a/dolphin/src/dolphinnewfilemenu.cpp
+++ b/dolphin/src/dolphinnewfilemenu.cpp
@@ -29,9 +29,9 @@
#include <kactioncollection.h>
#include <kio/job.h>
-DolphinNewFileMenu::DolphinNewFileMenu(QWidget* parent, DolphinMainWindow* mainWin) :
- KNewFileMenu(mainWin->actionCollection(), "create_new", parent),
- m_mainWin(mainWin)
+DolphinNewFileMenu::DolphinNewFileMenu(DolphinMainWindow* parent) :
+ KNewFileMenu(parent->actionCollection(), "create_new", parent),
+ m_mainWin(parent)
{
DolphinNewFileMenuObserver::instance().attach(this);
}
diff --git a/dolphin/src/dolphinnewfilemenu.h b/dolphin/src/dolphinnewfilemenu.h
index dae97d6..bc6f6be 100644
--- a/dolphin/src/dolphinnewfilemenu.h
+++ b/dolphin/src/dolphinnewfilemenu.h
@@ -39,7 +39,7 @@ class DolphinNewFileMenu : public KNewFileMenu
Q_OBJECT
public:
- DolphinNewFileMenu(QWidget* parent, DolphinMainWindow* mainWin);
+ DolphinNewFileMenu(DolphinMainWindow* parent);
virtual ~DolphinNewFileMenu();
protected slots: