Commit e16e8e1b authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

Port away from deprecated QList<->QSet conversion methods

parent 9b66f8b9
......@@ -656,7 +656,11 @@ void ViewMainPage::openUrls(const QList<QUrl>& allUrls, const QUrl &currentUrl)
{
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;
......
......@@ -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)
{
......
......@@ -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
};
/**
......
......@@ -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);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment