[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: extragear/multimedia/amarok/src/playlist/proxymodels
From: Teo Mrnjavac <teo.mrnjavac () gmail ! com>
Date: 2009-06-30 12:36:40
Message-ID: 1246365400.047609.27320.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 989505 by mrnjavac:
Moved flags(), mimeTypes() and mimeData() forwarders from the proxies to \
Playlist::ProxyBase.
M +0 -15 FilterProxy.cpp
M +0 -3 FilterProxy.h
M +0 -18 GroupingProxy.cpp
M +0 -3 GroupingProxy.h
M +20 -0 ProxyBase.cpp
M +21 -0 ProxyBase.h
M +0 -20 SortProxy.cpp
M +0 -20 SortProxy.h
--- trunk/extragear/multimedia/amarok/src/playlist/proxymodels/FilterProxy.cpp \
#989504:989505 @@ -237,21 +237,6 @@
return m_belowModel->supportedDropActions();
}
-Qt::ItemFlags FilterProxy::flags( const QModelIndex &index ) const
-{
- return m_belowModel->flags( index );
-}
-
-QStringList FilterProxy::mimeTypes() const
-{
- return m_belowModel->mimeTypes();
-}
-
-QMimeData * FilterProxy::mimeData( const QModelIndexList &index ) const
-{
- return m_belowModel->mimeData( index );
-}
-
void FilterProxy::setRowQueued( int row )
{
Model::instance()->setRowQueued( rowToSource( row ) );
--- trunk/extragear/multimedia/amarok/src/playlist/proxymodels/FilterProxy.h \
#989504:989505 @@ -103,9 +103,6 @@
Meta::TrackPtr trackAt( int row ) const;
Qt::DropActions supportedDropActions() const;
- Qt::ItemFlags flags( const QModelIndex& ) const;
- QStringList mimeTypes() const;
- QMimeData* mimeData( const QModelIndexList& ) const;
int totalLength() const;
--- trunk/extragear/multimedia/amarok/src/playlist/proxymodels/GroupingProxy.cpp \
#989504:989505 @@ -142,24 +142,6 @@
return m_belowModel->supportedDropActions();
}
-Qt::ItemFlags
-Playlist::GroupingProxy::flags( const QModelIndex &index ) const
-{
- return m_belowModel->flags( index );
-}
-
-QStringList
-Playlist::GroupingProxy::mimeTypes() const
-{
- return m_belowModel->mimeTypes();
-}
-
-QMimeData*
-Playlist::GroupingProxy::mimeData( const QModelIndexList& indexes ) const
-{
- return m_belowModel->mimeData( indexes );
-}
-
void
Playlist::GroupingProxy::setCollapsed( int, bool ) const
{
--- trunk/extragear/multimedia/amarok/src/playlist/proxymodels/GroupingProxy.h \
#989504:989505 @@ -78,9 +78,6 @@
void setActiveRow( int ) const;
Meta::TrackPtr trackAt( int ) const;
Qt::DropActions supportedDropActions() const;
- Qt::ItemFlags flags( const QModelIndex& ) const;
- QStringList mimeTypes() const;
- QMimeData* mimeData( const QModelIndexList& ) const;
// grouping-related functions
void setCollapsed( int, bool ) const;
--- trunk/extragear/multimedia/amarok/src/playlist/proxymodels/ProxyBase.cpp \
#989504:989505 @@ -112,6 +112,26 @@
return rowFromSource( m_belowModel->findPrevious( searchTerm, selectedRow, \
searchFields ) ); }
+Qt::ItemFlags
+ProxyBase::flags( const QModelIndex &index ) const
+{
+ //FIXME: This call is the same in all proxies but I think it should use a \
mapToSource() + // every time. Needs to be checked. -- Téo
+ return m_belowModel->flags( index );
+}
+
+QMimeData *
+ProxyBase::mimeData( const QModelIndexList &indexes ) const
+{
+ return m_belowModel->mimeData( indexes ); //TODO: probably needs mapToSource!
+}
+
+QStringList
+ProxyBase::mimeTypes() const
+{
+ return m_belowModel->mimeTypes();
+}
+
} //namespace Playlist
#include "ProxyBase.moc"
--- trunk/extragear/multimedia/amarok/src/playlist/proxymodels/ProxyBase.h \
#989504:989505 @@ -148,7 +148,28 @@
*/
virtual int findPrevious( const QString &searchTerm, int selectedRow, int \
searchFields );
+ /**
+ * Returns the item flags for the given index.
+ * @param index the index to retrieve the flags for.
+ * @return the item flags.
+ */
+ virtual Qt::ItemFlags flags( const QModelIndex& index ) const;
+ /**
+ * Returns an object that contains serialized items of data corresponding to the \
list + * of indexes specified.
+ * @param indexes a list of indexes.
+ * @return the MIME data corresponding to the indexes.
+ */
+ virtual QMimeData* mimeData( const QModelIndexList &indexes ) const;
+
+ /**
+ * Returns a list of MIME types that can be used to describe a list of model \
indexes. + * @return a QStringList of MIME types.
+ */
+ virtual QStringList mimeTypes() const;
+
+
//FIXME: When every proxy talks only to the proxy below it, these should be made \
protected // here and and in subclasses that reimplement them. For now, they \
have to be public // otherwise it won't compile. -- Téo 21/6/2009
--- trunk/extragear/multimedia/amarok/src/playlist/proxymodels/SortProxy.cpp \
#989504:989505 @@ -80,26 +80,6 @@
// pretty much just forward stuff through the stack of proxies start here.
// Please keep them sorted alphabetically. -- Téo
-Qt::ItemFlags
-SortProxy::flags( const QModelIndex &index ) const
-{
- //FIXME: This call is the same in all proxies but I think it should use a \
mapToSource()
- // every time. Needs to be checked. --Téo
- return m_belowModel->flags( index );
-}
-
-QMimeData *
-SortProxy::mimeData( const QModelIndexList &indexes ) const
-{
- return m_belowModel->mimeData( indexes ); //TODO: probably needs \
mapToSource!!!
-}
-
-QStringList
-SortProxy::mimeTypes() const
-{
- return m_belowModel->mimeTypes();
-}
-
int
SortProxy::rowCount(const QModelIndex& parent) const
{
--- trunk/extragear/multimedia/amarok/src/playlist/proxymodels/SortProxy.h \
#989504:989505 @@ -55,26 +55,6 @@
// Please keep them sorted alphabetically. -- To
/**
- * Returns the item flags for the given index.
- * @param index the index to retrieve the flags for.
- * @return the item flags.
- */
- Qt::ItemFlags flags( const QModelIndex& index ) const;
-
- /**
- * Returns an object that contains serialized items of data corresponding to the \
list of indexes specified.
- * @param indexes a list of indexes.
- * @return the MIME data corresponding to the indexes.
- */
- QMimeData* mimeData( const QModelIndexList &indexes ) const;
-
- /**
- * Returns a list of MIME types that can be used to describe a list of model \
indexes.
- * @return a QStringList of MIME types.
- */
- QStringList mimeTypes() const;
-
- /**
* Forwards the number of rows from the FilterProxy as SortProxy by definition \
shouldn't
* change the row count.
* @param parent the parent of the rows to count.
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic