Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions desktopintegration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,6 @@ void DesktopIntegration::removeFromDesktop(const QString &desktopId)
AppMgr::removeFromDesktop(desktopId);
}

bool DesktopIntegration::isAutoStart(const QString &desktopId) const
{
return AppMgr::autoStart(desktopId);
}

// only affect the one in XDG_CONFIG_HOME, don't care about the system one (even if there is one).
void DesktopIntegration::setAutoStart(const QString &desktopId, bool on)
{
Expand Down
1 change: 0 additions & 1 deletion desktopintegration.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ class DesktopIntegration : public QObject
Q_INVOKABLE bool isOnDesktop(const QString & desktopId) const;
Q_INVOKABLE void sendToDesktop(const QString & desktopId);
Q_INVOKABLE void removeFromDesktop(const QString & desktopId);
Q_INVOKABLE bool isAutoStart(const QString & desktopId) const;
Q_INVOKABLE void setAutoStart(const QString & desktopId, bool on = true);
Q_INVOKABLE bool shouldSkipConfirmUninstallDialog(const QString & desktopId) const;
Q_INVOKABLE void uninstallApp(const QString & desktopId);
Expand Down
5 changes: 3 additions & 2 deletions qml/AppItemMenu.qml
Comment thread
BLumia marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Loader {
property bool hideFavoriteMenu
property bool hideMoveToTopMenu
property bool hideDisplayScalingMenu
property bool autoStart
readonly property bool isFullscreen: LauncherController.currentFrame === "FullscreenFrame"
readonly property bool isHorizontalDock: DesktopIntegration.dockPosition === Qt.UpArrow || DesktopIntegration.dockPosition === Qt.DownArrow
readonly property int dockSpacing: (isHorizontalDock ? DesktopIntegration.dockGeometry.height : DesktopIntegration.dockGeometry.width) / Screen.devicePixelRatio
Expand Down Expand Up @@ -118,9 +119,9 @@ Loader {
MenuItem {
objectName: "RemoveFromStartup"
enabled: !root.desktopId.startsWith("internal/folders/")
text: DesktopIntegration.isAutoStart(root.desktopId) ? qsTr("Remove from startup") : qsTr("Add to startup")
text: root.autoStart ? qsTr("Remove from startup") : qsTr("Add to startup")
onTriggered: {
DesktopIntegration.setAutoStart(root.desktopId, !DesktopIntegration.isAutoStart(root.desktopId))
DesktopIntegration.setAutoStart(root.desktopId, !root.autoStart)
}
}
MenuItem {
Expand Down
3 changes: 2 additions & 1 deletion qml/Main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ QtObject {
isFavoriteItem: false,
hideFavoriteMenu: true,
hideDisplayScalingMenu: false,
hideMoveToTopMenu: true
hideMoveToTopMenu: true,
autoStart: model.autoStart
}, additionalProps));
menu.closed.connect(menu.destroy)
menu.popup();
Expand Down
3 changes: 2 additions & 1 deletion shell-launcher-applet/package/launcheritem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ AppletItem {
isFavoriteItem: false,
hideFavoriteMenu: true,
hideDisplayScalingMenu: Math.abs(DesktopIntegration.scaleFactor - 1.0) < 0.0001,
hideMoveToTopMenu: true
hideMoveToTopMenu: true,
autoStart: model.autoStart
}, additionalProps));
menu.closed.connect(menu.destroy)
menu.popup();
Expand Down
6 changes: 0 additions & 6 deletions src/ddeintegration/appmgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,6 @@ bool AppMgr::launchApp(const QString &desktopId, const QString &activationToken)
return true;
}

bool AppMgr::autoStart(const QString &desktopId)
{
const QVariant value = instance()->readProperty(desktopId, QStringLiteral("AutoStart"));
return value.isValid() && value.toBool();
}

void AppMgr::setAutoStart(const QString &desktopId, bool enabled)
{
instance()->setProperty(desktopId, QStringLiteral("AutoStart"), enabled);
Expand Down
1 change: 0 additions & 1 deletion src/ddeintegration/appmgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ class AppMgr final : public QObject
static AppMgr *instance();

static bool launchApp(const QString &desktopId, const QString &activationToken = {});
static bool autoStart(const QString &desktopId);
static void setAutoStart(const QString &desktopId, bool enabled);
static bool disableScale(const QString &desktopId);
static void setDisableScale(const QString &desktopId, bool disabled);
Expand Down
Loading