[vlc-commits] Qt: use dynamic ID for DialogEvent
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:03:16 2012 +0200| [11279e38852c23e7e225998daa24686feb3405dc] | committer: Francois Cartegnie
Qt: use dynamic ID for DialogEvent
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=11279e38852c23e7e225998daa24686feb3405dc
---
modules/gui/qt4/dialogs_provider.cpp | 5 ++++-
modules/gui/qt4/dialogs_provider.hpp | 10 ++--------
2 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/modules/gui/qt4/dialogs_provider.cpp b/modules/gui/qt4/dialogs_provider.cpp
index 978b23d..600c0d4 100644
--- a/modules/gui/qt4/dialogs_provider.cpp
+++ b/modules/gui/qt4/dialogs_provider.cpp
@@ -117,7 +117,7 @@ void DialogsProvider::quit()
void DialogsProvider::customEvent( QEvent *event )
{
- if( event->type() == (int)DialogEvent_Type )
+ if( event->type() == DialogEvent::DialogEvent_Type )
{
DialogEvent *de = static_cast<DialogEvent*>(event);
switch( de->i_dialog )
@@ -178,6 +178,9 @@ void DialogsProvider::customEvent( QEvent *event )
/****************************************************************************
* Individual simple dialogs
****************************************************************************/
+const QEvent::Type DialogEvent::DialogEvent_Type =
+ (QEvent::Type)QEvent::registerEventType();
+
void DialogsProvider::playlistDialog()
{
PlaylistDialog::getInstance( p_intf )->toggleVisible();
diff --git a/modules/gui/qt4/dialogs_provider.hpp b/modules/gui/qt4/dialogs_provider.hpp
index 57cc38d..f1f6a53 100644
--- a/modules/gui/qt4/dialogs_provider.hpp
+++ b/modules/gui/qt4/dialogs_provider.hpp
@@ -57,13 +57,6 @@ enum {
EXT_FILTER_SUBTITLE = 0x10,
};
-enum {
- DialogEvent_Type = QEvent::User + DialogEventTypeOffset + 1,
- //PLUndockEvent_Type = QEvent::User + DialogEventType + 2;
- //PLDockEvent_Type = QEvent::User + DialogEventType + 3;
- SetVideoOnTopEvent_Type = QEvent::User + DialogEventTypeOffset + 4,
-};
-
class QEvent;
class QSignalMapper;
class VLCMenuBar;
@@ -186,8 +179,9 @@ signals:
class DialogEvent : public QEvent
{
public:
+ static const QEvent::Type DialogEvent_Type;
DialogEvent( int _i_dialog, int _i_arg, intf_dialog_args_t *_p_arg ) :
- QEvent( (QEvent::Type)(DialogEvent_Type) )
+ QEvent( DialogEvent_Type )
{
i_dialog = _i_dialog;
i_arg = _i_arg;
More information about the vlc-commits
mailing list