mirror of
https://bitbucket.org/smil3y/kde-extraapps.git
synced 2025-02-24 10:52:53 +00:00
kdeplasma-addons: parent the weather validator to the weather location finder
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
7f129d6c3e
commit
7bb0c86cf6
4 changed files with 9 additions and 9 deletions
|
@ -28,7 +28,8 @@ class WeatherLocation::Private
|
||||||
public:
|
public:
|
||||||
Private(WeatherLocation *location)
|
Private(WeatherLocation *location)
|
||||||
: q(location),
|
: q(location),
|
||||||
locationEngine(nullptr)
|
locationEngine(nullptr),
|
||||||
|
weatherEngine(nullptr)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,8 +65,7 @@ WeatherLocation::WeatherLocation(QObject *parent)
|
||||||
|
|
||||||
WeatherLocation::~WeatherLocation()
|
WeatherLocation::~WeatherLocation()
|
||||||
{
|
{
|
||||||
qDeleteAll(d->validators.keys());
|
Q_ASSERT(d->validators.size() == 0);
|
||||||
d->validators.clear();
|
|
||||||
delete d;
|
delete d;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -98,7 +98,7 @@ void WeatherLocation::dataUpdated(const QString &source, const Plasma::DataEngin
|
||||||
city.truncate(city.indexOf(QLatin1Char(',')) - 1);
|
city.truncate(city.indexOf(QLatin1Char(',')) - 1);
|
||||||
}
|
}
|
||||||
if (!city.isEmpty()) {
|
if (!city.isEmpty()) {
|
||||||
WeatherValidator* validator = new WeatherValidator();
|
WeatherValidator* validator = new WeatherValidator(this);
|
||||||
validator->setDataEngine(d->weatherEngine);
|
validator->setDataEngine(d->weatherEngine);
|
||||||
connect(
|
connect(
|
||||||
validator, SIGNAL(finished(QMap<QString,QString>)),
|
validator, SIGNAL(finished(QMap<QString,QString>)),
|
||||||
|
|
|
@ -81,9 +81,9 @@ public:
|
||||||
q->setBusy(false);
|
q->setBusy(false);
|
||||||
q->showMessage(QIcon(), QString(), Plasma::ButtonNone);
|
q->showMessage(QIcon(), QString(), Plasma::ButtonNone);
|
||||||
q->setConfigurationRequired(true);
|
q->setConfigurationRequired(true);
|
||||||
location->deleteLater();
|
|
||||||
location = 0;
|
|
||||||
}
|
}
|
||||||
|
delete location;
|
||||||
|
location = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void giveUpBeingBusy()
|
void giveUpBeingBusy()
|
||||||
|
|
|
@ -26,7 +26,7 @@ class WeatherValidator::Private
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Private()
|
Private()
|
||||||
: dataengine(0),
|
: dataengine(nullptr),
|
||||||
ion(QLatin1String( "wettercom" ))
|
ion(QLatin1String( "wettercom" ))
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ public:
|
||||||
bool silent;
|
bool silent;
|
||||||
};
|
};
|
||||||
|
|
||||||
WeatherValidator::WeatherValidator(QWidget *parent)
|
WeatherValidator::WeatherValidator(QObject *parent)
|
||||||
: QObject(parent)
|
: QObject(parent)
|
||||||
, d(new Private())
|
, d(new Private())
|
||||||
{
|
{
|
||||||
|
|
|
@ -33,7 +33,7 @@ class PLASMAWEATHER_EXPORT WeatherValidator : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
WeatherValidator(QWidget *parent = 0);
|
WeatherValidator(QObject *parent = 0);
|
||||||
virtual ~WeatherValidator();
|
virtual ~WeatherValidator();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue