From a9946929bc45b96acd171a8137600277d122ccd9 Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Mon, 24 Nov 2008 21:54:59 +0000 Subject: general api cleanup git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@631 90c681e8-e032-0410-971d-27865f9a5e38 --- src/plugins/General/notifier/popupwidget.cpp | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'src/plugins/General/notifier/popupwidget.cpp') diff --git a/src/plugins/General/notifier/popupwidget.cpp b/src/plugins/General/notifier/popupwidget.cpp index c6ac1fc7a..8e640abdf 100644 --- a/src/plugins/General/notifier/popupwidget.cpp +++ b/src/plugins/General/notifier/popupwidget.cpp @@ -26,21 +26,25 @@ #include #include #include +#include #include "popupwidget.h" -PopupWidget::PopupWidget(const SongInfo &song, QWidget *parent) +PopupWidget::PopupWidget(QWidget *parent) : QFrame(parent) { setWindowFlags(Qt::X11BypassWindowManagerHint | - Qt::WindowStaysOnTopHint); + Qt::WindowStaysOnTopHint | Qt::Window); setFrameStyle(QFrame::Box | QFrame::Plain); - QString title = song.title(); - if(title.isEmpty()) - title = song.path().section('/',-1); - title.append(" "); - if (song.length() > 0) - title.append(QString("(%1:%2)").arg(song.length()/60).arg(song.length()%60, 2, 10, QChar('0'))); + SoundCore *core = SoundCore::instance(); + QString title = core->metaData(Qmmp::TITLE); + if (title.isEmpty()) + title = core->metaData(Qmmp::URL).section('/',-1); + if (core->length() > 0) + { + title.append(" "); + title.append(QString("(%1:%2)").arg(core->length()/60).arg(core->length()%60, 2, 10, QChar('0'))); + } QHBoxLayout *hlayout = new QHBoxLayout(this); QLabel *pixlabel = new QLabel(this); @@ -52,9 +56,9 @@ PopupWidget::PopupWidget(const SongInfo &song, QWidget *parent) QLabel *label1 = new QLabel(""+title+"", this); vlayout->addWidget(label1); - QString info = song.artist(); - if (!info.isEmpty() && !song.album().isEmpty()) - info.append(" - " + song.album()); + QString info = core->metaData(Qmmp::ARTIST); + if (!info.isEmpty() && !core->metaData(Qmmp::ALBUM).isEmpty()) + info.append(" - " + core->metaData(Qmmp::ALBUM)); if (!info.isEmpty()) { QLabel *label2 = new QLabel(info, this); -- cgit v1.2.3-13-gbd6f