diff options
| author | Elvis Angelaccio <[email protected]> | 2018-11-11 17:35:13 +0100 |
|---|---|---|
| committer | Elvis Angelaccio <[email protected]> | 2018-11-11 19:02:54 +0100 |
| commit | 140ccf1df8ae3b9958120881b4c34c0f230d5d54 (patch) | |
| tree | 3f8a84ea6be47592229d43f20e66270434826dff /src | |
| parent | e3eba9ea66e25607482af0e2a223b161438b261b (diff) | |
[PlacesItemModel] Match KFilePlacesModel addPlaces() API
This will allow to create a place visible only from Dolphin, by passing
an `appName` to the KFilePlacesModel.
CCBUG: 376619
Diffstat (limited to 'src')
| -rw-r--r-- | src/panels/places/placesitemmodel.cpp | 14 | ||||
| -rw-r--r-- | src/panels/places/placesitemmodel.h | 6 |
2 files changed, 10 insertions, 10 deletions
diff --git a/src/panels/places/placesitemmodel.cpp b/src/panels/places/placesitemmodel.cpp index f7fe5587c..86fbf886d 100644 --- a/src/panels/places/placesitemmodel.cpp +++ b/src/panels/places/placesitemmodel.cpp @@ -78,12 +78,14 @@ PlacesItemModel::~PlacesItemModel() { } -void PlacesItemModel::createPlacesItem(const QString& text, - const QUrl& url, - const QString& iconName, - int after) +void PlacesItemModel::createPlacesItem(const QString &text, const QUrl &url, const QString &iconName, const QString &appName) { - m_sourceModel->addPlace(text, url, iconName, {}, mapToSource(after)); + createPlacesItem(text, url, iconName, appName, -1); +} + +void PlacesItemModel::createPlacesItem(const QString &text, const QUrl &url, const QString &iconName, const QString &appName, int after) +{ + m_sourceModel->addPlace(text, url, iconName, appName, mapToSource(after)); } PlacesItem* PlacesItemModel::placesItem(int index) const @@ -369,7 +371,7 @@ void PlacesItemModel::dropMimeDataBefore(int index, const QMimeData* mimeData) continue; } - createPlacesItem(text, url, KIO::iconNameForUrl(url), qMax(0, index - 1)); + createPlacesItem(text, url, KIO::iconNameForUrl(url), {}, qMax(0, index - 1)); } } // will save bookmark alteration and fix sort if that is broken by the drag/drop operation diff --git a/src/panels/places/placesitemmodel.h b/src/panels/places/placesitemmodel.h index 58d0d55b2..dde3f3d7b 100644 --- a/src/panels/places/placesitemmodel.h +++ b/src/panels/places/placesitemmodel.h @@ -52,10 +52,8 @@ public: * @brief Create a new place entry in the bookmark file * and add it to the model */ - void createPlacesItem(const QString& text, - const QUrl& url, - const QString& iconName = QString(), - int after = -1); + void createPlacesItem(const QString& text, const QUrl& url, const QString& iconName = {}, const QString& appName = {}); + void createPlacesItem(const QString& text, const QUrl& url, const QString& iconName, const QString& appName, int after); PlacesItem* placesItem(int index) const; |
