From 10923660851e14fc954dcb0917e9f50185ab401f Mon Sep 17 00:00:00 2001 From: Jonas Suhr Christensen Date: Fri, 2 May 2014 16:17:38 +0200 Subject: Saving path to last loaded raw files. --- dgedit/filelist.cc | 3 ++- dgedit/filelist.h | 1 + dgedit/mainwindow.cc | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) (limited to 'dgedit') diff --git a/dgedit/filelist.cc b/dgedit/filelist.cc index c8e3b79..d956c9c 100644 --- a/dgedit/filelist.cc +++ b/dgedit/filelist.cc @@ -48,12 +48,13 @@ FileList::FileList() void FileList::addFiles() { QStringList files = QFileDialog::getOpenFileNames(this, tr("Open file"), - "", tr("Audio Files (*.wav)")); + path, tr("Audio Files (*.wav)")); QStringList::Iterator i = files.begin(); while(i != files.end()) { QString file = *i; QFileInfo fi(file); QString name = fi.baseName(); + path = fi.absolutePath(); QListWidgetItem *item = new QListWidgetItem(); setItemFile(item, file); diff --git a/dgedit/filelist.h b/dgedit/filelist.h index 637ed6c..60d1693 100644 --- a/dgedit/filelist.h +++ b/dgedit/filelist.h @@ -37,6 +37,7 @@ Q_OBJECT public: FileList(); + QString path; signals: void masterFileChanged(QString filename); void fileAdded(QString file, QString name); diff --git a/dgedit/mainwindow.cc b/dgedit/mainwindow.cc index 0e154ed..0f9f833 100644 --- a/dgedit/mainwindow.cc +++ b/dgedit/mainwindow.cc @@ -470,6 +470,7 @@ void MainWindow::loadSettings() settings.beginGroup("MainWindow"); lineed_exportp->setText(settings.value("exportpath", "").toString()); + filelist->path = settings.value("loadpath", "").toString(); resize(settings.value("size", QSize(700, 800)).toSize()); move(settings.value("pos", QPoint(0, 0)).toPoint()); settings.endGroup(); @@ -480,6 +481,7 @@ void MainWindow::saveSettings() QSettings settings; settings.beginGroup("MainWindow"); + settings.setValue("loadpath", filelist->path); settings.setValue("exportpath", lineed_exportp->text()); settings.setValue("size", size()); settings.setValue("pos", pos()); -- cgit v1.2.3