Skip to content

Commit

Permalink
Qt4/Qt5 neutral changes:
Browse files Browse the repository at this point in the history
connect to commitDataRequest signal for session management
  • Loading branch information
wwmayer committed Dec 23, 2016
1 parent fd1c42b commit de9aa48
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/Gui/GuiApplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ using namespace Gui;
GUIApplication::GUIApplication(int & argc, char ** argv)
: GUIApplicationNativeEventAware(argc, argv)
{
connect(this, SIGNAL(commitDataRequest(QSessionManager &)),
SLOT(slotCommitData(QSessionManager &)), Qt::DirectConnection);
}

GUIApplication::~GUIApplication()
Expand Down Expand Up @@ -130,7 +132,7 @@ bool GUIApplication::notify (QObject * receiver, QEvent * event)
return true;
}

void GUIApplication::commitData(QSessionManager &manager)
void GUIApplication::slotCommitData(QSessionManager &manager)
{
if (manager.allowsInteraction()) {
if (!Gui::getMainWindow()->close()) {
Expand Down
4 changes: 3 additions & 1 deletion src/Gui/GuiApplication.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,13 @@ class GUIApplication : public GUIApplicationNativeEventAware
* where an unhandled exception comes from.
*/
bool notify (QObject * receiver, QEvent * event);
void commitData(QSessionManager &manager);

/// Pointer to exceptions caught in Qt event handler
boost::shared_ptr<Base::SystemExitException> caughtException;

public Q_SLOTS:
void slotCommitData(QSessionManager &manager);

protected:
bool event(QEvent * event);
};
Expand Down

0 comments on commit de9aa48

Please sign in to comment.