Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Utilities
Konsole
Commits
145310d8
Commit
145310d8
authored
Oct 15, 2015
by
Kurt Hindenburg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use QStringLiteral and QLatin1String
parent
f9b0d40f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
13 deletions
+13
-13
src/Application.cpp
src/Application.cpp
+3
-3
src/ColorSchemeEditor.cpp
src/ColorSchemeEditor.cpp
+6
-6
src/ColorSchemeManager.cpp
src/ColorSchemeManager.cpp
+2
-2
src/EditProfileDialog.cpp
src/EditProfileDialog.cpp
+2
-2
No files found.
src/Application.cpp
View file @
145310d8
...
...
@@ -195,7 +195,7 @@ void Application::processTabsFromFileArgs(KCmdLineArgs* args,
continue
;
QHash
<
QString
,
QString
>
lineTokens
;
QStringList
lineParts
=
lineString
.
split
(
";;"
,
QString
::
SkipEmptyParts
);
QStringList
lineParts
=
lineString
.
split
(
QStringLiteral
(
";;"
)
,
QString
::
SkipEmptyParts
);
for
(
int
i
=
0
;
i
<
lineParts
.
size
();
++
i
)
{
QString
key
=
lineParts
.
at
(
i
).
section
(
':'
,
0
,
0
).
trimmed
().
toLower
();
...
...
@@ -203,7 +203,7 @@ void Application::processTabsFromFileArgs(KCmdLineArgs* args,
lineTokens
[
key
]
=
value
;
}
// should contain at least one of 'command' and 'profile'
if
(
lineTokens
.
contains
(
"command"
)
||
lineTokens
.
contains
(
"profile"
))
{
if
(
lineTokens
.
contains
(
QLatin1String
(
"command"
)
)
||
lineTokens
.
contains
(
QStringLiteral
(
"profile"
))
)
{
createTabFromArgs
(
args
,
window
,
lineTokens
);
sessions
++
;
}
else
{
...
...
@@ -337,7 +337,7 @@ Profile::Ptr Application::processProfileSelectArgs(KCmdLineArgs* args)
if
(
profile
)
return
profile
;
}
else
if
(
args
->
isSet
(
"fallback-profile"
))
{
Profile
::
Ptr
profile
=
ProfileManager
::
instance
()
->
loadProfile
(
"FALLBACK/"
);
Profile
::
Ptr
profile
=
ProfileManager
::
instance
()
->
loadProfile
(
QStringLiteral
(
"FALLBACK/"
)
)
;
if
(
profile
)
return
profile
;
}
...
...
src/ColorSchemeEditor.cpp
View file @
145310d8
...
...
@@ -82,7 +82,7 @@ ColorSchemeEditor::ColorSchemeEditor(QWidget* aParent)
// transparency slider
QFontMetrics
metrics
(
font
());
_ui
->
transparencyPercentLabel
->
setMinimumWidth
(
metrics
.
width
(
"100%"
));
_ui
->
transparencyPercentLabel
->
setMinimumWidth
(
metrics
.
width
(
QStringLiteral
(
"100%"
))
)
;
connect
(
_ui
->
transparencySlider
,
&
QSlider
::
valueChanged
,
this
,
&
Konsole
::
ColorSchemeEditor
::
setTransparencyPercentLabel
);
...
...
@@ -118,7 +118,7 @@ ColorSchemeEditor::ColorSchemeEditor(QWidget* aParent)
_ui
->
colorTable
->
horizontalHeader
()
->
setSectionResizeMode
(
COLOR_COLUMN
,
QHeaderView
::
Stretch
);
_ui
->
colorTable
->
horizontalHeader
()
->
setSectionResizeMode
(
INTENSE_COLOR_COLUMN
,
QHeaderView
::
Stretch
);
QTableWidgetItem
*
item
=
new
QTableWidgetItem
(
"Test"
);
QTableWidgetItem
*
item
=
new
QTableWidgetItem
(
QStringLiteral
(
"Test"
)
)
;
_ui
->
colorTable
->
setItem
(
0
,
0
,
item
);
_ui
->
colorTable
->
verticalHeader
()
->
hide
();
...
...
@@ -173,11 +173,11 @@ void ColorSchemeEditor::selectWallpaper()
{
// Get supported image formats and convert to QString for getOpenFileName()
const
QList
<
QByteArray
>
mimeTypes
=
QImageReader
::
supportedImageFormats
();
QString
fileFormats
=
"("
;
QString
fileFormats
=
QStringLiteral
(
"("
)
;
Q_FOREACH
(
const
QByteArray
&
mime
,
mimeTypes
)
{
fileFormats
+=
"*."
+
QString
::
fromLatin1
(
mime
)
+
" "
;
fileFormats
+=
QStringLiteral
(
"*.%1 "
).
arg
(
QLatin1String
(
mime
))
;
}
fileFormats
+=
")"
;
fileFormats
+=
QLatin1String
(
")"
)
;
const
QString
fileName
=
QFileDialog
::
getOpenFileName
(
this
,
i18nc
(
"@title:window"
,
"Select wallpaper image file"
),
...
...
@@ -208,7 +208,7 @@ void ColorSchemeEditor::setDescription(const QString& text)
}
void
ColorSchemeEditor
::
setTransparencyPercentLabel
(
int
percent
)
{
_ui
->
transparencyPercentLabel
->
setText
(
QString
(
"%1%"
).
arg
(
percent
));
_ui
->
transparencyPercentLabel
->
setText
(
QString
Literal
(
"%1%"
).
arg
(
percent
));
const
qreal
opacity
=
(
100.0
-
percent
)
/
100.0
;
_colors
->
setOpacity
(
opacity
);
...
...
src/ColorSchemeManager.cpp
View file @
145310d8
...
...
@@ -113,7 +113,7 @@ bool ColorSchemeManager::loadColorScheme(const QString& filePath)
QStringList
ColorSchemeManager
::
listColorSchemes
()
{
QStringList
colorschemes
;
const
QStringList
dirs
=
QStandardPaths
::
locateAll
(
QStandardPaths
::
GenericDataLocation
,
"konsole"
,
QStandardPaths
::
LocateDirectory
);
const
QStringList
dirs
=
QStandardPaths
::
locateAll
(
QStandardPaths
::
GenericDataLocation
,
QStringLiteral
(
"konsole"
)
,
QStandardPaths
::
LocateDirectory
);
colorschemes
.
reserve
(
dirs
.
size
());
Q_FOREACH
(
const
QString
&
dir
,
dirs
)
{
...
...
@@ -176,7 +176,7 @@ const ColorScheme* ColorSchemeManager::findColorScheme(const QString& name)
// A fix to prevent infinite loops if users puts / in ColorScheme name
// Konsole will create a sub-folder in that case (bko 315086)
// More code will have to go in to prevent the users from doing that.
if
(
name
.
contains
(
"/"
))
{
if
(
name
.
contains
(
QLatin1String
(
"/"
))
)
{
qWarning
()
<<
name
<<
" has an invalid character / in the name ... skipping"
;
return
defaultColorScheme
();
}
...
...
src/EditProfileDialog.cpp
View file @
145310d8
...
...
@@ -164,7 +164,7 @@ QString EditProfileDialog::groupProfileNames(const ProfileGroup::Ptr group, int
caption
+=
','
;
// limit caption length to prevent very long window titles
if
(
maxLength
>
0
&&
caption
.
length
()
>
maxLength
)
{
caption
+=
"..."
;
caption
+=
QLatin1String
(
"..."
)
;
break
;
}
}
...
...
@@ -334,7 +334,7 @@ void EditProfileDialog::showEnvironmentEditor()
QString
text
=
QInputDialog
::
getMultiLineText
(
this
,
i18n
(
"Edit Environment"
),
i18n
(
"One environment variable per line"
),
currentEnvironment
.
join
(
"
\n
"
),
currentEnvironment
.
join
(
QStringLiteral
(
"
\n
"
)
)
,
&
ok
);
if
(
ok
&&
!
text
.
isEmpty
())
{
...
...
Write
Preview
Markdown
is supported
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