Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Plasma Add-ons
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
5
Issues
5
List
Boards
Labels
Service Desk
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Plasma
Plasma Add-ons
Commits
8c6eb4cd
Commit
8c6eb4cd
authored
Jan 09, 2018
by
Friedrich W. H. Kossebau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[weather] Port away from Q_PRIVATE_SLOT
parent
148180d3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
19 deletions
+12
-19
libs/plasmaweather/weatherlocation.cpp
libs/plasmaweather/weatherlocation.cpp
+2
-6
libs/plasmaweather/weatherlocation.h
libs/plasmaweather/weatherlocation.h
+0
-2
libs/plasmaweather/weatherpopupapplet.cpp
libs/plasmaweather/weatherpopupapplet.cpp
+10
-8
libs/plasmaweather/weatherpopupapplet.h
libs/plasmaweather/weatherpopupapplet.h
+0
-3
No files found.
libs/plasmaweather/weatherlocation.cpp
View file @
8c6eb4cd
...
...
@@ -48,8 +48,8 @@ WeatherLocation::WeatherLocation(QObject *parent)
:
QObject
(
parent
)
,
d
(
new
WeatherLocationPrivate
(
this
))
{
QObject
::
connect
(
&
d
->
validator
,
SIGNAL
(
finished
(
QMap
<
QString
,
QString
>
))
,
this
,
SLOT
(
validatorFinished
(
QMap
<
QString
,
QString
>
))
);
connect
(
&
d
->
validator
,
&
WeatherValidator
::
finished
,
this
,
[
&
](
const
QMap
<
QString
,
QString
>&
sources
)
{
d
->
validatorFinished
(
sources
);
}
);
}
WeatherLocation
::~
WeatherLocation
()
=
default
;
...
...
@@ -90,7 +90,3 @@ void WeatherLocation::dataUpdated(const QString &source, const Plasma::DataEngin
emit
finished
(
QString
());
}
// needed due to private slots
#include "moc_weatherlocation.cpp"
libs/plasmaweather/weatherlocation.h
View file @
8c6eb4cd
...
...
@@ -58,8 +58,6 @@ public Q_SLOTS:
private:
const
QScopedPointer
<
class
WeatherLocationPrivate
>
d
;
Q_PRIVATE_SLOT
(
d
,
void
validatorFinished
(
const
QMap
<
QString
,
QString
>
&
results
))
};
#endif
libs/plasmaweather/weatherpopupapplet.cpp
View file @
8c6eb4cd
...
...
@@ -45,7 +45,8 @@ public:
busyTimer
=
new
QTimer
(
q
);
busyTimer
->
setInterval
(
2
*
60
*
1000
);
busyTimer
->
setSingleShot
(
true
);
QObject
::
connect
(
busyTimer
,
SIGNAL
(
timeout
()),
q
,
SLOT
(
giveUpBeingBusy
()));
QObject
::
connect
(
busyTimer
,
&
QTimer
::
timeout
,
q
,
[
&
]()
{
giveUpBeingBusy
();
});
}
WeatherPopupApplet
*
q
;
...
...
@@ -66,6 +67,7 @@ public:
double
longitude
;
QTimer
*
busyTimer
;
KNotification
*
timeoutNotification
;
QMetaObject
::
Connection
timeoutNotificationConnection
;
bool
isValidLatitude
()
{
return
-
90
<=
latitude
&&
latitude
<=
90
;
...
...
@@ -108,7 +110,10 @@ public:
KNotification
::
event
(
KNotification
::
Error
,
QString
(),
// TODO: some title?
i18n
(
"Weather information retrieval for %1 timed out."
,
list
.
value
(
2
)),
QStringLiteral
(
"dialog-error"
));
QObject
::
connect
(
timeoutNotification
,
SIGNAL
(
closed
()),
q
,
SLOT
(
onTimeoutNotificationClosed
()));
// seems global disconnect with wildcard does not cover lambdas, so remembering manually for disconnect
timeoutNotificationConnection
=
QObject
::
connect
(
timeoutNotification
,
&
KNotification
::
closed
,
q
,
[
&
]()
{
onTimeoutNotificationClosed
();
});
}
}
...
...
@@ -220,7 +225,7 @@ void WeatherPopupApplet::init()
void
WeatherPopupApplet
::
connectToEngine
()
{
if
(
d
->
timeoutNotification
)
{
QObject
::
disconnect
(
d
->
timeoutNotification
,
SIGNAL
(
closed
()),
this
,
SLOT
(
onTimeoutNotificationClosed
())
);
QObject
::
disconnect
(
d
->
timeoutNotification
Connection
);
d
->
timeoutNotification
=
nullptr
;
}
...
...
@@ -231,7 +236,8 @@ void WeatherPopupApplet::connectToEngine()
#if 0
if (!d->location) {
d->location = new WeatherLocation(this);
connect(d->location, SIGNAL(finished(QString)), this, SLOT(locationReady(QString)));
connect(d->location, &WeatherLocation::finished,
this, [&](const QString& source) { d->locationReady(source); });
}
Plasma::DataEngine *dataEngine = dataEngine(QStringLiteral("geolocation"));
...
...
@@ -412,7 +418,3 @@ QString WeatherPopupApplet::conditionIcon()
}
return
d
->
conditionIcon
;
}
// needed due to private slots
#include "moc_weatherpopupapplet.cpp"
libs/plasmaweather/weatherpopupapplet.h
View file @
8c6eb4cd
...
...
@@ -113,9 +113,6 @@ class PLASMAWEATHER_EXPORT WeatherPopupApplet : public Plasma::Applet, public Pl
const
QScopedPointer
<
class
WeatherPopupAppletPrivate
>
d
;
friend
class
WeatherPopupAppletPrivate
;
Q_PRIVATE_SLOT
(
d
,
void
locationReady
(
const
QString
&
source
))
Q_PRIVATE_SLOT
(
d
,
void
giveUpBeingBusy
())
Q_PRIVATE_SLOT
(
d
,
void
onTimeoutNotificationClosed
())
};
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment