aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2008-06-12 06:55:50 -0400
committerJason A. Donenfeld <Jason@zx2c4.com>2008-06-12 06:55:50 -0400
commitd0a7356ace6690605b89611c05ba1679715c95c8 (patch)
tree7ac12d156cc8ef36e8fd07856346ae991912fe3b
parentAdded structure to playerwindow.cpp code. Implemented queueing. (diff)
downloadzmusicplayer-d0a7356ace6690605b89611c05ba1679715c95c8.tar.xz
zmusicplayer-d0a7356ace6690605b89611c05ba1679715c95c8.zip
Fixed filter index code yet again.
-rwxr-xr-xcollectionsorter.cpp10
-rwxr-xr-xplayerwindow.cpp6
2 files changed, 8 insertions, 8 deletions
diff --git a/collectionsorter.cpp b/collectionsorter.cpp
index 5c97761..4d33756 100755
--- a/collectionsorter.cpp
+++ b/collectionsorter.cpp
@@ -27,7 +27,7 @@ bool CollectionSorter::filterAcceptsRow(int sourceRow, const QModelIndex &source
}
void CollectionSorter::setFilter(QString filter)
{
- QModelIndex currentSelected = mapToSource(currentItem());
+ QModelIndex currentSelected = currentItem();
bool b = filter != m_filter;
m_filter = filter;
if(b)
@@ -39,7 +39,7 @@ QModelIndex CollectionSorter::peekNext() const
{
if(m_selected + 1 >= rowCount() || rowCount() == 0)
return QModelIndex();
- return index(m_selected + 1, 0);
+ return mapToSource(index(m_selected + 1, 0));
}
QModelIndex CollectionSorter::moveNext()
@@ -53,7 +53,7 @@ QModelIndex CollectionSorter::peekPrevious() const
{
if(m_selected <= 0 || rowCount() == 0)
return QModelIndex();
- return index(m_selected - 1, 0);
+ return mapToSource(index(m_selected - 1, 0));
}
QModelIndex CollectionSorter::movePrevious()
@@ -65,7 +65,7 @@ QModelIndex CollectionSorter::movePrevious()
QModelIndex CollectionSorter::currentItem() const
{
if(m_selected >= 0)
- return index(m_selected, 0);
+ return mapToSource(index(m_selected, 0));
return QModelIndex();
}
void CollectionSorter::setCurrentItem(const QModelIndex& item)
@@ -82,7 +82,7 @@ void CollectionSorter::setCurrentItem(const QModelIndex& item)
if(item.model() == this) {
m_selected = item.row();
m_parent->setPosition(mapToSource(item).row());
- } else if(item.model() == sourceModel() ) {
+ } else if(item.model() == m_parent) {
m_selected = mapFromSource(item).row();
m_parent->setPosition(item.row());
}
diff --git a/playerwindow.cpp b/playerwindow.cpp
index 8e3f127..1fbd5b8 100755
--- a/playerwindow.cpp
+++ b/playerwindow.cpp
@@ -61,14 +61,14 @@ void PlayerWindow::setupUi()
QToolBar *toolBar = new QToolBar(this);
toolBar->setIconSize(QSize(16, 16));
toolBar->addAction(m_previousAction);
- toolBar->addAction(m_playAction); //make it play/pause one button
+ toolBar->addAction(m_playAction); //TODO: make it play/pause one button
toolBar->addAction(m_pauseAction);
toolBar->addAction(m_stopAction);
toolBar->addAction(m_nextAction);
m_seekSlider = new Phonon::SeekSlider(this);
toolBar->addWidget(m_seekSlider);
QLabel *volumeLabel = new QLabel(this);
- volumeLabel->setPixmap(style()->standardIcon(QStyle::SP_MediaVolume).pixmap(16)); // change to volumemediamute on 0 volume
+ volumeLabel->setPixmap(style()->standardIcon(QStyle::SP_MediaVolume).pixmap(16)); //TODO: change to volumemediamute on 0 volume
toolBar->addWidget(volumeLabel);
m_volumeSlider = new Phonon::VolumeSlider(this);
m_volumeSlider->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);
@@ -369,7 +369,7 @@ void PlayerWindow::rowChange()
void PlayerWindow::fixColumnSizes()
{
m_treeView->setUpdatesEnabled(false);
- int width = m_treeView->width() - 40; //Why not 0?
+ int width = m_treeView->width() - 40; //HACK: Why not 0?
m_treeView->setColumnWidth(1, m_suggestedRatio1 * width);
m_treeView->setColumnWidth(2, m_suggestedRatio2 * width);
m_treeView->setColumnWidth(3, m_suggestedRatio3 * width);