Commit fb5f477d authored by Mario Hlawitschka's avatar Mario Hlawitschka
Browse files

[STYLE] comply with ow style checker.

parent 09ca7b89
//---------------------------------------------------------------------------
//
// Project: OpenWalnut ( http://www.openwalnut.org )
//
// Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
// For more information see http://www.openwalnut.org/copying
//
// This file is part of OpenWalnut.
//
// OpenWalnut is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// OpenWalnut is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
//
//---------------------------------------------------------------------------
#include <QtGui/QtGui>
#include "WMainWindow.h"
......@@ -15,11 +39,11 @@ void WApplication::setMainWindow( WMainWindow* window )
mainWindow = window;
}
void WApplication::commitData( QSessionManager& manager )
void WApplication::commitData( QSessionManager& manager ) // NOLINT
{
if ( manager.allowsInteraction() )
{
int ret = QMessageBox::warning(
int ret = QMessageBox::warning(
mainWindow,
tr( "OpenWalnut" ),
tr( "Save changes?" ),
......@@ -27,8 +51,16 @@ void WApplication::commitData( QSessionManager& manager )
switch ( ret )
{
case QMessageBox::Save:
manager.release();
mainWindow->projectSaveAll();
if ( mainWindow->projectSaveAll() )
{
// we want to save and saving was successful, we are ready!
manager.release();
}
else
{
// if we want to save but saving failed, cancel action
manager.cancel();
}
break;
case QMessageBox::Discard:
break;
......
......@@ -44,8 +44,10 @@ public:
/** manage save dialogs when the session manager asks us to
* take care of our data */
virtual void commitData( QSessionManager& manager );
* take care of our data.
* This is an overloaded function from QT.
*/
virtual void commitData( QSessionManager& manager ); // NOLINT
protected:
WMainWindow* mainWindow;
......
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