[vlc-devel] commit: [Qt] move some static const int to enum (Jean-Baptiste Kempf )

git version control git at videolan.org
Mon Oct 20 01:47:37 CEST 2008


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Mon Oct 20 01:46:16 2008 +0200| [d0ed93fe655ea09cf10f0fc31c5bd0f543b3144b] | committer: Jean-Baptiste Kempf 

[Qt] move some static const int to enum

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d0ed93fe655ea09cf10f0fc31c5bd0f543b3144b
---

 modules/gui/qt4/components/extended_panels.hpp     |    1 -
 .../gui/qt4/components/playlist/playlist_model.hpp |   10 +++--
 modules/gui/qt4/components/simple_preferences.hpp  |    4 +-
 modules/gui/qt4/input_manager.hpp                  |   34 ++++++++++---------
 modules/gui/qt4/main_interface.hpp                 |    1 -
 modules/gui/qt4/qt4.hpp                            |   32 ++++++++++--------
 6 files changed, 44 insertions(+), 38 deletions(-)

diff --git a/modules/gui/qt4/components/extended_panels.hpp b/modules/gui/qt4/components/extended_panels.hpp
index aaffd02..41a18d1 100644
--- a/modules/gui/qt4/components/extended_panels.hpp
+++ b/modules/gui/qt4/components/extended_panels.hpp
@@ -37,7 +37,6 @@
 #include "ui/video_effects.h"
 #include "ui/v4l2.h"
 
-
 #include <QTabWidget>
 
 #define BANDS EQZ_BANDS_MAX
diff --git a/modules/gui/qt4/components/playlist/playlist_model.hpp b/modules/gui/qt4/components/playlist/playlist_model.hpp
index a097fa6..3f2d541 100644
--- a/modules/gui/qt4/components/playlist/playlist_model.hpp
+++ b/modules/gui/qt4/components/playlist/playlist_model.hpp
@@ -50,10 +50,12 @@ class PLItem;
 #define DEPTH_PL -1
 #define DEPTH_SEL 1
 
-static const int ItemUpdate_Type = QEvent::User + PLEventType + 2;
-static const int ItemDelete_Type = QEvent::User + PLEventType + 3;
-static const int ItemAppend_Type = QEvent::User + PLEventType + 4;
-static const int PLUpdate_Type   = QEvent::User + PLEventType + 5;
+enum {
+    ItemUpdate_Type = QEvent::User + PLEventType + 2,
+    ItemDelete_Type = QEvent::User + PLEventType + 3,
+    ItemAppend_Type = QEvent::User + PLEventType + 4,
+    PLUpdate_Type   = QEvent::User + PLEventType + 5,
+};
 
 class PLEvent : public QEvent
 {
diff --git a/modules/gui/qt4/components/simple_preferences.hpp b/modules/gui/qt4/components/simple_preferences.hpp
index e3414ab..8ec1676 100644
--- a/modules/gui/qt4/components/simple_preferences.hpp
+++ b/modules/gui/qt4/components/simple_preferences.hpp
@@ -55,9 +55,9 @@ enum {
 enum {
     CachingCustom = 0,
     CachingLowest = 100,
-    CachingLow = 200,
+    CachingLow    = 200,
     CachingNormal = 300,
-    CachingHigh = 400,
+    CachingHigh   = 400,
     CachingHigher = 500
 };
 
diff --git a/modules/gui/qt4/input_manager.hpp b/modules/gui/qt4/input_manager.hpp
index 609790d..9cda65c 100644
--- a/modules/gui/qt4/input_manager.hpp
+++ b/modules/gui/qt4/input_manager.hpp
@@ -36,21 +36,23 @@
 #include <QObject>
 #include <QEvent>
 
-static int const PositionUpdate_Type     = QEvent::User + IMEventType + 1;
-static int const ItemChanged_Type        = QEvent::User + IMEventType + 2;
-static int const ItemStateChanged_Type   = QEvent::User + IMEventType + 3;
-static int const ItemTitleChanged_Type   = QEvent::User + IMEventType + 4;
-static int const ItemRateChanged_Type    = QEvent::User + IMEventType + 5;
-static int const VolumeChanged_Type      = QEvent::User + IMEventType + 6;
-static int const ItemSpuChanged_Type     = QEvent::User + IMEventType + 7;
-static int const ItemTeletextChanged_Type= QEvent::User + IMEventType + 8;
-static int const InterfaceVoutUpdate_Type= QEvent::User + IMEventType + 9;
-static int const StatisticsUpdate_Type   = QEvent::User + IMEventType + 10;
-
-static int const FullscreenControlToggle_Type = QEvent::User + IMEventType + 11;
-static int const FullscreenControlShow_Type = QEvent::User + IMEventType + 12;
-static int const FullscreenControlHide_Type = QEvent::User + IMEventType + 13;
-static int const FullscreenControlPlanHide_Type = QEvent::User + IMEventType + 14;
+enum {
+    PositionUpdate_Type = QEvent::User + IMEventType + 1,
+    ItemChanged_Type,
+    ItemStateChanged_Type,
+    ItemTitleChanged_Type,
+    ItemRateChanged_Type,
+    VolumeChanged_Type,
+    ItemSpuChanged_Type,
+    ItemTeletextChanged_Type,
+    InterfaceVoutUpdate_Type,
+    StatisticsUpdate_Type,
+
+    FullscreenControlToggle_Type = QEvent::User + IMEventType + 20,
+    FullscreenControlShow_Type,
+    FullscreenControlHide_Type,
+    FullscreenControlPlanHide_Type,
+};
 
 class IMEvent : public QEvent
 {
@@ -102,7 +104,7 @@ private:
     void UpdateTeletext();
     void UpdateArt();
     void UpdateVout();
-    void UpdateStats(); // FIXME, remove from this file.
+    void UpdateStats();
 
     void AtoBLoop( int );
 
diff --git a/modules/gui/qt4/main_interface.hpp b/modules/gui/qt4/main_interface.hpp
index 8be4405..25b84e2 100644
--- a/modules/gui/qt4/main_interface.hpp
+++ b/modules/gui/qt4/main_interface.hpp
@@ -49,7 +49,6 @@ class FullscreenControllerWidget;
 class SpeedControlWidget;
 class QMenu;
 class QSize;
-//class QDockWidet;
 
 enum {
     CONTROLS_HIDDEN = 0x0,
diff --git a/modules/gui/qt4/qt4.hpp b/modules/gui/qt4/qt4.hpp
index e4adaba..7b75944 100755
--- a/modules/gui/qt4/qt4.hpp
+++ b/modules/gui/qt4/qt4.hpp
@@ -37,9 +37,24 @@
 
 #define HAS_QT43 ( QT_VERSION >= 0x040300 )
 
-#define QT_NORMAL_MODE 0
-#define QT_ALWAYS_VIDEO_MODE 1
-#define QT_MINIMAL_MODE 2
+enum {
+    QT_NORMAL_MODE = 0,
+    QT_ALWAYS_VIDEO_MODE,
+    QT_MINIMAL_MODE
+};
+
+enum {
+    DialogEventType = 0,
+    IMEventType     = 100,
+    PLEventType     = 200
+};
+
+enum {
+    DialogEvent_Type = QEvent::User + DialogEventType + 1,
+    //PLUndockEvent_Type = QEvent::User + DialogEventType + 2;
+    //PLDockEvent_Type = QEvent::User + DialogEventType + 3;
+    SetVideoOnTopEvent_Type = QEvent::User + DialogEventType + 4,
+};
 
 class QApplication;
 class QMenu;
@@ -123,12 +138,6 @@ struct intf_sys_t
 
 #define getSettings() p_intf->p_sys->mainSettings
 
-enum {
-    DialogEventType = 0,
-    IMEventType     = 100,
-    PLEventType     = 200
-};
-
 
 #include <QString>
 /* Replace separators on Windows because Qt is always using / */
@@ -153,11 +162,6 @@ static inline QString removeTrailingSlash( QString s )
 
 #define toNativeSepNoSlash( a ) toNativeSeparators( removeTrailingSlash( a ) )
 
-static const int DialogEvent_Type = QEvent::User + DialogEventType + 1;
-//static const int PLUndockEvent_Type = QEvent::User + DialogEventType + 2;
-//static const int PLDockEvent_Type = QEvent::User + DialogEventType + 3;
-static const int SetVideoOnTopEvent_Type = QEvent::User + DialogEventType + 4;
-
 class DialogEvent : public QEvent
 {
 public:




More information about the vlc-devel mailing list