diff --git a/frame/util/docksettings.cpp b/frame/util/docksettings.cpp index ea0b29c0f..66c16ce35 100644 --- a/frame/util/docksettings.cpp +++ b/frame/util/docksettings.cpp @@ -345,7 +345,7 @@ void DockSettings::onDisplayModeChanged() emit displayModeChanegd(); calculateWindowConfig(); - QTimer::singleShot(1, m_itemManager, &DockItemManager::sortPluginItems); + //QTimer::singleShot(1, m_itemManager, &DockItemManager::sortPluginItems); } void DockSettings::hideModeChanged() diff --git a/plugins/datetime/datetimeplugin.cpp b/plugins/datetime/datetimeplugin.cpp index 4ac5c1b7b..1f706a83e 100644 --- a/plugins/datetime/datetimeplugin.cpp +++ b/plugins/datetime/datetimeplugin.cpp @@ -109,21 +109,15 @@ int DatetimePlugin::itemSortKey(const QString &itemKey) { Q_UNUSED(itemKey); - Dock::DisplayMode mode = displayMode(); - const QString key = QString("pos_%1").arg(mode); - - if (mode == Dock::DisplayMode::Fashion) { - return m_proxyInter->getValue(this, key, 3).toInt(); - } else { - return m_proxyInter->getValue(this, key, -1).toInt(); - } + const QString key = QString("pos_%1").arg(Dock::Efficient); + return m_proxyInter->getValue(this, key, 5).toInt(); } void DatetimePlugin::setSortKey(const QString &itemKey, const int order) { Q_UNUSED(itemKey); - const QString key = QString("pos_%1").arg(displayMode()); + const QString key = QString("pos_%1").arg(Dock::Efficient); m_proxyInter->saveValue(this, key, order); } diff --git a/plugins/multitasking/multitaskingplugin.cpp b/plugins/multitasking/multitaskingplugin.cpp index ba3f60752..7924451f5 100644 --- a/plugins/multitasking/multitaskingplugin.cpp +++ b/plugins/multitasking/multitaskingplugin.cpp @@ -139,14 +139,14 @@ void MultitaskingPlugin::refreshIcon(const QString &itemKey) int MultitaskingPlugin::itemSortKey(const QString &itemKey) { - const QString key = QString("pos_%1_%2").arg(itemKey).arg(displayMode()); + const QString key = QString("pos_%1_%2").arg(itemKey).arg(Dock::Efficient); return m_proxyInter->getValue(this, key, 2).toInt(); } void MultitaskingPlugin::setSortKey(const QString &itemKey, const int order) { - const QString key = QString("pos_%1_%2").arg(itemKey).arg(displayMode()); + const QString key = QString("pos_%1_%2").arg(itemKey).arg(Dock::Efficient); m_proxyInter->saveValue(this, key, order); } diff --git a/plugins/network/networkplugin.cpp b/plugins/network/networkplugin.cpp index 311ccde9c..ce9f4d99f 100644 --- a/plugins/network/networkplugin.cpp +++ b/plugins/network/networkplugin.cpp @@ -147,14 +147,14 @@ QWidget *NetworkPlugin::itemPopupApplet(const QString &itemKey) int NetworkPlugin::itemSortKey(const QString &itemKey) { - const QString key = QString("pos_%1_%2").arg(itemKey).arg(displayMode()); + const QString key = QString("pos_%1_%2").arg(itemKey).arg(Dock::Efficient); - return m_proxyInter->getValue(this, key, displayMode() == Dock::DisplayMode::Fashion ? 2 : 2).toInt(); + return m_proxyInter->getValue(this, key, 2).toInt(); } void NetworkPlugin::setSortKey(const QString &itemKey, const int order) { - const QString key = QString("pos_%1_%2").arg(itemKey).arg(displayMode()); + const QString key = QString("pos_%1_%2").arg(itemKey).arg(Dock::Efficient); m_proxyInter->saveValue(this, key, order); } diff --git a/plugins/onboard/onboardplugin.cpp b/plugins/onboard/onboardplugin.cpp index 802745bd8..63d1ccc09 100644 --- a/plugins/onboard/onboardplugin.cpp +++ b/plugins/onboard/onboardplugin.cpp @@ -126,19 +126,13 @@ void OnboardPlugin::displayModeChanged(const Dock::DisplayMode displayMode) int OnboardPlugin::itemSortKey(const QString &itemKey) { - Dock::DisplayMode mode = displayMode(); - const QString key = QString("pos_%1_%2").arg(itemKey).arg(mode); - - if (mode == Dock::DisplayMode::Fashion) { - return m_proxyInter->getValue(this, key, 1).toInt(); - } else { - return m_proxyInter->getValue(this, key, 4).toInt(); - } + const QString key = QString("pos_%1_%2").arg(itemKey).arg(Dock::Efficient); + return m_proxyInter->getValue(this, key, 3).toInt(); } void OnboardPlugin::setSortKey(const QString &itemKey, const int order) { - const QString key = QString("pos_%1_%2").arg(itemKey).arg(displayMode()); + const QString key = QString("pos_%1_%2").arg(itemKey).arg(Dock::Efficient); m_proxyInter->saveValue(this, key, order); } diff --git a/plugins/overlay-warning/overlay-warning-plugin.cpp b/plugins/overlay-warning/overlay-warning-plugin.cpp index 8e4c1c977..571e6e060 100644 --- a/plugins/overlay-warning/overlay-warning-plugin.cpp +++ b/plugins/overlay-warning/overlay-warning-plugin.cpp @@ -121,19 +121,13 @@ void OverlayWarningPlugin::displayModeChanged(const Dock::DisplayMode displayMod int OverlayWarningPlugin::itemSortKey(const QString &itemKey) { - Dock::DisplayMode mode = displayMode(); - const QString key = QString("pos_%1_%2").arg(itemKey).arg(mode); - - if (mode == Dock::DisplayMode::Fashion) { - return m_proxyInter->getValue(this, key, 2).toInt(); - } else { - return m_proxyInter->getValue(this, key, 5).toInt(); - } + const QString key = QString("pos_%1_%2").arg(itemKey).arg(Dock::Efficient); + return m_proxyInter->getValue(this, key, 3).toInt(); } void OverlayWarningPlugin::setSortKey(const QString &itemKey, const int order) { - const QString key = QString("pos_%1_%2").arg(itemKey).arg(displayMode()); + const QString key = QString("pos_%1_%2").arg(itemKey).arg(Dock::Efficient); m_proxyInter->saveValue(this, key, order); } diff --git a/plugins/power/powerplugin.cpp b/plugins/power/powerplugin.cpp index e64b12bd1..a0a604d4b 100644 --- a/plugins/power/powerplugin.cpp +++ b/plugins/power/powerplugin.cpp @@ -139,14 +139,14 @@ void PowerPlugin::refreshIcon(const QString &itemKey) int PowerPlugin::itemSortKey(const QString &itemKey) { - const QString key = QString("pos_%1_%2").arg(itemKey).arg(displayMode()); + const QString key = QString("pos_%1_%2").arg(itemKey).arg(Dock::Efficient); - return m_proxyInter->getValue(this, key, displayMode() == Dock::DisplayMode::Fashion ? 3 : 3).toInt(); + return m_proxyInter->getValue(this, key, 4).toInt(); } void PowerPlugin::setSortKey(const QString &itemKey, const int order) { - const QString key = QString("pos_%1_%2").arg(itemKey).arg(displayMode()); + const QString key = QString("pos_%1_%2").arg(itemKey).arg(Dock::Efficient); m_proxyInter->saveValue(this, key, order); } diff --git a/plugins/show-desktop/showdesktopplugin.cpp b/plugins/show-desktop/showdesktopplugin.cpp index 1c5c32a3f..4a3e15abd 100644 --- a/plugins/show-desktop/showdesktopplugin.cpp +++ b/plugins/show-desktop/showdesktopplugin.cpp @@ -139,14 +139,14 @@ void ShowDesktopPlugin::refreshIcon(const QString &itemKey) int ShowDesktopPlugin::itemSortKey(const QString &itemKey) { - const QString key = QString("pos_%1_%2").arg(itemKey).arg(displayMode()); + const QString key = QString("pos_%1_%2").arg(itemKey).arg(Dock::Efficient); return m_proxyInter->getValue(this, key, 1).toInt(); } void ShowDesktopPlugin::setSortKey(const QString &itemKey, const int order) { - const QString key = QString("pos_%1_%2").arg(itemKey).arg(displayMode()); + const QString key = QString("pos_%1_%2").arg(itemKey).arg(Dock::Efficient); m_proxyInter->saveValue(this, key, order); } diff --git a/plugins/shutdown/shutdownplugin.cpp b/plugins/shutdown/shutdownplugin.cpp index 54e0ef0d2..49e6ffd7f 100644 --- a/plugins/shutdown/shutdownplugin.cpp +++ b/plugins/shutdown/shutdownplugin.cpp @@ -199,19 +199,13 @@ void ShutdownPlugin::displayModeChanged(const Dock::DisplayMode displayMode) int ShutdownPlugin::itemSortKey(const QString &itemKey) { - Dock::DisplayMode mode = displayMode(); - const QString key = QString("pos_%1_%2").arg(itemKey).arg(mode); - - if (mode == Dock::DisplayMode::Fashion) { - return m_proxyInter->getValue(this, key, 2).toInt(); - } else { - return m_proxyInter->getValue(this, key, 5).toInt(); - } + const QString key = QString("pos_%1_%2").arg(itemKey).arg(Dock::Efficient); + return m_proxyInter->getValue(this, key, 6).toInt(); } void ShutdownPlugin::setSortKey(const QString &itemKey, const int order) { - const QString key = QString("pos_%1_%2").arg(itemKey).arg(displayMode()); + const QString key = QString("pos_%1_%2").arg(itemKey).arg(Dock::Efficient); m_proxyInter->saveValue(this, key, order); } diff --git a/plugins/sound/soundplugin.cpp b/plugins/sound/soundplugin.cpp index 3df93a7b5..64bebf02e 100644 --- a/plugins/sound/soundplugin.cpp +++ b/plugins/sound/soundplugin.cpp @@ -107,14 +107,14 @@ void SoundPlugin::invokedMenuItem(const QString &itemKey, const QString &menuId, int SoundPlugin::itemSortKey(const QString &itemKey) { - const QString key = QString("pos_%1_%2").arg(itemKey).arg(displayMode()); + const QString key = QString("pos_%1_%2").arg(itemKey).arg(Dock::Efficient); - return m_proxyInter->getValue(this, key, displayMode() == Dock::DisplayMode::Fashion ? 1 : 1).toInt(); + return m_proxyInter->getValue(this, key, 1).toInt(); } void SoundPlugin::setSortKey(const QString &itemKey, const int order) { - const QString key = QString("pos_%1_%2").arg(itemKey).arg(displayMode()); + const QString key = QString("pos_%1_%2").arg(itemKey).arg(Dock::Efficient); m_proxyInter->saveValue(this, key, order); } diff --git a/plugins/trash/trashplugin.cpp b/plugins/trash/trashplugin.cpp index 7c373f204..a92da7825 100644 --- a/plugins/trash/trashplugin.cpp +++ b/plugins/trash/trashplugin.cpp @@ -154,13 +154,13 @@ void TrashPlugin::pluginStateSwitched() int TrashPlugin::itemSortKey(const QString &itemKey) { - const QString &key = QString("pos_%1_%2").arg(itemKey).arg(displayMode()); - return m_proxyInter->getValue(this, key, -1).toInt(); + const QString &key = QString("pos_%1_%2").arg(itemKey).arg(Dock::Efficient); + return m_proxyInter->getValue(this, key, 7).toInt(); } void TrashPlugin::setSortKey(const QString &itemKey, const int order) { - const QString &key = QString("pos_%1_%2").arg(itemKey).arg(displayMode()); + const QString &key = QString("pos_%1_%2").arg(itemKey).arg(Dock::Efficient); m_proxyInter->saveValue(this, key, order); } diff --git a/plugins/tray/trayplugin.cpp b/plugins/tray/trayplugin.cpp index ee66c33da..827d4de5d 100644 --- a/plugins/tray/trayplugin.cpp +++ b/plugins/tray/trayplugin.cpp @@ -176,7 +176,7 @@ int TrayPlugin::itemSortKey(const QString &itemKey) return defaultSort; } - const QString key = QString("pos_%1_%2").arg(trayWidget->itemKeyForConfig()).arg(displayMode()); + const QString key = QString("pos_%1_%2").arg(trayWidget->itemKeyForConfig()).arg(Dock::Efficient); return m_proxyInter->getValue(this, key, defaultSort).toInt(); } @@ -197,7 +197,7 @@ void TrayPlugin::setSortKey(const QString &itemKey, const int order) return; } - const QString key = QString("pos_%1_%2").arg(trayWidget->itemKeyForConfig()).arg(displayMode()); + const QString key = QString("pos_%1_%2").arg(trayWidget->itemKeyForConfig()).arg(Dock::Efficient); m_proxyInter->saveValue(this, key, order); }