m_documentProperties["proxyminsize"] = QString::number(KdenliveSettings::proxyminsize());
m_documentProperties["generateimageproxy"] = QString::number((int) KdenliveSettings::generateimageproxy());
m_documentProperties["proxyimageminsize"] = QString::number(KdenliveSettings::proxyimageminsize());
-
+#if QT_VERSION >= 0x040700
+ m_documentProperties["documentid"] = QString::number(QDateTime::currentMSecsSinceEpoch());
+#else
+ QDateTime date = QDateTime::currentDateTime();
+ m_documentProperties["documentid"] = QString::number(date.toTime_t());
+#endif
+
// Load properties
QMapIterator<QString, QString> i(properties);
while (i.hasNext()) {
QDomElement mlt = m_document.firstChildElement("mlt");
QDomElement infoXml = mlt.firstChildElement("kdenlivedoc");
+ // Set profile, fps, etc for the document
+ setProfilePath(infoXml.attribute("profile"));
+
// Check embedded effects
QDomElement customeffects = infoXml.firstChildElement("customeffects");
if (!customeffects.isNull() && customeffects.hasChildNodes()) {
QDomNamedNodeMap props = docproperties.attributes();
for (int i = 0; i < props.count(); i++)
m_documentProperties.insert(props.item(i).nodeName(), props.item(i).nodeValue());
- setProfilePath(infoXml.attribute("profile"));
+
if (validator.isModified()) setModified(true);
kDebug() << "Reading file: " << url.path() << ", found clips: " << producers.count();
}
file.close();
if (!autosave) {
cleanupBackupFiles();
+ QFileInfo info(file);
+ QString fileName = KUrl(path).fileName().section('.', 0, -2);
+ fileName.append("-" + m_documentProperties.value("documentid"));
+ fileName.append(info.lastModified().toString("-yyyy-MM-dd-hh-mm"));
+ fileName.append(".kdenlive.png");
+ KUrl backupFile = m_projectFolder;
+ backupFile.addPath(".backup/");
+ backupFile.addPath(fileName);
+ emit saveTimelinePreview(backupFile.path());
}
return true;
}
emit progressInfo(QString(), -1);
}*/
-void KdenliveDoc::checkProjectClips(bool displayRatioChanged)
+void KdenliveDoc::checkProjectClips(bool displayRatioChanged, bool fpsChanged)
{
if (m_render == NULL) return;
- m_clipManager->resetProducersList(m_render->producersList(), displayRatioChanged);
+ m_clipManager->resetProducersList(m_render->producersList(), displayRatioChanged, fpsChanged);
}
Render *KdenliveDoc::renderer()
bool KdenliveDoc::checkDocumentClips(QDomNodeList infoproducers)
{
DocumentChecker d(infoproducers, m_document);
- return (d.hasMissingClips() == false);
+ return (d.hasErrorInClips() == false);
/* int clipType;
QDomElement e;
void KdenliveDoc::backupLastSavedVersion(const QString &path)
{
// Ensure backup folder exists
+ if (path.isEmpty()) return;
QFile file(path);
KUrl backupFile = m_projectFolder;
backupFile.addPath(".backup/");
KIO::NetAccess::mkdir(backupFile, kapp->activeWindow());
QString fileName = KUrl(path).fileName().section('.', 0, -2);
QFileInfo info(file);
+ fileName.append("-" + m_documentProperties.value("documentid"));
fileName.append(info.lastModified().toString("-yyyy-MM-dd-hh-mm"));
fileName.append(".kdenlive");
backupFile.addPath(fileName);
- emit saveTimelinePreview(backupFile.path() + ".png");
-
if (file.exists()) {
// delete previous backup if it was done less than 60 seconds ago
QFile::remove(backupFile.path());
backupFile.addPath(".backup/");
QDir dir(backupFile.path());
QString projectFile = url().fileName().section('.', 0, -2);
+ projectFile.append("-" + m_documentProperties.value("documentid"));
projectFile.append("-??");
projectFile.append("??");
projectFile.append("-??");