diff --git a/CMakeLists.txt b/CMakeLists.txt index c1a2629..439724a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,9 +23,6 @@ if(${QT_VERSION_MAJOR} GREATER_EQUAL 6) qt_add_executable(KDiskInfo MANUAL_FINALIZATION ${PROJECT_SOURCES} - mainwindow.ui - statusdot.h statusdot.cpp - custombutton.h custombutton.cpp ) # Define target properties for Android with Qt 6 as: # set_property(TARGET KDiskInfo APPEND PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR @@ -41,6 +38,9 @@ else() else() add_executable(KDiskInfo ${PROJECT_SOURCES} + custombutton.h custombutton.cpp + statusdot.h statusdot.cpp + ) endif() endif() diff --git a/mainwindow.cpp b/mainwindow.cpp index 1e4580b..3ea4ac7 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -63,7 +63,7 @@ void MainWindow::scanDevices() QJsonObject device = value.toObject(); QString deviceName = device["name"].toString(); - QString allOutput = getSmartctlOutput({"--all", "--json", deviceName}, true); + QString allOutput = getSmartctlOutput({"smartctl", "--all", "--json", deviceName}, true); QJsonDocument localDoc = QJsonDocument::fromJson(allOutput.toUtf8()); QJsonObject localObj = localDoc.object(); @@ -358,10 +358,10 @@ QString MainWindow::getSmartctlOutput(const QStringList &arguments, bool root) QStringList commandArgs; if (root) { command = "pkexec"; - commandArgs = {"smartctl"}; + commandArgs = QStringList(); } else { command = "smartctl"; - commandArgs = {}; + commandArgs = QStringList(); } commandArgs.append(arguments); diff --git a/mainwindow.h b/mainwindow.h index a829e33..854ac67 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -8,6 +8,8 @@ #include #include #include +#include +#include #include "statusdot.h" #include "custombutton.h"