From 96cfa27dc27e4dc81385df243215fd516b043673 Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Mon, 2 Feb 2015 14:57:42 +0000 Subject: reduced number of template compilation git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@4716 90c681e8-e032-0410-971d-27865f9a5e38 --- src/plugins/General/notifier/popupwidget.cpp | 17 +++-------------- 1 file changed, 3 insertions(+), 14 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 b29b5c6f0..b14ba6396 100644 --- a/src/plugins/General/notifier/popupwidget.cpp +++ b/src/plugins/General/notifier/popupwidget.cpp @@ -30,8 +30,6 @@ #include #include #include -#include - #include "popupwidget.h" PopupWidget::PopupWidget(QWidget *parent) @@ -59,7 +57,7 @@ PopupWidget::PopupWidget(QWidget *parent) setWindowOpacity(settings.value("opacity", 1.0).toDouble()); QString fontname = settings.value("font").toString(); m_coverSize = settings.value("cover_size", 64).toInt(); - m_template = settings.value("template",DEFAULT_TEMPLATE).toString(); + m_formatter.setPattern(settings.value("template",DEFAULT_TEMPLATE).toString()); settings.endGroup(); //font QFont font; @@ -84,18 +82,9 @@ void PopupWidget::mousePressEvent (QMouseEvent *) void PopupWidget::showMetaData() { m_timer->stop(); - QString title = m_template; - SoundCore *core = SoundCore::instance(); - if (core->totalTime() > 0) - { - int l = core->totalTime()/1000; - title.replace("%l",QString("%1:%2").arg(l/60).arg(l%60, 2, 10, QChar('0'))); - } - else - title.replace("%l",""); - MetaDataFormatter f(title); - title = f.format(core->metaData()); + + QString title = m_formatter.format(core->metaData(), core->totalTime() / 1000); m_label1->setText(title); -- cgit v1.2.3-13-gbd6f