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
KScreenLocker
Commits
e2306247
Verified
Commit
e2306247
authored
Jan 23, 2022
by
ivan tkachenko
Browse files
Fix up JavaScript code style
GIT_SILENT
parent
258f7a31
Pipeline
#128094
passed with stage
in 2 minutes and 36 seconds
Changes
6
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
greeter/fallbacktheme/AccelButton.qml
View file @
e2306247
...
...
@@ -32,13 +32,13 @@ PlasmaComponents.Button {
text
:
parent
.
showAccel
?
accelLabel
:
normalLabel
onLabelChanged
:
{
var
i
=
label
.
indexOf
(
'
&
'
);
const
i
=
label
.
indexOf
(
'
&
'
);
if
(
i
<
0
)
{
accelLabel
=
'
<u>
'
+
label
[
0
]
+
'
</u>
'
+
label
.
substring
(
1
,
label
.
length
);
accelKey
=
label
[
0
].
toUpperCase
().
charCodeAt
(
0
);
normalLabel
=
label
}
else
{
var
stringToReplace
=
label
.
substr
(
i
,
2
);
const
stringToReplace
=
label
.
substr
(
i
,
2
);
accelKey
=
stringToReplace
.
toUpperCase
().
charCodeAt
(
1
);
accelLabel
=
label
.
replace
(
stringToReplace
,
'
<u>
'
+
stringToReplace
[
1
]
+
'
</u>
'
);
normalLabel
=
label
.
replace
(
stringToReplace
,
stringToReplace
[
1
]);
...
...
greeter/fallbacktheme/Greeter.qml
View file @
e2306247
...
...
@@ -123,7 +123,7 @@ Item {
}
Keys.onPressed
:
{
var
alt
=
(
event
.
modifiers
&
Qt
.
AltModifier
)
;
const
alt
=
event
.
modifiers
&
Qt
.
AltModifier
;
buttonRow
.
showAccel
=
alt
;
if
(
alt
)
{
...
...
@@ -133,11 +133,10 @@ Item {
// greeter.focus = false;
root
.
forceActiveFocus
();
var
buttons
=
[
switchUser
,
unlock
]
for
(
var
b
=
0
;
b
<
buttons
.
length
;
++
b
)
{
if
(
event
.
key
==
buttons
[
b
].
accelKey
)
{
for
(
const
button
of
[
switchUser
,
unlock
])
{
if
(
event
.
key
==
button
.
accelKey
)
{
buttonRow
.
showAccel
=
false
;
button
s
[
b
]
.
clicked
();
button
.
clicked
();
break
;
}
}
...
...
@@ -145,7 +144,7 @@ Item {
}
Keys.onReleased
:
{
buttonRow
.
showAccel
=
(
event
.
modifiers
&
Qt
.
AltModifier
)
buttonRow
.
showAccel
=
event
.
modifiers
&
Qt
.
AltModifier
;
}
Connections
{
...
...
greeter/fallbacktheme/SessionSwitching.qml
View file @
e2306247
...
...
@@ -140,12 +140,12 @@ Item {
}
Keys.onPressed
:
{
var
alt
=
(
event
.
modifiers
&
Qt
.
AltModifier
)
;
const
alt
=
event
.
modifiers
&
Qt
.
AltModifier
;
buttonRow
.
showAccel
=
alt
;
if
(
alt
)
{
var
buttons
=
[
activateSession
,
newSession
,
cancelSession
];
for
(
var
b
=
0
;
b
<
buttons
.
length
;
++
b
)
{
const
buttons
=
[
activateSession
,
newSession
,
cancelSession
];
for
(
let
b
=
0
;
b
<
buttons
.
length
;
++
b
)
{
if
(
event
.
key
==
buttons
[
b
].
accelKey
)
{
buttonRow
.
showAccel
=
false
;
buttons
[
b
].
clicked
();
...
...
@@ -156,6 +156,6 @@ Item {
}
Keys.onReleased
:
{
buttonRow
.
showAccel
=
(
event
.
modifiers
&
Qt
.
AltModifier
)
buttonRow
.
showAccel
=
event
.
modifiers
&
Qt
.
AltModifier
;
}
}
kcm/package/contents/ui/LnfConfig.qml
View file @
e2306247
...
...
@@ -39,29 +39,29 @@ QtControls.StackView {
onSourceFileChanged
:
{
pop
()
if
(
sourceFile
)
{
var
props
=
{}
var
lnfConfiguration
=
configDialog
.
lnfConfiguration
for
(
var
key
in
lnfConfiguration
)
{
const
props
=
{}
const
lnfConfiguration
=
configDialog
.
lnfConfiguration
for
(
const
key
in
lnfConfiguration
)
{
props
[
"
cfg_
"
+
key
]
=
lnfConfiguration
[
key
]
}
var
newItem
=
push
(
sourceFile
,
props
,
QtControls
.
StackView
.
ReplaceTransition
)
const
newItem
=
push
(
sourceFile
,
props
,
QtControls
.
StackView
.
ReplaceTransition
)
lnfConfiguration
.
valueChanged
.
connect
(
function
(
key
,
value
)
{
lnfConfiguration
.
valueChanged
.
connect
((
key
,
value
)
=>
{
if
(
newItem
[
"
cfg_
"
+
key
]
!==
undefined
)
{
newItem
[
"
cfg_
"
+
key
]
=
value
}
})
var
createSignalHandler
=
function
(
key
)
{
return
function
()
{
const
createSignalHandler
=
key
=>
{
return
()
=>
{
configDialog
.
lnfConfiguration
[
key
]
=
newItem
[
"
cfg_
"
+
key
]
configurationChanged
()
}
}
for
(
var
key
in
lnfConfiguration
)
{
var
changedSignal
=
newItem
[
"
cfg_
"
+
key
+
"
Changed
"
]
for
(
const
key
in
lnfConfiguration
)
{
const
changedSignal
=
newItem
[
"
cfg_
"
+
key
+
"
Changed
"
]
if
(
changedSignal
)
{
changedSignal
.
connect
(
createSignalHandler
(
key
))
}
...
...
kcm/package/contents/ui/WallpaperConfig.qml
View file @
e2306247
...
...
@@ -35,35 +35,34 @@ QtControls.StackView {
signal
configurationChanged
onSourceFileChanged
:
{
if
(
sourceFile
)
{
var
props
=
{}
var
wallpaperConfig
=
configDialog
.
wallpaperConfiguration
for
(
var
key
in
wallpaperConfig
)
{
const
props
=
{}
const
wallpaperConfig
=
configDialog
.
wallpaperConfiguration
for
(
const
key
in
wallpaperConfig
)
{
props
[
"
cfg_
"
+
key
]
=
wallpaperConfig
[
key
]
}
var
newItem
=
replace
(
sourceFile
,
props
,
QtControls
.
StackView
.
ReplaceTransition
)
const
newItem
=
replace
(
sourceFile
,
props
,
QtControls
.
StackView
.
ReplaceTransition
)
wallpaperConfig
.
valueChanged
.
connect
(
function
(
key
,
value
)
{
wallpaperConfig
.
valueChanged
.
connect
((
key
,
value
)
=>
{
if
(
newItem
[
"
cfg_
"
+
key
]
!==
undefined
)
{
newItem
[
"
cfg_
"
+
key
]
=
value
}
})
var
createSignalHandler
=
function
(
key
)
{
return
function
()
{
const
createSignalHandler
=
key
=>
{
return
()
=>
{
configDialog
.
wallpaperConfiguration
[
key
]
=
newItem
[
"
cfg_
"
+
key
]
configurationChanged
()
}
}
for
(
var
key
in
wallpaperConfig
)
{
var
changedSignal
=
newItem
[
"
cfg_
"
+
key
+
"
Changed
"
]
for
(
const
key
in
wallpaperConfig
)
{
const
changedSignal
=
newItem
[
"
cfg_
"
+
key
+
"
Changed
"
]
if
(
changedSignal
)
{
changedSignal
.
connect
(
createSignalHandler
(
key
))
}
}
}
else
{
}
else
{
replace
(
empty
)
}
}
...
...
kcm/package/contents/ui/main.qml
View file @
e2306247
...
...
@@ -55,12 +55,8 @@ KCM.SimpleKCM {
QQC2.SpinBox
{
from
:
1
editable
:
true
textFromValue
:
function
(
value
)
{
return
i18np
(
"
%1 minute
"
,
"
%1 minutes
"
,
value
)
}
valueFromText
:
function
(
text
)
{
return
parseInt
(
text
)
}
textFromValue
:
value
=>
i18np
(
"
%1 minute
"
,
"
%1 minutes
"
,
value
)
valueFromText
:
text
=>
parseInt
(
text
)
value
:
kcm
.
settings
.
timeout
onValueModified
:
kcm
.
settings
.
timeout
=
value
...
...
@@ -91,12 +87,8 @@ KCM.SimpleKCM {
from
:
0
to
:
300
editable
:
true
textFromValue
:
function
(
value
)
{
return
i18np
(
"
%1 second
"
,
"
%1 seconds
"
,
value
)
}
valueFromText
:
function
(
text
)
{
return
parseInt
(
text
)
}
textFromValue
:
value
=>
i18np
(
"
%1 second
"
,
"
%1 seconds
"
,
value
)
valueFromText
:
text
=>
parseInt
(
text
)
value
:
kcm
.
settings
.
lockGrace
onValueModified
:
kcm
.
settings
.
lockGrace
=
value
...
...
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