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
853e135c
Commit
853e135c
authored
Nov 03, 2020
by
David Redondo
🏎
Browse files
Port away from QString::sprintf
parent
567d49f5
Changes
6
Hide whitespace changes
Inline
Side-by-side
kcms/kfontinst/kcmfontinst/KCmFontInst.cpp
View file @
853e135c
...
...
@@ -598,10 +598,10 @@ void CKCmFontInst::print(bool all)
str
<<
(
*
it
).
family
<<
Qt
::
endl
<<
(
*
it
).
styleInfo
<<
Qt
::
endl
;
args
<<
"--embed"
<<
QString
().
sprintf
(
"0x%x"
,
(
unsigned
int
)
window
()
->
winId
())
args
<<
"--embed"
<<
QString
Literal
(
"0x%1"
).
arg
(
(
unsigned
int
)
window
()
->
winId
()
,
0
,
16
)
<<
"--qwindowtitle"
<<
title
<<
"--qwindowicon"
<<
"preferences-desktop-font-installer"
<<
"--size"
<<
QString
().
setNum
(
constSizes
[
dlg
.
chosenSize
()
<
6
?
dlg
.
chosenSize
()
:
2
])
<<
"--size"
<<
QString
::
number
(
constSizes
[
dlg
.
chosenSize
()
<
6
?
dlg
.
chosenSize
()
:
2
])
<<
"--listfile"
<<
tmpFile
.
fileName
()
<<
"--deletefile"
;
}
...
...
@@ -613,10 +613,10 @@ void CKCmFontInst::print(bool all)
}
else
{
args
<<
"--embed"
<<
QString
().
sprintf
(
"0x%x"
,
(
unsigned
int
)
window
()
->
winId
())
args
<<
"--embed"
<<
QString
Literal
(
"0x%1"
).
arg
(
(
unsigned
int
)
window
()
->
winId
()
,
0
,
16
)
<<
"--qwindowtitle"
<<
title
<<
"--qwindowicon"
<<
"preferences-desktop-font-installer"
<<
"--size"
<<
QString
().
setNum
(
constSizes
[
dlg
.
chosenSize
()
<
6
?
dlg
.
chosenSize
()
:
2
]);
<<
"--size"
<<
QString
::
number
(
constSizes
[
dlg
.
chosenSize
()
<
6
?
dlg
.
chosenSize
()
:
2
]);
for
(;
it
!=
end
;
++
it
)
args
<<
"--pfont"
<<
QString
((
*
it
).
family
.
toUtf8
()
+
','
+
QString
().
setNum
((
*
it
).
styleInfo
));
...
...
kcms/kfontinst/lib/Fc.cpp
View file @
853e135c
...
...
@@ -347,12 +347,7 @@ quint32 createStyleVal(const QString &name)
QString
styleValToStr
(
quint32
style
)
{
QString
str
;
int
weight
,
width
,
slant
;
decomposeStyleVal
(
style
,
weight
,
width
,
slant
);
str
.
sprintf
(
"0X%02X%02X%02X
\n
"
,
weight
,
width
,
slant
);
return
str
;
return
QStringLiteral
(
"0X%1
\n
"
).
arg
(
style
,
6
,
16
,
QLatin1Char
(
'0'
)).
toUpper
();
}
void
decomposeStyleVal
(
quint32
styleInfo
,
int
&
weight
,
int
&
width
,
int
&
slant
)
...
...
kcms/kfontinst/viewpart/CharTip.cpp
View file @
853e135c
...
...
@@ -172,7 +172,7 @@ void CCharTip::showTip()
details
+=
"<tr><td align=
\"
right
\"
><b>"
+
i18n
(
"Category"
)
+
" </b></td><td>"
+
toStr
(
cat
)
+
"</td></tr>"
;
details
+=
"<tr><td align=
\"
right
\"
><b>"
+
i18n
(
"UCS-4"
)
+
" </b></td><td>"
+
QString
().
sprintf
(
"U+%4.4X"
,
itsItem
.
ucs4
)
+
" </td></tr>"
;
"U+"
+
QString
Literal
(
"%1"
).
arg
(
itsItem
.
ucs4
,
4
,
16
)
+
" </td></tr>"
;
QString
str
(
QString
::
fromUcs4
(
&
(
itsItem
.
ucs4
),
1
));
details
+=
"<tr><td align=
\"
right
\"
><b>"
+
i18n
(
"UTF-16"
)
+
" </b></td><td>"
;
...
...
@@ -183,7 +183,7 @@ void CCharTip::showTip()
{
if
(
i
)
details
+=
' '
;
details
+=
QString
().
sprintf
(
"0x%4.4X"
,
utf16
[
i
]);
details
+=
QString
Literal
(
"0x%1"
).
arg
(
utf16
[
i
]
,
4
,
16
);
}
details
+=
"</td></tr>"
;
details
+=
"<tr><td align=
\"
right
\"
><b>"
+
i18n
(
"UTF-8"
)
+
" </b></td><td>"
;
...
...
@@ -194,7 +194,7 @@ void CCharTip::showTip()
{
if
(
i
)
details
+=
' '
;
details
+=
QString
().
sprintf
(
"0x%2.2X"
,
(
unsigned
char
)(
utf8
.
constData
()[
i
]));
details
+=
QString
Literal
(
"0x%1"
).
arg
(
(
unsigned
char
)(
utf8
.
constData
()[
i
])
,
2
,
16
);
}
details
+=
"</td></tr>"
;
...
...
@@ -204,7 +204,7 @@ void CCharTip::showTip()
(
0xE000
<=
itsItem
.
ucs4
&&
itsItem
.
ucs4
<=
0xFFFD
)
||
(
0x10000
<=
itsItem
.
ucs4
&&
itsItem
.
ucs4
<=
0x10FFFF
))
details
+=
"<tr><td align=
\"
right
\"
><b>"
+
i18n
(
"XML Decimal Entity"
)
+
" </b></td><td>"
+
QString
().
sprintf
(
"&#<b></b>%d;"
,
itsItem
.
ucs4
)
+
"</td></tr>"
;
"&#<b></b>"
+
QString
::
number
(
itsItem
.
ucs4
)
+
"
;
</td></tr>"
;
details
+=
"</table>"
;
itsLabel
->
setText
(
details
);
...
...
kcms/kfontinst/viewpart/FontViewPart.cpp
View file @
853e135c
...
...
@@ -413,7 +413,7 @@ void CFontViewPart::install()
if
(
title
.
isEmpty
())
title
=
QCoreApplication
::
applicationName
();
args
<<
"--embed"
<<
QString
().
sprintf
(
"0x%x"
,
(
unsigned
int
)
(
itsFrame
->
window
()
->
winId
()
)
)
args
<<
"--embed"
<<
QString
Literal
(
"0x%1"
).
arg
(
(
unsigned
int
)
itsFrame
->
window
()
->
winId
()
,
0
,
16
)
<<
"--qwindowtitle"
<<
title
<<
"--qwindowicon"
<<
"kfontview"
<<
url
().
toDisplayString
();
...
...
@@ -468,7 +468,7 @@ void CFontViewPart::print()
if
(
!
itsFontDetails
.
family
.
isEmpty
())
{
args
<<
"--embed"
<<
QString
().
sprintf
(
"0x%x"
,
(
unsigned
int
)
(
itsFrame
->
window
()
->
winId
()
)
)
args
<<
"--embed"
<<
QString
Literal
(
"0x%1"
).
arg
(
(
unsigned
int
)
itsFrame
->
window
()
->
winId
()
,
0
,
16
)
<<
"--qwindowtitle"
<<
title
<<
"--qwindowicon"
<<
"kfontview"
<<
"--size"
<<
"0"
...
...
@@ -476,7 +476,7 @@ void CFontViewPart::print()
}
#ifdef KFI_PRINT_APP_FONTS
else
args
<<
"--embed"
<<
QString
().
sprintf
(
"0x%x"
,
(
unsigned
int
)
(
itsFrame
->
window
()
->
winId
()
)
)
args
<<
"--embed"
<<
QString
Literal
(
"0x%1"
).
arg
(
(
unsigned
int
)
itsFrame
->
window
()
->
winId
()
,
0
,
16
)
<<
"--qwindowtitle"
<<
title
<<
"--qwindowicon"
<<
"kfontview"
<<
"--size "
<<
"0"
...
...
kcms/krdb/krdb.cpp
View file @
853e135c
...
...
@@ -223,15 +223,10 @@ static void applyQtSettings( KSharedConfigPtr kglobalcfg, QSettings& settings )
static
void
addColorDef
(
QString
&
s
,
const
char
*
n
,
const
QColor
&
col
)
{
QString
tmp
;
tmp
.
sprintf
(
"#define %s #%02x%02x%02x
\n
"
,
n
,
col
.
red
(),
col
.
green
(),
col
.
blue
());
s
+=
tmp
;
s
+=
QStringLiteral
(
"#define %1 "
).
arg
(
QString
::
fromUtf8
(
n
));
s
+=
col
.
name
().
toLower
();
}
// -----------------------------------------------------------------------------
static
void
copyFile
(
QFile
&
tmp
,
QString
const
&
filename
,
bool
)
...
...
ksmserver/client.cpp
View file @
853e135c
...
...
@@ -94,7 +94,7 @@ char * safeSmsGenerateClientID( SmsConn /*c*/ )
(1 would be IP, 2 would be DEC-NET format) */
char
hostname
[
256
];
if
(
gethostname
(
hostname
,
255
)
!=
0
)
my_addr
->
sprintf
(
"0%.8x"
,
KRandom
::
random
());
*
my_addr
=
QStringLiteral
(
"0%1"
).
arg
(
KRandom
::
random
()
,
8
,
16
);
else
{
// create some kind of hash for the hostname
int
addr
[
4
]
=
{
0
,
0
,
0
,
0
};
...
...
Christophe Marin
@krop
mentioned in commit
a00fe0a9
·
Dec 03, 2020
mentioned in commit
a00fe0a9
mentioned in commit a00fe0a96e3f1ca1f1415f9058effc99580ab0f9
Toggle commit list
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