mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-03 00:15:21 +00:00
fix(plugins): use a fixed default sort for plugins
Change-Id: Ib801201f1efd5290bc037b423281e6f1e79f424f
This commit is contained in:
parent
009c03c9fe
commit
e802e87e4b
Notes:
gerrit
2018-09-07 14:55:59 +08:00
Verified+1: <jenkins@deepin.com> Code-Review+2: 张丁元 <lxz@ilxz.me> Submitted-by: listenerri <listenerri@gmail.com> Submitted-at: Fri, 07 Sep 2018 14:55:59 +0800 Reviewed-on: https://cr.deepin.io/38230 Project: dde/dde-dock Branch: refs/heads/master
@ -83,8 +83,14 @@ int DatetimePlugin::itemSortKey(const QString &itemKey)
|
||||
{
|
||||
Q_UNUSED(itemKey);
|
||||
|
||||
const QString key = QString("pos_%1").arg(displayMode());
|
||||
return m_settings.value(key, 0).toInt();
|
||||
Dock::DisplayMode mode = displayMode();
|
||||
const QString key = QString("pos_%1").arg(mode);
|
||||
|
||||
if (mode == Dock::DisplayMode::Fashion) {
|
||||
return m_settings.value(key, 5).toInt();
|
||||
} else {
|
||||
return m_settings.value(key, -1).toInt();
|
||||
}
|
||||
}
|
||||
|
||||
void DatetimePlugin::setSortKey(const QString &itemKey, const int order)
|
||||
|
@ -150,8 +150,14 @@ QWidget *NetworkPlugin::itemPopupApplet(const QString &itemKey)
|
||||
|
||||
int NetworkPlugin::itemSortKey(const QString &itemKey)
|
||||
{
|
||||
const QString key = QString("pos_%1_%2").arg(itemKey).arg(displayMode());
|
||||
return m_settings.value(key, 0).toInt();
|
||||
Dock::DisplayMode mode = displayMode();
|
||||
const QString key = QString("pos_%1_%2").arg(itemKey).arg(mode);
|
||||
|
||||
if (mode == Dock::DisplayMode::Fashion) {
|
||||
return m_settings.value(key, 2).toInt();
|
||||
} else {
|
||||
return m_settings.value(key, 3).toInt();
|
||||
}
|
||||
}
|
||||
|
||||
void NetworkPlugin::setSortKey(const QString &itemKey, const int order)
|
||||
|
@ -225,8 +225,16 @@ void ShutdownPlugin::displayModeChanged(const Dock::DisplayMode displayMode)
|
||||
|
||||
int ShutdownPlugin::itemSortKey(const QString &itemKey)
|
||||
{
|
||||
const QString key = QString("pos_%1_%2").arg(itemKey).arg(displayMode());
|
||||
return m_settings.value(key, 0).toInt();
|
||||
Dock::DisplayMode mode = displayMode();
|
||||
const QString key = QString("pos_%1_%2").arg(itemKey).arg(mode);
|
||||
|
||||
//if (mode == Dock::DisplayMode::Fashion) {
|
||||
//return m_settings.value(key, 4).toInt();
|
||||
//} else {
|
||||
//return m_settings.value(key, 4).toInt();
|
||||
//}
|
||||
|
||||
return m_settings.value(key, 4).toInt();
|
||||
}
|
||||
|
||||
void ShutdownPlugin::setSortKey(const QString &itemKey, const int order)
|
||||
|
@ -106,8 +106,14 @@ int SoundPlugin::itemSortKey(const QString &itemKey)
|
||||
{
|
||||
Q_UNUSED(itemKey);
|
||||
|
||||
const QString key = QString("pos_%1").arg(displayMode());
|
||||
return m_settings.value(key, 0).toInt();
|
||||
Dock::DisplayMode mode = displayMode();
|
||||
const QString key = QString("pos_%1").arg(mode);
|
||||
|
||||
if (mode == Dock::DisplayMode::Fashion) {
|
||||
return m_settings.value(key, 1).toInt();
|
||||
} else {
|
||||
return m_settings.value(key, 2).toInt();
|
||||
}
|
||||
}
|
||||
|
||||
void SoundPlugin::setSortKey(const QString &itemKey, const int order)
|
||||
|
@ -137,8 +137,14 @@ bool SystemTrayPlugin::itemIsInContainer(const QString &itemKey)
|
||||
|
||||
int SystemTrayPlugin::itemSortKey(const QString &itemKey)
|
||||
{
|
||||
const QString key = QString("pos_%1_%2").arg(itemKey).arg(displayMode());
|
||||
return m_containerSettings->value(key, 0).toInt();
|
||||
Dock::DisplayMode mode = displayMode();
|
||||
const QString key = QString("pos_%1_%2").arg(itemKey).arg(mode);
|
||||
|
||||
if (mode == Dock::DisplayMode::Fashion) {
|
||||
return m_containerSettings->value(key, 3).toInt();
|
||||
} else {
|
||||
return m_containerSettings->value(key, 1).toInt();
|
||||
}
|
||||
}
|
||||
|
||||
void SystemTrayPlugin::setSortKey(const QString &itemKey, const int order)
|
||||
|
Loading…
x
Reference in New Issue
Block a user