diff --git a/src/lib/desktopinfo.cpp b/src/lib/desktopinfo.cpp index 6a3270e..a3134d3 100644 --- a/src/lib/desktopinfo.cpp +++ b/src/lib/desktopinfo.cpp @@ -34,8 +34,8 @@ std::vector DesktopInfo::currentDesktops; DesktopInfo::DesktopInfo(const std::string &_fileName) - : m_isValid(true) - , m_keyFile(KeyFile()) + : m_isValid(true) + , m_keyFile(KeyFile()) { std::string fileNameWithSuffix(_fileName); if (!DString::endWith(_fileName, ".desktop")) @@ -118,11 +118,9 @@ bool DesktopInfo::getIsHidden() bool DesktopInfo::getShowIn(std::vector desktopEnvs) { if (desktopEnvs.size() == 0) { - if (currentDesktops.size() == 0) { - const char *env = getenv(envDesktopEnv.c_str()); - const auto &desktop = DString::splitChars(env, ':'); - currentDesktops.assign(desktop.begin(), desktop.end()); - } + const char *env = getenv(envDesktopEnv.c_str()); + const auto &desktop = DString::splitChars(env, ':'); + currentDesktops.assign(desktop.begin(), desktop.end()); desktopEnvs.assign(currentDesktops.begin(), currentDesktops.end()); } @@ -327,7 +325,7 @@ KeyFile *DesktopInfo::getKeyFile() // class AppsDir AppsDir::AppsDir(const std::string &dirPath) - : m_path(dirPath) + : m_path(dirPath) { } diff --git a/src/modules/launcher/dbusadaptorlauncher.cpp b/src/modules/launcher/dbusadaptorlauncher.cpp index d8efd2c..0a974ab 100644 --- a/src/modules/launcher/dbusadaptorlauncher.cpp +++ b/src/modules/launcher/dbusadaptorlauncher.cpp @@ -19,7 +19,7 @@ DBusAdaptorLauncher::DBusAdaptorLauncher(QObject *parent) DBusAdaptorLauncher::~DBusAdaptorLauncher() { - // destructor + } Launcher *DBusAdaptorLauncher::parent() const @@ -47,13 +47,6 @@ void DBusAdaptorLauncher::setFullscreen(bool value) parent()->setFullscreen(value); } -bool DBusAdaptorLauncher::AddAutostart(const QString &desktopFile) -{ - QDBusInterface interface = QDBusInterface("com.deepin.daemon.Display", "/com/deepin/StartManager", "com.deepin.StartManager"); - QDBusReply reply = interface.call("AddAutostart", desktopFile); - return reply.isValid() ? reply.value() : false; -} - LauncherItemInfoList DBusAdaptorLauncher::GetAllItemInfos() { return parent()->getAllItemInfos(); @@ -84,21 +77,6 @@ bool DBusAdaptorLauncher::IsItemOnDesktop(const QString &id) return parent()->isItemOnDesktop(id); } -bool DBusAdaptorLauncher::LaunchWithTimestamp(const QString &desktopFile, int time) -{ - - QDBusInterface interface = QDBusInterface("com.deepin.daemon.Display", "/com/deepin/StartManager", "com.deepin.StartManager"); - QDBusReply reply = interface.call("LaunchWithTimestamp", desktopFile, time); - return reply.isValid() ? reply.value() : false; -} - -bool DBusAdaptorLauncher::RemoveAutostart(const QString &desktopFile) -{ - QDBusInterface interface = QDBusInterface("com.deepin.daemon.Display", "/com/deepin/StartManager", "com.deepin.StartManager"); - QDBusReply reply = interface.call("RemoveAutostart", desktopFile); - return reply.isValid() ? reply.value() : false; -} - bool DBusAdaptorLauncher::RequestRemoveFromDesktop(const QString &id) { return parent()->requestRemoveFromDesktop(id); diff --git a/src/modules/launcher/dbusadaptorlauncher.h b/src/modules/launcher/dbusadaptorlauncher.h index c709c7f..84bfce5 100644 --- a/src/modules/launcher/dbusadaptorlauncher.h +++ b/src/modules/launcher/dbusadaptorlauncher.h @@ -67,19 +67,6 @@ class DBusAdaptorLauncher: public QDBusAbstractAdaptor " \n" " \n" " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" " \n" " \n" " \n" @@ -116,15 +103,12 @@ public: // PROPERTIES void setFullscreen(bool value); public Q_SLOTS: // METHODS - bool AddAutostart(const QString &desktopFile); LauncherItemInfoList GetAllItemInfos(); QStringList GetAllNewInstalledApps(); bool GetDisableScaling(const QString &id); LauncherItemInfo GetItemInfo(const QString &id); bool GetUseProxy(const QString &id); bool IsItemOnDesktop(const QString &id); - bool LaunchWithTimestamp(const QString &desktopFile, int time); - bool RemoveAutostart(const QString &desktopFile); bool RequestRemoveFromDesktop(const QString &id); bool RequestSendToDesktop(const QString &id); void RequestUninstall(const QString &id); diff --git a/src/modules/launcher/launcher.cpp b/src/modules/launcher/launcher.cpp index 1d3527f..89a7c0b 100644 --- a/src/modules/launcher/launcher.cpp +++ b/src/modules/launcher/launcher.cpp @@ -1187,12 +1187,15 @@ Item Launcher:: NewItemWithDesktopInfo(DesktopInfo &info) Item item; item.info.path = appFileName; item.info.name = appName; - //item.info.keywords << enName << appName; + item.info.keywords << enName << appName; item.info.id = getAppIdByFilePath(item.info.path, appDirs); item.info.timeInstalled = ctime; item.exec = info.getCommandLine().c_str(); item.genericName = info.getGenericName().c_str(); item.comment = enComment; + if (!info.getIcon().empty()) + item.info.icon = info.getIcon().c_str(); + xDeepinCategory = xDeepinCategory.toLower(); for (auto &keyWord : info.getKeywords()) {