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
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,17 @@
"permissions": "readwrite",
"visibility": "private"
},
"cgroupsBasedGrouping": {
"value": true,
"serial": 0,
"flags": [],
"name": "cgroupsBasedGrouping",
"name[zh_CN]": "基于 cgroups 的任务图标分组",
"description": "Enable cgroups-based task grouping",
"description[zh_CN]": "启用基于 cgroups 的任务图标分组",
"permissions": "readonly",
"visibility": "private"
},
"Docked_Items": {
"value": ["id: dde-file-manager,type: amAPP", "id: org.deepin.browser,type: amAPP", "id: deepin-app-store,type: amAPP", "id: org.deepin.dde.control-center, type: amAPP", "id: deepin-music,type: amAPP", "id: deepin-editor,type: amAPP", "id: deepin-mail,type: amAPP","id: deepin-terminal,type: amAPP","id: dde-calendar,type: amAPP", "id: deepin-calculator,type: amAPP"],
"serial": 0,
Expand Down
1 change: 1 addition & 0 deletions panels/dock/taskmanager/globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ static inline const QString DOCK_ACTION_DOCK = "dock-action-dock";
// setting keys
static inline const QString TASKMANAGER_ALLOWFOCEQUIT_KEY = "Allow_Force_Quit";
static inline const QString TASKMANAGER_WINDOWSPLIT_KEY = "noTaskGrouping";
static inline const QString TASKMANAGER_CGROUPS_BASED_GROUPING_KEY = "cgroupsBasedGrouping";
static inline const QString TASKMANAGER_DOCKEDITEMS_KEY = "Docked_Items";
constexpr auto TASKMANAGER_DOCKEDELEMENTS_KEY = "dockedElements";

Expand Down
2 changes: 1 addition & 1 deletion panels/dock/taskmanager/taskmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ void TaskManager::handleWindowAdded(QPointer<AbstractWindow> window)
qCDebug(taskManagerLog()) << "identify by AM:" << desktopId;
}

if (desktopfile.isNull() || !desktopfile->isValied().first) {
if (Settings->cgroupsBasedGrouping() && (desktopfile.isNull() || !desktopfile->isValied().first)) {
desktopfile = DESKTOPFILEFACTORY::createByWindow(window);
qCDebug(taskManagerLog()) << "identify by Fallback:" << desktopId;
}
Expand Down
6 changes: 6 additions & 0 deletions panels/dock/taskmanager/taskmanagersettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@

m_allowForceQuit = enableStr2Bool(m_taskManagerDconfig->value(TASKMANAGER_ALLOWFOCEQUIT_KEY).toString());
m_windowSplit = m_taskManagerDconfig->value(TASKMANAGER_WINDOWSPLIT_KEY).toBool();
m_cgroupsBasedGrouping = m_taskManagerDconfig->value(TASKMANAGER_CGROUPS_BASED_GROUPING_KEY, true).toBool();
m_dockedElements = m_taskManagerDconfig->value(TASKMANAGER_DOCKEDELEMENTS_KEY, {}).toStringList();
migrateFromDockedItems();
}
Expand All @@ -77,7 +78,12 @@
m_taskManagerDconfig->setValue(TASKMANAGER_WINDOWSPLIT_KEY, m_windowSplit);
}

bool TaskManagerSettings::cgroupsBasedGrouping() const

Check warning on line 81 in panels/dock/taskmanager/taskmanagersettings.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

The function 'cgroupsBasedGrouping' is never used.
{
return m_cgroupsBasedGrouping;
}

QStringList TaskManagerSettings::dockedElements() const

Check warning on line 86 in panels/dock/taskmanager/taskmanagersettings.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

The function 'dockedElements' is never used.
{
return m_dockedElements;
}
Expand Down
3 changes: 3 additions & 0 deletions panels/dock/taskmanager/taskmanagersettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ class TaskManagerSettings : public QObject
bool isWindowSplit();
void setWindowSplit(bool split);

bool cgroupsBasedGrouping() const;

void setDockedElements(const QStringList &elements);
void appendDockedElements(const QString &element);
void removeDockedElements(const QString &element);
Expand All @@ -51,6 +53,7 @@ class TaskManagerSettings : public QObject

bool m_allowForceQuit;
bool m_windowSplit;
bool m_cgroupsBasedGrouping;
QStringList m_dockedElements;
};
}