Bugzilla – Attachment 73700 Details for
Bug 158805
akregator crashes on exit
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
IDP Log In
|
Forgot Password
[patch]
kdepim3 patch
ak.patch (text/plain), 2.47 KB, created by
Lubos Lunak
on 2006-03-17 15:02:02 UTC
(
hide
)
Description:
kdepim3 patch
Filename:
MIME Type:
Creator:
Lubos Lunak
Created:
2006-03-17 15:02:02 UTC
Size:
2.47 KB
patch
obsolete
>diff -u akregator/src/librss/loader.cpp akregator/src/librss/loader.cpp >--- akregator/src/librss/loader.cpp (revision 515291) >+++ akregator/src/librss/loader.cpp (revision 516072) >@@ -13,12 +13,14 @@ > > #include <kio/job.h> > #include <kprocess.h> >+#include <kstaticdeleter.h> > #include <kurl.h> > #include <kdebug.h> > > #include <qdom.h> > #include <qbuffer.h> > #include <qregexp.h> >+#include <qstring.h> > #include <qstringlist.h> > #include <qtimer.h> > >@@ -32,8 +34,10 @@ > { > } > >-struct FileRetriever::Private >+class FileRetriever::Private > { >+ public: >+ > Private() > : buffer(NULL), > lastError(0), job(NULL) >@@ -48,8 +52,12 @@ > QBuffer *buffer; > int lastError; > KIO::Job *job; >+ static KStaticDeleter<QString> userAgentsd; >+ static QString* userAgent; > }; > >+KStaticDeleter<QString> FileRetriever::Private::userAgentsd; >+QString* FileRetriever::Private::userAgent = 0L; > FileRetriever::FileRetriever() > : d(new Private) > { >@@ -61,11 +69,18 @@ > } > > bool FileRetriever::m_useCache = true; >-QString FileRetriever::m_userAgent = 0; >+ >+QString FileRetriever::userAgent() >+{ >+ if (Private::userAgent == 0L) >+ FileRetriever::Private::userAgentsd.setObject(Private::userAgent, new QString); >+ return *Private::userAgent; >+} > > void FileRetriever::setUserAgent(const QString &ua) > { >- m_userAgent = ua; >+ if (Private::userAgent == 0L) >+ FileRetriever::Private::userAgentsd.setObject(Private::userAgent, new QString); > } > > void FileRetriever::setUseCache(bool enabled) >@@ -88,7 +103,9 @@ > > d->job = KIO::get(u, !m_useCache, false); > >- d->job->addMetaData("UserAgent", m_userAgent); >+ QString ua = userAgent(); >+ if (!ua.isEmpty()) >+ d->job->addMetaData("UserAgent", ua); > > > QTimer::singleShot(1000*90, this, SLOT(slotTimeout())); >@@ -298,8 +315,6 @@ > return d->discoveredFeedURL; > } > >-#include <kdebug.h> >- > void Loader::slotRetrieverDone(const QByteArray &data, bool success) > { > d->lastError = d->retriever->errorCode(); >only in patch2: >unchanged: >--- akregator/src/librss/loader.h (revision 516071) >+++ akregator/src/librss/loader.h (revision 516072) >@@ -121,6 +121,7 @@ > > static void setUseCache(bool enabled); > static void setUserAgent(const QString &ua); >+ static QString userAgent(); > > signals: > /** >@@ -143,7 +144,6 @@ > > private: > static bool m_useCache; >- static QString m_userAgent; > > FileRetriever(const FileRetriever &other); > FileRetriever &operator=(const FileRetriever &other);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 158805
: 73700