mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-23 18:32:50 +00:00
plasma: use Q_BYTE_ORDER to determine byte order
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
7bea8548e8
commit
206b343667
1 changed files with 7 additions and 7 deletions
|
@ -366,14 +366,14 @@ void StatusNotifierItemSource::contextMenuReady()
|
|||
|
||||
QPixmap StatusNotifierItemSource::KDbusImageStructToPixmap(const KDbusImageStruct &image) const
|
||||
{
|
||||
//swap from network byte order if we are little endian
|
||||
if (QSysInfo::ByteOrder == QSysInfo::LittleEndian) {
|
||||
uint *uintBuf = (uint *) image.data.data();
|
||||
for (uint i = 0; i < image.data.size()/sizeof(uint); ++i) {
|
||||
*uintBuf = ntohl(*uintBuf);
|
||||
++uintBuf;
|
||||
}
|
||||
// swap from network byte order if we are little endian
|
||||
#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
|
||||
uint *uintBuf = (uint *) image.data.data();
|
||||
for (uint i = 0; i < image.data.size()/sizeof(uint); ++i) {
|
||||
*uintBuf = ntohl(*uintBuf);
|
||||
++uintBuf;
|
||||
}
|
||||
#endif
|
||||
QImage iconImage(image.width, image.height, QImage::Format_ARGB32 );
|
||||
memcpy(iconImage.bits(), (uchar*)image.data.data(), iconImage.byteCount());
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue