Remember last folder for dvd projects

CCBUG: 96281
parent c2749e94
......@@ -29,6 +29,7 @@
#include <klocalizedstring.h>
#include <KMessageBox>
#include <KRecentDirs>
#include <QFile>
#include <QTimer>
......@@ -908,10 +909,12 @@ void DvdWizard::slotAbort()
void DvdWizard::slotSave()
{
QUrl url = QFileDialog::getSaveFileUrl(this, i18n("Save DVD Project"), QUrl::fromLocalFile(QDir::homePath()), i18n("DVD project (*.kdvd)"));
QString projectFolder = KRecentDirs::dir(":KdenliveDvdFolder");
if (projectFolder.isEmpty()) projectFolder = QDir::homePath();
QUrl url = QFileDialog::getSaveFileUrl(this, i18n("Save DVD Project"), QUrl::fromLocalFile(projectFolder), i18n("DVD project (*.kdvd)"));
if (!url.isValid())
return;
KRecentDirs::add(":KdenliveDvdFolder", url.adjusted(QUrl::RemoveFilename).path());
if (currentId() == 0)
m_pageChapters->setVobFiles(m_pageVob->dvdFormat(), m_pageVob->selectedUrls(), m_pageVob->durations(), m_pageVob->chapters());
......@@ -945,9 +948,12 @@ void DvdWizard::slotSave()
void DvdWizard::slotLoad()
{
const QUrl url = QFileDialog::getOpenFileUrl(this, QString(), QUrl::fromLocalFile(QDir::homePath()), i18n("DVD project (*.kdvd)"));
QString projectFolder = KRecentDirs::dir(":KdenliveDvdFolder");
if (projectFolder.isEmpty()) projectFolder = QDir::homePath();
const QUrl url = QFileDialog::getOpenFileUrl(this, QString(), QUrl::fromLocalFile(projectFolder), i18n("DVD project (*.kdvd)"));
if (!url.isValid())
return;
KRecentDirs::add(":KdenliveDvdFolder", url.adjusted(QUrl::RemoveFilename).path());
QDomDocument doc;
QFile file(url.path());
doc.setContent(&file, false);
......
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