fix infinite loop & fix safeGetFileTree for houseArrestAfcClient

This commit is contained in:
uncor3
2026-01-20 07:08:44 +00:00
parent b3ba32e74e
commit d2867acc47
6 changed files with 13 additions and 18 deletions
+3 -2
View File
@@ -206,8 +206,9 @@ void AfcExplorerWidget::loadPath(const QString &path)
updateAddressBar(path);
updateNavigationButtons();
AFCFileTree tree =
ServiceManager::safeGetFileTree(m_device, path.toStdString(), m_afc);
AFCFileTree tree = ServiceManager::safeGetFileTree(
m_device, path.toStdString(), true, m_afc);
if (!tree.success) {
showErrorState();
return;
+3
View File
@@ -193,6 +193,9 @@ protected:
{
if (event->type() == QEvent::ApplicationFontChange) {
updateIconSize();
/* TODO: may be use PaletteChange event?
but ApplicationPaletteChange seems to be a better fit here than
PaletteChange*/
} else if (event->type() == QEvent::ApplicationPaletteChange) {
update();
}
+4 -13
View File
@@ -154,7 +154,10 @@ void AppTabWidget::updateStyles()
"; border-radius: 10px; border: 1px solid " +
bgColor.lighter().name() + "; }";
}
setStyleSheet(style);
// prevent infinite loop
if (style != styleSheet()) {
setStyleSheet(style);
}
}
InstalledAppsWidget::InstalledAppsWidget(iDescriptorDevice *device,
@@ -733,18 +736,6 @@ void InstalledAppsWidget::loadAppContainer(const QString &bundleId)
return result;
}
QStringList files;
if (list) {
for (int i = 0; list[i]; i++) {
QString fileName = QString::fromUtf8(list[i]);
if (fileName != "." && fileName != "..") {
qDebug() << "Found file:" << fileName;
files.append(fileName);
}
}
afc_dictionary_free(list);
}
result["files"] = files;
result["afcClient"] =
QVariant::fromValue(reinterpret_cast<void *>(afcClient));
result["houseArrestClient"] = QVariant::fromValue(
-1
View File
@@ -87,7 +87,6 @@ private:
QLabel *m_iconLabel;
QLabel *m_nameLabel;
QLabel *m_versionLabel;
QList<AppTabWidget *> m_appTabs;
QNetworkAccessManager *m_networkManager = new QNetworkAccessManager(this);
};
+2 -1
View File
@@ -214,7 +214,8 @@ public:
iDescriptorDevice *device, const char *path,
std::optional<afc_client_t> altAfc = std::nullopt);
static AFCFileTree
safeGetFileTree(iDescriptorDevice *device, const std::string &path = "/", bool checkDir = true,
safeGetFileTree(iDescriptorDevice *device, const std::string &path = "/",
bool checkDir = true,
std::optional<afc_client_t> altAfc = std::nullopt);
};