]> cloud.milkyroute.net Git - dolphin.git/commitdiff
fix crash when pressing F2 on startup
authorDavid Faure <faure@kde.org>
Thu, 15 Nov 2007 17:16:17 +0000 (17:16 +0000)
committerDavid Faure <faure@kde.org>
Thu, 15 Nov 2007 17:16:17 +0000 (17:16 +0000)
enable undo

svn path=/trunk/KDE/kdebase/apps/; revision=737159

src/dolphinpart.cpp
src/dolphinpart.h

index 27000eae67b733e9af28392e3cac4ede24449ec3..f278edddf4c3380912e9bfc02f564ac6e829ccb9 100644 (file)
@@ -129,6 +129,7 @@ void DolphinPart::createActions()
 
     KAction* renameAction = new KAction(i18nc("@action:inmenu", "Rename..."), this);
     connect(renameAction, SIGNAL(triggered()), m_view, SLOT(renameSelectedItems()));
+    renameAction->setEnabled(false);
     renameAction->setShortcut(Qt::Key_F2);
     actionCollection()->addAction("rename", renameAction);
 }
index eb1e009ec70c19a3043611dd287a671898eb13ed..bf81b55f48d4b8d71b2304fd67c71096f24ca25c 100644 (file)
@@ -34,6 +34,10 @@ class KAboutData;
 class DolphinPart : public KParts::ReadOnlyPart
 {
     Q_OBJECT
+    // Used by konqueror. Technically it means "we want undo enabled if
+    // there are things in the undo history and the current part is a dolphin part".
+    // Even though it's konqueror doing the undo...
+    Q_PROPERTY( bool supportsUndo READ supportsUndo )
 
 public:
     explicit DolphinPart(QWidget* parentWidget, QObject* parent, const QStringList& args);
@@ -43,7 +47,13 @@ public:
 
     virtual bool openUrl(const KUrl& url);
 
+    /// see the supportsUndo property
+    bool supportsUndo() const { return true; }
+
 protected:
+    /**
+     * We reimplement openUrl so no need to implement openFile.
+     */
     virtual bool openFile() { return true; }
 
 private Q_SLOTS: