[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdenetwork/knewsticker/common
From:       Frerich Raabe <raabe () kde ! org>
Date:       2004-07-10 1:52:57
Message-ID: 20040710015257.93CD716B26 () office ! kde ! org
[Download RAW message or body]

CVS commit by raabe: 

- Fix downloading of custom newsfeed icons
CCMAIL:62131-done@bugs.kde.org


  M +10 -4     newsiconmgr.cpp   1.21


--- kdenetwork/knewsticker/common/newsiconmgr.cpp  #1.20:1.21
@@ -17,4 +17,5 @@
 #include <kstandarddirs.h>
 
+#include <qbuffer.h>
 #include <qfile.h>
 #include <qimage.h>
@@ -23,5 +24,6 @@ struct KIODownload
 {
         KURL     url;
-        QCString data;
+        QByteArray data;
+        QIODevice::Offset dataOffset;
 };
 
@@ -94,5 +96,5 @@ void NewsIconMgr::getIcon(const KURL &ur
                 KIODownload download;
                 download.url = url;
-                download.data = QCString();
+                download.dataOffset = 0;
                 m_kioDownload.insert(job, download);
         }
@@ -109,5 +111,9 @@ bool NewsIconMgr::isStdIcon(const QPixma
 void NewsIconMgr::slotData(KIO::Job *job, const QByteArray &data)
 {
-        m_kioDownload[job].data += data;
+        QBuffer buf(m_kioDownload[job].data);
+        buf.open(IO_WriteOnly);
+        buf.at(m_kioDownload[job].dataOffset);
+        buf.writeBlock(data);
+        m_kioDownload[job].dataOffset = buf.at();
 }
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic