From d2867acc47e51dc8515ca4d9e0379cb64961ab2e Mon Sep 17 00:00:00 2001 From: uncor3 Date: Tue, 20 Jan 2026 07:08:44 +0000 Subject: [PATCH] fix infinite loop & fix safeGetFileTree for houseArrestAfcClient --- lib/zupdater | 2 +- src/afcexplorerwidget.cpp | 5 +++-- src/iDescriptor-ui.h | 3 +++ src/installedappswidget.cpp | 17 ++++------------- src/installedappswidget.h | 1 - src/servicemanager.h | 3 ++- 6 files changed, 13 insertions(+), 18 deletions(-) diff --git a/lib/zupdater b/lib/zupdater index 61aea85..3b28a91 160000 --- a/lib/zupdater +++ b/lib/zupdater @@ -1 +1 @@ -Subproject commit 61aea855c82a67a3536ec00aca7acd583bcbfc83 +Subproject commit 3b28a91564240eda485b0ed323fb6ecf12d46275 diff --git a/src/afcexplorerwidget.cpp b/src/afcexplorerwidget.cpp index ef1b5a7..8ad9928 100644 --- a/src/afcexplorerwidget.cpp +++ b/src/afcexplorerwidget.cpp @@ -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; diff --git a/src/iDescriptor-ui.h b/src/iDescriptor-ui.h index 19a78e3..431e7e8 100644 --- a/src/iDescriptor-ui.h +++ b/src/iDescriptor-ui.h @@ -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(); } diff --git a/src/installedappswidget.cpp b/src/installedappswidget.cpp index c4e1862..3f6b9a6 100644 --- a/src/installedappswidget.cpp +++ b/src/installedappswidget.cpp @@ -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(afcClient)); result["houseArrestClient"] = QVariant::fromValue( diff --git a/src/installedappswidget.h b/src/installedappswidget.h index 8638aae..66f13c9 100644 --- a/src/installedappswidget.h +++ b/src/installedappswidget.h @@ -87,7 +87,6 @@ private: QLabel *m_iconLabel; QLabel *m_nameLabel; QLabel *m_versionLabel; - QList m_appTabs; QNetworkAccessManager *m_networkManager = new QNetworkAccessManager(this); }; diff --git a/src/servicemanager.h b/src/servicemanager.h index ec234ce..a522126 100644 --- a/src/servicemanager.h +++ b/src/servicemanager.h @@ -214,7 +214,8 @@ public: iDescriptorDevice *device, const char *path, std::optional 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 altAfc = std::nullopt); };