// init default document properties
m_documentProperties["zoom"] = "7";
+ m_documentProperties["verticalzoom"] = "1";
m_documentProperties["zonein"] = "0";
m_documentProperties["zoneout"] = "100";
// TODO: backup the document or alert the user?
success = validator.validate(DOCUMENTVERSION);
if (success) { // Let the validator handle error messages
- setModified(validator.isModified());
QDomElement mlt = m_document.firstChildElement("mlt");
QDomElement infoXml = mlt.firstChildElement("kdenlivedoc");
profileName = infoXml.attribute("profile");
- m_projectFolder = infoXml.attribute("projectfolder");
+ m_projectFolder = KUrl(infoXml.attribute("projectfolder"));
QDomElement docproperties = infoXml.firstChildElement("documentproperties");
QDomNamedNodeMap props = docproperties.attributes();
for (int i = 0; i < props.count(); i++) {
infoXml.removeChild(markers);
}
setProfilePath(profileName);
+ setModified(validator.isModified());
kDebug() << "Reading file: " << url.path() << ", found clips: " << producers.count();
}
}
}
}
-void KdenliveDoc::setZoom(int factor)
+void KdenliveDoc::setZoom(int horizontal, int vertical)
{
- m_documentProperties["zoom"] = QString::number(factor);
+ m_documentProperties["zoom"] = QString::number(horizontal);
+ m_documentProperties["verticalzoom"] = QString::number(vertical);
}
-int KdenliveDoc::zoom() const
+QPoint KdenliveDoc::zoom() const
{
- return m_documentProperties.value("zoom").toInt();
+ return QPoint(m_documentProperties.value("zoom").toInt(), m_documentProperties.value("verticalzoom").toInt());
}
void KdenliveDoc::setZone(int start, int end)
if (createClipItem) {
emit addProjectClip(clip);
qApp->processEvents();
- m_render->getFileProperties(clip->toXML(), clip->getId(), false);
+ m_render->getFileProperties(clip->toXML(), clip->getId(), true);
}
}
void KdenliveDoc::cachePixmap(const QString &fileId, const QPixmap &pix) const
{
- pix.save(m_projectFolder.path() + "/thumbs/" + fileId + ".png");
+ pix.save(m_projectFolder.path(KUrl::AddTrailingSlash) + "thumbs/" + fileId + ".png");
}
QString KdenliveDoc::getLadspaFile() const
{
int ct = 0;
QString counter = QString::number(ct).rightJustified(5, '0', false);
- while (QFile::exists(m_projectFolder.path() + "/ladspa/" + counter + ".ladspa")) {
+ while (QFile::exists(m_projectFolder.path(KUrl::AddTrailingSlash) + "ladspa/" + counter + ".ladspa")) {
ct++;
counter = QString::number(ct).rightJustified(5, '0', false);
}
- return m_projectFolder.path() + "/ladspa/" + counter + ".ladspa";
+ return m_projectFolder.path(KUrl::AddTrailingSlash) + "ladspa/" + counter + ".ladspa";
}
bool KdenliveDoc::checkDocumentClips(QDomNodeList infoproducers)
for (int i = 0; i < infoproducers.count(); i++) {
e = infoproducers.item(i).toElement();
clipType = e.attribute("type").toInt();
- if (clipType == TEXT || clipType == COLOR) continue;
+ if (clipType == COLOR) continue;
+ if (clipType == TEXT) {
+ //TODO: Check is clip template is missing (xmltemplate) or hash changed
+ continue;
+ }
id = e.attribute("id");
resource = e.attribute("resource");
if (clipType == SLIDESHOW) resource = KUrl(resource).directory();
if (!KIO::NetAccess::exists(KUrl(resource), KIO::NetAccess::SourceSide, 0)) {
// Missing clip found
missingClips.append(e);
+ } else {
+ // Check if the clip has changed
+ if (clipType != SLIDESHOW && e.hasAttribute("file_hash")) {
+ if (e.attribute("file_hash") != DocClipBase::getHash(e.attribute("resource")))
+ e.removeAttribute("file_hash");
+ }
}
}
if (missingClips.isEmpty()) return true;