Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
System Settings
Commits
6dbd1e9f
Commit
6dbd1e9f
authored
May 13, 2021
by
Laurent Montel
😁
Browse files
Use Q_EMIT to make it compile against kf5.82
parent
e270fb25
Changes
5
Hide whitespace changes
Inline
Side-by-side
core/BaseMode.h
View file @
6dbd1e9f
...
...
@@ -216,7 +216,7 @@ Q_SIGNALS:
* of displayed view is changed.
*
* @param state Determines whether changes have been made in the view.
* @warning Failure to
emit
this will result in inconsistent application headers and change state.
* @warning Failure to
Q_EMIT
this will result in inconsistent application headers and change state.
*/
void
viewChanged
(
bool
state
);
...
...
core/MenuProxyModel.cpp
View file @
6dbd1e9f
...
...
@@ -122,10 +122,10 @@ void MenuProxyModel::setFilterRegExp(const QString &pattern)
if
(
pattern
==
filterRegExp
())
{
return
;
}
emit
layoutAboutToBeChanged
();
Q_EMIT
layoutAboutToBeChanged
();
KCategorizedSortFilterProxyModel
::
setFilterRegExp
(
pattern
);
emit
layoutChanged
();
emit
filterRegExpChanged
();
Q_EMIT
layoutChanged
();
Q_EMIT
filterRegExpChanged
();
}
QString
MenuProxyModel
::
filterRegExp
()
const
...
...
@@ -135,7 +135,7 @@ QString MenuProxyModel::filterRegExp() const
void
MenuProxyModel
::
setFilterRegExp
(
const
QRegExp
&
regExp
)
{
emit
layoutAboutToBeChanged
();
Q_EMIT
layoutAboutToBeChanged
();
KCategorizedSortFilterProxyModel
::
setFilterRegExp
(
regExp
);
emit
layoutChanged
();
Q_EMIT
layoutChanged
();
}
core/ModuleView.cpp
View file @
6dbd1e9f
...
...
@@ -379,7 +379,7 @@ bool ModuleView::moduleSave(KCModuleProxy *module)
}
module
->
save
();
emit
moduleSaved
();
Q_EMIT
moduleSaved
();
return
true
;
}
...
...
@@ -518,7 +518,7 @@ void ModuleView::stateChanged()
d
->
mReset
->
setVisible
(
buttons
&
KCModule
::
Apply
);
d
->
mHelp
->
setEnabled
(
buttons
&
KCModule
::
Help
);
d
->
mHelp
->
setVisible
(
buttons
&
KCModule
::
Help
);
emit
moduleChanged
(
change
);
Q_EMIT
moduleChanged
(
change
);
}
void
ModuleView
::
keyPressEvent
(
QKeyEvent
*
event
)
...
...
@@ -529,7 +529,7 @@ void ModuleView::keyPressEvent(QKeyEvent *event)
return
;
}
else
if
(
event
->
key
()
==
Qt
::
Key_Escape
)
{
event
->
accept
();
emit
closeRequest
();
Q_EMIT
closeRequest
();
return
;
}
else
if
(
event
->
key
()
==
Qt
::
Key_F1
&&
event
->
modifiers
()
==
Qt
::
ShiftModifier
)
{
QWhatsThis
::
enterWhatsThisMode
();
...
...
icons/IconMode.cpp
View file @
6dbd1e9f
...
...
@@ -168,7 +168,7 @@ void IconMode::changeModuleWithArgs(const QModelIndex &activeModule, const QStri
void
IconMode
::
moduleLoaded
()
{
d
->
backAction
->
setEnabled
(
true
);
emit
changeToolBarItems
(
BaseMode
::
NoItems
);
Q_EMIT
changeToolBarItems
(
BaseMode
::
NoItems
);
}
void
IconMode
::
backToOverview
()
...
...
@@ -177,8 +177,8 @@ void IconMode::backToOverview()
d
->
mainWidget
->
setCurrentWidget
(
d
->
categoryView
);
d
->
moduleView
->
closeModules
();
d
->
backAction
->
setEnabled
(
false
);
emit
changeToolBarItems
(
BaseMode
::
Search
|
BaseMode
::
Configure
|
BaseMode
::
Quit
);
emit
viewChanged
(
false
);
Q_EMIT
changeToolBarItems
(
BaseMode
::
Search
|
BaseMode
::
Configure
|
BaseMode
::
Quit
);
Q_EMIT
viewChanged
(
false
);
}
}
...
...
@@ -207,7 +207,7 @@ void IconMode::initWidget()
d
->
mainWidget
->
addWidget
(
d
->
categoryView
);
d
->
mainWidget
->
addWidget
(
d
->
moduleView
);
d
->
mainWidget
->
setCurrentWidget
(
d
->
categoryView
);
emit
changeToolBarItems
(
BaseMode
::
Search
|
BaseMode
::
Configure
|
BaseMode
::
Quit
);
Q_EMIT
changeToolBarItems
(
BaseMode
::
Search
|
BaseMode
::
Configure
|
BaseMode
::
Quit
);
d
->
mainWidget
->
installEventFilter
(
this
);
if
(
!
startupModule
().
isEmpty
())
{
...
...
@@ -231,7 +231,7 @@ void IconMode::reloadStartupModule()
bool
IconMode
::
eventFilter
(
QObject
*
watched
,
QEvent
*
event
)
{
if
(
watched
==
d
->
mainWidget
&&
event
->
type
()
==
QEvent
::
Show
)
{
emit
changeToolBarItems
(
BaseMode
::
Search
|
BaseMode
::
Configure
|
BaseMode
::
Quit
);
Q_EMIT
changeToolBarItems
(
BaseMode
::
Search
|
BaseMode
::
Configure
|
BaseMode
::
Quit
);
}
return
BaseMode
::
eventFilter
(
watched
,
event
);
}
...
...
sidebar/SidebarMode.cpp
View file @
6dbd1e9f
...
...
@@ -103,9 +103,9 @@ void SubcategoryModel::setParentIndex(const QModelIndex &activeModule)
{
selectionModel
()
->
select
(
activeModule
,
QItemSelectionModel
::
ClearAndSelect
);
m_activeModuleIndex
=
QPersistentModelIndex
(
activeModule
);
emit
titleChanged
();
emit
iconChanged
();
emit
categoryOwnedByKCMChanged
();
Q_EMIT
titleChanged
();
Q_EMIT
iconChanged
();
Q_EMIT
categoryOwnedByKCMChanged
();
}
void
SubcategoryModel
::
loadParentCategoryModule
()
...
...
@@ -276,7 +276,7 @@ public:
return
;
}
m_actionMenuVisible
=
actionMenuVisible
;
emit
sidebarMode
->
actionMenuVisibleChanged
();
Q_EMIT
sidebarMode
->
actionMenuVisibleChanged
();
}
bool
m_introPageVisible
=
true
;
bool
m_defaultsIndicatorsVisible
=
false
;
...
...
@@ -489,7 +489,7 @@ void SidebarMode::loadModule(const QModelIndex &activeModule, const QStringList
if
(
homeItem
())
{
d
->
m_introPageVisible
=
activeModule
==
d
->
categorizedModel
->
mapFromSource
(
d
->
model
->
indexForItem
(
homeItem
()));
emit
introPageVisibleChanged
();
Q_EMIT
introPageVisibleChanged
();
}
else
{
setIntroPageVisible
(
false
);
}
...
...
@@ -508,18 +508,18 @@ void SidebarMode::loadModule(const QModelIndex &activeModule, const QStringList
if
(
d
->
activeSearchRow
>
-
1
)
{
d
->
activeSearchRow
=
-
1
;
emit
activeSearchRowChanged
();
Q_EMIT
activeSearchRowChanged
();
}
emit
activeCategoryRowChanged
();
emit
activeSubCategoryRowChanged
();
Q_EMIT
activeCategoryRowChanged
();
Q_EMIT
activeSubCategoryRowChanged
();
}
else
if
(
activeModule
.
model
()
==
d
->
subCategoryModel
)
{
if
(
d
->
activeSearchRow
>
-
1
)
{
d
->
activeSearchRow
=
-
1
;
emit
activeSearchRowChanged
();
Q_EMIT
activeSearchRowChanged
();
}
d
->
activeSubCategoryRow
=
activeModule
.
row
();
emit
activeSubCategoryRowChanged
();
Q_EMIT
activeSubCategoryRowChanged
();
}
else
if
(
activeModule
.
model
()
==
d
->
searchModel
)
{
QModelIndex
originalIndex
=
d
->
categorizedModel
->
mapFromSource
(
d
->
flatModel
->
mapToSource
(
d
->
searchModel
->
mapToSource
(
activeModule
)));
...
...
@@ -537,17 +537,17 @@ void SidebarMode::loadModule(const QModelIndex &activeModule, const QStringList
}
d
->
subCategoryModel
->
setParentIndex
(
originalIndex
.
parent
().
isValid
()
?
originalIndex
.
parent
()
:
originalIndex
);
emit
activeCategoryRowChanged
();
emit
activeSubCategoryRowChanged
();
Q_EMIT
activeCategoryRowChanged
();
Q_EMIT
activeSubCategoryRowChanged
();
}
d
->
activeSearchRow
=
activeModule
.
row
();
emit
activeSearchRowChanged
();
Q_EMIT
activeSearchRowChanged
();
}
else
{
if
(
d
->
activeSearchRow
>
-
1
)
{
d
->
activeSearchRow
=
-
1
;
emit
activeSearchRowChanged
();
Q_EMIT
activeSearchRowChanged
();
}
QModelIndex
flatIndex
;
...
...
@@ -580,8 +580,8 @@ void SidebarMode::loadModule(const QModelIndex &activeModule, const QStringList
d
->
activeCategoryRow
=
idx
.
row
();
d
->
activeSubCategoryRow
=
-
1
;
}
emit
activeCategoryRowChanged
();
emit
activeSubCategoryRowChanged
();
Q_EMIT
activeCategoryRowChanged
();
Q_EMIT
activeSubCategoryRowChanged
();
}
}
}
...
...
@@ -627,11 +627,11 @@ void SidebarMode::updateDefaults()
void
SidebarMode
::
updateCategoryModel
(
const
QModelIndex
&
categoryIdx
)
{
auto
sourceIdx
=
d
->
categorizedModel
->
mapToSource
(
categoryIdx
);
emit
d
->
model
->
dataChanged
(
sourceIdx
,
sourceIdx
);
Q_EMIT
d
->
model
->
dataChanged
(
sourceIdx
,
sourceIdx
);
auto
subCateogryIdx
=
d
->
subCategoryModel
->
index
(
d
->
activeSubCategoryRow
,
0
);
auto
subCategorySourceIdx
=
d
->
categorizedModel
->
mapToSource
(
d
->
subCategoryModel
->
mapToSource
(
subCateogryIdx
));
emit
d
->
model
->
dataChanged
(
subCategorySourceIdx
,
subCategorySourceIdx
);
Q_EMIT
d
->
model
->
dataChanged
(
subCategorySourceIdx
,
subCategorySourceIdx
);
}
int
SidebarMode
::
activeSearchRow
()
const
...
...
@@ -663,17 +663,17 @@ void SidebarMode::setIntroPageVisible(const bool &introPageVisible)
d
->
moduleView
->
loadModule
(
d
->
model
->
indexForItem
(
homeItem
()),
QStringList
()
);
d
->
activeCategoryRow
=
-
1
;
d
->
activeSubCategoryRow
=
-
1
;
emit
activeCategoryRowChanged
();
emit
activeSubCategoryRowChanged
();
Q_EMIT
activeCategoryRowChanged
();
Q_EMIT
activeSubCategoryRowChanged
();
}
}
}
else
{
if
(
introPageVisible
)
{
d
->
subCategoryModel
->
setParentIndex
(
QModelIndex
());
d
->
activeCategoryRow
=
-
1
;
emit
activeCategoryRowChanged
();
Q_EMIT
activeCategoryRowChanged
();
d
->
activeSubCategoryRow
=
-
1
;
emit
activeSubCategoryRowChanged
();
Q_EMIT
activeSubCategoryRowChanged
();
d
->
placeHolderWidget
->
show
();
d
->
moduleView
->
hide
();
}
else
{
...
...
@@ -683,7 +683,7 @@ void SidebarMode::setIntroPageVisible(const bool &introPageVisible)
}
d
->
m_introPageVisible
=
introPageVisible
;
emit
introPageVisibleChanged
();
Q_EMIT
introPageVisibleChanged
();
}
void
SidebarMode
::
setHeaderHeight
(
qreal
height
)
...
...
@@ -693,7 +693,7 @@ void SidebarMode::setHeaderHeight(qreal height)
}
d
->
moduleView
->
setHeaderHeight
(
height
);
emit
headerHeightChanged
();
Q_EMIT
headerHeightChanged
();
}
qreal
SidebarMode
::
headerHeight
()
const
...
...
@@ -725,18 +725,18 @@ void SidebarMode::toggleDefaultsIndicatorsVisibility()
}
}
config
().
writeEntry
(
"HighlightNonDefaultSettings"
,
d
->
m_defaultsIndicatorsVisible
);
emit
defaultsIndicatorsVisibleChanged
();
Q_EMIT
defaultsIndicatorsVisibleChanged
();
}
void
SidebarMode
::
updateModelMenuItem
(
MenuItem
*
item
)
{
auto
itemIdx
=
d
->
model
->
indexForItem
(
item
);
emit
d
->
model
->
dataChanged
(
itemIdx
,
itemIdx
);
Q_EMIT
d
->
model
->
dataChanged
(
itemIdx
,
itemIdx
);
MenuItem
*
parent
=
item
->
parent
();
while
(
parent
)
{
auto
parentIdx
=
d
->
model
->
indexForItem
(
parent
);
if
(
parentIdx
.
isValid
())
{
emit
d
->
model
->
dataChanged
(
parentIdx
,
parentIdx
);
Q_EMIT
d
->
model
->
dataChanged
(
parentIdx
,
parentIdx
);
parent
=
parent
->
parent
();
}
else
{
parent
=
nullptr
;
...
...
@@ -838,7 +838,7 @@ void SidebarMode::initWidget()
d
->
moduleView
->
hide
();
d
->
mainLayout
->
addWidget
(
d
->
moduleView
);
d
->
mainLayout
->
addWidget
(
d
->
placeHolderWidget
);
emit
changeToolBarItems
(
BaseMode
::
NoItems
);
Q_EMIT
changeToolBarItems
(
BaseMode
::
NoItems
);
d
->
toolTipManager
=
new
ToolTipManager
(
d
->
categorizedModel
,
d
->
quickWidget
,
ToolTipManager
::
ToolTipPosition
::
Right
);
d
->
mostUsedToolTipManager
=
new
ToolTipManager
(
d
->
mostUsedModel
,
d
->
placeHolderWidget
,
ToolTipManager
::
ToolTipPosition
::
BottomCenter
);
...
...
@@ -896,9 +896,9 @@ bool SidebarMode::eventFilter(QObject *watched, QEvent *event)
}
else
if
(
watched
==
d
->
quickWidget
&&
event
->
type
()
==
QEvent
::
Leave
)
{
QCoreApplication
::
sendEvent
(
d
->
quickWidget
->
quickWindow
(),
event
);
}
else
if
(
watched
==
d
->
mainWidget
&&
event
->
type
()
==
QEvent
::
Resize
)
{
emit
widthChanged
();
Q_EMIT
widthChanged
();
}
else
if
(
watched
==
d
->
mainWidget
&&
event
->
type
()
==
QEvent
::
Show
)
{
emit
changeToolBarItems
(
BaseMode
::
NoItems
);
Q_EMIT
changeToolBarItems
(
BaseMode
::
NoItems
);
}
return
BaseMode
::
eventFilter
(
watched
,
event
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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