diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2010-03-20 08:57:31 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2010-03-20 08:57:31 +0000 |
| commit | 75281f98fa68c5326e4725b107317d8f477e3e7d (patch) | |
| tree | c0817f29128d04171df1ca48d803865dcb3eee93 /src/plugins/General | |
| parent | 2eff41971d3776c7c4ac1ea9fa9a6f5a4f1513ab (diff) | |
| download | qmmp-75281f98fa68c5326e4725b107317d8f477e3e7d.tar.gz qmmp-75281f98fa68c5326e4725b107317d8f477e3e7d.tar.bz2 qmmp-75281f98fa68c5326e4725b107317d8f477e3e7d.zip | |
fixed installation
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@1635 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/General')
| -rw-r--r-- | src/plugins/General/kdenotify/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | src/plugins/General/kdenotify/kdenotify.cpp | 19 | ||||
| -rw-r--r-- | src/plugins/General/kdenotify/kdenotify.h | 3 | ||||
| -rw-r--r-- | src/plugins/General/kdenotify/kdenotify.pro | 6 |
4 files changed, 23 insertions, 7 deletions
diff --git a/src/plugins/General/kdenotify/CMakeLists.txt b/src/plugins/General/kdenotify/CMakeLists.txt index e27d26e0e..d62a7b8f4 100644 --- a/src/plugins/General/kdenotify/CMakeLists.txt +++ b/src/plugins/General/kdenotify/CMakeLists.txt @@ -63,3 +63,5 @@ ADD_LIBRARY(kdenotify MODULE ${libkdenotify_SRCS} ${libkdenotify_MOC_SRCS} ${lib add_dependencies(kdenotify qmmpui) target_link_libraries(kdenotify ${QT_LIBRARIES} -lqmmpui -lqmmp) install(TARGETS kdenotify DESTINATION ${LIB_DIR}/qmmp/General) +install(FILES images/empty_cover.png DESTINATION share/qmmp/images) +install(FILES images/app_icon.png DESTINATION share/qmmp/images) diff --git a/src/plugins/General/kdenotify/kdenotify.cpp b/src/plugins/General/kdenotify/kdenotify.cpp index af8e87db6..892967013 100644 --- a/src/plugins/General/kdenotify/kdenotify.cpp +++ b/src/plugins/General/kdenotify/kdenotify.cpp @@ -27,6 +27,7 @@ #include <QDebug> #include <QTimer> #include <QImage> +#include <QApplication> #include <qmmpui/metadataformatter.h> #include <qmmp/soundcore.h> #include <qmmp/metadatamanager.h> @@ -53,7 +54,14 @@ KdeNotify::KdeNotify(QObject *parent) : General(parent),m_UseFreedesktopSpec(fal m_UseFreedesktopSpec = true; } qWarning() << "KdeNotify: DBus interfece created successfully."; - m_ConfigDir = QFileInfo(Qmmp::configFile()).absoluteDir().path(); + //m_ConfigDir = QFileInfo(Qmmp::configFile()).absoluteDir().path(); + QString path = QFileInfo(Qmmp::configFile()).absoluteDir().path(); + QDir dir(path); + if(!dir.exists("kdenotifycache")) + dir.mkdir("kdenotifycache"); + dir.cd("kdenotifycache"); + m_coverPath = dir.absolutePath() + "/cover.jpg"; + m_imagesDir = QDir(qApp->applicationFilePath () +"/../../share/qmmp/images").absolutePath(); QSettings settings(Qmmp::configFile(),QSettings::IniFormat); settings.beginGroup("Kde_Notifier"); @@ -73,7 +81,7 @@ KdeNotify::KdeNotify(QObject *parent) : General(parent),m_UseFreedesktopSpec(fal KdeNotify::~KdeNotify() { QDir dir(QDir::home()); - dir.remove(m_ConfigDir + "/cover.jpg"); + dir.remove(m_coverPath); } QString KdeNotify::totalTimeString() @@ -100,7 +108,7 @@ QList<QVariant> KdeNotify::prepareNotification() args.append(0U); //replaces-id if(!m_UseFreedesktopSpec) args.append(""); //event-id - args.append(m_ConfigDir + "/app_icon.png"); //app-icon(path to icon on disk) + args.append(m_imagesDir + "/app_icon.png"); //app-icon(path to icon on disk) args.append(tr("Qmmp now playing:")); //summary (notification title) MetaDataFormatter f(m_template); @@ -112,13 +120,12 @@ QList<QVariant> KdeNotify::prepareNotification() QPixmap cover = MetaDataManager::instance()->instance()->getCover(core->metaData(Qmmp::URL)); if(!cover.isNull()) { - coverPath = m_ConfigDir + "/cover.jpg"; + coverPath = m_coverPath; cover.scaled(100,100,Qt::IgnoreAspectRatio,Qt::SmoothTransformation).save(coverPath); } } if(coverPath.isEmpty()) - coverPath = m_ConfigDir + "/empty_cover.png"; - + coverPath = m_imagesDir + "/empty_cover.png"; QString nBody; nBody.append("<table padding=\"3px\"><tr><td width=\"80px\" height=\"80px\" padding=\"3px\">"); diff --git a/src/plugins/General/kdenotify/kdenotify.h b/src/plugins/General/kdenotify/kdenotify.h index e928c27ab..26aae0cdf 100644 --- a/src/plugins/General/kdenotify/kdenotify.h +++ b/src/plugins/General/kdenotify/kdenotify.h @@ -41,11 +41,12 @@ public: private: QList<QVariant> prepareNotification(); QDBusInterface *notifier; - QString m_ConfigDir; + QString m_coverPath; int m_NotifyDelay; bool m_ShowCovers; bool m_UseFreedesktopSpec; QString m_template; + QString m_imagesDir; private slots: void showMetaData(); diff --git a/src/plugins/General/kdenotify/kdenotify.pro b/src/plugins/General/kdenotify/kdenotify.pro index d350b513e..a0f1f2665 100644 --- a/src/plugins/General/kdenotify/kdenotify.pro +++ b/src/plugins/General/kdenotify/kdenotify.pro @@ -39,3 +39,9 @@ TRANSLATIONS = translations/kdenotify_plugin_cs.ts \ translations/kdenotify_plugin_it.ts \ translations/kdenotify_plugin_tr.ts \ translations/kdenotify_plugin_lt.ts + + +images.files = app_icon.png \ + empty_cover.png +images.path = /share/qmmp/images/ +INSTALLS += images |
