SVN commit 850675 by rytilahti: use a singleshot timer to add the favicon listener. randomizes the timer's timeout between 1-4000ms, hope it isn't too much. this causes gui to show-up before starting doing the fetches and behave nicer for the user. M +8 -2 feed.cpp M +2 -0 feed.h --- trunk/KDE/kdepim/akregator/src/feed.cpp #850674:850675 @@ -42,6 +42,7 @@ #include #include #include +#include //#include @@ -52,6 +53,7 @@ #include #include #include +#include #include @@ -367,8 +369,8 @@ void Feed::setXmlUrl(const QString& s) { d->xmlUrl = s; - if( ! Settings::fetchOnStartup() ) // TODO: perhaps this should have a randomized timer also not to block the ui on startup? another option could be a favicon cache, which may not be a bad idea.. - FeedIconManager::self()->addListener( KUrl( d->xmlUrl ), this ); + if( ! Settings::fetchOnStartup() ) + QTimer::singleShot(KRandom::random() % 4000, this, SLOT(slotAddFeedIconListener())); // TODO: let's give a gui some time to show up before starting the fetch when no fetch on startup is used. replace this with something proper later... } QString Feed::htmlUrl() const { return d->htmlUrl; } @@ -449,6 +451,10 @@ } } +void Feed::slotAddFeedIconListener() +{ + FeedIconManager::self()->addListener( KUrl( d->xmlUrl ), this ); +} void Feed::appendArticles(const Syndication::FeedPtr feed) { --- trunk/KDE/kdepim/akregator/src/feed.h #850674:850675 @@ -228,6 +228,8 @@ /** add this feed to the fetch queue @c queue */ void slotAddToFetchQueue(Akregator::FetchQueue* queue, bool intervalFetchOnly=false); + + void slotAddFeedIconListener(); signals: /** emitted when fetching started */