SVN commit 1356655 by brisset: BUG: 318144 Set the current directory at the right place so that the "fileRelative" attribute saved in the .kst file always works, even when kst2 is called from a different dir than the one where the .kst resides. Fix some indentation issues on the way. M +2 -1 document.cpp M +1 -5 mainwindow.cpp --- branches/work/kst/portto4/kst/src/libkstapp/document.cpp #1356654:1356655 @@ -232,7 +232,8 @@ _lastError = QObject::tr("File could not be opened for reading."); return false; } - + // Set the application dir to the current dir to be able to load data using the "fileRelative" attribute + QDir::setCurrent(file.left(file.lastIndexOf('/')) + '/'); _fileName = file; // If we move this into the block then we could, if desired, open --- branches/work/kst/portto4/kst/src/libkstapp/mainwindow.cpp #1356654:1356655 @@ -444,9 +444,6 @@ } void MainWindow::openFile(const QString &file) { - QDir::setCurrent(file.left(file.lastIndexOf('/')) + '/'); - QDir::setCurrent(file.left(file.lastIndexOf('/'))); - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); newDoc(true); // Does all the init stuff, but does not ask for override as it's supposed to be done elsewhere bool ok = _doc->open(file); @@ -464,8 +461,7 @@ } -void MainWindow::exportGraphicsFile( - const QString &filename, const QString &format, int width, int height, int display) { +void MainWindow::exportGraphicsFile(const QString &filename, const QString &format, int width, int height, int display) { int viewCount = 0; int n_views = _tabWidget->views().size(); for (int i_view = 0; i_view