Changeset View
Changeset View
Standalone View
Standalone View
applets/comic/comic.cpp
Context not available. | |||||
71 | mCheckNewStrips(nullptr), | 71 | mCheckNewStrips(nullptr), | ||
---|---|---|---|---|---|
72 | mActionShop(nullptr), | 72 | mActionShop(nullptr), | ||
73 | mEngine(nullptr), | 73 | mEngine(nullptr), | ||
74 | mSavingDir(nullptr) | 74 | mSavingDir(nullptr), | ||
75 | dropEngine(nullptr) | ||||
75 | { | 76 | { | ||
76 | setHasConfigurationInterface( true ); | 77 | setHasConfigurationInterface( true ); | ||
77 | } | 78 | } | ||
Context not available. | |||||
159 | 160 | | |||
160 | updateUsedComics(); | 161 | updateUsedComics(); | ||
161 | changeComic( true ); | 162 | changeComic( true ); | ||
163 | | ||||
164 | dropEngine = new QTimer( this ); | ||||
165 | dropEngine->setSingleShot( true ); | ||||
166 | dropEngine->setInterval( 3 * 60 * 1000 ); | ||||
167 | connect( dropEngine, &QTimer::timeout, this, [this]() { | ||||
168 | setBusy(false); | ||||
169 | if (mEngine) { | ||||
170 | mEngine->disconnectSource( mOldSource, this ); | ||||
171 | } | ||||
172 | mOldSource.clear(); | ||||
173 | }); | ||||
162 | } | 174 | } | ||
163 | 175 | | |||
164 | ComicApplet::~ComicApplet() | 176 | ComicApplet::~ComicApplet() | ||
Context not available. | |||||
176 | void ComicApplet::dataUpdated( const QString &source, const Plasma::DataEngine::Data &data ) | 188 | void ComicApplet::dataUpdated( const QString &source, const Plasma::DataEngine::Data &data ) | ||
177 | { | 189 | { | ||
178 | setBusy(false); | 190 | setBusy(false); | ||
191 | dropEngine->stop(); | ||||
179 | 192 | | |||
180 | //disconnect prefetched comic strips | 193 | //disconnect prefetched comic strips | ||
181 | if (mEngine && source != mOldSource ) { | 194 | if (mEngine && source != mOldSource ) { | ||
Context not available. | |||||
492 | if ( !id.isEmpty() && mEngine && mEngine->isValid() ) { | 505 | if ( !id.isEmpty() && mEngine && mEngine->isValid() ) { | ||
493 | 506 | | |||
494 | setBusy(true); | 507 | setBusy(true); | ||
508 | dropEngine->start(); | ||||
495 | 509 | | |||
496 | const QString identifier = id + QLatin1Char(':') + identifierSuffix; | 510 | const QString identifier = id + QLatin1Char(':') + identifierSuffix; | ||
497 | 511 | | |||
Context not available. |