diff --git a/qml/AppUI/AppList.qml b/qml/AppUI/AppList.qml index 2eecaf1..eac31e0 100644 --- a/qml/AppUI/AppList.qml +++ b/qml/AppUI/AppList.qml @@ -112,9 +112,6 @@ Item { } if (mouse.button === Qt.LeftButton) { appManager.launchApp(id); - if (recentInstall) { - appManager.appLaunched(id); - } return; } } @@ -140,9 +137,6 @@ Item { Keys.onPressed: { if (event.key === Qt.Key_Enter || event.key === Qt.Key_Return) { appManager.launchApp(id); - if (recentInstall) { - appManager.appLaunched(id); - } } } } diff --git a/src/appdata/app-data-manager.cpp b/src/appdata/app-data-manager.cpp index 5822e5d..5a66d68 100644 --- a/src/appdata/app-data-manager.cpp +++ b/src/appdata/app-data-manager.cpp @@ -346,7 +346,9 @@ void AppDataWorker::fixToTopSlot(const QString &path, const int &num) void AppDataWorker::setAppLaunched(const QString &path) { - m_applicationInfo->setAppLaunchedState(path); + if (m_appManager->m_normalApps.value(path).launched() == 0) { + m_applicationInfo->setAppLaunchedState(path); + } } void AppDataWorker::loadPreInstallAppData() diff --git a/src/utils/app-manager.cpp b/src/utils/app-manager.cpp index 72502fc..abef7ff 100644 --- a/src/utils/app-manager.cpp +++ b/src/utils/app-manager.cpp @@ -50,6 +50,8 @@ AppManager::AppManager(QObject *parent) : QObject(parent) bool AppManager::launchApp(const QString &desktopFilePath) { Q_EMIT request(UkuiMenuApplication::Hide); + AppDataManager::instance()->appLaunch(desktopFilePath); + if (launchAppWithDBus(desktopFilePath)) { return true; } @@ -78,11 +80,6 @@ bool AppManager::launchBinaryApp(const QString &app, const QString &args) return QProcess::startDetached(cmd); } -void AppManager::appLaunched(const QString &desktopFilePath) -{ - AppDataManager::instance()->appLaunch(desktopFilePath); -} - bool AppManager::launchAppWithDBus(const QString &app) { if (!m_appManagerDbusInterface) { diff --git a/src/utils/app-manager.h b/src/utils/app-manager.h index 7a26d85..028ff55 100644 --- a/src/utils/app-manager.h +++ b/src/utils/app-manager.h @@ -35,7 +35,6 @@ public: Q_INVOKABLE bool launchApp(const QString &desktopFilePath); Q_INVOKABLE bool launchBinaryApp(const QString &app, const QString &args = QString()); - Q_INVOKABLE void appLaunched(const QString &desktopFilePath); private: explicit AppManager(QObject *parent = nullptr);