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() {
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
coreWidget_->restoreState (windowStates.value("Core/Window/State").toByteArray ());
//try to restore the geometry
coreWidget_->restoreGeometry (windowStates.value("Core/Window/Geometry").toByteArray ());
if (statesFile.exists() ) {
QSettings windowStates(OpenFlipper::Options::configDirStr() + OpenFlipper::Options::dirSeparator() + "WindowStates.dat", QSettings::IniFormat);
coreWidget_->toolSplitter_->restoreState (windowStates.value("Core/ToolSplitter").toByteArray ());
coreWidget_->splitter_->restoreState (windowStates.value("Core/LogSplitter").toByteArray ());
//try to restore the windowState
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");
windowStates.beginGroup ("LogSlider");
coreWidget_->slidingLogger_->restoreState (windowStates);
windowStates.endGroup ();
coreWidget_->toolBox_->restoreState (windowStates);
windowStates.endGroup ();
applyOptions();
windowStates.beginGroup ("Core");
windowStates.beginGroup ("LogSlider");
coreWidget_->slidingLogger_->restoreState (windowStates);
windowStates.endGroup ();
coreWidget_->toolBox_->restoreState (windowStates);
windowStates.endGroup ();
} else {
coreWidget_->show();
applyOptions();
}
if ( OpenFlipperSettings().value("Core/Gui/splash",true).toBool() ) {
splash_->finish(coreWidget_);
......
......@@ -194,7 +194,7 @@ void Core::setupOptions() {
if ( localIni.exists() )
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);
// ==============================================================
......
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