Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
Plasma Add-ons
Commits
4c1aa258
Verified
Commit
4c1aa258
authored
Feb 11, 2021
by
Alexander Lohnau
💬
Browse files
Fix some Qt container anti pattern
parent
c3328db8
Changes
3
Hide whitespace changes
Inline
Side-by-side
applets/notes/plugin/documenthandler.cpp
View file @
4c1aa258
...
...
@@ -309,8 +309,10 @@ QStringList DocumentHandler::defaultFontSizes() const
{
// uhm... this is quite ugly
QStringList
sizes
;
QFontDatabase
db
;
for
(
int
size
:
db
.
standardSizes
())
const
QList
<
int
>
standardSizes
=
QFontDatabase
::
standardSizes
();
sizes
.
reserve
(
standardSizes
.
count
());
for
(
int
size
:
standardSizes
)
{
sizes
.
append
(
QString
::
number
(
size
));
}
return
sizes
;
}
dataengines/comic/comicproviderwrapper.cpp
View file @
4c1aa258
...
...
@@ -755,8 +755,8 @@ void ComicProviderWrapper::requestPage(const QString &url, int id, const QVarian
{
QMap
<
QString
,
QString
>
map
;
for
(
const
QString
&
key
:
infos
.
keys
()
)
{
map
[
key
]
=
i
nfos
[
key
]
.
toString
();
for
(
auto
it
=
infos
.
begin
(),
end
=
infos
.
end
();
it
!=
end
;
++
it
)
{
map
[
it
.
key
()
]
=
i
t
.
value
()
.
toString
();
}
mProvider
->
requestPage
(
QUrl
(
url
),
id
,
map
);
++
mRequests
;
...
...
@@ -766,8 +766,8 @@ void ComicProviderWrapper::requestRedirectedUrl(const QString &url, int id, cons
{
QMap
<
QString
,
QString
>
map
;
for
(
const
QString
&
key
:
infos
.
keys
()
)
{
map
[
key
]
=
i
nfos
[
key
]
.
toString
();
for
(
auto
it
=
infos
.
begin
(),
end
=
infos
.
end
();
it
!=
end
;
++
it
)
{
map
[
it
.
key
()
]
=
i
t
.
value
()
.
toString
();
}
mProvider
->
requestRedirectedUrl
(
QUrl
(
url
),
id
,
map
);
++
mRequests
;
...
...
runners/dictionary/dictionarymatchengine.cpp
View file @
4c1aa258
...
...
@@ -78,8 +78,7 @@ void DictionaryMatchEngine::dataUpdated(const QString &source, const Plasma::Dat
QString
definition
(
result
[
QLatin1String
(
"text"
)].
toString
());
m_wordLock
.
lockForRead
();
const
auto
values
=
m_lockers
.
values
(
source
);
for
(
ThreadData
*
data
:
values
)
{
for
(
ThreadData
*
data
:
qAsConst
(
m_lockers
))
{
QMutexLocker
locker
(
&
data
->
mutex
);
/* Because of QString's CoW semantics, we don't have to worry about
* the overhead of assigning this to every item. */
...
...
Write
Preview
Supports
Markdown
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