mirror of
https://github.com/TomHarte/CLK.git
synced 2024-11-22 12:33:29 +00:00
Preserves open path between launches.
This commit is contained in:
parent
c5d8d9127b
commit
782a62585e
@ -74,8 +74,13 @@ void MainWindow::createActions() {
|
||||
}
|
||||
|
||||
void MainWindow::open() {
|
||||
QString fileName = QFileDialog::getOpenFileName(this);
|
||||
Settings settings;
|
||||
|
||||
// Use the Settings to get a default open path; write it back afterwards.
|
||||
QString fileName = QFileDialog::getOpenFileName(this, tr("Open..."), settings.value("openPath").toString());
|
||||
if(!fileName.isEmpty()) {
|
||||
settings.setValue("openPath", QFileInfo(fileName).absoluteDir().path());
|
||||
|
||||
// My understanding of SDI: if a file was opened for a 'vacant' window, launch it directly there;
|
||||
// otherwise create a new window for it.
|
||||
if(machine) {
|
||||
|
Loading…
Reference in New Issue
Block a user