File dolphin-fix-cannot-create-subfolder.diff of Package kdebase4.import5302

--- a/apps/dolphin/src/dolphincontextmenu.cpp
+++ b/apps/dolphin/src/dolphincontextmenu.cpp
@@ -239,12 +239,14 @@ void DolphinContextMenu::openItemContext
     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"));
--- a/apps/dolphin/src/dolphinmainwindow.cpp
+++ b/apps/dolphin/src/dolphinmainwindow.cpp
@@ -1408,7 +1408,7 @@ void DolphinMainWindow::setActiveViewCon
 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"));
--- a/apps/dolphin/src/dolphinnewfilemenu.cpp
+++ b/apps/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);
 }
--- a/apps/dolphin/src/dolphinnewfilemenu.h
+++ b/apps/dolphin/src/dolphinnewfilemenu.h
@@ -39,7 +39,7 @@ class DolphinNewFileMenu : public KNewFi
     Q_OBJECT
 
 public:
-    DolphinNewFileMenu(QWidget* parent, DolphinMainWindow* mainWin);
+    DolphinNewFileMenu(DolphinMainWindow* parent);
     virtual ~DolphinNewFileMenu();
 
 protected slots: