fix(src/extension/menu): 正常应用列表的部分应用右键菜单也存在“从列表中删除”

This commit is contained in:
youdiansaodongxi 2024-06-25 13:54:11 +08:00
parent ef7315b3c9
commit c1c77d38e1
1 changed files with 2 additions and 0 deletions

View File

@ -21,6 +21,7 @@
#include "app-manager.h" #include "app-manager.h"
#include "../context-menu-extension.h" #include "../context-menu-extension.h"
#include "basic-app-model.h" #include "basic-app-model.h"
#include "user-config.h"
#include <QStringLiteral> #include <QStringLiteral>
#include <QDBusInterface> #include <QDBusInterface>
@ -182,6 +183,7 @@ void AppContentMenu::addUninstall(QObject *parent, const QString &appId, QList<Q
void AppContentMenu::addRemoveFromList(QObject *parent, const QString &appId, const int &appLaunched, const QString &appInsertTime, QList<QAction *> &list) void AppContentMenu::addRemoveFromList(QObject *parent, const QString &appId, const int &appLaunched, const QString &appInsertTime, QList<QAction *> &list)
{ {
if (appLaunched == 1) return; if (appLaunched == 1) return;
if (UserConfig::instance()->isPreInstalledApps(appId)) return;
QDateTime installDate = QDateTime::fromString(appInsertTime, "yyyy-MM-dd hh:mm:ss"); QDateTime installDate = QDateTime::fromString(appInsertTime, "yyyy-MM-dd hh:mm:ss");
if (!installDate.isValid()) return; if (!installDate.isValid()) return;