diff --git a/debian/changelog b/debian/changelog index 5e1bb3c..1688c1c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +spark-store (4.8.4) UNRELEASED; urgency=medium + + * 修复 软件更新器更新无法正确处理忽略的软件包 + + -- shenmo Tue, 28 Aug 2025 01:03:08 +0800 + spark-store (4.8.3) UNRELEASED; urgency=medium * 更新软件主图标 diff --git a/spark-update-tool/CMakeLists.txt b/spark-update-tool/CMakeLists.txt index a76b1e2..cb94870 100644 --- a/spark-update-tool/CMakeLists.txt +++ b/spark-update-tool/CMakeLists.txt @@ -9,7 +9,8 @@ set(CMAKE_AUTORCC ON) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) -find_package(Qt5 REQUIRED COMPONENTS Widgets Network Concurrent) +find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets Network Concurrent) +find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets Network Concurrent) set(PROJECT_SOURCES src/main.cpp @@ -29,22 +30,39 @@ set(PROJECT_SOURCES src/ignoreconfig.cpp ) -if(ANDROID) - add_library(spark-update-tool SHARED +if(${QT_VERSION_MAJOR} GREATER_EQUAL 6) + qt_add_executable(spark-update-tool + MANUAL_FINALIZATION ${PROJECT_SOURCES} ) +# Define target properties for Android with Qt 6 as: +# set_property(TARGET spark-update-tool APPEND PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR +# ${CMAKE_CURRENT_SOURCE_DIR}/android) +# For more information, see https://doc.qt.io/qt-6/qt-add-executable.html#target-creation +else() + if(ANDROID) + add_library(spark-update-tool SHARED + ${PROJECT_SOURCES} + ) # Define properties for Android with Qt 5 after find_package() calls as: # set(ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/android") -else() - add_executable(spark-update-tool - ${PROJECT_SOURCES} - ) + else() + add_executable(spark-update-tool + ${PROJECT_SOURCES} + ) + endif() endif() -target_link_libraries(spark-update-tool PRIVATE Qt5::Widgets Qt5::Network Qt5::Concurrent) +target_link_libraries(spark-update-tool PRIVATE Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Network Qt${QT_VERSION_MAJOR}::Concurrent) +# Qt for iOS sets MACOSX_BUNDLE_GUI_IDENTIFIER automatically since Qt 6.1. +# If you are developing for iOS or macOS you should consider setting an +# explicit, fixed bundle identifier manually though. +if(${QT_VERSION} VERSION_LESS 6.1.0) + set(BUNDLE_ID_OPTION MACOSX_BUNDLE_GUI_IDENTIFIER com.example.spark-update-tool) +endif() set_target_properties(spark-update-tool PROPERTIES - MACOSX_BUNDLE_GUI_IDENTIFIER com.example.spark-update-tool + ${BUNDLE_ID_OPTION} MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION} MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} MACOSX_BUNDLE TRUE @@ -56,4 +74,8 @@ install(TARGETS spark-update-tool BUNDLE DESTINATION . LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -) \ No newline at end of file +) + +if(QT_VERSION_MAJOR EQUAL 6) + qt_finalize_executable(spark-update-tool) +endif() \ No newline at end of file diff --git a/spark-update-tool/debian/changelog b/spark-update-tool/debian/changelog index 01eb32d..c3eda0f 100644 --- a/spark-update-tool/debian/changelog +++ b/spark-update-tool/debian/changelog @@ -1,3 +1,7 @@ +spark-update-tool (1.0.4) unstable; urgency=low + + * 修复点击更新全部按钮后,会更新被忽略应用的问题。 + spark-update-tool (1.0.3) unstable; urgency=low * 修复默认图标加载失败的问题 diff --git a/spark-update-tool/src/appdelegate.cpp b/spark-update-tool/src/appdelegate.cpp index 792c249..ba889ec 100644 --- a/spark-update-tool/src/appdelegate.cpp +++ b/spark-update-tool/src/appdelegate.cpp @@ -12,6 +12,7 @@ AppDelegate::AppDelegate(QObject *parent) : QStyledItemDelegate(parent), m_downloadManager(new DownloadManager(this)), m_installProcess(nullptr) { connect(m_downloadManager, &DownloadManager::downloadFinished, this, + [this](const QString &packageName, bool success) { if (m_downloads.contains(packageName)) { m_downloads[packageName].isDownloading = false; @@ -39,6 +40,17 @@ AppDelegate::AppDelegate(QObject *parent) connect(&m_spinnerUpdateTimer, &QTimer::timeout, this, &AppDelegate::updateSpinner); } +AppDelegate::~AppDelegate() +{ + // 终止并清理安装进程 + if (m_installProcess && m_installProcess->state() != QProcess::NotRunning) { + m_installProcess->kill(); + m_installProcess->waitForFinished(3000); + m_installProcess->deleteLater(); + m_installProcess = nullptr; + } +} + void AppDelegate::setModel(QAbstractItemModel *model) { m_model = model; } @@ -311,6 +323,14 @@ void AppDelegate::startDownloadForAll() { if (!m_model) return; for (int row = 0; row < m_model->rowCount(); ++row) { QModelIndex index = m_model->index(row, 0); + + // 检查应用是否被忽略 + bool isIgnored = index.data(Qt::UserRole + 8).toBool(); + if (isIgnored) { + qDebug() << "跳过被忽略的应用:" << index.data(Qt::UserRole + 1).toString(); + continue; + } + QString packageName = index.data(Qt::UserRole + 1).toString(); if (m_downloads.contains(packageName) && (m_downloads[packageName].isDownloading || m_downloads[packageName].isInstalled)) continue; @@ -474,6 +494,13 @@ void AppDelegate::startDownloadForSelected() { QModelIndex index = m_model->index(row, 0); QString packageName = index.data(Qt::UserRole + 1).toString(); + // 检查应用是否被忽略 + bool isIgnored = index.data(Qt::UserRole + 8).toBool(); + if (isIgnored) { + qDebug() << "跳过被忽略的应用:" << packageName; + continue; + } + // 只下载选中的应用 if (m_selectedPackages.contains(packageName)) { if (m_downloads.contains(packageName) && (m_downloads[packageName].isDownloading || m_downloads[packageName].isInstalled)) diff --git a/spark-update-tool/src/appdelegate.h b/spark-update-tool/src/appdelegate.h index 25ea337..ac3f69a 100644 --- a/spark-update-tool/src/appdelegate.h +++ b/spark-update-tool/src/appdelegate.h @@ -21,6 +21,7 @@ class AppDelegate : public QStyledItemDelegate { Q_OBJECT public: explicit AppDelegate(QObject *parent = nullptr); + ~AppDelegate(); void setModel(QAbstractItemModel *model); diff --git a/spark-update-tool/src/downloadmanager.cpp b/spark-update-tool/src/downloadmanager.cpp index 9780324..16d06d5 100644 --- a/spark-update-tool/src/downloadmanager.cpp +++ b/spark-update-tool/src/downloadmanager.cpp @@ -10,6 +10,20 @@ DownloadManager::DownloadManager(QObject *parent) : QObject(parent) cleanupTempFiles(); } +DownloadManager::~DownloadManager() +{ + // 终止并清理所有正在运行的下载进程 + for (auto it = m_processes.begin(); it != m_processes.end(); ) { + QProcess *process = it.value(); + if (process->state() != QProcess::NotRunning) { + process->kill(); // 立即终止进程 + process->waitForFinished(3000); // 最多等待3秒 + } + process->deleteLater(); + it = m_processes.erase(it); + } +} + void DownloadManager::startDownload(const QString &packageName, const QString &url, const QString &outputPath) { if (m_processes.contains(packageName)) { @@ -114,4 +128,4 @@ void DownloadManager::cleanupTempFiles() for (const QString &f : leftovers) { tempDir.remove(f); } -} +} \ No newline at end of file diff --git a/spark-update-tool/src/downloadmanager.h b/spark-update-tool/src/downloadmanager.h index 0614368..8e1aa31 100644 --- a/spark-update-tool/src/downloadmanager.h +++ b/spark-update-tool/src/downloadmanager.h @@ -10,6 +10,7 @@ class DownloadManager : public QObject Q_OBJECT public: explicit DownloadManager(QObject *parent = nullptr); + ~DownloadManager(); void startDownload(const QString &packageName, const QString &url, const QString &outputPath); void cancelDownload(const QString &packageName); bool isDownloading(const QString &packageName) const; @@ -25,4 +26,4 @@ private: QMap m_processes; }; -#endif // DOWNLOADMANAGER_H +#endif // DOWNLOADMANAGER_H \ No newline at end of file diff --git a/src/widgets/common/customlabel.cpp b/src/widgets/common/customlabel.cpp index c796e4e..27b940e 100644 --- a/src/widgets/common/customlabel.cpp +++ b/src/widgets/common/customlabel.cpp @@ -10,7 +10,7 @@ CustomLabel::CustomLabel(QWidget *parent, QPixmap CustomLabel::pixmap() const { - return QLabel::pixmap(); + return *QLabel::pixmap(); } void CustomLabel::setPixmap(const QPixmap &pixmap) @@ -22,4 +22,4 @@ void CustomLabel::setPixmap(const QPixmap &pixmap) Qt::SmoothTransformation); QLabel::setPixmap(_pixmap); -} \ No newline at end of file +} diff --git a/translations/spark-store_en.ts b/translations/spark-store_en.ts index 7fe778c..92611fc 100644 --- a/translations/spark-store_en.ts +++ b/translations/spark-store_en.ts @@ -86,10 +86,10 @@ - - - - + + + + Download and Install @@ -177,87 +177,87 @@ - + Developer Mode Disabled - - - + + + Reinstall - - - + + + Launch - + Upgrade - - + + Install - + Installing - - - - - + + + + + Warning - + The current application does not support or tested on deepin, there may be problems - + The current application does not support or tested on UOS, there may be problems - + The current application does not support or tested on Ubuntu, there may be problems - + The current application does not support or tested on Debian, there may be problems - + The current application does not support or tested on current platform, there may be problems - - + + Spark Store - + Uninstall succeeded - + The URL has been copied to the clipboard diff --git a/translations/spark-store_es.ts b/translations/spark-store_es.ts index a37cb3e..4a7e5fc 100644 --- a/translations/spark-store_es.ts +++ b/translations/spark-store_es.ts @@ -86,10 +86,10 @@ - - - - + + + + Download and Install Descargar e instalar @@ -177,87 +177,87 @@ Haga clic en "abrir" - + Developer Mode Disabled Se ha desactivado el modo desarrollador - - - + + + Reinstall Reinstalación - - - + + + Launch - + Upgrade Actualización - - + + Install Instalación - + Installing Se está instalando - - - - - + + + + + Warning Aviso - + The current application does not support or tested on deepin, there may be problems - + The current application does not support or tested on UOS, there may be problems - + The current application does not support or tested on Ubuntu, there may be problems - + The current application does not support or tested on Debian, there may be problems - + The current application does not support or tested on current platform, there may be problems - - + + Spark Store SPARK Store - + Uninstall succeeded Desinstalación exitosa - + The URL has been copied to the clipboard La URL ha sido copiada al portapapeles diff --git a/translations/spark-store_fr.ts b/translations/spark-store_fr.ts index 0f1d0c1..3272d25 100644 --- a/translations/spark-store_fr.ts +++ b/translations/spark-store_fr.ts @@ -86,10 +86,10 @@ - - - - + + + + Download and Install Télécharger et installer @@ -177,87 +177,87 @@ Cliquez sur Ouvrir - + Developer Mode Disabled Mode développeur désactivé - - - + + + Reinstall Réinstaller - - - + + + Launch - + Upgrade Mise à niveau - - + + Install Installation - + Installing Installation en cours - - - - - + + + + + Warning Avertissement - + The current application does not support or tested on deepin, there may be problems - + The current application does not support or tested on UOS, there may be problems - + The current application does not support or tested on Ubuntu, there may be problems - + The current application does not support or tested on Debian, there may be problems - + The current application does not support or tested on current platform, there may be problems - - + + Spark Store Le Spark store - + Uninstall succeeded Désinstallation réussie - + The URL has been copied to the clipboard L'URL a été copiée dans le presse - papiers diff --git a/translations/spark-store_zh_CN.ts b/translations/spark-store_zh_CN.ts index e1f59f6..8f858fc 100644 --- a/translations/spark-store_zh_CN.ts +++ b/translations/spark-store_zh_CN.ts @@ -81,10 +81,10 @@ - - - - + + + + Download and Install 下载并安装 @@ -177,87 +177,87 @@ 点击跳转 - + Developer Mode Disabled 开发者模式未开启 - - - + + + Reinstall 重新安装 - - - + + + Launch 启动应用 - + Upgrade 升级 - - + + Install 安装 - + Installing 正在安装 - - - - - + + + + + Warning 警告 - + The current application does not support or tested on deepin, there may be problems 当前应用不支持或未在deepin上测试过,安装后可能会出现问题 - + The current application does not support or tested on UOS, there may be problems 当前应用不支持或未在UOS上测试过,安装后可能会出现问题 - + The current application does not support or tested on Ubuntu, there may be problems 当前应用不支持或未在Ubuntu上测试过,安装后可能会出现问题 - + The current application does not support or tested on Debian, there may be problems 当前应用不支持或未在Debian上测试过,安装后可能会出现问题 - + The current application does not support or tested on current platform, there may be problems 当前应用不支持或未在您的平台上测试过,安装后可能会出现问题 - - + + Spark Store 星火应用商店 - + Uninstall succeeded 卸载成功 - + The URL has been copied to the clipboard 链接已复制到剪贴板 diff --git a/translations/spark-store_zh_TW.ts b/translations/spark-store_zh_TW.ts index 9bf2712..f261b9e 100644 --- a/translations/spark-store_zh_TW.ts +++ b/translations/spark-store_zh_TW.ts @@ -81,10 +81,10 @@ - - - - + + + + Download and Install 下載並安裝 @@ -177,87 +177,87 @@ 点击跳转 - + Developer Mode Disabled 开发者模式未开启 - - - + + + Reinstall 重新安裝 - - - + + + Launch - + Upgrade 升级 - - + + Install 安装 - + Installing 正在安装 - - - - - + + + + + Warning - + The current application does not support or tested on deepin, there may be problems - + The current application does not support or tested on UOS, there may be problems - + The current application does not support or tested on Ubuntu, there may be problems - + The current application does not support or tested on Debian, there may be problems - + The current application does not support or tested on current platform, there may be problems - - + + Spark Store 星火应用商店 - + Uninstall succeeded 卸载成功 - + The URL has been copied to the clipboard 链接已复制到剪贴板