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
Graphics
Gwenview
Commits
e16e8e1b
Commit
e16e8e1b
authored
Nov 17, 2020
by
Friedrich W. H. Kossebau
Browse files
Port away from deprecated QList<->QSet conversion methods
parent
9b66f8b9
Changes
4
Hide whitespace changes
Inline
Side-by-side
app/viewmainpage.cpp
View file @
e16e8e1b
...
...
@@ -656,7 +656,11 @@ void ViewMainPage::openUrls(const QList<QUrl>& allUrls, const QUrl ¤tUrl)
{
DocumentView
::
Setup
setup
;
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
QSet
<
QUrl
>
urls
(
allUrls
.
begin
(),
allUrls
.
end
());
#else
QSet
<
QUrl
>
urls
=
allUrls
.
toSet
();
#endif
d
->
mCompareMode
=
urls
.
count
()
>
1
;
typedef
QMap
<
QUrl
,
DocumentView
*>
ViewForUrlMap
;
...
...
lib/semanticinfo/abstractsemanticinfobackend.cpp
View file @
e16e8e1b
...
...
@@ -38,6 +38,13 @@ TagSet::TagSet()
TagSet
::
TagSet
(
const
QSet
<
SemanticInfoTag
>&
set
)
:
QSet
<
QString
>
(
set
)
{}
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
TagSet
::
TagSet
(
const
QList
<
SemanticInfoTag
>&
list
)
:
QSet
(
list
.
begin
(),
list
.
end
())
{
}
#endif
QVariant
TagSet
::
toVariant
()
const
{
QStringList
lst
=
values
();
...
...
@@ -50,6 +57,15 @@ TagSet TagSet::fromVariant(const QVariant& variant)
return
TagSet
::
fromList
(
lst
);
}
TagSet
TagSet
::
fromList
(
const
QList
<
SemanticInfoTag
>&
list
)
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
return
TagSet
(
list
);
#else
return
QSet
<
SemanticInfoTag
>::
fromList
(
lst
);
#endif
}
AbstractSemanticInfoBackEnd
::
AbstractSemanticInfoBackEnd
(
QObject
*
parent
)
:
QObject
(
parent
)
{
...
...
lib/semanticinfo/abstractsemanticinfobackend.h
View file @
e16e8e1b
...
...
@@ -52,6 +52,12 @@ public:
QVariant
toVariant
()
const
;
static
TagSet
fromVariant
(
const
QVariant
&
);
static
TagSet
fromList
(
const
QList
<
SemanticInfoTag
>&
);
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
private:
TagSet
(
const
QList
<
SemanticInfoTag
>&
);
#endif
};
/**
...
...
lib/semanticinfo/baloosemanticinfobackend.cpp
View file @
e16e8e1b
...
...
@@ -89,7 +89,7 @@ void BalooSemanticInfoBackend::retrieveSemanticInfo(const QUrl &url)
SemanticInfo
si
;
si
.
mRating
=
md
.
rating
();
si
.
mDescription
=
md
.
userComment
();
si
.
mTags
=
md
.
tags
()
.
toSet
(
);
si
.
mTags
=
TagSet
::
fromList
(
md
.
tags
());
emit
semanticInfoRetrieved
(
url
,
si
);
}
...
...
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