intf_sys_t *p_sys = p_intf->p_sys;
var_Destroy (p_this->p_libvlc, "qt4-iface");
- QApplication::quit();
+ QVLCApp::triggerQuit();
vlc_join (p_sys->thread, NULL);
#ifdef Q_WS_X11
MsgEventType = 300,
};
-class QApplication;
+class QVLCApp;
class QMenu;
class MainInterface;
class QSettings;
{
vlc_thread_t thread;
- QApplication *p_app; /* Main Qt Application */
+ QVLCApp *p_app; /* Main Qt Application */
MainInterface *p_mi; /* Main Interface, NULL if DialogProvider Mode */
QSettings *mainSettings; /* Qt State settings not messing main VLC ones */
class QVLCApp : public QApplication
{
+ Q_OBJECT
+
public:
- QVLCApp( int & argc, char ** argv ) : QApplication( argc, argv, true ) { }
+ QVLCApp( int & argc, char ** argv ) : QApplication( argc, argv, true )
+ {
+ connect( this, SIGNAL(quitSignal()), this, SLOT(quit()) );
+ }
+
+ static void triggerQuit()
+ {
+ QVLCApp *app = qobject_cast<QVLCApp*>( instance() );
+ if ( app )
+ emit app->quitSignal();
+ }
#if defined (Q_WS_X11)
QVLCApp( Display *dp, int & argc, char ** argv )
: QApplication( dp, argc, argv )
{
+ connect( this, SIGNAL(quitSignal()), this, SLOT(quit()) );
}
#endif
return false;
}
#endif
+
+
+signals:
+ void quitSignal();
+
};
#endif