[rkward] /: Add button to show current working directory

Thomas Friedrichsmeier null at kde.org
Thu Apr 19 19:05:55 UTC 2018


Git commit e4bd9ccdca260ff69dbef7c2d112fa6dcc186fb0 by Thomas Friedrichsmeier.
Committed on 19/04/2018 at 19:05.
Pushed by tfry into branch 'master'.

Add button to show current working directory

M  +2    -1    ChangeLog
M  +6    -1    rkward/windows/rkfilebrowser.cpp
M  +1    -1    rkward/windows/rkfilebrowser.h

https://commits.kde.org/rkward/e4bd9ccdca260ff69dbef7c2d112fa6dcc186fb0

diff --git a/ChangeLog b/ChangeLog
index 07198e92..4dd18605 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 --- Version 0.7.1 - UNRELEASED
-- Do not throw an error on objects that return non-numeric/non-scalar dim()
+- File tool window gains button to switch to current working directory
 - Fix a crash when closing a plugin dialog with an active plot preview
+- Do not throw an error on objects that return non-numeric/non-scalar dim()
 
 --- Version 0.7.0b - Apr-16-2018
 - Fix failure to install translations
diff --git a/rkward/windows/rkfilebrowser.cpp b/rkward/windows/rkfilebrowser.cpp
index 1cd5196b..3531c02a 100644
--- a/rkward/windows/rkfilebrowser.cpp
+++ b/rkward/windows/rkfilebrowser.cpp
@@ -2,7 +2,7 @@
                           rkfilebrowser  -  description
                              -------------------
     begin                : Thu Apr 26 2007
-    copyright            : (C) 2007-2016 by Thomas Friedrichsmeier
+    copyright            : (C) 2007-2018 by Thomas Friedrichsmeier
     email                : thomas.friedrichsmeier at kdemail.net
  ***************************************************************************/
 
@@ -122,6 +122,11 @@ RKFileBrowserWidget::RKFileBrowserWidget (QWidget *parent) : QWidget (parent) {
 	toolbar->addAction (dir->actionCollection ()->action ("back"));
 	toolbar->addAction (dir->actionCollection ()->action ("forward"));
 	toolbar->addAction (dir->actionCollection ()->action ("home"));
+	QAction* action = new QAction (QIcon::fromTheme ("folder-sync"), i18n ("Working directory"), this);
+	action->setToolTip (action->text ());
+	connect(action, &QAction::triggered, this, [=] () { setURL (QUrl::fromLocalFile (QDir::currentPath ())); });
+	toolbar->addAction (action);
+	toolbar->addSeparator ();
 	toolbar->addAction (dir->actionCollection ()->action ("short view"));
 	toolbar->addAction (dir->actionCollection ()->action ("tree view"));
 	toolbar->addAction (dir->actionCollection ()->action ("detailed view"));
diff --git a/rkward/windows/rkfilebrowser.h b/rkward/windows/rkfilebrowser.h
index 5751f587..b38f9d91 100644
--- a/rkward/windows/rkfilebrowser.h
+++ b/rkward/windows/rkfilebrowser.h
@@ -59,9 +59,9 @@ public:
 	explicit RKFileBrowserWidget (QWidget *widget);
 	~RKFileBrowserWidget ();
 
-	void setURL (const QUrl &url);
 	bool eventFilter (QObject* o, QEvent* e) override;
 public slots:
+	void setURL (const QUrl &url);
 	void urlChangedInView (const QUrl &url);
 	void stringChangedInCombo (const QString &url);
 	void urlChangedInCombo (const QUrl &url);



More information about the rkward-tracker mailing list