Workaround missing kdenlive mimetype, should fix

http://www.kdenlive.org:80/mantis/view.php?id=329

svn path=/branches/KDE4/; revision=2691
parent d1ae3fa9
......@@ -949,7 +949,12 @@ void MainWindow::saveFileAs(const QString &outputFileName) {
}
void MainWindow::saveFileAs() {
QString outputFile = KFileDialog::getSaveFileName(KUrl(), "application/x-kdenlive");
// Check that the Kdenlive mime type is correctly installed
QString mimetype = "application/x-kdenlive";
KMimeType::Ptr mime = KMimeType::mimeType(mimetype);
if (!mime) mimetype = "*.kdenlive";
QString outputFile = KFileDialog::getSaveFileName(KUrl(), mimetype);
if (QFile::exists(outputFile)) {
if (KMessageBox::questionYesNo(this, i18n("File already exists.\nDo you want to overwrite it ?")) == KMessageBox::No) return;
}
......@@ -967,7 +972,12 @@ void MainWindow::saveFile() {
}
void MainWindow::openFile() {
KUrl url = KFileDialog::getOpenUrl(KUrl(), "application/x-kdenlive");
// Check that the Kdenlive mime type is correctly installed
QString mimetype = "application/x-kdenlive";
KMimeType::Ptr mime = KMimeType::mimeType(mimetype);
if (!mime) mimetype = "*.kdenlive";
KUrl url = KFileDialog::getOpenUrl(KUrl(), mimetype);
if (url.isEmpty()) return;
m_fileOpenRecent->addUrl(url);
openFile(url);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment