if (!infoXmlNode.isNull()) {
QDomElement infoXml = infoXmlNode.toElement();
QString profilePath = infoXml.attribute("profile");
+ QString projectFolderPath = infoXml.attribute("projectfolder");
+ if (!projectFolderPath.isEmpty()) m_projectFolder = KUrl(projectFolderPath);
+ if (m_projectFolder.isEmpty()) m_projectFolder = KUrl(KdenliveSettings::defaultprojectfolder());
m_startPos = infoXml.attribute("position").toInt();
m_zoom = infoXml.attribute("zoom", "7").toInt();
setProfilePath(profilePath);
m_document = createEmptyDocument(tracks.x(), tracks.y());
setProfilePath(profileName);
}
+ if (m_projectFolder.isEmpty()) m_projectFolder = KUrl(KdenliveSettings::defaultprojectfolder());
+
+ // make sure that the necessary folders exist
+ KStandardDirs::makeDir(m_projectFolder.path() + "/titles/");
+ KStandardDirs::makeDir(m_projectFolder.path() + "/thumbs/");
+
m_scenelist = m_document.toString();
kDebug() << "KDEnnlive document, init timecode: " << m_fps;
if (m_fps == 30000.0 / 1001.0) m_timecode.setFormat(30, true);
else m_timecode.setFormat((int) m_fps);
-
connect(m_autoSaveTimer, SIGNAL(timeout()), this, SLOT(slotAutoSave()));
}
addedXml.setAttribute("version", "0.8");
addedXml.setAttribute("profile", profilePath());
addedXml.setAttribute("position", m_render->seekPosition().frames(m_fps));
+ addedXml.setAttribute("projectfolder", m_projectFolder.path());
addedXml.setAttribute("tracks", getTracksInfo());
addedXml.setAttribute("zoom", m_zoom);
}
KUrl KdenliveDoc::projectFolder() const {
- if (m_projectFolder.isEmpty()) return KUrl(KStandardDirs::locateLocal("appdata", "/projects/"));
+ //if (m_projectFolder.isEmpty()) return KUrl(KStandardDirs::locateLocal("appdata", "/projects/"));
return m_projectFolder;
}
kDebug() << attrname << " = " << attributes.item(i).nodeValue();
}
clip->setProperties(properties);
- emit addProjectClip(clip);
+ emit addProjectClip(clip, false);
}
}
m_tracksList.removeAt(ix);
}
+void KdenliveDoc::setTrackType(int ix, TrackInfo type) {
+ m_tracksList[ix].type = type.type;
+ m_tracksList[ix].isMute = type.isMute;
+ m_tracksList[ix].isBlind = type.isBlind;
+}
+
const QList <TrackInfo> KdenliveDoc::tracksList() const {
return m_tracksList;
}
return result;
}
+void KdenliveDoc::cachePixmap(const QString &fileId, const QPixmap &pix) const {
+ pix.save(m_projectFolder.path() + "/thumbs/" + fileId + ".png");
+}
+
+
#include "kdenlivedoc.moc"