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 Workspace
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
3
Issues
3
List
Boards
Labels
Service Desk
Milestones
Merge Requests
62
Merge Requests
62
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 Workspace
Commits
5956f5ad
Commit
5956f5ad
authored
Jan 04, 2018
by
Friedrich W. H. Kossebau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[weather] use multi-arg with strings
parent
9f914401
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
18 deletions
+26
-18
dataengines/weather/ions/noaa/ion_noaa.cpp
dataengines/weather/ions/noaa/ion_noaa.cpp
+6
-6
dataengines/weather/ions/wetter.com/ion_wettercom.cpp
dataengines/weather/ions/wetter.com/ion_wettercom.cpp
+20
-12
No files found.
dataengines/weather/ions/noaa/ion_noaa.cpp
View file @
5956f5ad
...
...
@@ -619,12 +619,12 @@ void NOAAIon::updateWeather(const QString& source)
// Get the short day name for the forecast
data
.
insert
(
QStringLiteral
(
"Short Forecast Day %1"
).
arg
(
i
),
QStringLiteral
(
"%1|%2|%3|%4|%5|%6"
)
.
arg
(
forecast
.
day
)
.
arg
(
iconName
)
.
arg
(
i18nc
(
"weather forecast"
,
forecast
.
summary
.
toUtf8
().
data
()))
.
arg
(
forecast
.
high
)
.
arg
(
forecast
.
low
)
.
arg
(
QStringLiteral
()));
.
arg
(
forecast
.
day
,
iconName
,
i18nc
(
"weather forecast"
,
forecast
.
summary
.
toUtf8
().
data
()),
forecast
.
high
,
forecast
.
low
,
QString
()));
++
i
;
}
...
...
dataengines/weather/ions/wetter.com/ion_wettercom.cpp
View file @
5956f5ad
...
...
@@ -515,8 +515,9 @@ void WetterComIon::forecast_slotJobFinished(KJob *job)
if
(
m_sourcesToReset
.
contains
(
source
))
{
m_sourcesToReset
.
removeAll
(
source
);
const
QString
weatherSource
=
QStringLiteral
(
"wettercom|weather|%1|%2;%3"
)
.
arg
(
source
).
arg
(
m_place
[
source
].
placeCode
)
.
arg
(
m_place
[
source
].
displayName
);
.
arg
(
source
,
m_place
[
source
].
placeCode
,
m_place
[
source
].
displayName
);
// so the weather engine updates it's data
forceImmediateUpdateOfAllVisualizations
();
...
...
@@ -682,8 +683,9 @@ void WetterComIon::updateWeather(const QString& source, bool parseError)
qCDebug
(
IONENGINE_WETTERCOM
)
<<
"Source:"
<<
source
;
QString
weatherSource
=
QStringLiteral
(
"wettercom|weather|%1|%2;%3"
)
.
arg
(
source
).
arg
(
m_place
[
source
].
placeCode
)
.
arg
(
m_place
[
source
].
displayName
);
.
arg
(
source
,
m_place
[
source
].
placeCode
,
m_place
[
source
].
displayName
);
Plasma
::
DataEngine
::
Data
data
;
data
.
insert
(
QStringLiteral
(
"Place"
),
m_place
[
source
].
displayName
);
...
...
@@ -701,9 +703,11 @@ void WetterComIon::updateWeather(const QString& source, bool parseError)
data
.
insert
(
QStringLiteral
(
"Short Forecast Day %1"
).
arg
(
i
),
QStringLiteral
(
"%1|%2|%3|%4|%5|%6"
)
.
arg
(
QLocale
().
toString
(
weather
.
period
.
date
().
day
()))
.
arg
(
weather
.
iconName
).
arg
(
weather
.
summary
)
.
arg
(
weather
.
tempHigh
).
arg
(
weather
.
tempLow
)
.
arg
(
QLocale
().
toString
(
weather
.
period
.
date
().
day
()),
weather
.
iconName
,
weather
.
summary
)
.
arg
(
weather
.
tempHigh
)
.
arg
(
weather
.
tempLow
)
.
arg
(
weather
.
probability
));
i
++
;
}
else
{
...
...
@@ -711,17 +715,21 @@ void WetterComIon::updateWeather(const QString& source, bool parseError)
data
.
insert
(
QStringLiteral
(
"Short Forecast Day %1"
).
arg
(
i
),
QStringLiteral
(
"%1|%2|%3|%4|%5|%6"
)
.
arg
(
i18n
(
"Day"
)).
arg
(
dayWeather
.
iconName
)
.
arg
(
dayWeather
.
summary
).
arg
(
dayWeather
.
tempHigh
)
.
arg
(
dayWeather
.
tempLow
).
arg
(
dayWeather
.
probability
));
.
arg
(
i18n
(
"Day"
),
dayWeather
.
iconName
,
dayWeather
.
summary
)
.
arg
(
dayWeather
.
tempHigh
)
.
arg
(
dayWeather
.
tempLow
)
.
arg
(
dayWeather
.
probability
));
i
++
;
if
(
forecastPeriod
->
hasNightWeather
())
{
WeatherData
::
ForecastInfo
nightWeather
=
forecastPeriod
->
getNightWeather
();
data
.
insert
(
QStringLiteral
(
"Short Forecast Day %1"
).
arg
(
i
),
QStringLiteral
(
"%1 nt|%2|%3|%4|%5|%6"
)
.
arg
(
i18n
(
"Night"
)).
arg
(
nightWeather
.
iconName
)
.
arg
(
nightWeather
.
summary
)
.
arg
(
i18n
(
"Night"
),
nightWeather
.
iconName
,
nightWeather
.
summary
)
.
arg
(
nightWeather
.
tempHigh
)
.
arg
(
nightWeather
.
tempLow
)
.
arg
(
nightWeather
.
probability
));
...
...
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