[vlc-devel] [PATCH 3/8] gui/qt: qt.hpp: remove macro TOGGLEV

Filip Roséen filip at atch.se
Mon Mar 20 13:41:53 CET 2017


The macro is only used at one location, and as such there is no need
for the define to exist in qt.hpp.
---
 modules/gui/qt/components/interface_widgets.hpp | 2 +-
 modules/gui/qt/qt.hpp                           | 3 ---
 2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/modules/gui/qt/components/interface_widgets.hpp b/modules/gui/qt/components/interface_widgets.hpp
index 40363002ff..ca2926c49c 100644
--- a/modules/gui/qt/components/interface_widgets.hpp
+++ b/modules/gui/qt/components/interface_widgets.hpp
@@ -114,7 +114,7 @@ protected:
     static const int MARGIN = 5;
     QString defaultArt;
 public slots:
-    void toggle(){ TOGGLEV( this ); }
+    void toggle(){ isVisible() ? hide() : show(); }
     void updateArt( const QString& );
 };
 
diff --git a/modules/gui/qt/qt.hpp b/modules/gui/qt/qt.hpp
index f4c1d15959..e077a5b288 100644
--- a/modules/gui/qt/qt.hpp
+++ b/modules/gui/qt/qt.hpp
@@ -153,9 +153,6 @@ struct vlc_playlist_locker {
 
 #define VISIBLE(i) (i && i->isVisible())
 
-#define TOGGLEV( x ) { if( x->isVisible() ) x->hide();          \
-            else  x->show(); }
-
 /* for widgets which must not follow the RTL auto layout changes */
 #define RTL_UNAFFECTED_WIDGET setLayoutDirection( Qt::LeftToRight );
 
-- 
2.12.0


More information about the vlc-devel mailing list