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

This commit is contained in:
youdiansaodongxi 2024-06-25 13:54:11 +08:00 committed by iaom
parent 1f241819b7
commit 06b388db9a
1 changed files with 2 additions and 0 deletions

View File

@ -21,6 +21,7 @@
#include "app-manager.h"
#include "../context-menu-extension.h"
#include "basic-app-model.h"
#include "user-config.h"
#include <QStringLiteral>
#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)
{
if (appLaunched == 1) return;
if (UserConfig::instance()->isPreInstalledApps(appId)) return;
QDateTime installDate = QDateTime::fromString(appInsertTime, "yyyy-MM-dd hh:mm:ss");
if (!installDate.isValid()) return;