[vlmc-devel] commit: Cleanup: Removed unused class/file (Hugo Beauzee-Luyssen )

git at videolan.org git at videolan.org
Thu Mar 11 18:37:09 CET 2010


vlmc | branch: master | Hugo Beauzee-Luyssen <beauze.h at gmail.com> | Thu Mar 11 18:29:28 2010 +0100| [36a005917e9ff4f7cbeb45ca652a75b642b0dab9] | committer: Hugo Beauzee-Luyssen 

Cleanup: Removed unused class/file

> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=36a005917e9ff4f7cbeb45ca652a75b642b0dab9
---

 src/CMakeLists.txt            |    2 -
 src/Gui/FileInfoListModel.cpp |   73 -----------------------------------------
 src/Gui/FileInfoListModel.h   |   26 --------------
 3 files changed, 0 insertions(+), 101 deletions(-)

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 0e341f3..d56377f 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -24,7 +24,6 @@ SET(VLMC_SRCS
     Gui/ClickableLabel.cpp
     Gui/ClipProperty.cpp
     Gui/DockWidgetManager.cpp
-    Gui/FileInfoListModel.cpp
     Gui/LanguageHelper.cpp
     Gui/LCDTimecode.cpp
     Gui/MainWindow.cpp
@@ -112,7 +111,6 @@ SET (VLMC_HDRS
     Gui/ClipProperty.h
     Gui/DockWidgetManager.h
     Gui/export/RendererSettings.h
-    Gui/FileInfoListModel.h
     Gui/import/ImportController.h
     Gui/LanguageHelper.h
     Gui/LCDTimecode.h
diff --git a/src/Gui/FileInfoListModel.cpp b/src/Gui/FileInfoListModel.cpp
deleted file mode 100644
index 25cb66b..0000000
--- a/src/Gui/FileInfoListModel.cpp
+++ /dev/null
@@ -1,73 +0,0 @@
-#include "FileInfoListModel.h"
-#include "QDebug"
-FileInfoListModel::FileInfoListModel( QObject* parent )
-        : QAbstractListModel( parent )
-{ }
-
-FileInfoListModel::FileInfoListModel(const QFileInfoList& fileInfoList, QObject* parent )
-        : QAbstractListModel( parent ), m_fileInfoList( fileInfoList )
-{ }
-
-int FileInfoListModel::rowCount( const QModelIndex& ) const
-{
-    return m_fileInfoList.count();
-}
-
-QVariant FileInfoListModel::data( const QModelIndex& index, int role ) const
-{
-    if ( !index.isValid() )
-        return QVariant();
-    if ( index.row() >= m_fileInfoList.size() )
-        return QVariant();
-    if ( role == Qt::DisplayRole )
-    {
-        // TODO: It's a hack that needs to be fixed
-        QFileInfo fileInfo = m_fileInfoList.at( index.row() );
-        return static_cast<QString>( fileInfo.fileName() );
-    }
-    else
-        return QVariant();
-}
-
-QVariant FileInfoListModel::headerData( int section, Qt::Orientation orientation, int role ) const
-{
-    if ( role != Qt::DisplayRole )
-        return QVariant();
-    if ( orientation == Qt::Horizontal )
-        return QString( "Column %1" ).arg( section );
-    else
-        return QString( "Row %1" ).arg( section );
-}
-
-Qt::ItemFlags FileInfoListModel::flags( const QModelIndex& index ) const
-{
-    if ( !index.isValid() )
-        return Qt::ItemIsEnabled;
-    return QAbstractItemModel::flags( index ) | Qt::ItemIsEditable;
-}
-
-bool FileInfoListModel::setData( const QModelIndex& index, const QVariant& value, int role )
-{
-    if ( index.isValid() && role == Qt::DisplayRole )
-    {
-        m_fileInfoList.replace( index.row(), value.toString() );
-        emit dataChanged( index, index );
-        return true;
-    }
-    return false;
-}
-
- void   FileInfoListModel::setFileInfoList( const QFileInfoList& fileInfoList )
- {
-    m_fileInfoList = fileInfoList;
-    reset();
- }
-
- QFileInfo  FileInfoListModel::fileInfo( const QModelIndex& index ) const
- {
-    if ( index.isValid() )
-    {
-        return m_fileInfoList[ index.row() ];
-    }
-    return QFileInfo();
- }
diff --git a/src/Gui/FileInfoListModel.h b/src/Gui/FileInfoListModel.h
deleted file mode 100644
index 2998e69..0000000
--- a/src/Gui/FileInfoListModel.h
+++ /dev/null
@@ -1,26 +0,0 @@
-#ifndef FILEINFOLISTMODEL_H
-#define FILEINFOLISTMODEL_H
-
-#include <QAbstractItemModel>
-#include <QFileInfoList>
-
-class FileInfoListModel : public QAbstractListModel
-{
-    Q_OBJECT
-
-    public:
-        FileInfoListModel( QObject* parent = 0 );
-        FileInfoListModel(const QFileInfoList& fileInfoList, QObject* parent = 0 );
-        int             rowCount( const QModelIndex& parent = QModelIndex() ) const;
-        QVariant        data( const QModelIndex& index, int role ) const;
-        QVariant        headerData( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const;
-        Qt::ItemFlags   flags( const QModelIndex& index ) const;
-        bool            setData( const QModelIndex& index, const QVariant& value, int role = Qt::EditRole );
-        void            setFileInfoList( const QFileInfoList& fileInfosList );
-        QFileInfo       fileInfo( const QModelIndex& index ) const;
-
-    private:
-        QFileInfoList   m_fileInfoList;
-    };
-
-#endif // FILEINFOLISTMODEL_H



More information about the Vlmc-devel mailing list