Changeset View
Changeset View
Standalone View
Standalone View
src/filewidgets/kfileplacesmodel.cpp
| Show First 20 Lines • Show All 305 Lines • ▼ Show 20 Line(s) | 304 | KFilePlacesItem::createSystemBookmark(d->bookmarkManager, | |||
|---|---|---|---|---|---|
| 306 | QUrl(QStringLiteral("trash:/")), QStringLiteral("user-trash")); | 306 | QUrl(QStringLiteral("trash:/")), QStringLiteral("user-trash")); | ||
| 307 | 307 | | |||
| 308 | setDefaultMetadataItemForGroup(PlacesType); | 308 | setDefaultMetadataItemForGroup(PlacesType); | ||
| 309 | setDefaultMetadataItemForGroup(RemoteType); | 309 | setDefaultMetadataItemForGroup(RemoteType); | ||
| 310 | setDefaultMetadataItemForGroup(DevicesType); | 310 | setDefaultMetadataItemForGroup(DevicesType); | ||
| 311 | setDefaultMetadataItemForGroup(RemovableDevicesType); | 311 | setDefaultMetadataItemForGroup(RemovableDevicesType); | ||
| 312 | setDefaultMetadataItemForGroup(TagsType); | 312 | setDefaultMetadataItemForGroup(TagsType); | ||
| 313 | 313 | | |||
| 314 | // Add a Recently Used entry if available (it comes from kio-extras) | ||||
| 315 | if (KProtocolInfo::isKnownProtocol(QStringLiteral("recentlyused"))) { | ||||
meven: Should we add this to existing places settings ?
Like we do with `withBaloo` for instance… | |||||
| 316 | KFilePlacesItem::createSystemBookmark(d->bookmarkManager, | ||||
| 317 | QStringLiteral("Recently Used"), I18N_NOOP2("KFile System Bookmarks", "Recently Used"), | ||||
| 318 | QUrl(QStringLiteral("recentlyused:/")), QStringLiteral("document-open-recent-symbolic")); | ||||
| 319 | } | ||||
| 320 | | ||||
| 314 | // Force bookmarks to be saved. If on open/save dialog and the bookmarks are not saved, QFile::exists | 321 | // Force bookmarks to be saved. If on open/save dialog and the bookmarks are not saved, QFile::exists | ||
| 315 | // will always return false, which opening/closing all the time the open/save dialog would case the | 322 | // will always return false, which opening/closing all the time the open/save dialog would case the | ||
| 316 | // bookmarks to be added once each time, having lots of times each bookmark. (ereslibre) | 323 | // bookmarks to be added once each time, having lots of times each bookmark. (ereslibre) | ||
| 317 | d->bookmarkManager->saveAs(file); | 324 | d->bookmarkManager->saveAs(file); | ||
| 318 | } | 325 | } | ||
| 319 | 326 | | |||
| 320 | // if baloo is enabled, add new urls even if the bookmark file is not empty | 327 | // if baloo is enabled, add new urls even if the bookmark file is not empty | ||
| 321 | if (d->fileIndexingEnabled && | 328 | if (d->fileIndexingEnabled && | ||
| 322 | root.metaDataItem(QStringLiteral("withBaloo")) != QLatin1String("true")) { | 329 | root.metaDataItem(QStringLiteral("withBaloo")) != QLatin1String("true")) { | ||
| 323 | 330 | | |||
| 324 | root.setMetaDataItem(QStringLiteral("withBaloo"), QStringLiteral("true")); | 331 | root.setMetaDataItem(QStringLiteral("withBaloo"), QStringLiteral("true")); | ||
| 325 | KFilePlacesItem::createSystemBookmark(d->bookmarkManager, | 332 | KFilePlacesItem::createSystemBookmark(d->bookmarkManager, | ||
| 326 | QStringLiteral("Today"), I18N_NOOP2("KFile System Bookmarks", "Today"), | 333 | QStringLiteral("Modified Today"), I18N_NOOP2("KFile System Bookmarks", "Today"), | ||
timeline protocol works on modification date, we should change this to "Modified Today". meven: timeline protocol works on modification date, we should change this to "Modified Today".
It is… | |||||
| 327 | QUrl(QStringLiteral("timeline:/today")), QStringLiteral("go-jump-today")); | 334 | QUrl(QStringLiteral("timeline:/today")), QStringLiteral("go-jump-today")); | ||
| 328 | KFilePlacesItem::createSystemBookmark(d->bookmarkManager, | 335 | KFilePlacesItem::createSystemBookmark(d->bookmarkManager, | ||
| 329 | QStringLiteral("Yesterday"), I18N_NOOP2("KFile System Bookmarks", "Yesterday"), | 336 | QStringLiteral("Modified Yesterday"), I18N_NOOP2("KFile System Bookmarks", "Yesterday"), | ||
meven: same here | |||||
| 330 | QUrl(QStringLiteral("timeline:/yesterday")), QStringLiteral("view-calendar-day")); | 337 | QUrl(QStringLiteral("timeline:/yesterday")), QStringLiteral("view-calendar-day")); | ||
| 331 | KFilePlacesItem::createSystemBookmark(d->bookmarkManager, | 338 | KFilePlacesItem::createSystemBookmark(d->bookmarkManager, | ||
| 332 | QStringLiteral("Documents"), I18N_NOOP2("KFile System Bookmarks", "Documents"), | 339 | QStringLiteral("Documents"), I18N_NOOP2("KFile System Bookmarks", "Documents"), | ||
| 333 | QUrl(QStringLiteral("search:/documents")), QStringLiteral("folder-text")); | 340 | QUrl(QStringLiteral("search:/documents")), QStringLiteral("folder-text")); | ||
| 334 | KFilePlacesItem::createSystemBookmark(d->bookmarkManager, | 341 | KFilePlacesItem::createSystemBookmark(d->bookmarkManager, | ||
| 335 | QStringLiteral("Images"), I18N_NOOP2("KFile System Bookmarks", "Images"), | 342 | QStringLiteral("Images"), I18N_NOOP2("KFile System Bookmarks", "Images"), | ||
| 336 | QUrl(QStringLiteral("search:/images")), QStringLiteral("folder-images")); | 343 | QUrl(QStringLiteral("search:/images")), QStringLiteral("folder-images")); | ||
| 337 | KFilePlacesItem::createSystemBookmark(d->bookmarkManager, | 344 | KFilePlacesItem::createSystemBookmark(d->bookmarkManager, | ||
| ▲ Show 20 Lines • Show All 1013 Lines • Show Last 20 Lines | |||||
Should we add this to existing places settings ?
Like we do with withBaloo for instance, adding it if it was not added before.