summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Baptiste Mardelle <jb@kdenlive.org>2016-12-07 08:46:02 (GMT)
committerJean-Baptiste Mardelle <jb@kdenlive.org>2016-12-07 09:40:30 (GMT)
commitf8696c813c9952274c0f5c416688abab5c4a1193 (patch)
tree509b3ea80ee24f0d8a252a9f131d9b49ef422a2f
parentbf0e20855c7021a78352cbc60eff25a4c8adedcd (diff)
Fix broken generators (mimetype not added on non KDE Desktop)
BUG: 371798
-rw-r--r--data/westley.xml2
-rw-r--r--src/bin/generators/generators.cpp12
-rw-r--r--src/project/projectmanager.cpp7
3 files changed, 14 insertions, 7 deletions
diff --git a/data/westley.xml b/data/westley.xml
index e419150..27f3250 100644
--- a/data/westley.xml
+++ b/data/westley.xml
@@ -3,7 +3,7 @@
<mime-type type="video/mlt-playlist">
<comment>MLT video playlist</comment>
<sub-class-of type="application/xml"/>
- <glob pattern="*.westley"/>
<glob pattern="*.mlt"/>
+ <glob pattern="*.westley"/>
</mime-type>
</mime-info>
diff --git a/src/bin/generators/generators.cpp b/src/bin/generators/generators.cpp
index 03f1479..9c316b4 100644
--- a/src/bin/generators/generators.cpp
+++ b/src/bin/generators/generators.cpp
@@ -161,7 +161,17 @@ QUrl Generators::getSavedClip(QString clipFolder)
if (clipFolder.isEmpty()) {
clipFolder = QDir::homePath();
}
- QUrl url = QFileDialog::getSaveFileUrl(this, i18n("Save clip"), QUrl::fromLocalFile(clipFolder), i18n("MLT playlist (*.mlt)"));
+ QFileDialog fd(this);
+ fd.setDirectory(clipFolder);
+ fd.setNameFilter(i18n("MLT playlist (*.mlt)"));
+ fd.setAcceptMode(QFileDialog::AcceptSave);
+ fd.setFileMode(QFileDialog::AnyFile);
+ fd.setDefaultSuffix(QStringLiteral("mlt"));
+ if (fd.exec() != QDialog::Accepted || fd.selectedUrls().isEmpty()) {
+ return QUrl();
+ }
+ QUrl url = fd.selectedUrls().first();
+
if (url.isValid()) {
#if KXMLGUI_VERSION_MINOR < 23 && KXMLGUI_VERSION_MAJOR == 5
// Since Plasma 5.7 (release at same time as KF 5.23,
diff --git a/src/project/projectmanager.cpp b/src/project/projectmanager.cpp
index 4f52cf7..9897cec 100644
--- a/src/project/projectmanager.cpp
+++ b/src/project/projectmanager.cpp
@@ -341,13 +341,10 @@ bool ProjectManager::saveFileAs()
fd.setAcceptMode(QFileDialog::AcceptSave);
fd.setFileMode(QFileDialog::AnyFile);
fd.setDefaultSuffix(QStringLiteral("kdenlive"));
- if (fd.exec() != QDialog::Accepted) {
+ if (fd.exec() != QDialog::Accepted || fd.selectedFiles().isEmpty()) {
return false;
}
- if (fd.selectedFiles().isEmpty()) {
- return false;
- }
- QString outputFile = fd.selectedFiles().at(0);
+ QString outputFile = fd.selectedFiles().first();
#if KXMLGUI_VERSION_MINOR < 23 && KXMLGUI_VERSION_MAJOR == 5
// Since Plasma 5.7 (release at same time as KF 5.23,