add launchers in universal group also

pull/1/head
Michail Vourlakos 8 years ago
parent 35336983ac
commit 111d004e47

@ -149,12 +149,12 @@ QStringList LayoutSettings::launchers() const
return m_launchers;
}
void LayoutSettings::setLaunchers(QStringList launchers)
void LayoutSettings::setLaunchers(QStringList launcherList)
{
if (m_launchers == launchers)
if (m_launchers == launcherList)
return;
m_launchers = launchers;
m_launchers = launcherList;
emit launchersChanged();
}

@ -63,7 +63,7 @@ public:
void setActivities(QStringList activities);
QStringList launchers() const;
void setLaunchers(QStringList launchers);
void setLaunchers(QStringList launcherList);
static QString layoutName(const QString &fileName);

@ -31,6 +31,7 @@ UniversalSettings::UniversalSettings(KSharedConfig::Ptr config, QObject *parent)
{
connect(this, &UniversalSettings::currentLayoutNameChanged, this, &UniversalSettings::saveConfig);
connect(this, &UniversalSettings::lastNonAssignedLayoutNameChanged, this, &UniversalSettings::saveConfig);
connect(this, &UniversalSettings::launchersChanged, this, &UniversalSettings::saveConfig);
connect(this, &UniversalSettings::versionChanged, this, &UniversalSettings::saveConfig);
}
@ -114,6 +115,22 @@ void UniversalSettings::setLayoutsWindowSize(QSize size)
emit layoutsWindowSizeChanged();
}
QStringList UniversalSettings::launchers() const
{
return m_launchers;
}
void UniversalSettings::setLaunchers(QStringList launcherList)
{
if (m_launchers == launcherList) {
return;
}
m_launchers = launcherList;
emit launchersChanged();
}
bool UniversalSettings::autostart() const
{
QFile autostartFile(QDir::homePath() + "/.config/autostart/org.kde.latte-dock.desktop");
@ -158,6 +175,7 @@ void UniversalSettings::loadConfig()
m_currentLayoutName = m_universalGroup.readEntry("currentLayout", QString());
m_lastNonAssignedLayoutName = m_universalGroup.readEntry("lastNonAssignedLayout", QString());
m_layoutsWindowSize = m_universalGroup.readEntry("layoutsWindowSize", QSize(700, 450));
m_launchers = m_universalGroup.readEntry("launchers", QStringList());
}
void UniversalSettings::saveConfig()
@ -166,6 +184,7 @@ void UniversalSettings::saveConfig()
m_universalGroup.writeEntry("currentLayout", m_currentLayoutName);
m_universalGroup.writeEntry("lastNonAssignedLayout", m_lastNonAssignedLayoutName);
m_universalGroup.writeEntry("layoutsWindowSize", m_layoutsWindowSize);
m_universalGroup.writeEntry("launchers", m_launchers);
m_universalGroup.sync();
}

@ -38,6 +38,7 @@ class UniversalSettings : public QObject {
Q_PROPERTY(QString currentLayoutName READ currentLayoutName WRITE setCurrentLayoutName NOTIFY currentLayoutNameChanged)
Q_PROPERTY(QStringList launchers READ launchers WRITE setLaunchers NOTIFY launchersChanged)
public:
UniversalSettings(KSharedConfig::Ptr config, QObject *parent = nullptr);
~UniversalSettings() override;
@ -59,11 +60,15 @@ public:
QSize layoutsWindowSize() const;
void setLayoutsWindowSize(QSize);
QStringList launchers() const;
void setLaunchers(QStringList launcherList);
signals:
void autostartChanged();
void currentLayoutNameChanged();
void lastNonAssignedLayoutNameChanged();
void layoutsWindowSizeChanged();
void launchersChanged();
void versionChanged();
private slots:
@ -80,6 +85,7 @@ private:
QString m_currentLayoutName;
QString m_lastNonAssignedLayoutName;
QSize m_layoutsWindowSize{700, 450};
QStringList m_launchers;
KConfigGroup m_universalGroup;
KSharedConfig::Ptr m_config;

@ -92,6 +92,13 @@ public:
AllIndicator = 2
};
Q_ENUM(ActiveAppletIndicator)
enum LaunchersGroup {
UnigueLaunchers = 0,
LayoutLaunchers = 1,
GlobalLaunchers = 2
};
Q_ENUM(LaunchersGroup)
};
}//end of namespace

Loading…
Cancel
Save