client: Use QT_VERSION for 'enum class' fallback
authorShane Synan <digitalcircuit36939@gmail.com>
Sun, 17 Jun 2018 19:30:33 +0000 (14:30 -0500)
committerManuel Nickschas <sputnick@quassel-irc.org>
Sun, 17 Jun 2018 22:10:58 +0000 (00:10 +0200)
Use QT_VERSION macro for 'enum class' fallback, making it much
simpler to clean up the Qt4 code once the migration happens.

src/uisupport/uistyle.h

index a50519c..b87e221 100644 (file)
@@ -164,14 +164,17 @@ public:
     };
 
     /// Display of sender prefix modes
+#if QT_VERSION >= 0x050000
+    enum class SenderPrefixMode {
+#else
     enum SenderPrefixMode {
+#endif
         NoModes = 0,      ///< Hide sender modes
         HighestMode = 1,  ///< Show the highest active sender mode
         AllModes = 2      ///< Show all active sender modes
     };
     // Do not change SenderPrefixMode numbering without also adjusting
     // ChatViewSettingsPage::initSenderPrefixComboBox() and chatviewsettingspage.ui "defaultValue"
-    // TODO Qt5: Switch to "enum class"
 
     struct Format {
         FormatType type;