Commit 9a2305ea authored by Scott Wheeler's avatar Scott Wheeler

Fixed some stuff with the status label. It wasn't updating properly

when the track advanced.

svn path=/trunk/kdemultimedia/juk/; revision=183957
parent 71d5d71d
......@@ -307,8 +307,26 @@ void JuK::stopFile()
sliderAction->getTrackPositionSlider()->setEnabled(false);
if(playingItem)
playingItem->setPixmap(0, 0);
playingItem = 0;
statusLabel->clear();
updateStatusLabel();
}
void JuK::updateStatusLabel()
{
if(playingItem) {
Playlist *p = static_cast<Playlist *>(playingItem->listView());
if(p && p->playlistBoxItem()) {
QString label = p->playlistBoxItem()->text()
+ " / " + playingItem->text(PlaylistItem::ArtistColumn)
+ " - " + playingItem->text(PlaylistItem::TrackColumn);
statusLabel->setText(label);
}
else
statusLabel->clear();
}
else
statusLabel->clear();
}
////////////////////////////////////////////////////////////////////////////////
......@@ -355,6 +373,7 @@ void JuK::pollPlay()
playingItem->setPixmap(0, QPixmap(UserIcon("playing")));
}
}
updateStatusLabel();
}
else
stopFile();
......@@ -402,13 +421,7 @@ void JuK::playItem(PlaylistItem *item)
playingItem->setPixmap(0, QPixmap(UserIcon("playing")));
playTimer->start(pollInterval);
Playlist * p = static_cast<Playlist *>(item->listView());
if(p && p->playlistBoxItem()) {
QString label = p->playlistBoxItem()->text()
+ " / " + item->text(PlaylistItem::ArtistColumn)
+ " - " + item->text(PlaylistItem::TrackColumn);
statusLabel->setText(label);
}
updateStatusLabel();
}
}
}
......
......@@ -57,6 +57,8 @@ private:
virtual bool queryClose();
void updateStatusLabel();
// layout objects
PlaylistSplitter *splitter;
QLabel *statusLabel;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment