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