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 Desktop
Commits
8173e1d6
Commit
8173e1d6
authored
Jan 14, 2022
by
Ahmad Samir
Committed by
Fushan Wen
Jan 15, 2022
Browse files
Use QString() for empty strings
GIT_SILENT
parent
8fb84c2f
Pipeline
#123620
passed with stage
in 2 minutes and 40 seconds
Changes
11
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
containments/desktop/plugins/folder/mimetypesmodel.cpp
View file @
8173e1d6
...
...
@@ -109,7 +109,7 @@ QStringList MimeTypesModel::checkedTypes() const
return
list
;
}
return
QStringList
(
Q
Latin1
String
(
""
));
return
QStringList
(
QString
());
}
void
MimeTypesModel
::
setCheckedTypes
(
const
QStringList
&
list
)
...
...
kcms/componentchooser/componentchooser.cpp
View file @
8173e1d6
...
...
@@ -72,7 +72,7 @@ void ComponentChooser::load()
QVariantMap
application
;
application
[
"name"
]
=
i18n
(
"Other…"
);
application
[
"icon"
]
=
QStringLiteral
(
"application-x-shellscript"
);
application
[
"storageId"
]
=
Q
Latin1
String
(
""
);
application
[
"storageId"
]
=
QString
();
m_applications
+=
application
;
if
(
m_index
==
-
1
)
{
m_index
=
0
;
...
...
kcms/componentchooser/componentchooserterminal.cpp
View file @
8173e1d6
...
...
@@ -18,7 +18,7 @@
ComponentChooserTerminal
::
ComponentChooserTerminal
(
QObject
*
parent
)
:
ComponentChooser
(
parent
,
Q
Latin1
String
(
""
),
QString
(),
QStringLiteral
(
"TerminalEmulator"
),
QStringLiteral
(
"org.kde.konsole.desktop"
),
i18n
(
"Select default terminal emulator"
))
...
...
@@ -73,7 +73,7 @@ void ComponentChooserTerminal::load()
QVariantMap
application
;
application
[
"name"
]
=
i18n
(
"Other…"
);
application
[
"icon"
]
=
QStringLiteral
(
"application-x-shellscript"
);
application
[
"storageId"
]
=
Q
Latin1
String
(
""
);
application
[
"storageId"
]
=
QString
();
m_applications
+=
application
;
if
(
m_index
==
-
1
)
{
m_index
=
0
;
...
...
kcms/joystick/caldialog.cpp
View file @
8173e1d6
...
...
@@ -80,7 +80,7 @@ void CalDialog::calibrate()
else
if
(
i
==
1
)
hint
=
i18n
(
"(usually Y)"
);
else
hint
=
Q
Latin1
String
(
""
);
hint
=
QString
();
// minimum position
text
->
setText
(
...
...
kcms/joystick/joydevice.cpp
View file @
8173e1d6
...
...
@@ -35,7 +35,7 @@ QString JoyDevice::errText(ErrorCode code) const
{
switch
(
code
)
{
case
SUCCESS
:
return
Q
Latin1
String
(
""
);
return
QString
();
case
OPEN_FAILED
:
{
return
i18n
(
"The given device %1 could not be opened: %2"
,
devName
,
strerror
(
errno
));
...
...
@@ -177,7 +177,7 @@ void JoyDevice::close()
::
close
(
joyFd
);
joyFd
=
-
1
;
descr
=
Q
Latin1
String
(
""
);
descr
=
QString
();
delete
[]
amin
;
delete
[]
amax
;
...
...
kcms/joystick/joywidget.cpp
View file @
8173e1d6
...
...
@@ -204,7 +204,7 @@ void JoyWidget::restoreCurrDev()
{
if
(
!
joydev
)
// no device open
{
device
->
setEditText
(
Q
Latin1
String
(
""
));
device
->
setEditText
(
QString
());
calibrate
->
setEnabled
(
false
);
}
else
{
// try to find the current open device in the combobox list
...
...
kcms/keyboard/kcm_add_layout_dialog.cpp
View file @
8173e1d6
...
...
@@ -109,7 +109,7 @@ void AddLayoutDialog::accept()
{
QString
label
=
layoutDialogUi
->
labelEdit
->
text
();
if
(
label
==
selectedLayout
)
{
label
=
Q
Latin1
String
(
""
);
label
=
QString
();
}
selectedLayoutUnit
.
setDisplayName
(
label
);
selectedLayoutUnit
.
setShortcut
(
layoutDialogUi
->
kkeysequencewidget
->
keySequence
());
...
...
kcms/keyboard/layout_memory_persister.cpp
View file @
8173e1d6
...
...
@@ -44,7 +44,7 @@ static bool isDefaultLayoutConfig(const LayoutSet &layout, const QList<LayoutUni
QString
LayoutMemoryPersister
::
getLayoutMapAsString
()
{
if
(
!
canPersist
())
return
Q
Latin1
String
(
""
);
return
QString
();
QDomDocument
doc
(
DOC_NAME
);
QDomElement
root
=
doc
.
createElement
(
ROOT_NODE
);
...
...
@@ -54,7 +54,7 @@ QString LayoutMemoryPersister::getLayoutMapAsString()
if
(
layoutMemory
.
keyboardConfig
.
switchingPolicy
()
==
KeyboardConfig
::
SWITCH_POLICY_GLOBAL
)
{
if
(
!
globalLayout
.
isValid
())
return
Q
Latin1
String
(
""
);
return
QString
();
QDomElement
item
=
doc
.
createElement
(
ITEM_NODE
);
item
.
setAttribute
(
CURRENT_LAYOUT_ATTRIBUTE
,
globalLayout
.
toString
());
...
...
kcms/keyboard/x11_helper.cpp
View file @
8173e1d6
...
...
@@ -382,7 +382,7 @@ LayoutUnit::LayoutUnit(const QString &fullLayoutName)
{
QStringList
lv
=
fullLayoutName
.
split
(
LAYOUT_VARIANT_SEPARATOR_PREFIX
);
m_layout
=
lv
[
0
];
m_variant
=
lv
.
size
()
>
1
?
stripVariantName
(
lv
[
1
])
:
Q
Latin1
String
(
""
);
m_variant
=
lv
.
size
()
>
1
?
stripVariantName
(
lv
[
1
])
:
QString
();
}
QString
LayoutUnit
::
toString
()
const
...
...
kcms/keyboard/xkb_helper.cpp
View file @
8173e1d6
...
...
@@ -36,14 +36,14 @@ static const QString COMMAND_OPTIONS_SEPARATOR(QStringLiteral(","));
static
QString
getSetxkbmapExe
()
{
if
(
setxkbmapNotFound
)
return
Q
Latin1
String
(
""
);
return
QString
();
if
(
setxkbmapExe
.
isEmpty
())
{
setxkbmapExe
=
QStandardPaths
::
findExecutable
(
SETXKBMAP_EXEC
);
if
(
setxkbmapExe
.
isEmpty
())
{
setxkbmapNotFound
=
true
;
qCCritical
(
KCM_KEYBOARD
)
<<
"Can't find"
<<
SETXKBMAP_EXEC
<<
"- keyboard layouts won't be configured"
;
return
Q
Latin1
String
(
""
);
return
QString
();
}
}
return
setxkbmapExe
;
...
...
@@ -116,7 +116,7 @@ bool XkbHelper::initializeKeyboardLayouts(const QList<LayoutUnit> &layoutUnits)
QStringList
setxkbmapCommandArguments
;
setxkbmapCommandArguments
.
append
(
QStringLiteral
(
"-layout"
));
setxkbmapCommandArguments
.
append
(
layouts
.
join
(
COMMAND_OPTIONS_SEPARATOR
));
if
(
!
variants
.
join
(
Q
Latin1
String
(
""
)).
isEmpty
())
{
if
(
!
variants
.
join
(
QString
()).
isEmpty
())
{
setxkbmapCommandArguments
.
append
(
QStringLiteral
(
"-variant"
));
setxkbmapCommandArguments
.
append
(
variants
.
join
(
COMMAND_OPTIONS_SEPARATOR
));
}
...
...
@@ -146,7 +146,7 @@ bool XkbHelper::initializeKeyboardLayouts(KeyboardConfig &config)
setxkbmapCommandArguments
.
append
(
QStringLiteral
(
"-layout"
));
setxkbmapCommandArguments
.
append
(
layouts
.
join
(
COMMAND_OPTIONS_SEPARATOR
));
if
(
!
variants
.
join
(
Q
Latin1
String
(
""
)).
isEmpty
())
{
if
(
!
variants
.
join
(
QString
()).
isEmpty
())
{
setxkbmapCommandArguments
.
append
(
QStringLiteral
(
"-variant"
));
setxkbmapCommandArguments
.
append
(
variants
.
join
(
COMMAND_OPTIONS_SEPARATOR
));
}
...
...
kcms/solid_actions/ActionItem.cpp
View file @
8173e1d6
...
...
@@ -35,7 +35,7 @@ ActionItem::ActionItem(const QString &pathToDesktop, const QString &action, QObj
configGroups
.
append
(
desktopFileWrite
->
actionGroup
(
actionName
));
actionGroups
.
insert
(
ActionItem
::
GroupAction
,
&
configGroups
.
last
());
const
QString
predicateString
=
readKey
(
ActionItem
::
GroupDesktop
,
QStringLiteral
(
"X-KDE-Solid-Predicate"
),
Q
Latin1
String
(
""
));
const
QString
predicateString
=
readKey
(
ActionItem
::
GroupDesktop
,
QStringLiteral
(
"X-KDE-Solid-Predicate"
),
QString
());
predicateItem
=
Solid
::
Predicate
::
fromString
(
predicateString
);
}
...
...
@@ -54,17 +54,17 @@ bool ActionItem::isUserSupplied() const
QString
ActionItem
::
icon
()
const
{
return
readKey
(
ActionItem
::
GroupAction
,
QStringLiteral
(
"Icon"
),
Q
Latin1
String
(
""
));
return
readKey
(
ActionItem
::
GroupAction
,
QStringLiteral
(
"Icon"
),
QString
());
}
QString
ActionItem
::
exec
()
const
{
return
readKey
(
ActionItem
::
GroupAction
,
QStringLiteral
(
"Exec"
),
Q
Latin1
String
(
""
));
return
readKey
(
ActionItem
::
GroupAction
,
QStringLiteral
(
"Exec"
),
QString
());
}
QString
ActionItem
::
name
()
const
{
return
readKey
(
ActionItem
::
GroupAction
,
QStringLiteral
(
"Name"
),
Q
Latin1
String
(
""
));
return
readKey
(
ActionItem
::
GroupAction
,
QStringLiteral
(
"Name"
),
QString
());
}
Solid
::
Predicate
ActionItem
::
predicate
()
const
...
...
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