]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/statusbar/statusbarspaceinfo.cpp
[CLAZY] Fixed all level 1 and level 2 warnings with small exceptions
[dolphin.git] / src / statusbar / statusbarspaceinfo.cpp
index 127641e601d1468479ef925f9539ecd31dc12fb7..ed909cd28df84fe33b5025d8870bcb92de0f85a2 100644 (file)
 #include "statusbarspaceinfo.h"
 
 #include "spaceinfoobserver.h"
-#include "spaceinfotoolsmenu.h"
 
 #include <QMouseEvent>
 
 #include <KLocalizedString>
+#include <KNS3/KMoreToolsMenuFactory>
 #include <KIO/Job>
 
 
@@ -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(QStringLiteral("dolphin/statusbar-diskspace-menu"));
+        auto menu = menuFactory.createMenuFromGroupingNames(
+            { "disk-usage", "more:", "disk-partitions" }, m_url);
+
+        menu->exec(QCursor::pos());
     }
 }