~ubuntu-branches/ubuntu/saucy/clementine/saucy

« back to all changes in this revision

Viewing changes to src/widgets/osd_x11.cpp

  • Committer: Package Import Robot
  • Author(s): Thomas PIERSON
  • Date: 2012-01-01 20:43:39 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20120101204339-lsb6nndwhfy05sde
Tags: 1.0.1+dfsg-1
New upstream release. (Closes: #653926, #651611, #657391)

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
#include "config.h"
19
19
#include "osd.h"
 
20
#include "core/logging.h"
20
21
 
21
22
#include <QtDebug>
22
23
 
36
37
    return arg;
37
38
  }
38
39
  QImage scaled = image.scaledToHeight(100, Qt::SmoothTransformation);
39
 
  QImage i = scaled.convertToFormat(QImage::Format_ARGB32).rgbSwapped();
 
40
 
 
41
  scaled = scaled.convertToFormat(QImage::Format_ARGB32);
 
42
#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
 
43
  // ABGR -> ARGB
 
44
  QImage i = scaled.rgbSwapped();
 
45
#else
 
46
  // ABGR -> GBAR
 
47
  QImage i(scaled.size(), scaled.format());
 
48
  for (int y = 0; y < i.height(); ++y) {
 
49
    QRgb* p = (QRgb*) scaled.scanLine(y);
 
50
    QRgb* q = (QRgb*) i.scanLine(y);
 
51
    QRgb* end = p + scaled.width();
 
52
    while (p < end) {
 
53
      *q = qRgba(qGreen(*p), qBlue(*p), qAlpha(*p), qRed(*p));
 
54
      p++;
 
55
      q++;
 
56
    }
 
57
  }
 
58
#endif
 
59
 
40
60
  arg.beginStructure();
41
61
  arg << i.width();
42
62
  arg << i.height();
66
86
      "/org/freedesktop/Notifications",
67
87
      QDBusConnection::sessionBus()));
68
88
  if (!interface_->isValid()) {
69
 
    qWarning() << "Error connecting to notifications service.";
 
89
    qLog(Warning) << "Error connecting to notifications service.";
70
90
  }
71
91
#endif // HAVE_DBUS
72
92
}
116
136
  connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)),
117
137
      SLOT(CallFinished(QDBusPendingCallWatcher*)));
118
138
#else // HAVE_DBUS
119
 
  qWarning() << __PRETTY_FUNCTION__ << ": NOT IMPLEMENTED";
 
139
  qLog(Warning) << "not implemented";
120
140
#endif // HAVE_DBUS
121
141
}
122
142
 
126
146
 
127
147
  QDBusPendingReply<uint> reply = *watcher;
128
148
  if (reply.isError()) {
129
 
    qWarning() << "Error sending notification" << reply.error().name();
 
149
    qLog(Warning) << "Error sending notification" << reply.error().name();
130
150
    return;
131
151
  }
132
152