更新代码

This commit is contained in:
feiyangqingyun
2022-11-24 20:15:50 +08:00
parent 2ce7ba59df
commit 65c1c61c40
102 changed files with 376 additions and 81 deletions

View File

@@ -29,8 +29,10 @@ DeviceSizeTable::DeviceSizeTable(QWidget *parent) : QTableWidget(parent)
textColor2 = QColor(255, 255, 255);
textColor3 = QColor(255, 255, 255);
#if defined(Q_OS_UNIX) && !defined(Q_OS_WASM)
process = new QProcess(this);
connect(process, SIGNAL(readyRead()), this, SLOT(readData()));
#endif
this->clear();
@@ -118,8 +120,7 @@ void DeviceSizeTable::load()
insertSize(dirName, use, free, all, percent);
}
}
#else
#elif defined(Q_OS_UNIX) && !defined(Q_OS_WASM)
process->start("df", QStringList() << "-h");
#endif
}
@@ -182,6 +183,7 @@ void DeviceSizeTable::setTextColor3(const QColor &textColor3)
void DeviceSizeTable::readData()
{
#if defined(Q_OS_UNIX) && !defined(Q_OS_WASM)
while (!process->atEnd()) {
QString result = QLatin1String(process->readLine());
#ifdef __arm__
@@ -206,6 +208,7 @@ void DeviceSizeTable::readData()
}
#endif
}
#endif
}
void DeviceSizeTable::checkSize(const QString &result, const QString &name)
@@ -217,7 +220,7 @@ void DeviceSizeTable::checkSize(const QString &result, const QString &name)
for (int i = 0; i < list.count(); ++i) {
QString s = list.at(i).trimmed();
if (s == "") {
if (s.isEmpty()) {
continue;
}

View File

@@ -64,12 +64,12 @@ IconHelper *IconHelper::getIconHelper(int icon)
//由于部分值范围冲突所以可以指定索引来取
//fontawesome 0xf000-0xf2e0
//fontawesome6 0xe000-0xe33d 0xf000-0xf8ff
//iconfont 0xe501-0xe793 0xe8d5-0xea5d
//iconfont 0xe501-0xe793 0xe8d5-0xea5d 0xeb00-0xec00
//weather 0xe900-0xe9cf
IconHelper *iconHelper = iconFontAwesome;
if (iconFontIndex < 0) {
if ((icon > 0xe501 && icon < 0xe793) || (icon > 0xe8d5 && icon < 0xea5d)) {
if ((icon >= 0xe501 && icon <= 0xe793) || (icon >= 0xe8d5 && icon <= 0xea5d) || (icon >= 0xeb00 && icon <= 0xec00)) {
iconHelper = iconFontAliBaBa;
}
} else if (iconFontIndex == 0) {