Changeset View
Changeset View
Standalone View
Standalone View
src/panels/places/placesitem.cpp
Show First 20 Lines • Show All 133 Lines • ▼ Show 20 Line(s) | 124 | { | |||
---|---|---|---|---|---|
134 | delete m_access; | 134 | delete m_access; | ||
135 | delete m_volume; | 135 | delete m_volume; | ||
136 | delete m_disc; | 136 | delete m_disc; | ||
137 | delete m_mtp; | 137 | delete m_mtp; | ||
138 | 138 | | |||
139 | const QString udi = bookmark.metaDataItem(QStringLiteral("UDI")); | 139 | const QString udi = bookmark.metaDataItem(QStringLiteral("UDI")); | ||
140 | if (udi.isEmpty()) { | 140 | if (udi.isEmpty()) { | ||
141 | setIcon(bookmark.icon()); | 141 | setIcon(bookmark.icon()); | ||
142 | setText(i18nc("KFile System Bookmarks", bookmark.text().toUtf8().constData())); | 142 | setText(i18ndc("kio5", "KFile System Bookmarks", bookmark.text().toUtf8().constData())); | ||
143 | setUrl(bookmark.url()); | 143 | setUrl(bookmark.url()); | ||
144 | setSystemItem(bookmark.metaDataItem(QStringLiteral("isSystemItem")) == QLatin1String("true")); | 144 | setSystemItem(bookmark.metaDataItem(QStringLiteral("isSystemItem")) == QLatin1String("true")); | ||
145 | } else { | 145 | } else { | ||
146 | initializeDevice(udi); | 146 | initializeDevice(udi); | ||
147 | } | 147 | } | ||
148 | 148 | | |||
149 | setHidden(bookmark.metaDataItem(QStringLiteral("IsHidden")) == QLatin1String("true")); | 149 | setHidden(bookmark.metaDataItem(QStringLiteral("IsHidden")) == QLatin1String("true")); | ||
150 | } | 150 | } | ||
▲ Show 20 Lines • Show All 89 Lines • ▼ Show 20 Line(s) | 239 | if (role == "iconName") { | |||
240 | m_bookmark.setIcon(icon()); | 240 | m_bookmark.setIcon(icon()); | ||
241 | } else if (role == "text") { | 241 | } else if (role == "text") { | ||
242 | // Only store the text in the KBookmark if it is not the translation of | 242 | // Only store the text in the KBookmark if it is not the translation of | ||
243 | // the current text. This makes sure that the text is re-translated if | 243 | // the current text. This makes sure that the text is re-translated if | ||
244 | // the user chooses another language, or the translation itself changes. | 244 | // the user chooses another language, or the translation itself changes. | ||
245 | // | 245 | // | ||
246 | // NOTE: It is important to use "KFile System Bookmarks" as context | 246 | // NOTE: It is important to use "KFile System Bookmarks" as context | ||
247 | // (see PlacesItemModel::createSystemBookmarks()). | 247 | // (see PlacesItemModel::createSystemBookmarks()). | ||
248 | if (text() != i18nc("KFile System Bookmarks", m_bookmark.text().toUtf8().data())) { | 248 | if (text() != i18ndc("kio5", "KFile System Bookmarks", m_bookmark.text().toUtf8().data())) { | ||
249 | m_bookmark.setFullText(text()); | 249 | m_bookmark.setFullText(text()); | ||
250 | } | 250 | } | ||
251 | } else if (role == "url") { | 251 | } else if (role == "url") { | ||
252 | m_bookmark.setUrl(url()); | 252 | m_bookmark.setUrl(url()); | ||
253 | } else if (role == "udi") { | 253 | } else if (role == "udi") { | ||
254 | m_bookmark.setMetaDataItem(QStringLiteral("UDI"), udi()); | 254 | m_bookmark.setMetaDataItem(QStringLiteral("UDI"), udi()); | ||
255 | } else if (role == "isSystemItem") { | 255 | } else if (role == "isSystemItem") { | ||
256 | m_bookmark.setMetaDataItem(QStringLiteral("isSystemItem"), isSystemItem() ? QStringLiteral("true") : QStringLiteral("false")); | 256 | m_bookmark.setMetaDataItem(QStringLiteral("isSystemItem"), isSystemItem() ? QStringLiteral("true") : QStringLiteral("false")); | ||
Show All 20 Lines |