# HG changeset patch # User Andre Heinecke # Date 1430919702 -7200 # Node ID 58f1b3c330afb69cd3da66ac51bd625dd17547a4 # Parent 179239c94740eb98ffc793d65af01744d9f500c1 (issue9) Show maximized by default If the Window geometry is not saved show maximized otherwise restore the Window state / geometry. diff -r 179239c94740 -r 58f1b3c330af src/mainwindow.cpp --- a/src/mainwindow.cpp Wed May 06 15:31:54 2015 +0200 +++ b/src/mainwindow.cpp Wed May 06 15:41:42 2015 +0200 @@ -84,8 +84,10 @@ } void MainWindow::readSettings() { - restoreGeometry(mSettings.value("geometry").toByteArray()); - restoreState(mSettings.value("windowState").toByteArray()); + if (mSettings.contains("geometry")) { + restoreGeometry(mSettings.value("geometry").toByteArray()); + restoreState(mSettings.value("windowState").toByteArray()); + } } /* void MainWindow::dragEnterEvent(QDragEnterEvent *event) @@ -155,7 +157,13 @@ mCurFolder = folder; mPlayer->setBaseDir(folder); mDataView->selectNextRow(); - show(); + if (!mSettings.contains("geometry")) { + qDebug() << "Showing maximized"; + show(); + showMaximized(); + } else { + show(); + } } void MainWindow::showPictureNameStatus(const QString& fileName, int current,