mirror of
https://bitbucket.org/smil3y/kde-extraapps.git
synced 2025-02-23 18:32:53 +00:00
kdeplasma-addons: stop emitting the finished signal of WeatherLocation once a valid source is found
how valid the source is is entirely different thing, more than one weather source can match a given location (look for "multiple" in the ions and think why it is a thing) Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
7bb0c86cf6
commit
002bf61331
1 changed files with 6 additions and 3 deletions
|
@ -29,7 +29,8 @@ public:
|
|||
Private(WeatherLocation *location)
|
||||
: q(location),
|
||||
locationEngine(nullptr),
|
||||
weatherEngine(nullptr)
|
||||
weatherEngine(nullptr),
|
||||
foundsource(false)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -42,10 +43,11 @@ public:
|
|||
}
|
||||
|
||||
validators.remove(validator);
|
||||
if (!source.isEmpty()) {
|
||||
if (!source.isEmpty() && !foundsource) {
|
||||
foundsource = true;
|
||||
emit q->finished(source);
|
||||
}
|
||||
if (validators.isEmpty()) {
|
||||
if (!foundsource && validators.isEmpty()) {
|
||||
emit q->finished(QString());
|
||||
}
|
||||
}
|
||||
|
@ -53,6 +55,7 @@ public:
|
|||
WeatherLocation *q;
|
||||
Plasma::DataEngine *locationEngine;
|
||||
Plasma::DataEngine *weatherEngine;
|
||||
bool foundsource;
|
||||
QMap<WeatherValidator*,QString> validators;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue