[vlc-commits] Qt: PL/ML Model: Factorize zoom functions

Francois Cartegnie git at videolan.org
Thu Jul 19 14:23:23 CEST 2012


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Jul 18 21:43:21 2012 +0200| [b08027f1fa3c9918662af9b98a62f0279579e5b1] | committer: Francois Cartegnie

Qt: PL/ML Model: Factorize zoom functions

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

 modules/gui/qt4/components/playlist/playlist_model.cpp |   13 -------------
 modules/gui/qt4/components/playlist/playlist_model.hpp |    5 -----
 modules/gui/qt4/components/playlist/vlc_model.cpp      |   12 ++++++++++++
 modules/gui/qt4/components/playlist/vlc_model.hpp      |    5 ++++-
 4 files changed, 16 insertions(+), 19 deletions(-)

diff --git a/modules/gui/qt4/components/playlist/playlist_model.cpp b/modules/gui/qt4/components/playlist/playlist_model.cpp
index ca7b1e5..3fad26a 100644
--- a/modules/gui/qt4/components/playlist/playlist_model.cpp
+++ b/modules/gui/qt4/components/playlist/playlist_model.cpp
@@ -1215,19 +1215,6 @@ void PLModel::actionSlot( QAction *action )
     }
 }
 
-/* */
-void PLModel::increaseZoom()
-{
-    i_zoom++;
-    emit layoutChanged();
-}
-
-void PLModel::decreaseZoom()
-{
-    i_zoom--;
-    emit layoutChanged();
-}
-
 /******************* Drag and Drop helper class ******************/
 PlMimeData::~PlMimeData()
 {
diff --git a/modules/gui/qt4/components/playlist/playlist_model.hpp b/modules/gui/qt4/components/playlist/playlist_model.hpp
index 97daba8..897aa8f 100644
--- a/modules/gui/qt4/components/playlist/playlist_model.hpp
+++ b/modules/gui/qt4/components/playlist/playlist_model.hpp
@@ -181,9 +181,6 @@ private:
     int i_cached_id;
     int i_cached_input_id;
 
-    /* Zoom factor for font-size */
-    int i_zoom;
-
     /* */
     QString latestSearch;
 
@@ -194,8 +191,6 @@ private slots:
     void processItemAppend( int item, int parent );
     void commitBufferedRowInserts();
     void activateItem( playlist_item_t *p_item );
-    void increaseZoom();
-    void decreaseZoom();
 };
 
 class PlMimeData : public QMimeData
diff --git a/modules/gui/qt4/components/playlist/vlc_model.cpp b/modules/gui/qt4/components/playlist/vlc_model.cpp
index ede9773..6b88645 100644
--- a/modules/gui/qt4/components/playlist/vlc_model.cpp
+++ b/modules/gui/qt4/components/playlist/vlc_model.cpp
@@ -76,3 +76,15 @@ QPixmap VLCModel::getArtPixmap( const QModelIndex & index, const QSize & size )
 
     return artPix;
 }
+
+void VLCModel::increaseZoom()
+{
+    i_zoom++;
+    emit layoutChanged();
+}
+
+void VLCModel::decreaseZoom()
+{
+    i_zoom--;
+    emit layoutChanged();
+}
diff --git a/modules/gui/qt4/components/playlist/vlc_model.hpp b/modules/gui/qt4/components/playlist/vlc_model.hpp
index 3daf28a..3b7d047 100644
--- a/modules/gui/qt4/components/playlist/vlc_model.hpp
+++ b/modules/gui/qt4/components/playlist/vlc_model.hpp
@@ -115,10 +115,13 @@ public:
 public slots:
     virtual void activateItem( const QModelIndex &index ) = 0;
     virtual void actionSlot( QAction *action ) = 0;
+    void increaseZoom();
+    void decreaseZoom();
 
 protected:
     intf_thread_t *p_intf;
-
+    /* Zoom factor for font-size */
+    int i_zoom; /* FIXME: Probably should belong to View/Delegate */
 };
 
 Q_DECLARE_METATYPE(VLCModel::actionsContainerType)



More information about the vlc-commits mailing list