mirror of
https://github.com/edisionnano/QDiskInfo.git
synced 2026-04-21 14:03:19 +03:00
Fix compilation issues
This commit is contained in:
@@ -23,9 +23,6 @@ if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
|
|||||||
qt_add_executable(KDiskInfo
|
qt_add_executable(KDiskInfo
|
||||||
MANUAL_FINALIZATION
|
MANUAL_FINALIZATION
|
||||||
${PROJECT_SOURCES}
|
${PROJECT_SOURCES}
|
||||||
mainwindow.ui
|
|
||||||
statusdot.h statusdot.cpp
|
|
||||||
custombutton.h custombutton.cpp
|
|
||||||
)
|
)
|
||||||
# Define target properties for Android with Qt 6 as:
|
# Define target properties for Android with Qt 6 as:
|
||||||
# set_property(TARGET KDiskInfo APPEND PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR
|
# set_property(TARGET KDiskInfo APPEND PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR
|
||||||
@@ -41,6 +38,9 @@ else()
|
|||||||
else()
|
else()
|
||||||
add_executable(KDiskInfo
|
add_executable(KDiskInfo
|
||||||
${PROJECT_SOURCES}
|
${PROJECT_SOURCES}
|
||||||
|
custombutton.h custombutton.cpp
|
||||||
|
statusdot.h statusdot.cpp
|
||||||
|
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ void MainWindow::scanDevices()
|
|||||||
QJsonObject device = value.toObject();
|
QJsonObject device = value.toObject();
|
||||||
QString deviceName = device["name"].toString();
|
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());
|
QJsonDocument localDoc = QJsonDocument::fromJson(allOutput.toUtf8());
|
||||||
QJsonObject localObj = localDoc.object();
|
QJsonObject localObj = localDoc.object();
|
||||||
@@ -358,10 +358,10 @@ QString MainWindow::getSmartctlOutput(const QStringList &arguments, bool root)
|
|||||||
QStringList commandArgs;
|
QStringList commandArgs;
|
||||||
if (root) {
|
if (root) {
|
||||||
command = "pkexec";
|
command = "pkexec";
|
||||||
commandArgs = {"smartctl"};
|
commandArgs = QStringList();
|
||||||
} else {
|
} else {
|
||||||
command = "smartctl";
|
command = "smartctl";
|
||||||
commandArgs = {};
|
commandArgs = QStringList();
|
||||||
}
|
}
|
||||||
|
|
||||||
commandArgs.append(arguments);
|
commandArgs.append(arguments);
|
||||||
|
|||||||
@@ -8,6 +8,8 @@
|
|||||||
#include <QJsonObject>
|
#include <QJsonObject>
|
||||||
#include <QJsonArray>
|
#include <QJsonArray>
|
||||||
#include <QButtonGroup>
|
#include <QButtonGroup>
|
||||||
|
#include <QAction>
|
||||||
|
#include <cmath>
|
||||||
|
|
||||||
#include "statusdot.h"
|
#include "statusdot.h"
|
||||||
#include "custombutton.h"
|
#include "custombutton.h"
|
||||||
|
|||||||
Reference in New Issue
Block a user