┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Faure <[email protected]>2007-11-15 17:16:17 +0000
committerDavid Faure <[email protected]>2007-11-15 17:16:17 +0000
commitda8dc77c53c5cd604645768a1dacc6497cd58838 (patch)
tree353759f915d8420e4402644299062b670f367575
parent53d65e6392d3b03d7709385df5006d5d34c22852 (diff)
fix crash when pressing F2 on startup
enable undo svn path=/trunk/KDE/kdebase/apps/; revision=737159
-rw-r--r--src/dolphinpart.cpp1
-rw-r--r--src/dolphinpart.h10
2 files changed, 11 insertions, 0 deletions
diff --git a/src/dolphinpart.cpp b/src/dolphinpart.cpp
index 27000eae6..f278edddf 100644
--- a/src/dolphinpart.cpp
+++ b/src/dolphinpart.cpp
@@ -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);
}
diff --git a/src/dolphinpart.h b/src/dolphinpart.h
index eb1e009ec..bf81b55f4 100644
--- a/src/dolphinpart.h
+++ b/src/dolphinpart.h
@@ -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: