[vlmc-devel] Rename MediaLibrary UI class to MediaLibraryView

Hugo Beauzée-Luyssen git at videolan.org
Mon Jul 4 15:34:30 CEST 2016


vlmc | branch: medialibrary | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Thu Jun  2 09:26:57 2016 +0200| [87d54786a2e6f3d86caf2ea1a5473bbdfe2edbb7] | committer: Hugo Beauzée-Luyssen

Rename MediaLibrary UI class to MediaLibraryView

This is more of a workaround to allow a new MediaLibrary class to exist,
however I hope that we will be able to split VLMC in two components in
the future; at which point this commit should probably be reverted or
adapted

> https://code.videolan.org/videolan/vlmc/commit/87d54786a2e6f3d86caf2ea1a5473bbdfe2edbb7
---

 src/CMakeLists.txt                                 |  4 +--
 src/Gui/MainWindow.cpp                             |  4 +--
 src/Gui/MainWindow.h                               |  4 +--
 .../{MediaLibrary.cpp => MediaLibraryView.cpp}     | 32 +++++++++++-----------
 .../library/{MediaLibrary.h => MediaLibraryView.h} | 21 +++++++-------
 .../ui/{MediaLibrary.ui => MediaLibraryView.ui}    |  4 +--
 6 files changed, 35 insertions(+), 34 deletions(-)

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 4e09414..05eb06d 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -159,7 +159,7 @@ ELSE(NOT WITH_GUI)
         Gui/import/TagWidget.cpp
         Gui/library/ListViewController.cpp
         Gui/library/MediaCellView.cpp
-        Gui/library/MediaLibrary.cpp
+        Gui/library/MediaLibraryView.cpp
         Gui/library/MediaListView.cpp
         Gui/library/StackViewController.cpp
         Gui/library/StackViewNavController.cpp
@@ -219,7 +219,7 @@ ELSE(NOT WITH_GUI)
         Gui/import/ui/ImportController.ui
         Gui/import/ui/TagWidget.ui
         Gui/library/ui/MediaCellView.ui
-        Gui/library/ui/MediaLibrary.ui
+        Gui/library/ui/MediaLibraryView.ui
         Gui/library/ui/StackViewNavController.ui
         Gui/media/ui/ClipMetadataDisplayer.ui
         Gui/preview/ui/PreviewWidget.ui
diff --git a/src/Gui/MainWindow.cpp b/src/Gui/MainWindow.cpp
index c77a2f1..473bc4c 100644
--- a/src/Gui/MainWindow.cpp
+++ b/src/Gui/MainWindow.cpp
@@ -54,7 +54,7 @@
 /* Widgets */
 #include "effectsengine/EffectsListView.h"
 #include "import/ImportController.h"
-#include "library/MediaLibrary.h"
+#include "library/MediaLibraryView.h"
 #include "widgets/NotificationZone.h"
 #include "preview/PreviewWidget.h"
 #include "timeline/Timeline.h"
@@ -460,7 +460,7 @@ MainWindow::setupEffectsList()
 void
 MainWindow::setupLibrary()
 {
-    m_mediaLibrary = new MediaLibrary;
+    m_mediaLibrary = new MediaLibraryView;
     m_dockedLibrary = dockWidget( m_mediaLibrary, Qt::TopDockWidgetArea );
 }
 
diff --git a/src/Gui/MainWindow.h b/src/Gui/MainWindow.h
index bc58f6e..bfab377 100644
--- a/src/Gui/MainWindow.h
+++ b/src/Gui/MainWindow.h
@@ -37,7 +37,7 @@ class QUndoView;
 
 class   EffectsListView;
 class   ImportController;
-class   MediaLibrary;
+class   MediaLibraryView;
 class   PreviewWidget;
 class   Project;
 class   ProjectWizard;
@@ -129,7 +129,7 @@ private:
     SettingsDialog*         m_projectPreferences;
     ProjectWizard*          m_wizard;
     ImportController*       m_importController;
-    MediaLibrary            *m_mediaLibrary;
+    MediaLibraryView            *m_mediaLibrary;
     EffectsListView*        m_effectsList;
     QUndoView*              m_undoView;
     QDockWidget*            m_dockedUndoView;
diff --git a/src/Gui/library/MediaLibrary.cpp b/src/Gui/library/MediaLibraryView.cpp
similarity index 85%
rename from src/Gui/library/MediaLibrary.cpp
rename to src/Gui/library/MediaLibraryView.cpp
index 8f5dd45..67bbb95 100644
--- a/src/Gui/library/MediaLibrary.cpp
+++ b/src/Gui/library/MediaLibraryView.cpp
@@ -20,7 +20,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
-#include "MediaLibrary.h"
+#include "MediaLibraryView.h"
 
 #include "Project/Project.h"
 #include "Media/Clip.h"
@@ -36,8 +36,8 @@
 #include <QUrl>
 #include <QMimeData>
 
-MediaLibrary::MediaLibrary(QWidget *parent) : QWidget(parent),
-    m_ui( new Ui::MediaLibrary() )
+MediaLibraryView::MediaLibraryView(QWidget *parent) : QWidget(parent),
+    m_ui( new Ui::MediaLibraryView() )
 {
     m_ui->setupUi( this );
     setAcceptDrops( true );
@@ -58,13 +58,13 @@ MediaLibrary::MediaLibrary(QWidget *parent) : QWidget(parent),
              this, SLOT( filterTypeChanged() ) );
 }
 
-MediaLibrary::~MediaLibrary()
+MediaLibraryView::~MediaLibraryView()
 {
     delete m_ui;
 }
 
 void
-MediaLibrary::changeEvent( QEvent *e )
+MediaLibraryView::changeEvent( QEvent *e )
 {
     QWidget::changeEvent( e );
     switch ( e->type() )
@@ -78,7 +78,7 @@ MediaLibrary::changeEvent( QEvent *e )
 }
 
 void
-MediaLibrary::filterUpdated( const QString &filter )
+MediaLibraryView::filterUpdated( const QString &filter )
 {
     const MediaListView::MediaList              &medias = m_mediaListView->mediaList();
     MediaListView::MediaList::const_iterator    it = medias.begin();
@@ -93,8 +93,8 @@ MediaLibrary::filterUpdated( const QString &filter )
     }
 }
 
-MediaLibrary::Filter
-MediaLibrary::currentFilter()
+MediaLibraryView::Filter
+MediaLibraryView::currentFilter()
 {
     switch ( m_ui->filterType->currentIndex() )
     {
@@ -108,7 +108,7 @@ MediaLibrary::currentFilter()
 }
 
 void
-MediaLibrary::viewChanged( ViewController *view )
+MediaLibraryView::viewChanged( ViewController *view )
 {
     MediaListView       *mlv = qobject_cast<MediaListView*>( view );
 
@@ -121,25 +121,25 @@ MediaLibrary::viewChanged( ViewController *view )
 }
 
 bool
-MediaLibrary::filterByName( const Clip *clip, const QString &filter )
+MediaLibraryView::filterByName( const Clip *clip, const QString &filter )
 {
     return ( clip->media()->fileName().contains( filter, Qt::CaseInsensitive ) );
 }
 
 bool
-MediaLibrary::filterByTags( const Clip *clip, const QString &filter )
+MediaLibraryView::filterByTags( const Clip *clip, const QString &filter )
 {
     return ( clip->matchMetaTag( filter ) );
 }
 
 void
-MediaLibrary::filterTypeChanged()
+MediaLibraryView::filterTypeChanged()
 {
     filterUpdated( m_ui->filterInput->text() );
 }
 
 void
-MediaLibrary::dragEnterEvent( QDragEnterEvent *event )
+MediaLibraryView::dragEnterEvent( QDragEnterEvent *event )
 {
     if ( event->mimeData()->hasFormat( "text/uri-list" ) )
     {
@@ -150,19 +150,19 @@ MediaLibrary::dragEnterEvent( QDragEnterEvent *event )
 }
 
 void
-MediaLibrary::dragMoveEvent( QDragMoveEvent *event )
+MediaLibraryView::dragMoveEvent( QDragMoveEvent *event )
 {
     event->acceptProposedAction();
 }
 
 void
-MediaLibrary::dragLeaveEvent( QDragLeaveEvent *event )
+MediaLibraryView::dragLeaveEvent( QDragLeaveEvent *event )
 {
    event->accept();
 }
 
 void
-MediaLibrary::dropEvent( QDropEvent *event )
+MediaLibraryView::dropEvent( QDropEvent *event )
 {
     const QList<QUrl>         &fileList = event->mimeData()->urls();
 
diff --git a/src/Gui/library/MediaLibrary.h b/src/Gui/library/MediaLibraryView.h
similarity index 87%
rename from src/Gui/library/MediaLibrary.h
rename to src/Gui/library/MediaLibraryView.h
index 6bb8313..3c5013e 100644
--- a/src/Gui/library/MediaLibrary.h
+++ b/src/Gui/library/MediaLibraryView.h
@@ -20,26 +20,27 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
-#ifndef MEDIALIBRARY_H
-#define MEDIALIBRARY_H
+#ifndef MEDIALIBRARYVIEW_H
+#define MEDIALIBRARYVIEW_H
 
 #include <QWidget>
 
-#include "ui_MediaLibrary.h"
+#include "ui_MediaLibraryView.h"
+
 class   Clip;
 class   MediaListView;
 class   MediaContainer;
 class   ViewController;
 
-class MediaLibrary : public QWidget
+class MediaLibraryView : public QWidget
 {
     Q_OBJECT
-    Q_DISABLE_COPY( MediaLibrary );
+    Q_DISABLE_COPY( MediaLibraryView );
 
     public:
         typedef bool    (*Filter)( const Clip*, const QString& filter );
-        explicit MediaLibrary( QWidget *parent = 0);
-        virtual ~MediaLibrary();
+        explicit MediaLibraryView( QWidget *parent = 0);
+        virtual ~MediaLibraryView();
 
     protected:
         void        dragEnterEvent( QDragEnterEvent *event );
@@ -62,8 +63,8 @@ class MediaLibrary : public QWidget
         static bool         filterByTags( const Clip *clip, const QString &filter );
 
     private:
-        Ui::MediaLibrary    *m_ui;
-        MediaListView       *m_mediaListView;
+        Ui::MediaLibraryView *m_ui;
+        MediaListView        *m_mediaListView;
 
     private slots:
         void                filterUpdated( const QString &filter );
@@ -80,4 +81,4 @@ class MediaLibrary : public QWidget
         void                clipSelected( Clip* );
 };
 
-#endif // MEDIALIBRARY_H
+#endif // MEDIALIBRARYVIEW_H
diff --git a/src/Gui/library/ui/MediaLibrary.ui b/src/Gui/library/ui/MediaLibraryView.ui
similarity index 95%
rename from src/Gui/library/ui/MediaLibrary.ui
rename to src/Gui/library/ui/MediaLibraryView.ui
index 14c2710..4c57bee 100644
--- a/src/Gui/library/ui/MediaLibrary.ui
+++ b/src/Gui/library/ui/MediaLibraryView.ui
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <ui version="4.0">
- <class>MediaLibrary</class>
- <widget class="QWidget" name="MediaLibrary">
+ <class>MediaLibraryView</class>
+ <widget class="QWidget" name="MediaLibraryView">
   <property name="geometry">
    <rect>
     <x>0</x>



More information about the Vlmc-devel mailing list