mirror of
https://github.com/clementine-player/Clementine
synced 2025-01-23 07:50:13 +01:00
Fixes for code review comments for r252
This commit is contained in:
parent
04fda5badd
commit
9993342ead
@ -1,10 +1,10 @@
|
||||
// Libnotify headers need to go before Qt ones because they use "signals" as
|
||||
// a variable name
|
||||
#ifndef NOLIBNOTIFY
|
||||
#ifdef HAVE_LIBNOTIFY
|
||||
# include <libnotify/notify.h>
|
||||
# include <gdk-pixbuf/gdk-pixbuf.h>
|
||||
# include <glib.h>
|
||||
#endif // NOLIBNOTIFY
|
||||
#endif // HAVE_LIBNOTIFY
|
||||
|
||||
#include "osd.h"
|
||||
|
||||
@ -15,16 +15,16 @@
|
||||
void OSD::Init() {
|
||||
notification_ = NULL;
|
||||
pixbuf_ = NULL;
|
||||
#ifndef NOLIBNOTIFY
|
||||
#ifdef HAVE_LIBNOTIFY
|
||||
notify_init(QCoreApplication::applicationName().toUtf8().constData());
|
||||
#endif
|
||||
}
|
||||
|
||||
bool OSD::SupportsNativeNotifications() {
|
||||
#ifdef NOLIBNOTIFY
|
||||
return false;
|
||||
#else
|
||||
#ifdef HAVE_LIBNOTIFY
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -34,7 +34,7 @@ bool OSD::SupportsTrayPopups() {
|
||||
|
||||
void OSD::ShowMessageNative(const QString& summary, const QString& message,
|
||||
const QString& icon) {
|
||||
#ifndef NOLIBNOTIFY
|
||||
#ifdef HAVE_LIBNOTIFY
|
||||
if (summary.isNull())
|
||||
return;
|
||||
|
||||
@ -60,12 +60,12 @@ void OSD::ShowMessageNative(const QString& summary, const QString& message,
|
||||
}
|
||||
|
||||
pixbuf_ = NULL;
|
||||
#endif // NOLIBNOTIFY
|
||||
#endif // HAVE_LIBNOTIFY
|
||||
}
|
||||
|
||||
void OSD::ShowMessageNative(const QString& summary, const QString& message,
|
||||
const QImage& image) {
|
||||
#ifndef NOLIBNOTIFY
|
||||
#ifdef HAVE_LIBNOTIFY
|
||||
QImage happy_gdk_image = image.convertToFormat(QImage::Format_RGB888).scaledToHeight(100);
|
||||
pixbuf_ = gdk_pixbuf_new_from_data(
|
||||
happy_gdk_image.bits(),
|
||||
@ -78,5 +78,5 @@ void OSD::ShowMessageNative(const QString& summary, const QString& message,
|
||||
NULL, NULL);
|
||||
|
||||
ShowMessageNative(summary, message, QString());
|
||||
#endif // NOLIBNOTIFY
|
||||
#endif // HAVE_LIBNOTIFY
|
||||
}
|
||||
|
@ -179,9 +179,9 @@ win32|fedora-win32-cross:LIBS += -ltag \
|
||||
|
||||
# OSD
|
||||
unix:!macx {
|
||||
nolibnotify:DEFINES += NOLIBNOTIFY
|
||||
SOURCES += osd_x11.cpp
|
||||
!nolibnotify {
|
||||
DEFINES += HAVE_LIBNOTIFY
|
||||
QMAKE_CXXFLAGS += $$system(pkg-config --cflags libnotify)
|
||||
LIBS += $$system(pkg-config --libs libnotify)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user