return ret;
}
-void KdenliveDoc::saveSceneList(const QString &path, QDomDocument sceneList) {
+bool KdenliveDoc::saveSceneList(const QString &path, QDomDocument sceneList) {
QDomNode wes = sceneList.elementsByTagName("westley").at(0);
QDomElement addedXml = sceneList.createElement("kdenlivedoc");
QFile file(path);
if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
kWarning() << "////// ERROR writing to file: " << path;
- return;
+ KMessageBox::error(kapp->activeWindow(), i18n("Cannot write to file %1", path));
+ return false;
}
QTextStream out(&file);
out << sceneList.toString();
file.close();
-
+ return true;
}
QDomElement KdenliveDoc::documentInfoXml() {
int zoom() const;
const double dar();
double projectDuration() const;
- void saveSceneList(const QString &path, QDomDocument sceneList);
+ bool saveSceneList(const QString &path, QDomDocument sceneList);
private:
KUrl m_url;
void MainWindow::saveFileAs(const QString &outputFileName) {
QDomDocument currentSceneList = m_projectMonitor->sceneList();
- m_activeDocument->saveSceneList(outputFileName, currentSceneList);
+ if (m_activeDocument->saveSceneList(outputFileName, currentSceneList) == false)
+ return;
m_activeDocument->setUrl(KUrl(outputFileName));
if (m_activeDocument->m_autosave == NULL) {
m_activeDocument->m_autosave = new KAutoSaveFile(KUrl(outputFileName), this);