1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-19 07:19:42 +01:00

* More natural job view order.

This commit is contained in:
Christian Muehlhaeuser 2011-11-28 10:37:55 +01:00
parent 2585467f0a
commit ffe30498cb
2 changed files with 14 additions and 7 deletions

View File

@ -21,18 +21,21 @@
#include "JobStatusItem.h"
#include "utils/logger.h"
JobStatusModel::JobStatusModel( QObject* parent )
: QAbstractListModel ( parent )
{
}
JobStatusModel::~JobStatusModel()
{
qDeleteAll( m_items );
m_collapseCount.clear();
}
void
JobStatusModel::addJob( JobStatusItem* item )
{
@ -55,11 +58,12 @@ JobStatusModel::addJob( JobStatusItem* item )
}
qDebug() << "Adding item:" << item;
beginInsertRows( QModelIndex(), 0, 0 );
m_items.prepend( item );
beginInsertRows( QModelIndex(), m_items.count() - 1, m_items.count() );
m_items.append( item );
endInsertRows();
}
Qt::ItemFlags
JobStatusModel::flags( const QModelIndex& index ) const
{
@ -101,6 +105,7 @@ JobStatusModel::data( const QModelIndex& index, int role ) const
return QVariant();
}
int
JobStatusModel::rowCount( const QModelIndex& parent ) const
{
@ -165,6 +170,7 @@ JobStatusModel::itemFinished()
item->deleteLater();
}
void
JobStatusModel::itemUpdated()
{

View File

@ -19,23 +19,22 @@
#include "JobStatusView.h"
#include "libtomahawk/pipeline.h"
#include "pipeline.h"
#include "JobStatusModel.h"
#include "JobStatusDelegate.h"
#include "PipelineStatusItem.h"
#include "TransferStatusItem.h"
#include "LatchedStatusItem.h"
#include "utils/logger.h"
#include <QHeaderView>
#include <QVBoxLayout>
#include <QListView>
#include <QAbstractItemModel>
#include "TransferStatusItem.h"
#include "LatchedStatusItem.h"
using namespace Tomahawk;
JobStatusView* JobStatusView::s_instance = 0;
JobStatusView::JobStatusView( AnimatedSplitter* parent )
@ -77,6 +76,7 @@ JobStatusView::JobStatusView( AnimatedSplitter* parent )
new LatchedStatusManager( this );
}
void
JobStatusView::setModel( JobStatusModel* m )
{
@ -88,6 +88,7 @@ JobStatusView::setModel( JobStatusModel* m )
connect( m_view->model(), SIGNAL( rowsRemoved( QModelIndex, int, int ) ), this, SLOT( checkCount() ) );
}
void
JobStatusView::checkCount()
{