[vlc-commits] Qt: UpdateDialog: use dynamic event IDs
Francois Cartegnie
git at videolan.org
Fri Aug 17 19:14:52 CEST 2012
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Aug 17 19:09:30 2012 +0200| [1cc91766d9340fa3af52959d58bfbf68cc771691] | committer: Francois Cartegnie
Qt: UpdateDialog: use dynamic event IDs
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1cc91766d9340fa3af52959d58bfbf68cc771691
---
modules/gui/qt4/dialogs/help.cpp | 9 +++++++--
modules/gui/qt4/dialogs/help.hpp | 5 ++---
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/modules/gui/qt4/dialogs/help.cpp b/modules/gui/qt4/dialogs/help.cpp
index 903160a..602932e 100644
--- a/modules/gui/qt4/dialogs/help.cpp
+++ b/modules/gui/qt4/dialogs/help.cpp
@@ -141,13 +141,18 @@ static void UpdateCallback( void *data, bool b_ret )
QEvent* event;
if( b_ret )
- event = new QEvent( (QEvent::Type)UDOkEvent );
+ event = new QEvent( UpdateDialog::UDOkEvent );
else
- event = new QEvent( (QEvent::Type)UDErrorEvent );
+ event = new QEvent( UpdateDialog::UDErrorEvent );
QApplication::postEvent( UDialog, event );
}
+const QEvent::Type UpdateDialog::UDOkEvent =
+ (QEvent::Type)QEvent::registerEventType();
+const QEvent::Type UpdateDialog::UDErrorEvent =
+ (QEvent::Type)QEvent::registerEventType();
+
UpdateDialog::UpdateDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
{
/* build Ui */
diff --git a/modules/gui/qt4/dialogs/help.hpp b/modules/gui/qt4/dialogs/help.hpp
index bd09ae9..ca39bc3 100644
--- a/modules/gui/qt4/dialogs/help.hpp
+++ b/modules/gui/qt4/dialogs/help.hpp
@@ -65,13 +65,12 @@ public slots:
#ifdef UPDATE_CHECK
-static const int UDOkEvent = QEvent::User + DialogEventTypeOffset + 21;
-static const int UDErrorEvent = QEvent::User + DialogEventTypeOffset + 22;
-
class UpdateDialog : public QVLCFrame, public Singleton<UpdateDialog>
{
Q_OBJECT
public:
+ static const QEvent::Type UDOkEvent;
+ static const QEvent::Type UDErrorEvent;
void updateNotify( bool );
private:
More information about the vlc-commits
mailing list