Commit da005d91 authored by Jan Möbius's avatar Jan Möbius
Browse files

Use OpenFlipper Settings for getting current Dir



git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@11166 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 7526604b
...@@ -150,8 +150,8 @@ void Core::saveSettings(){ ...@@ -150,8 +150,8 @@ void Core::saveSettings(){
} }
// Get the chosen directory and remember it. // Get the chosen directory and remember it.
QString newpath = complete_name.section(OpenFlipper::Options::dirSeparator(),0,-2); QFileInfo fileInfo(complete_name);
OpenFlipperSettings().setValue("Core/CurrentDir", newpath); OpenFlipperSettings().setValue("Core/CurrentDir", fileInfo.absolutePath() );
// ======================================================================================== // ========================================================================================
// update status information // update status information
...@@ -185,7 +185,7 @@ void Core::saveSettings(){ ...@@ -185,7 +185,7 @@ void Core::saveSettings(){
if ( saveAllBox->isChecked() ) if ( saveAllBox->isChecked() )
{ {
// Use path of settings file for all objects // Use path of settings file for all objects
filename = newpath + OpenFlipper::Options::dirSeparator() + o_it->name(); filename = fileInfo.absolutePath() + OpenFlipper::Options::dirSeparator() + o_it->name();
} }
else else
{ {
...@@ -194,8 +194,8 @@ void Core::saveSettings(){ ...@@ -194,8 +194,8 @@ void Core::saveSettings(){
// handle the case that the object was created in current session and not loaded from disk // handle the case that the object was created in current session and not loaded from disk
if (o_it->path() == ".") { if (o_it->path() == ".") {
filename = newpath + OpenFlipper::Options::dirSeparator() + o_it->name(); filename = fileInfo.absolutePath() + OpenFlipper::Options::dirSeparator() + o_it->name();
std::cerr << "newpath : " << newpath.toStdString() << std::endl; std::cerr << "newpath : " << fileInfo.absolutePath().toStdString() << std::endl;
std::cerr << "name : " << o_it->name().toStdString() << std::endl; std::cerr << "name : " << o_it->name().toStdString() << std::endl;
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment