mirror of
https://github.com/edisionnano/QDiskInfo.git
synced 2026-04-05 20:41:28 +03:00
Merge remote-tracking branch 'origin/main' into feat/disk-grid
This commit is contained in:
@@ -55,13 +55,13 @@ export QT_STYLE_OVERRIDE="${QT_STYLE_OVERRIDE:-Breeze}"
|
|||||||
[ -f "$APPIMAGE".stylesheet ] && APPIMAGE_QT_THEME="$APPIMAGE.stylesheet"
|
[ -f "$APPIMAGE".stylesheet ] && APPIMAGE_QT_THEME="$APPIMAGE.stylesheet"
|
||||||
[ -f "$APPIMAGE_QT_THEME" ] && set -- "$@" "-stylesheet" "$APPIMAGE_QT_THEME"
|
[ -f "$APPIMAGE_QT_THEME" ] && set -- "$@" "-stylesheet" "$APPIMAGE_QT_THEME"
|
||||||
|
|
||||||
if ! command -v smartctl >/dev/null 2>&1; then
|
#if ! command -v smartctl >/dev/null 2>&1; then
|
||||||
echo "smartctl is not on the system, using bundled binary..."
|
# echo "smartctl is not on the system, using bundled binary..."
|
||||||
export PATH="$PATH:"$CACHEDIR"/qdiskinfo-appimage"
|
export PATH="$CACHEDIR/qdiskinfo-appimage:$PATH"
|
||||||
mkdir -p "$CACHEDIR"/qdiskinfo-appimage
|
mkdir -p "$CACHEDIR"/qdiskinfo-appimage
|
||||||
cp -v "$CURRENTDIR"/smartctl "$CACHEDIR"/qdiskinfo-appimage
|
cp -v "$CURRENTDIR"/smartctl "$CACHEDIR"/qdiskinfo-appimage
|
||||||
chmod +x "$CACHEDIR"/qdiskinfo-appimage/smartctl
|
chmod +x "$CACHEDIR"/qdiskinfo-appimage/smartctl
|
||||||
fi
|
#fi
|
||||||
|
|
||||||
exec "$CURRENTDIR"/bin/QDiskInfo "$@"' > ./AppRun
|
exec "$CURRENTDIR"/bin/QDiskInfo "$@"' > ./AppRun
|
||||||
chmod +x ./AppRun
|
chmod +x ./AppRun
|
||||||
|
|||||||
@@ -571,7 +571,11 @@ void MainWindow::populateWindow(const QJsonObject &localObj, const QString &heal
|
|||||||
qlonglong lbaWritten = attrObj["raw"].toObject()["value"].toVariant().toLongLong();
|
qlonglong lbaWritten = attrObj["raw"].toObject()["value"].toVariant().toLongLong();
|
||||||
qlonglong oneGB = static_cast<qlonglong>(std::pow(2, 30));
|
qlonglong oneGB = static_cast<qlonglong>(std::pow(2, 30));
|
||||||
qlonglong gigabytes = (lbaWritten * logicalBlockSize) / oneGB;
|
qlonglong gigabytes = (lbaWritten * logicalBlockSize) / oneGB;
|
||||||
totalWritesInt = static_cast<int>(gigabytes);
|
int gigabytesInt = static_cast<int>(gigabytes);
|
||||||
|
if (!gigabytesInt) {
|
||||||
|
gigabytesInt = static_cast<int>(lbaWritten);
|
||||||
|
}
|
||||||
|
totalWritesInt = gigabytesInt;
|
||||||
} else if (attrObj["name"] == "Host_Writes_GiB" || attrObj["name"] == "Lifetime_Writes_GiB") {
|
} else if (attrObj["name"] == "Host_Writes_GiB" || attrObj["name"] == "Lifetime_Writes_GiB") {
|
||||||
double gibibytes = attrObj["raw"].toObject()["value"].toDouble();
|
double gibibytes = attrObj["raw"].toObject()["value"].toDouble();
|
||||||
double bytesPerGiB = static_cast<double>(1ULL << 30);
|
double bytesPerGiB = static_cast<double>(1ULL << 30);
|
||||||
@@ -592,7 +596,11 @@ void MainWindow::populateWindow(const QJsonObject &localObj, const QString &heal
|
|||||||
qlonglong lbaRead = attrObj["raw"].toObject()["value"].toVariant().toLongLong();
|
qlonglong lbaRead = attrObj["raw"].toObject()["value"].toVariant().toLongLong();
|
||||||
qlonglong oneGB = static_cast<qlonglong>(std::pow(2, 30));
|
qlonglong oneGB = static_cast<qlonglong>(std::pow(2, 30));
|
||||||
qlonglong gigabytes = (lbaRead * logicalBlockSize) / oneGB;
|
qlonglong gigabytes = (lbaRead * logicalBlockSize) / oneGB;
|
||||||
totalReadsInt = static_cast<int>(gigabytes);
|
int gigabytesInt = static_cast<int>(gigabytes);
|
||||||
|
if (!gigabytesInt) {
|
||||||
|
gigabytesInt = static_cast<int>(lbaRead);
|
||||||
|
}
|
||||||
|
totalReadsInt = gigabytesInt;
|
||||||
} else if (attrObj["name"] == "Host_Reads_GiB" || attrObj["name"] == "Lifetime_Reads_GiB") {
|
} else if (attrObj["name"] == "Host_Reads_GiB" || attrObj["name"] == "Lifetime_Reads_GiB") {
|
||||||
double gibibytes = attrObj["raw"].toObject()["value"].toDouble();
|
double gibibytes = attrObj["raw"].toObject()["value"].toDouble();
|
||||||
double bytesPerGiB = static_cast<double>(1ULL << 30);
|
double bytesPerGiB = static_cast<double>(1ULL << 30);
|
||||||
|
|||||||
Reference in New Issue
Block a user