Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
Plasma Workspace
Commits
359d397b
Commit
359d397b
authored
Apr 28, 2022
by
Yari Polla
Browse files
libtaskmanager: add a property and relevant handlers to toggle tasks reordering
parent
e4864862
Pipeline
#169487
passed with stage
in 13 minutes and 41 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
libtaskmanager/tasksmodel.cpp
View file @
359d397b
...
...
@@ -1366,6 +1366,18 @@ void TasksModel::setGroupingLauncherUrlBlacklist(const QStringList &list)
}
}
bool
TasksModel
::
taskReorderingEnabled
()
const
{
return
dynamicSortFilter
();
}
void
TasksModel
::
setTaskReorderingEnabled
(
bool
enabled
)
{
enabled
?
setDynamicSortFilter
(
true
)
:
setDynamicSortFilter
(
false
);
Q_EMIT
taskReorderingEnabledChanged
();
}
QStringList
TasksModel
::
launcherList
()
const
{
if
(
d
->
launcherTasksModel
)
{
...
...
libtaskmanager/tasksmodel.h
View file @
359d397b
...
...
@@ -72,6 +72,7 @@ class TASKMANAGER_EXPORT TasksModel : public QSortFilterProxyModel, public Abstr
Q_PROPERTY
(
QStringList
groupingAppIdBlacklist
READ
groupingAppIdBlacklist
WRITE
setGroupingAppIdBlacklist
NOTIFY
groupingAppIdBlacklistChanged
)
Q_PROPERTY
(
QStringList
groupingLauncherUrlBlacklist
READ
groupingLauncherUrlBlacklist
WRITE
setGroupingLauncherUrlBlacklist
NOTIFY
groupingLauncherUrlBlacklistChanged
)
Q_PROPERTY
(
bool
taskReorderingEnabled
READ
taskReorderingEnabled
WRITE
setTaskReorderingEnabled
NOTIFY
taskReorderingEnabledChanged
)
Q_PROPERTY
(
QModelIndex
activeTask
READ
activeTask
NOTIFY
activeTaskChanged
)
public:
...
...
@@ -534,6 +535,20 @@ public:
**/
void
setGroupingLauncherUrlBlacklist
(
const
QStringList
&
list
);
/**
* Enables or disables tasks reordering.
*
* @param enabled enables tasks reordering if @c true; disables it otherwise.
*/
void
setTaskReorderingEnabled
(
bool
enabled
);
/**
* Returns whether tasks reordering is enabled or not.
*
* @returns whether tasks reordering is enabled or not.
*/
bool
taskReorderingEnabled
()
const
;
/**
* Finds the first active (AbstractTasksModel::IsActive) task in the model
* and returns its QModelIndex, or a null QModelIndex if no active task is
...
...
@@ -880,6 +895,7 @@ Q_SIGNALS:
void
groupingWindowTasksThresholdChanged
()
const
;
void
groupingAppIdBlacklistChanged
()
const
;
void
groupingLauncherUrlBlacklistChanged
()
const
;
void
taskReorderingEnabledChanged
()
const
;
void
activeTaskChanged
()
const
;
protected:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment