From 3932297962d7394574346c016c38ef5103dc5a7c Mon Sep 17 00:00:00 2001 From: Jan Darmochwal Date: Thu, 7 Oct 2010 14:53:20 +0200 Subject: Support for command line arguments and conf files * anyoption has been replaced by getopt * replaces huge unmaintainable .cpp and .h files from an external source by standard POSIX library calls * I would suggest using Boost.Program_options if cross-platform support is needed * support user/global configuration file --- src/save_restore_session.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/save_restore_session.cpp') diff --git a/src/save_restore_session.cpp b/src/save_restore_session.cpp index ec292a2..3b0e8ab 100644 --- a/src/save_restore_session.cpp +++ b/src/save_restore_session.cpp @@ -1,11 +1,12 @@ +#include "save_restore_session.h" #include #include #include +#include "globals.h" void writeSessionName(QString name) { - // TODO: use constants - QDir saveFileDir(QDir::homePath() + "/.openslx"); - QString saveFileName("vmchooser_prev_session"); + QDir saveFileDir(QDir::homePath() + "/" + VMCHOOSER_USER_PATH); + QString saveFileName(VMCHOOSER_PREVIOUS_SESSION_FILE); if (! saveFileDir.exists()) { if (! saveFileDir.mkpath(saveFileDir.path())) { @@ -22,10 +23,10 @@ void writeSessionName(QString name) { } QString readSessionName() { - QString saveFileDir(QDir::homePath() + "/.openslx"); - QString saveFileName("vmchooser_prev_session"); + QDir saveFileDir(QDir::homePath() + "/" + VMCHOOSER_USER_PATH); + QString saveFileName(VMCHOOSER_PREVIOUS_SESSION_FILE); - QFile saveFile(saveFileDir + "/" + saveFileName); + QFile saveFile(saveFileDir.path() + "/" + saveFileName); if (saveFile.open(QIODevice::ReadOnly)) { return QString(saveFile.readAll()); -- cgit v1.2.3-55-g7522