From ece6650ecd3af0eb450e28a9aadcb0f4dd26cb24 Mon Sep 17 00:00:00 2001 From: Gregor Mi Date: Sun, 3 May 2015 20:40:04 +0200 Subject: Remove SpaceInfoToolsMenu and use KMoreToolsMenuFactory instead Reduces the amount of needed code. NEW: by using KMoreTools the menu is now user-configurable and will automatically extended when KMoreToolsPresets gets new tools. REVIEW: 122911 --- src/statusbar/statusbarspaceinfo.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/statusbar/statusbarspaceinfo.cpp') diff --git a/src/statusbar/statusbarspaceinfo.cpp b/src/statusbar/statusbarspaceinfo.cpp index 127641e60..29135566f 100644 --- a/src/statusbar/statusbarspaceinfo.cpp +++ b/src/statusbar/statusbarspaceinfo.cpp @@ -21,11 +21,11 @@ #include "statusbarspaceinfo.h" #include "spaceinfoobserver.h" -#include "spaceinfotoolsmenu.h" #include #include +#include #include @@ -71,8 +71,16 @@ void StatusBarSpaceInfo::hideEvent(QHideEvent* event) void StatusBarSpaceInfo::mousePressEvent(QMouseEvent* event) { if (event->button() == Qt::LeftButton) { - SpaceInfoToolsMenu spaceInfoToolsMenu(this, m_url); - spaceInfoToolsMenu.exec(QCursor::pos()); + // Creates a menu with tools that help to find out more about free + // disk space for the given url. + + // Note that this object must live long enough in case the user opens + // the "Configure..." dialog + KMoreToolsMenuFactory menuFactory("dolphin/statusbar-diskspace-menu"); + auto menu = menuFactory.createMenuFromGroupingNames( + { "disk-usage", "more:", "disk-partitions" }, m_url); + + menu->exec(QCursor::pos()); } } -- cgit v1.3