#include <KIO/NetAccess>
#include <KIO/CopyJob>
#include <KApplication>
+#include <KGlobal>
+#include <KBookmarkManager>
+#include <KBookmark>
+#include <KStandardDirs>
#include <QCryptographicHash>
#include <QFile>
QDomNodeList infoproducers = m_document.elementsByTagName("kdenlive_producer");
success = checkDocumentClips(infoproducers);
if (success) {
+ if (m_document.documentElement().attribute("modified") == "1") setModified(true);
parent->slotGotProgressInfo(i18n("Loading"), 0);
QDomElement mlt = m_document.firstChildElement("mlt");
QDomElement infoXml = mlt.firstChildElement("kdenlivedoc");
for (int i = 0; i < props.count(); i++)
m_documentProperties.insert(props.item(i).nodeName(), props.item(i).nodeValue());
setProfilePath(infoXml.attribute("profile"));
- setModified(validator.isModified());
+ if (validator.isModified()) setModified(true);
kDebug() << "Reading file: " << url.path() << ", found clips: " << producers.count();
}
}
KStandardDirs::makeDir(m_projectFolder.path(KUrl::AddTrailingSlash) + "thumbs/");
KStandardDirs::makeDir(m_projectFolder.path(KUrl::AddTrailingSlash) + "ladspa/");
+ updateProjectFolderPlacesEntry();
+
//kDebug() << "// SETTING SCENE LIST:\n\n" << m_document.toString();
connect(m_autoSaveTimer, SIGNAL(timeout()), this, SLOT(slotAutoSave()));
}
KStandardDirs::makeDir(url.path(KUrl::AddTrailingSlash) + "thumbs/");
if (KMessageBox::questionYesNo(kapp->activeWindow(), i18n("You have changed the project folder. Do you want to copy the cached data from %1 to the new folder %2?").arg(m_projectFolder.path(), url.path())) == KMessageBox::Yes) moveProjectData(url);
m_projectFolder = url;
+
+ updateProjectFolderPlacesEntry();
}
void KdenliveDoc::moveProjectData(KUrl url)
return (!importedEffects.isEmpty());
}
+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);
+ }
+}
+
#include "kdenlivedoc.moc"