Commit 8b2d98ac authored by Mario Hlawitschka's avatar Mario Hlawitschka
Browse files

[STYLE] make style checker happy

parent 993b659a
......@@ -54,13 +54,13 @@ void WApplication::commitData( QSessionManager& manager ) // NOLINT
return;
}
WMainWindow* mainWindow = dynamic_cast<WMainWindow*>(myMainWidget);
WMainWindow* mainWindow = dynamic_cast<WMainWindow*>( myMainWidget );
if( !mainWindow )
{
manager.release(); // not our main class, can't store
return;
}
QApplication::commitData( manager );
if ( manager.allowsInteraction() )
{
......@@ -106,48 +106,49 @@ bool WApplication::notify( QObject* object, QEvent* event )
// do the default action, but catch exceptions
retval = QApplication::notify( object, event );
}
catch( WException &we )
catch( const WException &we )
{
QMessageBox msgBox( myMainWidget );
msgBox.setIcon( QMessageBox::Critical );
msgBox.setInformativeText( tr( "An uncaught exception occurred which may be due to a corrupt installation or a programming bug. "
"Please check the openwalnut bug reporter for similar tickets and report the issue including the following text:<br><br><i>" )
"Please check the openwalnut bug reporter for similar tickets and report the "
"issue including the following text:<br><br><i>" )
+ we.what() +
"</i><br><br>Please report to<br><a href=\""
OPENWALNUT_BUGREPORTER_URL
"\">" OPENWALNUT_BUGREPORTER_URL "</a>" );
msgBox.setText( tr( "Uncaught Exception" ) );
QPushButton* websiteButton = msgBox.addButton( tr("Go to web site"), QMessageBox::ActionRole );
QPushButton* websiteButton = msgBox.addButton( tr( "Go to web site" ), QMessageBox::ActionRole );
msgBox.setStandardButtons( QMessageBox::Ignore );
msgBox.setEscapeButton( QMessageBox::Ignore );
msgBox.exec();
if( msgBox.clickedButton() == websiteButton )
{
/* bool success = */ QDesktopServices::openUrl ( QUrl( OPENWALNUT_BUGREPORTER_URL ) );
/* bool success = */ QDesktopServices::openUrl( QUrl( OPENWALNUT_BUGREPORTER_URL ) );
}
}
catch( std::exception &se )
catch( const std::exception &se )
{
QMessageBox msgBox( myMainWidget );
msgBox.setIcon( QMessageBox::Critical );
msgBox.setInformativeText( tr( "An uncaught exception occurred which may be due to a corrupt installation or a programming bug. "
"Please check the openwalnut bug reporter for similar tickets and report the issue including the following text:<br><br><i>" )
"Please check the openwalnut bug reporter for similar tickets and report the "
"issue including the following text:<br><br><i>" )
+ se.what() +
"</i><br><br>Please report to<br><a href=\""
OPENWALNUT_BUGREPORTER_URL
"\">" OPENWALNUT_BUGREPORTER_URL "</a>" );
msgBox.setText( tr( "Uncaught Exception" ) );
QPushButton* websiteButton = msgBox.addButton( tr("Go to web site"), QMessageBox::ActionRole );
QPushButton* websiteButton = msgBox.addButton( tr( "Go to web site" ), QMessageBox::ActionRole );
msgBox.setStandardButtons( QMessageBox::Ignore );
msgBox.setEscapeButton( QMessageBox::Ignore );
msgBox.exec();
if( msgBox.clickedButton() == websiteButton )
{
/* bool success = */ QDesktopServices::openUrl ( QUrl( OPENWALNUT_BUGREPORTER_URL ) );
/* bool success = */ QDesktopServices::openUrl( QUrl( OPENWALNUT_BUGREPORTER_URL ) );
}
}
return retval;
}
......@@ -45,7 +45,7 @@ public:
* This is an overloaded function from QT.
*/
virtual void commitData( QSessionManager& manager ); // NOLINT
/**
* store the main widget for error reporting and session management
*/
......@@ -55,7 +55,7 @@ public:
* Overloaded to catch uncaught exceptions in event handlers and displays a bug-warning.
*/
virtual bool notify( QObject* receiver, QEvent* e );
protected:
QWidget* myMainWidget;
};
......
......@@ -147,9 +147,10 @@ int WQt4Gui::run()
//TODO(mario): this should run on all platforms but crashes at least on Linux right now. Therefore, I only use it on OSX
WApplication appl( m_argc, m_argv, true );
#else
QApplication appl( m_argc, m_argv, true ); // TODO( mario ): I want a WApplication here for session handling but that code crashes
// TODO( mario ): I want a WApplication here for session handling but that code crashes
QApplication appl( m_argc, m_argv, true );
#endif
// the call path of the application, this uses QApplication which needs to be instantiated.
boost::filesystem::path walnutBin = boost::filesystem::path( QApplication::applicationDirPath().toStdString() );
// setup path helper which provides several paths to others^
......
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