mirror of
https://bitbucket.org/smil3y/kde-extraapps.git
synced 2025-02-23 10:22:52 +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:
|
||||
Private(WeatherLocation *location)
|
||||
: q(location),
|
||||
locationEngine(nullptr)
|
||||
locationEngine(nullptr),
|
||||
weatherEngine(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -64,8 +65,7 @@ WeatherLocation::WeatherLocation(QObject *parent)
|
|||
|
||||
WeatherLocation::~WeatherLocation()
|
||||
{
|
||||
qDeleteAll(d->validators.keys());
|
||||
d->validators.clear();
|
||||
Q_ASSERT(d->validators.size() == 0);
|
||||
delete d;
|
||||
}
|
||||
|
||||
|
@ -98,7 +98,7 @@ void WeatherLocation::dataUpdated(const QString &source, const Plasma::DataEngin
|
|||
city.truncate(city.indexOf(QLatin1Char(',')) - 1);
|
||||
}
|
||||
if (!city.isEmpty()) {
|
||||
WeatherValidator* validator = new WeatherValidator();
|
||||
WeatherValidator* validator = new WeatherValidator(this);
|
||||
validator->setDataEngine(d->weatherEngine);
|
||||
connect(
|
||||
validator, SIGNAL(finished(QMap<QString,QString>)),
|
||||
|
|
|
@ -81,9 +81,9 @@ public:
|
|||
q->setBusy(false);
|
||||
q->showMessage(QIcon(), QString(), Plasma::ButtonNone);
|
||||
q->setConfigurationRequired(true);
|
||||
location->deleteLater();
|
||||
location = 0;
|
||||
}
|
||||
delete location;
|
||||
location = 0;
|
||||
}
|
||||
|
||||
void giveUpBeingBusy()
|
||||
|
|
|
@ -26,7 +26,7 @@ class WeatherValidator::Private
|
|||
{
|
||||
public:
|
||||
Private()
|
||||
: dataengine(0),
|
||||
: dataengine(nullptr),
|
||||
ion(QLatin1String( "wettercom" ))
|
||||
{}
|
||||
|
||||
|
@ -36,7 +36,7 @@ public:
|
|||
bool silent;
|
||||
};
|
||||
|
||||
WeatherValidator::WeatherValidator(QWidget *parent)
|
||||
WeatherValidator::WeatherValidator(QObject *parent)
|
||||
: QObject(parent)
|
||||
, d(new Private())
|
||||
{
|
||||
|
|
|
@ -33,7 +33,7 @@ class PLASMAWEATHER_EXPORT WeatherValidator : public QObject
|
|||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
WeatherValidator(QWidget *parent = 0);
|
||||
WeatherValidator(QObject *parent = 0);
|
||||
virtual ~WeatherValidator();
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue