diff options
Diffstat (limited to 'src/panels')
| -rw-r--r-- | src/panels/places/placesitem.cpp | 14 | ||||
| -rw-r--r-- | src/panels/places/placesitemmodel.cpp | 2 | ||||
| -rw-r--r-- | src/panels/places/placesitemmodel.h | 2 |
3 files changed, 15 insertions, 3 deletions
diff --git a/src/panels/places/placesitem.cpp b/src/panels/places/placesitem.cpp index 76b51e3aa..41f22cce4 100644 --- a/src/panels/places/placesitem.cpp +++ b/src/panels/places/placesitem.cpp @@ -120,6 +120,10 @@ Solid::Device PlacesItem::device() const void PlacesItem::setBookmark(const KBookmark& bookmark) { + if (bookmark == m_bookmark) { + return; + } + m_bookmark = bookmark; delete m_access; @@ -302,7 +306,15 @@ void PlacesItem::updateBookmarkForRole(const QByteArray& role) if (role == "iconName") { m_bookmark.setIcon(icon()); } else if (role == "text") { - m_bookmark.setFullText(text()); + // Only store the text in the KBookmark if it is not the translation of + // the current text. This makes sure that the text is re-translated if + // the user chooses another language, or the translation itself changes. + // + // NOTE: It is important to use "KFile System Bookmarks" as context + // (see PlacesItemModel::createSystemBookmarks()). + if (text() != i18nc("KFile System Bookmarks", m_bookmark.text().toUtf8().data())) { + m_bookmark.setFullText(text()); + } } else if (role == "url") { m_bookmark.setUrl(url()); } else if (role == "udi)") { diff --git a/src/panels/places/placesitemmodel.cpp b/src/panels/places/placesitemmodel.cpp index eae2095c9..681479dfb 100644 --- a/src/panels/places/placesitemmodel.cpp +++ b/src/panels/places/placesitemmodel.cpp @@ -377,7 +377,7 @@ void PlacesItemModel::requestStorageSetup(int index) } } -QMimeData* PlacesItemModel::createMimeData(const QSet<int>& indexes) const +QMimeData* PlacesItemModel::createMimeData(const KItemSet& indexes) const { KUrl::List urls; QByteArray itemData; diff --git a/src/panels/places/placesitemmodel.h b/src/panels/places/placesitemmodel.h index 693836033..cd37e7353 100644 --- a/src/panels/places/placesitemmodel.h +++ b/src/panels/places/placesitemmodel.h @@ -118,7 +118,7 @@ public: void requestStorageSetup(int index); /** @reimp */ - virtual QMimeData* createMimeData(const QSet<int>& indexes) const; + virtual QMimeData* createMimeData(const KItemSet& indexes) const; /** @reimp */ virtual bool supportsDropping(int index) const; |
