- convertDocument(version);
- /*
- * read again <kdenlivedoc> and <westley> to get all the new
- * stuff (convertDocument() can now do anything without breaking
- * document loading)
- */
- infoXmlNode = m_document.elementsByTagName("kdenlivedoc").at(0);
- infoXml = infoXmlNode.toElement();
- version = infoXml.attribute("version").toDouble();
- westley = m_document.elementsByTagName("westley").at(0);
-
- 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);
-
- // Build tracks
- QString tracks = infoXml.attribute("tracks");
- TrackInfo videoTrack;
- videoTrack.type = VIDEOTRACK;
- videoTrack.isMute = false;
- videoTrack.isBlind = false;
-
- TrackInfo audioTrack;
- audioTrack.type = AUDIOTRACK;
- audioTrack.isMute = false;
- audioTrack.isBlind = true;
- for (int i = 0; i < tracks.size(); i++) {
- if (tracks.data()[i] == 'v') m_tracksList.append(videoTrack);
- else m_tracksList.append(audioTrack);
- }
-
+ if (!convertDocument(version)) {
+ KMessageBox::sorry(parent, i18n("This project type is unsupported and can't be loaded."), i18n("Unable to open project"));
+ m_document = createEmptyDocument(tracks.x(), tracks.y());
+ setProfilePath(profileName);
+ } else {
+ /*
+ * read again <kdenlivedoc> and <westley> to get all the new
+ * stuff (convertDocument() can now do anything without breaking
+ * document loading)
+ */
+ infoXmlNode = m_document.elementsByTagName("kdenlivedoc").at(0);
+ infoXml = infoXmlNode.toElement();
+ version = infoXml.attribute("version").toDouble();
+ westley = m_document.elementsByTagName("westley").at(0);
+
+ 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);
+
+ // Build tracks
+ QString tracks = infoXml.attribute("tracks");
+ TrackInfo videoTrack;
+ videoTrack.type = VIDEOTRACK;
+ videoTrack.isMute = false;
+ videoTrack.isBlind = false;
+
+ TrackInfo audioTrack;
+ audioTrack.type = AUDIOTRACK;
+ audioTrack.isMute = false;
+ audioTrack.isBlind = true;
+ for (int i = 0; i < tracks.size(); i++) {
+ if (tracks.data()[i] == 'v') m_tracksList.append(videoTrack);
+ else m_tracksList.append(audioTrack);
+ }