[education/rkward] rkward/windows: Port away from KDirOperator::actionCollection

Nicolas Fella null at kde.org
Sat Oct 8 20:03:48 BST 2022


Git commit 2f8bcc3358ebc1ddfba3b1592d724a0b22482822 by Nicolas Fella.
Committed on 08/10/2022 at 17:49.
Pushed by tfry into branch 'master'.

Port away from KDirOperator::actionCollection

M  +15   -0    rkward/windows/rkfilebrowser.cpp

https://invent.kde.org/education/rkward/commit/2f8bcc3358ebc1ddfba3b1592d724a0b22482822

diff --git a/rkward/windows/rkfilebrowser.cpp b/rkward/windows/rkfilebrowser.cpp
index ad548f52..9f532fe5 100644
--- a/rkward/windows/rkfilebrowser.cpp
+++ b/rkward/windows/rkfilebrowser.cpp
@@ -107,19 +107,34 @@ RKFileBrowserWidget::RKFileBrowserWidget (QWidget *parent) : QWidget (parent) {
 	connect (RKWardMainWindow::getMain (), &RKWardMainWindow::aboutToQuitRKWard, this, &RKFileBrowserWidget::saveConfig);
 	layout->addWidget (dir);
 
+#if KIO_VERSION < QT_VERSION_CHECK(5, 100, 0)
 	toolbar->addAction (dir->actionCollection ()->action ("up"));
 	toolbar->addAction (dir->actionCollection ()->action ("back"));
 	toolbar->addAction (dir->actionCollection ()->action ("forward"));
 	toolbar->addAction (dir->actionCollection ()->action ("home"));
+#else
+	toolbar->addAction (dir->action (KDirOperator::Up));
+	toolbar->addAction (dir->action (KDirOperator::Back));
+	toolbar->addAction (dir->action (KDirOperator::Forward));
+	toolbar->addAction (dir->action (KDirOperator::Home));
+#endif
+
 	QAction* action = new QAction (QIcon::fromTheme ("folder-sync"), i18n ("Working directory"), this);
 	action->setToolTip (action->text ());
 	connect(action, &QAction::triggered, this, [=] () { follow_working_directory = true; syncToWD(); });
 	toolbar->addAction (action);
 	toolbar->addSeparator ();
+#if KIO_VERSION < QT_VERSION_CHECK(5, 100, 0)
 	toolbar->addAction (dir->actionCollection ()->action ("short view"));
 	toolbar->addAction (dir->actionCollection ()->action ("tree view"));
 	toolbar->addAction (dir->actionCollection ()->action ("detailed view"));
 //	toolbar->addAction (dir->actionCollection ()->action ("detailed tree view"));	// should we have this as well? Trying to avoid crowding in the toolbar
+#else
+	toolbar->addAction (dir->action (KDirOperator::ShortView));
+	toolbar->addAction (dir->action (KDirOperator::TreeView));
+	toolbar->addAction (dir->action (KDirOperator::DetailedView));
+//	toolbar->addAction (dir->action (KDirOperator::DetailedTreeView));	// should we have this as well? Trying to avoid crowding in the toolbar
+#endif
 
 	fi_actions = new KFileItemActions (this);
 	rename_action = new QAction (i18n ("Rename"), this);  // Oh my, why isn't there a standard action for this?


More information about the rkward-tracker mailing list