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
KScreen
Commits
e028473d
Commit
e028473d
authored
Oct 23, 2020
by
Aleix Pol Gonzalez
🐧
Browse files
Address constness of objects
Will save us some unnecessary copies
parent
0c9a8941
Changes
4
Hide whitespace changes
Inline
Side-by-side
kded/config.cpp
View file @
e028473d
...
...
@@ -44,7 +44,7 @@ Config::Config(KScreen::ConfigPtr config, QObject *parent)
{
}
QString
Config
::
filePath
()
QString
Config
::
filePath
()
const
{
if
(
!
QDir
().
mkpath
(
configsDirPath
()))
{
return
QString
();
...
...
kded/config.h
View file @
e028473d
...
...
@@ -63,7 +63,7 @@ Q_SIGNALS:
private:
friend
class
TestConfig
;
QString
filePath
();
QString
filePath
()
const
;
std
::
unique_ptr
<
Config
>
readFile
(
const
QString
&
fileName
);
bool
writeFile
(
const
QString
&
filePath
);
...
...
kded/daemon.cpp
View file @
e028473d
...
...
@@ -455,14 +455,14 @@ void KScreenDaemon::outputConnectedChanged()
void
KScreenDaemon
::
monitorConnectedChange
()
{
KScreen
::
OutputList
outputs
=
m_monitoredConfig
->
data
()
->
outputs
();
Q_FOREACH
(
const
KScreen
::
OutputPtr
&
output
,
outputs
)
{
const
KScreen
::
OutputList
outputs
=
m_monitoredConfig
->
data
()
->
outputs
();
for
(
const
KScreen
::
OutputPtr
&
output
:
outputs
)
{
connect
(
output
.
data
(),
&
KScreen
::
Output
::
isConnectedChanged
,
this
,
&
KScreenDaemon
::
outputConnectedChanged
,
Qt
::
UniqueConnection
);
}
connect
(
m_monitoredConfig
->
data
().
data
(),
&
KScreen
::
Config
::
outputAdded
,
this
,
[
this
]
(
const
KScreen
::
OutputPtr
output
)
{
[
this
]
(
const
KScreen
::
OutputPtr
&
output
)
{
if
(
output
->
isConnected
())
{
m_changeCompressor
->
start
();
}
...
...
kded/output.cpp
View file @
e028473d
...
...
@@ -62,7 +62,7 @@ void Output::readInGlobalPartFromInfo(KScreen::OutputPtr output, const QVariantM
qCDebug
(
KSCREEN_KDED
)
<<
"Finding a mode for"
<<
size
<<
"@"
<<
modeInfo
[
QStringLiteral
(
"refresh"
)].
toFloat
();
KScreen
::
ModeList
modes
=
output
->
modes
();
const
KScreen
::
ModeList
modes
=
output
->
modes
();
KScreen
::
ModePtr
matchingMode
;
for
(
const
KScreen
::
ModePtr
&
mode
:
modes
)
{
if
(
mode
->
size
()
!=
size
)
{
...
...
@@ -323,7 +323,7 @@ void Output::readIn(KScreen::OutputPtr output, const QVariantMap &info, Control:
void
Output
::
readInOutputs
(
KScreen
::
ConfigPtr
config
,
const
QVariantList
&
outputsInfo
)
{
KScreen
::
OutputList
outputs
=
config
->
outputs
();
const
KScreen
::
OutputList
outputs
=
config
->
outputs
();
ControlConfig
control
(
config
);
// As global outputs are indexed by a hash of their edid, which is not unique,
// to be able to tell apart multiple identical outputs, these need special treatment
...
...
@@ -338,10 +338,9 @@ void Output::readInOutputs(KScreen::ConfigPtr config, const QVariantList &output
}
allIds
<<
outputId
;
}
allIds
.
clear
();
}
for
(
KScreen
::
OutputPtr
output
:
outputs
)
{
for
(
const
KScreen
::
OutputPtr
&
output
:
outputs
)
{
if
(
!
output
->
isConnected
())
{
output
->
setEnabled
(
false
);
continue
;
...
...
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