+void KdenliveDoc::updateProjectFolderPlacesEntry()
+{
+ const QString file = KStandardDirs::locateLocal("data", "kfileplaces/bookmarks.xml");
+ KBookmarkManager *bookmarkManager = KBookmarkManager::managerForFile(file, "kfilePlaces");
+ KBookmarkGroup root = bookmarkManager->root();
+ KBookmark bookmark = root.first();
+
+ QString kdenliveName = KGlobal::mainComponent().componentName();
+ KUrl documentLocation = m_projectFolder;
+
+ bool exists = false;
+
+ while (!bookmark.isNull()) {
+ // UDI not empty indicates a device
+ QString udi = bookmark.metaDataItem("UDI");
+ QString appName = bookmark.metaDataItem("OnlyInApp");
+
+ if (udi.isEmpty() && appName == kdenliveName && bookmark.text() == i18n("Project Folder")) {
+ if (bookmark.url() != documentLocation) {
+ bookmark.setUrl(documentLocation);
+ bookmarkManager->emitChanged(root);
+ }
+ exists = true;
+ break;
+ }
+
+ bookmark = root.next(bookmark);
+ }
+
+ // if entry does not exist yet (was not found), well, create it then
+ if (!exists) {
+ KBookmark newBookmark = root.addBookmark(i18n("Project Folder"), documentLocation, "folder-favorites");
+ // Make this user selectable ?
+ newBookmark.setMetaDataItem("OnlyInApp", kdenliveName);
+ bookmarkManager->emitChanged(root);
+ }
+}
+