[Kst] branches/work/kst/portto4/kst/src/libkstapp
Peter Kümmel
syntheticpp at gmx.net
Thu Aug 12 13:40:19 CEST 2010
SVN commit 1162652 by kuemmel:
remember last opened kst file
M +8 -1 mainwindow.cpp
--- branches/work/kst/portto4/kst/src/libkstapp/mainwindow.cpp #1162651:1162652
@@ -233,10 +233,17 @@
if (_doc->isChanged() && !promptSave()) {
return;
}
- QString fn = QFileDialog::getOpenFileName(this, tr("Kst: Open File"), _doc->fileName(), tr("Kst Sessions (*.kst)"));
+ QSettings settings("Kst2");
+ const QString lastKey = "lastOpenedKstFile";
+ QString fn = settings.value(lastKey).toString();
if (fn.isEmpty()) {
+ fn = _doc->fileName();
+ }
+ fn = QFileDialog::getOpenFileName(this, tr("Kst: Open File"), fn, tr("Kst Sessions (*.kst)"));
+ if (fn.isEmpty()) {
return;
}
+ settings.setValue(lastKey, fn);
QDir::setCurrent(fn.left(fn.lastIndexOf("/")));
openFile(fn);
setWindowTitle("Kst - " + fn);
More information about the Kst
mailing list