diff options
| author | Renato Araujo Oliveira Filho <[email protected]> | 2017-12-15 09:10:47 -0300 |
|---|---|---|
| committer | Renato Araujo Oliveira Filho <[email protected]> | 2018-01-02 10:15:47 -0300 |
| commit | 9d3a019445d7a7fdf3177bca9eeef4c44599e706 (patch) | |
| tree | 4df8aa1d0fe27bc1cf5e92a8d98ee7a3c49dd2ba /src/panels/places/placesitemmodel.cpp | |
| parent | 9d01f723aa67f107bf96c8f2fbce5036422a54fe (diff) | |
Ignore baloo urls created from new KIO model
Summary:
For now ignore baloo urls that was created by new KIO::KFilePlacesModel,
until we make use of new KIO API.
BUG: 387888
Test Plan:
Open any KIO file dialog using the new API.
Runs dolphin v17.12.0
Make sure that baloo urls does not appear duplicated
Reviewers: ngraham, elvisangelaccio
Reviewed By: ngraham, elvisangelaccio
Subscribers: cfeck, elvisangelaccio, ervin, mlaurent, #dolphin
Differential Revision: https://phabricator.kde.org/D9347
Diffstat (limited to 'src/panels/places/placesitemmodel.cpp')
| -rw-r--r-- | src/panels/places/placesitemmodel.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/panels/places/placesitemmodel.cpp b/src/panels/places/placesitemmodel.cpp index 680d513b5..abdd4c20b 100644 --- a/src/panels/places/placesitemmodel.cpp +++ b/src/panels/places/placesitemmodel.cpp @@ -65,6 +65,17 @@ namespace { // Hence a prefix to the application-name of the stored bookmarks is // added, which is only read by PlacesItemModel. const char AppNamePrefix[] = "-places-panel"; + + static QList<QUrl> balooURLs = { + QUrl(QStringLiteral("timeline:/today")), + QUrl(QStringLiteral("timeline:/yesterday")), + QUrl(QStringLiteral("timeline:/thismonth")), + QUrl(QStringLiteral("timeline:/lastmonth")), + QUrl(QStringLiteral("search:/documents")), + QUrl(QStringLiteral("search:/images")), + QUrl(QStringLiteral("search:/audio")), + QUrl(QStringLiteral("search:/videos")) + }; } PlacesItemModel::PlacesItemModel(QObject* parent) : @@ -832,6 +843,12 @@ bool PlacesItemModel::acceptBookmark(const KBookmark& bookmark, const QString appName = bookmark.metaDataItem(QStringLiteral("OnlyInApp")); const bool deviceAvailable = availableDevices.contains(udi); + if (balooURLs.contains(url) && appName.isEmpty()) { + // Does not accept baloo URLS with empty appName, this came from new KIO model and will cause duplications + qCWarning(DolphinDebug) << "Ignore KIO url:" << url; + return false; + } + const bool allowedHere = (appName.isEmpty() || appName == KAboutData::applicationData().componentName() || appName == KAboutData::applicationData().componentName() + AppNamePrefix) |
