From 7436ae5e45d16aecb088abe1d072bd21b13a83bf Mon Sep 17 00:00:00 2001 From: Tobias Rundstrom Date: Wed, 1 Mar 2006 21:52:12 -0300 Subject: [PATCH] Unbreak scrolling again. --- Playlist.cpp | 3 +-- PlaylistList.cpp | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Playlist.cpp b/Playlist.cpp index 7d25496..f62476f 100644 --- a/Playlist.cpp +++ b/Playlist.cpp @@ -15,8 +15,6 @@ PlaylistScrollButton::PlaylistScrollButton (PlaylistScroller *parent, uint norma void PlaylistScrollButton::mouseMoveEvent (QMouseEvent *event) { - PlaylistWindow *pw = dynamic_cast(window ()); - QPoint p (event->pos ()); int npos = pos().y()+p.y()-m_diffy; @@ -112,6 +110,7 @@ void PlaylistWindow::doScroll (int pos) { int npos = ((float)pos) / (float)(m_scroller->getMax()) * float(m_list->height() - m_view->height()); + m_list->setOffset (npos); if (npos == 0) { m_list->update (); diff --git a/PlaylistList.cpp b/PlaylistList.cpp index 53e9507..f588b3d 100644 --- a/PlaylistList.cpp +++ b/PlaylistList.cpp @@ -91,7 +91,7 @@ PlaylistList::playlistChanged (QHash h) { uint id = h.value("id").toUInt(); if (m_itemmap->contains (id)) { - m_items->append (m_itemmap->value (id)); + addItem (m_itemmap->value (id)); } else { new PlaylistItem (this, id); } @@ -182,7 +182,7 @@ PlaylistList::playlistList (QList l) { for (int i = 0; i < l.count(); i++) { if (m_itemmap->contains (l.value(i))) { - m_items->append (m_itemmap->value (l.value(i))); + addItem (m_itemmap->value (l.value (i))); } else { new PlaylistItem (this, l.value(i)); }