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
734f3084
Commit
734f3084
authored
Mar 13, 2022
by
Laurent Montel
Browse files
Fix some clazy warnings
parent
111200bf
Pipeline
#149759
passed with stage
in 11 minutes and 31 seconds
Changes
28
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
applets/systemtray/container/CMakeLists.txt
View file @
734f3084
...
...
@@ -3,6 +3,7 @@ plasma_install_package(package org.kde.plasma.systemtray)
set
(
systemtraycontainer_SRCS
systemtraycontainer.cpp
systemtraycontainer.h
)
ecm_qt_declare_logging_category
(
systemtraycontainer_SRCS HEADER debug.h
...
...
applets/systemtray/dbusserviceobserver.cpp
View file @
734f3084
...
...
@@ -17,7 +17,7 @@
#include
<QDBusPendingReply>
#include
<QDBusServiceWatcher>
DBusServiceObserver
::
DBusServiceObserver
(
QPointer
<
SystemTraySettings
>
settings
,
QObject
*
parent
)
DBusServiceObserver
::
DBusServiceObserver
(
const
QPointer
<
SystemTraySettings
>
&
settings
,
QObject
*
parent
)
:
QObject
(
parent
)
,
m_settings
(
settings
)
,
m_sessionServiceWatcher
(
new
QDBusServiceWatcher
(
this
))
...
...
@@ -64,7 +64,7 @@ void DBusServiceObserver::registerPlugin(const KPluginMetaData &pluginMetaData)
rx
.
setPatternSyntax
(
QRegExp
::
Wildcard
);
m_dbusActivatableTasks
[
pluginMetaData
.
pluginId
()]
=
rx
;
const
QString
watchedService
=
QString
(
dbusactivation
).
replace
(
".*"
,
"*"
);
const
QString
watchedService
=
QString
(
dbusactivation
).
replace
(
QLatin1String
(
".*"
)
,
QLatin1String
(
"*"
)
)
;
m_sessionServiceWatcher
->
addWatchedService
(
watchedService
);
m_systemServiceWatcher
->
addWatchedService
(
watchedService
);
}
...
...
@@ -74,7 +74,7 @@ void DBusServiceObserver::unregisterPlugin(const QString &pluginId)
{
if
(
m_dbusActivatableTasks
.
contains
(
pluginId
))
{
QRegExp
rx
=
m_dbusActivatableTasks
.
take
(
pluginId
);
const
QString
watchedService
=
rx
.
pattern
().
replace
(
".*"
,
"*"
);
const
QString
watchedService
=
rx
.
pattern
().
replace
(
QLatin1String
(
".*"
)
,
QLatin1String
(
"*"
)
)
;
m_sessionServiceWatcher
->
removeWatchedService
(
watchedService
);
m_systemServiceWatcher
->
removeWatchedService
(
watchedService
);
}
...
...
applets/systemtray/dbusserviceobserver.h
View file @
734f3084
...
...
@@ -24,7 +24,7 @@ class DBusServiceObserver : public QObject
{
Q_OBJECT
public:
explicit
DBusServiceObserver
(
QPointer
<
SystemTraySettings
>
settings
,
QObject
*
parent
=
nullptr
);
explicit
DBusServiceObserver
(
const
QPointer
<
SystemTraySettings
>
&
settings
,
QObject
*
parent
=
nullptr
);
void
registerPlugin
(
const
KPluginMetaData
&
pluginMetaData
);
void
unregisterPlugin
(
const
QString
&
pluginId
);
...
...
applets/systemtray/plasmoidregistry.cpp
View file @
734f3084
...
...
@@ -111,7 +111,7 @@ void PlasmoidRegistry::packageUninstalled(const QString &pluginId)
void
PlasmoidRegistry
::
registerPlugin
(
const
KPluginMetaData
&
pluginMetaData
)
{
if
(
!
pluginMetaData
.
isValid
()
||
pluginMetaData
.
value
(
QStringLiteral
(
"X-Plasma-NotificationArea"
))
!=
"true"
)
{
if
(
!
pluginMetaData
.
isValid
()
||
pluginMetaData
.
value
(
QStringLiteral
(
"X-Plasma-NotificationArea"
))
!=
QLatin1String
(
"true"
)
)
{
return
;
}
...
...
applets/systemtray/systemtraymodel.cpp
View file @
734f3084
...
...
@@ -88,7 +88,7 @@ static QString plasmoidCategoryForMetadata(const KPluginMetaData &metadata)
return
category
;
}
PlasmoidModel
::
PlasmoidModel
(
QPointer
<
SystemTraySettings
>
settings
,
QPointer
<
PlasmoidRegistry
>
plasmoidRegistry
,
QObject
*
parent
)
PlasmoidModel
::
PlasmoidModel
(
const
QPointer
<
SystemTraySettings
>
&
settings
,
const
QPointer
<
PlasmoidRegistry
>
&
plasmoidRegistry
,
QObject
*
parent
)
:
BaseModel
(
settings
,
parent
)
,
m_plasmoidRegistry
(
plasmoidRegistry
)
{
...
...
@@ -97,7 +97,7 @@ PlasmoidModel::PlasmoidModel(QPointer<SystemTraySettings> settings, QPointer<Pla
const
auto
appletMetaDataList
=
m_plasmoidRegistry
->
systemTrayApplets
();
for
(
const
auto
&
info
:
appletMetaDataList
)
{
if
(
!
info
.
isValid
()
||
info
.
value
(
QStringLiteral
(
"X-Plasma-NotificationArea"
))
!=
"true"
)
{
if
(
!
info
.
isValid
()
||
info
.
value
(
QStringLiteral
(
"X-Plasma-NotificationArea"
))
!=
QLatin1String
(
"true"
)
)
{
continue
;
}
appendRow
(
info
);
...
...
applets/systemtray/systemtraymodel.h
View file @
734f3084
...
...
@@ -73,7 +73,7 @@ public:
HasApplet
,
};
explicit
PlasmoidModel
(
QPointer
<
SystemTraySettings
>
settings
,
QPointer
<
PlasmoidRegistry
>
plasmoidRegistry
,
QObject
*
parent
=
nullptr
);
explicit
PlasmoidModel
(
const
QPointer
<
SystemTraySettings
>
&
settings
,
const
QPointer
<
PlasmoidRegistry
>
&
plasmoidRegistry
,
QObject
*
parent
=
nullptr
);
QVariant
data
(
const
QModelIndex
&
index
,
int
role
=
Qt
::
DisplayRole
)
const
override
;
int
rowCount
(
const
QModelIndex
&
parent
=
QModelIndex
())
const
override
;
...
...
components/sessionsprivate/sessionsmodel.cpp
View file @
734f3084
...
...
@@ -40,12 +40,12 @@ SessionsModel::SessionsModel(QObject *parent)
bool
SessionsModel
::
canSwitchUser
()
const
{
return
const_cast
<
SessionsModel
*>
(
this
)
->
m_displayManager
.
isSwitchable
()
&&
KAuthorized
::
authorizeAction
(
Q
Latin1
String
(
"switch_user"
));
return
const_cast
<
SessionsModel
*>
(
this
)
->
m_displayManager
.
isSwitchable
()
&&
KAuthorized
::
authorizeAction
(
QString
Literal
(
"switch_user"
));
}
bool
SessionsModel
::
canStartNewSession
()
const
{
return
const_cast
<
SessionsModel
*>
(
this
)
->
m_displayManager
.
numReserve
()
>
0
&&
KAuthorized
::
authorizeAction
(
Q
Latin1
String
(
"start_new_session"
));
return
const_cast
<
SessionsModel
*>
(
this
)
->
m_displayManager
.
numReserve
()
>
0
&&
KAuthorized
::
authorizeAction
(
QString
Literal
(
"start_new_session"
));
}
bool
SessionsModel
::
shouldLock
()
const
...
...
components/shellprivate/widgetexplorer/kcategorizeditemsviewmodels.cpp
View file @
734f3084
...
...
@@ -200,7 +200,7 @@ void DefaultItemFilterProxyModel::setFilter(const Filter &filter)
Q_EMIT
filterChanged
();
}
void
DefaultItemFilterProxyModel
::
setFilterType
(
const
QString
type
)
void
DefaultItemFilterProxyModel
::
setFilterType
(
const
QString
&
type
)
{
m_filter
.
first
=
type
;
invalidateFilter
();
...
...
@@ -212,7 +212,7 @@ QString DefaultItemFilterProxyModel::filterType() const
return
m_filter
.
first
;
}
void
DefaultItemFilterProxyModel
::
setFilterQuery
(
const
QVariant
query
)
void
DefaultItemFilterProxyModel
::
setFilterQuery
(
const
QVariant
&
query
)
{
m_filter
.
second
=
query
;
invalidateFilter
();
...
...
components/shellprivate/widgetexplorer/kcategorizeditemsviewmodels_p.h
View file @
734f3084
...
...
@@ -130,10 +130,10 @@ public:
void
setSearchTerm
(
const
QString
&
pattern
);
QString
searchTerm
()
const
;
void
setFilterType
(
const
QString
type
);
void
setFilterType
(
const
QString
&
type
);
QString
filterType
()
const
;
void
setFilterQuery
(
const
QVariant
query
);
void
setFilterQuery
(
const
QVariant
&
query
);
QVariant
filterQuery
()
const
;
void
setFilter
(
const
Filter
&
filter
);
...
...
components/shellprivate/widgetexplorer/openwidgetassistant.cpp
View file @
734f3084
...
...
@@ -24,9 +24,8 @@ namespace Plasma
OpenWidgetAssistant
::
OpenWidgetAssistant
(
QWidget
*
parent
)
:
KAssistantDialog
(
parent
)
,
m_fileWidget
(
nullptr
)
,
m_filePageWidget
(
n
ullptr
)
,
m_filePageWidget
(
n
ew
QWidget
(
this
)
)
{
m_filePageWidget
=
new
QWidget
(
this
);
QVBoxLayout
*
layout
=
new
QVBoxLayout
(
m_filePageWidget
);
m_fileWidget
=
new
KFileWidget
(
QUrl
(),
m_filePageWidget
);
...
...
@@ -37,8 +36,7 @@ OpenWidgetAssistant::OpenWidgetAssistant(QWidget *parent)
layout
->
addWidget
(
m_fileWidget
);
m_fileWidget
->
setFilter
(
QString
());
QStringList
mimes
;
mimes
<<
QStringLiteral
(
"application/x-plasma"
);
const
QStringList
mimes
{
QStringLiteral
(
"application/x-plasma"
)};
m_fileWidget
->
setMimeFilter
(
mimes
);
m_filePage
=
new
KPageWidgetItem
(
m_filePageWidget
,
i18n
(
"Select Plasmoid File"
));
...
...
@@ -55,7 +53,7 @@ void OpenWidgetAssistant::slotHelpClicked()
void
OpenWidgetAssistant
::
finished
()
{
m_fileWidget
->
accept
();
// how interesting .. accept() must be called before the state is set
QString
packageFilePath
=
m_fileWidget
->
selectedFile
();
const
QString
packageFilePath
=
m_fileWidget
->
selectedFile
();
if
(
packageFilePath
.
isEmpty
())
{
// TODO: user visible error handling
qDebug
()
<<
"hm. no file path?"
;
...
...
components/shellprivate/widgetexplorer/plasmaappletitemmodel.cpp
View file @
734f3084
...
...
@@ -133,7 +133,7 @@ bool PlasmaAppletItem::matches(const QString &pattern) const
keywords
<<
&
name
<<
m_info
.
value
(
QStringLiteral
(
"Keywords"
),
QString
()).
splitRef
(
QLatin1Char
(
';'
),
Qt
::
SkipEmptyParts
);
}
for
(
const
auto
&
keyword
:
keywords
)
{
for
(
const
auto
&
keyword
:
std
::
as_const
(
keywords
)
)
{
if
(
keyword
.
startsWith
(
pattern
,
Qt
::
CaseInsensitive
))
{
return
true
;
}
...
...
components/shellprivate/widgetexplorer/widgetexplorer.cpp
View file @
734f3084
...
...
@@ -132,7 +132,7 @@ void WidgetExplorerPrivate::initFilters()
if
(
!
plugin
.
isValid
())
{
continue
;
}
if
(
plugin
.
rawData
().
value
(
"NoDisplay"
).
toBool
()
||
plugin
.
category
()
==
QLatin1String
(
"Containments"
)
||
plugin
.
category
().
isEmpty
())
{
if
(
plugin
.
rawData
().
value
(
QStringLiteral
(
"NoDisplay"
)
)
.
toBool
()
||
plugin
.
category
()
==
QLatin1String
(
"Containments"
)
||
plugin
.
category
().
isEmpty
())
{
// we don't want to show the hidden category
continue
;
}
...
...
@@ -453,7 +453,7 @@ void WidgetExplorer::immutabilityChanged(Plasma::Types::ImmutabilityType type)
void
WidgetExplorer
::
downloadWidgets
()
{
if
(
!
d
->
newStuffDialog
)
{
d
->
newStuffDialog
=
new
KNS3
::
QtQuickDialogWrapper
(
Q
Latin1
String
(
"plasmoids.knsrc"
));
d
->
newStuffDialog
=
new
KNS3
::
QtQuickDialogWrapper
(
QString
Literal
(
"plasmoids.knsrc"
));
}
d
->
newStuffDialog
->
open
();
...
...
containmentactions/applauncher/launch.cpp
View file @
734f3084
...
...
@@ -34,7 +34,7 @@ QList<QAction *> AppLauncher::contextualActions()
return
m_actions
;
}
void
AppLauncher
::
makeMenu
(
QMenu
*
menu
,
const
KServiceGroup
::
Ptr
group
)
void
AppLauncher
::
makeMenu
(
QMenu
*
menu
,
const
KServiceGroup
::
Ptr
&
group
)
{
const
auto
entries
=
group
->
entries
(
true
,
true
,
true
);
for
(
const
KSycocaEntry
::
Ptr
&
p
:
entries
)
{
...
...
containmentactions/applauncher/launch.h
View file @
734f3084
...
...
@@ -35,7 +35,7 @@ public:
void
save
(
KConfigGroup
&
config
)
override
;
protected:
void
makeMenu
(
QMenu
*
menu
,
const
KServiceGroup
::
Ptr
group
);
void
makeMenu
(
QMenu
*
menu
,
const
KServiceGroup
::
Ptr
&
group
);
private:
KServiceGroup
::
Ptr
m_group
;
...
...
containmentactions/contextmenu/menu.cpp
View file @
734f3084
...
...
@@ -29,14 +29,6 @@
ContextMenu
::
ContextMenu
(
QObject
*
parent
,
const
QVariantList
&
args
)
:
Plasma
::
ContainmentActions
(
parent
,
args
)
,
m_runCommandAction
(
nullptr
)
,
m_lockScreenAction
(
nullptr
)
,
m_logoutAction
(
nullptr
)
,
m_configureDisplaysAction
(
nullptr
)
,
m_separator1
(
nullptr
)
,
m_separator2
(
nullptr
)
,
m_separator3
(
nullptr
)
,
m_buttons
(
nullptr
)
,
m_session
(
new
SessionManagement
(
this
))
{
}
...
...
containmentactions/contextmenu/menu.h
View file @
734f3084
...
...
@@ -33,17 +33,17 @@ public Q_SLOTS:
void
configureDisplays
();
private:
QAction
*
m_runCommandAction
;
QAction
*
m_lockScreenAction
;
QAction
*
m_logoutAction
;
QAction
*
m_configureDisplaysAction
;
QAction
*
m_separator1
;
QAction
*
m_separator2
;
QAction
*
m_separator3
;
QAction
*
m_runCommandAction
=
nullptr
;
QAction
*
m_lockScreenAction
=
nullptr
;
QAction
*
m_logoutAction
=
nullptr
;
QAction
*
m_configureDisplaysAction
=
nullptr
;
QAction
*
m_separator1
=
nullptr
;
QAction
*
m_separator2
=
nullptr
;
QAction
*
m_separator3
=
nullptr
;
// action name and whether it is enabled or not
QHash
<
QString
,
bool
>
m_actions
;
QStringList
m_actionOrder
;
QButtonGroup
*
m_buttons
;
SessionManagement
*
m_session
;
QButtonGroup
*
m_buttons
=
nullptr
;
SessionManagement
*
const
m_session
;
};
containmentactions/paste/paste.cpp
View file @
734f3084
...
...
@@ -18,8 +18,8 @@
Paste
::
Paste
(
QObject
*
parent
,
const
QVariantList
&
args
)
:
Plasma
::
ContainmentActions
(
parent
,
args
)
,
m_action
(
new
QAction
(
this
))
{
m_action
=
new
QAction
(
this
);
QObject
::
connect
(
m_action
,
&
QAction
::
triggered
,
this
,
&
Paste
::
doPaste
);
}
...
...
containmentactions/paste/paste.h
View file @
734f3084
...
...
@@ -22,5 +22,5 @@ private Q_SLOTS:
void
doPaste
();
private:
QAction
*
m_action
;
QAction
*
const
m_action
;
};
containmentactions/switchdesktop/desktop.h
View file @
734f3084
...
...
@@ -33,5 +33,5 @@ private Q_SLOTS:
private:
QHash
<
int
,
QAction
*>
m_actions
;
TaskManager
::
VirtualDesktopInfo
*
m_virtualDesktopInfo
;
TaskManager
::
VirtualDesktopInfo
*
const
m_virtualDesktopInfo
;
};
containmentactions/switchwindow/switch.h
View file @
734f3084
...
...
@@ -23,7 +23,7 @@ class SwitchWindow : public Plasma::ContainmentActions
{
Q_OBJECT
public:
SwitchWindow
(
QObject
*
parent
,
const
QVariantList
&
args
);
explicit
SwitchWindow
(
QObject
*
parent
,
const
QVariantList
&
args
);
~
SwitchWindow
()
override
;
void
restore
(
const
KConfigGroup
&
config
)
override
;
...
...
@@ -53,7 +53,7 @@ private:
Ui
::
Config
m_ui
;
MenuMode
m_mode
;
TaskManager
::
VirtualDesktopInfo
*
m_virtualDesktopInfo
;
TaskManager
::
VirtualDesktopInfo
*
const
m_virtualDesktopInfo
;
static
TaskManager
::
ActivityInfo
*
s_activityInfo
;
static
TaskManager
::
TasksModel
*
s_tasksModel
;
...
...
Prev
1
2
Next
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