1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-21 00:09:47 +01:00

* Remove CollectionView which is replaced by TrackView.

This commit is contained in:
Christian Muehlhaeuser 2012-06-01 04:59:48 +02:00
parent bdab8bc1c8
commit 35fd077d01
3 changed files with 0 additions and 159 deletions

View File

@ -50,7 +50,6 @@ set( libGuiSources
playlist/TreeProxyModelPlaylistInterface.cpp
playlist/TreeHeader.cpp
playlist/TreeItemDelegate.cpp
playlist/CollectionView.cpp
playlist/PlaylistModel.cpp
playlist/PlaylistView.cpp
playlist/PlaylistItemDelegate.cpp

View File

@ -1,98 +0,0 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
* Copyright 2010-2011, Jeff Mitchell <jeff@tomahawk-player.org>
*
* Tomahawk is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Tomahawk is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
*/
#include "CollectionView.h"
#include <QDragEnterEvent>
#include <QPainter>
#include "PlayableModel.h"
#include "widgets/OverlayWidget.h"
#include "utils/Logger.h"
#include "Source.h"
using namespace Tomahawk;
CollectionView::CollectionView( QWidget* parent )
: TrackView( parent )
{
setProxyModel( new PlayableProxyModel( this ) );
setDragDropMode( QAbstractItemView::DragOnly );
}
CollectionView::~CollectionView()
{
qDebug() << Q_FUNC_INFO;
}
void
CollectionView::setModel( QAbstractItemModel* model )
{
Q_UNUSED( model );
qDebug() << "Explicitly use setPlayableModel instead";
Q_ASSERT( false );
}
void
CollectionView::setPlayableModel( PlayableModel* model )
{
TrackView::setPlayableModel( model );
setColumnHidden( PlayableModel::Score, true ); // Hide score column per default
setColumnHidden( PlayableModel::Origin, true ); // Hide origin column per default
setColumnHidden( PlayableModel::Composer, true ); //Hide composer column per default
setGuid( QString( "collectionview/%1" ).arg( model->columnCount() ) );
sortByColumn( PlayableModel::Artist, Qt::AscendingOrder );
connect( model, SIGNAL( trackCountChanged( unsigned int ) ), SLOT( onTrackCountChanged( unsigned int ) ) );
}
void
CollectionView::dragEnterEvent( QDragEnterEvent* event )
{
event->ignore();
}
void
CollectionView::onTrackCountChanged( unsigned int tracks )
{
if ( tracks == 0 )
{
overlay()->setText( tr( "This collection is empty." ) );
overlay()->show();
}
else
overlay()->hide();
}
bool
CollectionView::jumpToCurrentTrack()
{
scrollTo( proxyModel()->currentIndex(), QAbstractItemView::PositionAtCenter );
return true;
}

View File

@ -1,60 +0,0 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
* Copyright 2010-2012, Jeff Mitchell <jeff@tomahawk-player.org>
*
* Tomahawk is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Tomahawk is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef COLLECTIONVIEW_H
#define COLLECTIONVIEW_H
#include "PlayableModel.h"
#include "PlayableProxyModel.h"
#include "TrackView.h"
#include "ViewPage.h"
#include "DllMacro.h"
class DLLEXPORT CollectionView : public TrackView, public Tomahawk::ViewPage
{
Q_OBJECT
public:
explicit CollectionView( QWidget* parent = 0 );
~CollectionView();
virtual void setPlayableModel( PlayableModel* model );
virtual void setModel( QAbstractItemModel* model );
virtual QWidget* widget() { return this; }
virtual Tomahawk::playlistinterface_ptr playlistInterface() const { return proxyModel()->playlistInterface(); }
virtual QString title() const { return model()->title(); }
virtual QString description() const { return model()->description(); }
virtual QPixmap pixmap() const { return QPixmap( RESPATH "images/music-icon.png" ); }
virtual bool showModes() const { return true; }
virtual bool showFilter() const { return true; }
virtual bool jumpToCurrentTrack();
private slots:
void onTrackCountChanged( unsigned int tracks );
protected:
virtual void dragEnterEvent( QDragEnterEvent* event );
};
#endif // COLLECTIONVIEW_H