Commit e30c653e authored by Jan Möbius's avatar Jan Möbius

Make sure windowsstates file exists before using it



git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@14013 383ad7c9-94d9-4d36-a494-682f7c89f535
parent d098feda
...@@ -581,26 +581,36 @@ Core::init() { ...@@ -581,26 +581,36 @@ Core::init() {
if ( OpenFlipper::Options::gui() ) { if ( OpenFlipper::Options::gui() ) {
QSettings windowStates(OpenFlipper::Options::configDirStr() + OpenFlipper::Options::dirSeparator() + "WindowStates.dat", QSettings::IniFormat); QFile statesFile(OpenFlipper::Options::configDirStr() + OpenFlipper::Options::dirSeparator() + "WindowStates.dat");
//try to restore the windowState if (statesFile.exists() ) {
coreWidget_->restoreState (windowStates.value("Core/Window/State").toByteArray ()); QSettings windowStates(OpenFlipper::Options::configDirStr() + OpenFlipper::Options::dirSeparator() + "WindowStates.dat", QSettings::IniFormat);
//try to restore the geometry
coreWidget_->restoreGeometry (windowStates.value("Core/Window/Geometry").toByteArray ());
coreWidget_->toolSplitter_->restoreState (windowStates.value("Core/ToolSplitter").toByteArray ()); //try to restore the windowState
coreWidget_->splitter_->restoreState (windowStates.value("Core/LogSplitter").toByteArray ()); coreWidget_->restoreState (windowStates.value("Core/Window/State").toByteArray ());
//try to restore the geometry
coreWidget_->restoreGeometry (windowStates.value("Core/Window/Geometry").toByteArray ());
coreWidget_->show(); coreWidget_->toolSplitter_->restoreState (windowStates.value("Core/ToolSplitter").toByteArray ());
coreWidget_->splitter_->restoreState (windowStates.value("Core/LogSplitter").toByteArray ());
applyOptions(); coreWidget_->show();
windowStates.beginGroup ("Core"); applyOptions();
windowStates.beginGroup ("LogSlider");
coreWidget_->slidingLogger_->restoreState (windowStates); windowStates.beginGroup ("Core");
windowStates.endGroup (); windowStates.beginGroup ("LogSlider");
coreWidget_->toolBox_->restoreState (windowStates); coreWidget_->slidingLogger_->restoreState (windowStates);
windowStates.endGroup (); windowStates.endGroup ();
coreWidget_->toolBox_->restoreState (windowStates);
windowStates.endGroup ();
} else {
coreWidget_->show();
applyOptions();
}
if ( OpenFlipperSettings().value("Core/Gui/splash",true).toBool() ) { if ( OpenFlipperSettings().value("Core/Gui/splash",true).toBool() ) {
splash_->finish(coreWidget_); splash_->finish(coreWidget_);
......
...@@ -194,7 +194,7 @@ void Core::setupOptions() { ...@@ -194,7 +194,7 @@ void Core::setupOptions() {
if ( localIni.exists() ) if ( localIni.exists() )
optionFiles.push_back(OpenFlipper::Options::configDirStr() + OpenFlipper::Options::dirSeparator() + "OpenFlipper.ini"); optionFiles.push_back(OpenFlipper::Options::configDirStr() + OpenFlipper::Options::dirSeparator() + "OpenFlipper.ini");
// Set the previously generated Optionfiles // Set the previously generated option files
OpenFlipper::Options::optionFiles(optionFiles); OpenFlipper::Options::optionFiles(optionFiles);
// ============================================================== // ==============================================================
......
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