diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2008-11-24 21:54:59 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2008-11-24 21:54:59 +0000 |
| commit | a9946929bc45b96acd171a8137600277d122ccd9 (patch) | |
| tree | 5e675c6dbc697ac80ed3920c768c7fd6c328df0f /src/plugins/General/notifier/popupwidget.cpp | |
| parent | 52cdbf3b10333908693f21a7c04ff7983baf923e (diff) | |
| download | qmmp-a9946929bc45b96acd171a8137600277d122ccd9.tar.gz qmmp-a9946929bc45b96acd171a8137600277d122ccd9.tar.bz2 qmmp-a9946929bc45b96acd171a8137600277d122ccd9.zip | |
general api cleanup
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@631 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/General/notifier/popupwidget.cpp')
| -rw-r--r-- | src/plugins/General/notifier/popupwidget.cpp | 26 |
1 files changed, 15 insertions, 11 deletions
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 <QPalette> #include <QSettings> #include <QDir> +#include <qmmp/soundcore.h> #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("<b>"+title+"</b>", 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); |
