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
fae151b2
Commit
fae151b2
authored
Nov 07, 2020
by
Mikel Johnson
Browse files
Use QStringLiteral and QLatin1String where it makes sense
parent
ed891891
Changes
10
Hide whitespace changes
Inline
Side-by-side
applets/kicker/plugin/contactentry.cpp
View file @
fae151b2
...
...
@@ -114,7 +114,7 @@ QVariantList ContactEntry::actions() const
{
QVariantList
actionList
;
actionList
<<
Kicker
::
createActionItem
(
i18n
(
"Show Contact Information..."
),
QString
(
"identity"
),
QStringLiteral
(
"showContactInfo"
));
actionList
<<
Kicker
::
createActionItem
(
i18n
(
"Show Contact Information..."
),
QString
Literal
(
"identity"
),
QStringLiteral
(
"showContactInfo"
));
return
actionList
;
}
...
...
applets/kicker/plugin/rootmodel.cpp
View file @
fae151b2
...
...
@@ -411,7 +411,7 @@ void RootModel::refresh()
int
separatorPosition
=
0
;
if
(
allModel
)
{
m_entryList
.
prepend
(
new
GroupEntry
(
this
,
i18n
(
"All Applications"
),
QString
(
"applications-all"
),
allModel
));
m_entryList
.
prepend
(
new
GroupEntry
(
this
,
i18n
(
"All Applications"
),
QString
Literal
(
"applications-all"
),
allModel
));
++
separatorPosition
;
}
...
...
@@ -432,7 +432,7 @@ void RootModel::refresh()
if
(
m_showRecentContacts
)
{
m_recentContactsModel
=
new
RecentContactsModel
(
this
);
m_entryList
.
prepend
(
new
GroupEntry
(
this
,
i18n
(
"Recent Contacts"
),
QString
(
"view-history"
),
m_recentContactsModel
));
m_entryList
.
prepend
(
new
GroupEntry
(
this
,
i18n
(
"Recent Contacts"
),
QString
Literal
(
"view-history"
),
m_recentContactsModel
));
++
separatorPosition
;
}
...
...
@@ -443,8 +443,8 @@ void RootModel::refresh()
?
i18n
(
"Recent Files"
)
:
i18n
(
"Often Used Files"
),
m_recentOrdering
==
RecentUsageModel
::
Recent
?
QString
(
"view-history"
)
:
QString
(
"office-chart-pie"
),
?
QString
Literal
(
"view-history"
)
:
QString
Literal
(
"office-chart-pie"
),
m_recentDocsModel
));
++
separatorPosition
;
}
...
...
@@ -456,8 +456,8 @@ void RootModel::refresh()
?
i18n
(
"Recent Applications"
)
:
i18n
(
"Often Used Applications"
),
m_recentOrdering
==
RecentUsageModel
::
Recent
?
QString
(
"view-history"
)
:
QString
(
"office-chart-pie"
),
?
QString
Literal
(
"view-history"
)
:
QString
Literal
(
"office-chart-pie"
),
m_recentAppsModel
));
++
separatorPosition
;
}
...
...
@@ -470,7 +470,7 @@ void RootModel::refresh()
m_systemModel
=
new
SystemModel
(
this
);
if
(
m_showPowerSession
)
{
m_entryList
<<
new
GroupEntry
(
this
,
i18n
(
"Power / Session"
),
QString
(
"system-log-out"
),
m_systemModel
);
m_entryList
<<
new
GroupEntry
(
this
,
i18n
(
"Power / Session"
),
QString
Literal
(
"system-log-out"
),
m_systemModel
);
}
endResetModel
();
...
...
kcms/kfontinst/kcmfontinst/KCmFontInst.cpp
View file @
fae151b2
...
...
@@ -964,10 +964,10 @@ void CKCmFontInst::setStatusBar()
if
(
disabled
||
partial
)
{
text
+=
QString
(
" (<img src=
\"
%1
\"
/>%2"
).
arg
(
KIconLoader
::
global
()
->
iconPath
(
"dialog-ok"
,
-
KIconLoader
::
SizeSmall
)).
arg
(
enabled
)
+
QString
(
" <img src=
\"
%1
\"
/>%2"
).
arg
(
KIconLoader
::
global
()
->
iconPath
(
"dialog-cancel"
,
-
KIconLoader
::
SizeSmall
)).
arg
(
disabled
);
text
+=
Q
Latin1
String
(
" (<img src=
\"
%1
\"
/>%2"
).
arg
(
KIconLoader
::
global
()
->
iconPath
(
"dialog-ok"
,
-
KIconLoader
::
SizeSmall
)).
arg
(
enabled
)
+
Q
Latin1
String
(
" <img src=
\"
%1
\"
/>%2"
).
arg
(
KIconLoader
::
global
()
->
iconPath
(
"dialog-cancel"
,
-
KIconLoader
::
SizeSmall
)).
arg
(
disabled
);
if
(
partial
)
text
+=
QString
(
" <img src=
\"
%1
\"
/>%2"
).
arg
(
partialIcon
()).
arg
(
partial
);
text
+=
Q
Latin1
String
(
" <img src=
\"
%1
\"
/>%2"
).
arg
(
partialIcon
()).
arg
(
partial
);
text
+=
QLatin1Char
(
')'
);
itsStatusLabel
->
setToolTip
(
partial
?
i18n
(
"<table>"
...
...
kcms/krdb/krdb.cpp
View file @
fae151b2
...
...
@@ -416,8 +416,8 @@ void runRdb( uint flags )
// Export the Xcursor theme & size settings
KConfigGroup
mousecfg
(
KSharedConfig
::
openConfig
(
QStringLiteral
(
"kcminputrc"
)
),
"Mouse"
);
QString
theme
=
mousecfg
.
readEntry
(
"cursorTheme"
,
QString
(
"breeze_cursors"
));
QString
size
=
mousecfg
.
readEntry
(
"cursorSize"
,
QString
(
"24"
));
QString
theme
=
mousecfg
.
readEntry
(
"cursorTheme"
,
QString
Literal
(
"breeze_cursors"
));
QString
size
=
mousecfg
.
readEntry
(
"cursorSize"
,
QString
Literal
(
"24"
));
QString
contents
;
if
(
!
theme
.
isNull
())
...
...
kcms/lookandfeel/autotests/kcmtest.cpp
View file @
fae151b2
...
...
@@ -100,7 +100,7 @@ void KcmTest::testWidgetStyle()
KConfigGroup
cg
(
&
config
,
"KDE"
);
// We have to use an actual theme name here because setWidgetStyle checks
// if the theme can actually be used before it changes the config
QCOMPARE
(
cg
.
readEntry
(
"widgetStyle"
,
QString
()),
QString
(
"Fusion"
));
QCOMPARE
(
cg
.
readEntry
(
"widgetStyle"
,
QString
()),
QString
Literal
(
"Fusion"
));
}
void
KcmTest
::
testColors
()
...
...
@@ -110,7 +110,7 @@ void KcmTest::testColors()
KConfig
config
(
QStringLiteral
(
"kdeglobals"
));
KConfigGroup
cg
(
&
config
,
"General"
);
QCOMPARE
(
cg
.
readEntry
(
"ColorScheme"
,
QString
()),
QString
(
"customTestValue"
));
QCOMPARE
(
cg
.
readEntry
(
"ColorScheme"
,
QString
()),
QString
Literal
(
"customTestValue"
));
}
void
KcmTest
::
testIcons
()
...
...
@@ -119,7 +119,7 @@ void KcmTest::testIcons()
KConfig
config
(
QStringLiteral
(
"kdeglobals"
));
KConfigGroup
cg
(
&
config
,
"Icons"
);
QCOMPARE
(
cg
.
readEntry
(
"Theme"
,
QString
()),
QString
(
"customTestValue"
));
QCOMPARE
(
cg
.
readEntry
(
"Theme"
,
QString
()),
QString
Literal
(
"customTestValue"
));
}
void
KcmTest
::
testPlasmaTheme
()
...
...
@@ -128,7 +128,7 @@ void KcmTest::testPlasmaTheme()
KConfig
config
(
QStringLiteral
(
"plasmarc"
));
KConfigGroup
cg
(
&
config
,
"Theme"
);
QCOMPARE
(
cg
.
readEntry
(
"name"
,
QString
()),
QString
(
"customTestValue"
));
QCOMPARE
(
cg
.
readEntry
(
"name"
,
QString
()),
QString
Literal
(
"customTestValue"
));
}
void
KcmTest
::
testCursorTheme
()
...
...
@@ -137,7 +137,7 @@ void KcmTest::testCursorTheme()
KConfig
config
(
QStringLiteral
(
"kcminputrc"
));
KConfigGroup
cg
(
&
config
,
"Mouse"
);
QCOMPARE
(
cg
.
readEntry
(
"cursorTheme"
,
QString
()),
QString
(
"customTestValue"
));
QCOMPARE
(
cg
.
readEntry
(
"cursorTheme"
,
QString
()),
QString
Literal
(
"customTestValue"
));
}
void
KcmTest
::
testSplashScreen
()
...
...
@@ -146,8 +146,8 @@ void KcmTest::testSplashScreen()
KConfig
config
(
QStringLiteral
(
"ksplashrc"
));
KConfigGroup
cg
(
&
config
,
"KSplash"
);
QCOMPARE
(
cg
.
readEntry
(
"Theme"
,
QString
()),
QString
(
"customTestValue"
));
QCOMPARE
(
cg
.
readEntry
(
"Engine"
,
QString
()),
QString
(
"KSplashQML"
));
QCOMPARE
(
cg
.
readEntry
(
"Theme"
,
QString
()),
QString
Literal
(
"customTestValue"
));
QCOMPARE
(
cg
.
readEntry
(
"Engine"
,
QString
()),
QString
Literal
(
"KSplashQML"
));
}
void
KcmTest
::
testLockScreen
()
...
...
@@ -156,7 +156,7 @@ void KcmTest::testLockScreen()
KConfig
config
(
QStringLiteral
(
"kscreenlockerrc"
));
KConfigGroup
cg
(
&
config
,
"Greeter"
);
QCOMPARE
(
cg
.
readEntry
(
"Theme"
,
QString
()),
QString
(
"customTestValue"
));
QCOMPARE
(
cg
.
readEntry
(
"Theme"
,
QString
()),
QString
Literal
(
"customTestValue"
));
}
void
KcmTest
::
testWindowSwitcher
()
...
...
@@ -185,31 +185,31 @@ void KcmTest::testKCMSave()
KConfig
config
(
QStringLiteral
(
"kdeglobals"
));
KConfigGroup
cg
(
&
config
,
"KDE"
);
// See comment in testWidgetStyle
QCOMPARE
(
cg
.
readEntry
(
"widgetStyle"
,
QString
()),
QString
(
"Fusion"
));
QCOMPARE
(
cg
.
readEntry
(
"widgetStyle"
,
QString
()),
QString
Literal
(
"Fusion"
));
cg
=
KConfigGroup
(
&
config
,
"General"
);
//save() capitalizes the ColorScheme
QCOMPARE
(
cg
.
readEntry
(
"ColorScheme"
,
QString
()),
QString
(
"TestValue"
));
QCOMPARE
(
cg
.
readEntry
(
"ColorScheme"
,
QString
()),
QString
Literal
(
"TestValue"
));
cg
=
KConfigGroup
(
&
config
,
"Icons"
);
QCOMPARE
(
cg
.
readEntry
(
"Theme"
,
QString
()),
QString
(
"testValue"
));
QCOMPARE
(
cg
.
readEntry
(
"Theme"
,
QString
()),
QString
Literal
(
"testValue"
));
KConfig
plasmaConfig
(
QStringLiteral
(
"plasmarc"
));
cg
=
KConfigGroup
(
&
plasmaConfig
,
"Theme"
);
QCOMPARE
(
cg
.
readEntry
(
"name"
,
QString
()),
QString
(
"testValue"
));
QCOMPARE
(
cg
.
readEntry
(
"name"
,
QString
()),
QString
Literal
(
"testValue"
));
KConfig
inputConfig
(
QStringLiteral
(
"kcminputrc"
));
cg
=
KConfigGroup
(
&
inputConfig
,
"Mouse"
);
QCOMPARE
(
cg
.
readEntry
(
"cursorTheme"
,
QString
()),
QString
(
"testValue"
));
QCOMPARE
(
cg
.
readEntry
(
"cursorTheme"
,
QString
()),
QString
Literal
(
"testValue"
));
KConfig
splashConfig
(
QStringLiteral
(
"ksplashrc"
));
cg
=
KConfigGroup
(
&
splashConfig
,
"KSplash"
);
QCOMPARE
(
cg
.
readEntry
(
"Theme"
,
QString
()),
QString
(
"customTestValue"
));
QCOMPARE
(
cg
.
readEntry
(
"Engine"
,
QString
()),
QString
(
"KSplashQML"
));
QCOMPARE
(
cg
.
readEntry
(
"Theme"
,
QString
()),
QString
Literal
(
"customTestValue"
));
QCOMPARE
(
cg
.
readEntry
(
"Engine"
,
QString
()),
QString
Literal
(
"KSplashQML"
));
KConfig
lockerConfig
(
QStringLiteral
(
"kscreenlockerrc"
));
cg
=
KConfigGroup
(
&
lockerConfig
,
"Greeter"
);
QCOMPARE
(
cg
.
readEntry
(
"Theme"
,
QString
()),
QString
(
"org.kde.test"
));
QCOMPARE
(
cg
.
readEntry
(
"Theme"
,
QString
()),
QString
Literal
(
"org.kde.test"
));
KConfig
kwinConfig
(
QStringLiteral
(
"kwinrc"
));
cg
=
KConfigGroup
(
&
kwinConfig
,
"TabBox"
);
...
...
libtaskmanager/autotests/tasktoolstest.cpp
View file @
fae151b2
...
...
@@ -159,11 +159,11 @@ void TaskToolsTest::createAppLink()
{
KDesktopFile
file
(
appLinkPath
());
KConfigGroup
group
=
file
.
desktopGroup
();
group
.
writeEntry
(
QLatin1String
(
"Type"
),
QString
(
"Application"
));
group
.
writeEntry
(
QLatin1String
(
"Type"
),
QString
Literal
(
"Application"
));
group
.
writeEntry
(
QLatin1String
(
"Name"
),
m_referenceAppData
.
name
);
group
.
writeEntry
(
QLatin1String
(
"GenericName"
),
m_referenceAppData
.
genericName
);
group
.
writeEntry
(
QLatin1String
(
"Icon"
),
QString
(
"konversation"
));
group
.
writeEntry
(
QLatin1String
(
"Exec"
),
QString
(
"konversation"
));
group
.
writeEntry
(
QLatin1String
(
"Icon"
),
QString
Literal
(
"konversation"
));
group
.
writeEntry
(
QLatin1String
(
"Exec"
),
QString
Literal
(
"konversation"
));
file
.
sync
();
QVERIFY
(
file
.
hasApplicationType
());
...
...
@@ -192,7 +192,7 @@ void TaskToolsTest::createIcon()
KConfig
config
(
themeFile
);
KConfigGroup
group
(
config
.
group
(
QLatin1String
(
"Icon Theme"
)));
group
.
writeEntry
(
QLatin1String
(
"Name"
),
KIconTheme
::
defaultThemeName
());
group
.
writeEntry
(
QLatin1String
(
"Inherits"
),
QString
(
"hicolor"
));
group
.
writeEntry
(
QLatin1String
(
"Inherits"
),
QString
Literal
(
"hicolor"
));
config
.
sync
();
QVERIFY
(
QFile
::
exists
(
themeFile
));
...
...
libtaskmanager/tasktools.cpp
View file @
fae151b2
...
...
@@ -700,7 +700,7 @@ QString defaultApplication(const QUrl &url)
}
}
return
QString
(
""
);
return
Q
Latin1
String
(
""
);
}
bool
launcherUrlsMatch
(
const
QUrl
&
a
,
const
QUrl
&
b
,
UrlComparisonMode
mode
)
...
...
runners/bookmarks/tests/testchromebookmarks.cpp
View file @
fae151b2
...
...
@@ -35,7 +35,7 @@ void TestChromeBookmarks::initTestCase()
void
TestChromeBookmarks
::
bookmarkFinderShouldFindEachProfileDirectory
()
{
FindChromeProfile
findChrome
(
"chromium"
,
"./chrome-config-home"
);
QString
profileTemplate
=
QString
(
"./chrome-config-home/.config/%1/%2/Bookmarks"
);
QString
profileTemplate
=
QString
Literal
(
"./chrome-config-home/.config/%1/%2/Bookmarks"
);
QList
<
Profile
>
profiles
=
findChrome
.
find
();
QCOMPARE
(
profiles
.
size
(),
2
);
...
...
shell/scripting/scriptengine.cpp
View file @
fae151b2
...
...
@@ -97,7 +97,7 @@ int ScriptEngine::defaultPanelScreen() const
QJSValue
ScriptEngine
::
newError
(
const
QString
&
message
)
{
return
evaluate
(
QString
(
"new Error('%1');"
).
arg
(
message
));
return
evaluate
(
QString
Literal
(
"new Error('%1');"
).
arg
(
message
));
}
QString
ScriptEngine
::
onlyExec
(
const
QString
&
commandLine
)
...
...
wallpapers/image/autotests/testfindpreferredimage.cpp
View file @
fae151b2
...
...
@@ -26,7 +26,7 @@ QString formatResolution(const QString &str)
{
QSize
size
=
resSize
(
str
);
float
aspectRatio
=
(
size
.
height
()
>
0
)
?
size
.
width
()
/
(
float
)
size
.
height
()
:
0
;
return
QString
(
"%1 (%2)"
).
arg
(
str
,
9
).
arg
(
aspectRatio
,
7
);
return
QString
Literal
(
"%1 (%2)"
).
arg
(
str
,
9
).
arg
(
aspectRatio
,
7
);
}
class
TestResolutions
:
public
QObject
...
...
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