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( 2 * 60 * 1000 ); | ||||
167 | connect( dropEngine, &QTimer::timeout, this, [this]() { | ||||
168 | dataUpdated( QString{}, Plasma::DataEngine::Data{} ); | ||||
169 | }); | ||||
162 | } | 170 | } | ||
163 | 171 | | |||
164 | ComicApplet::~ComicApplet() | 172 | ComicApplet::~ComicApplet() | ||
Context not available. | |||||
176 | void ComicApplet::dataUpdated( const QString &source, const Plasma::DataEngine::Data &data ) | 184 | void ComicApplet::dataUpdated( const QString &source, const Plasma::DataEngine::Data &data ) | ||
177 | { | 185 | { | ||
178 | setBusy(false); | 186 | setBusy(false); | ||
187 | dropEngine->stop(); | ||||
179 | 188 | | |||
180 | //disconnect prefetched comic strips | 189 | //disconnect prefetched comic strips | ||
181 | if (mEngine && source != mOldSource ) { | 190 | if (mEngine && source != mOldSource ) { | ||
Context not available. | |||||
492 | if ( !id.isEmpty() && mEngine && mEngine->isValid() ) { | 501 | if ( !id.isEmpty() && mEngine && mEngine->isValid() ) { | ||
493 | 502 | | |||
494 | setBusy(true); | 503 | setBusy(true); | ||
504 | dropEngine->start(); | ||||
495 | 505 | | |||
496 | const QString identifier = id + QLatin1Char(':') + identifierSuffix; | 506 | const QString identifier = id + QLatin1Char(':') + identifierSuffix; | ||
497 | 507 | | |||
Context not available. |