openweather autodetect when empty string works
This commit is contained in:
parent
8a8df6337a
commit
fa9313f6f8
@ -138,7 +138,7 @@ void OpenWeatherMap::processSearchLocationResponse(QByteArray data)
|
|||||||
cityList.append(city);
|
cityList.append(city);
|
||||||
|
|
||||||
m_cityId = elemant.value("id").toString();
|
m_cityId = elemant.value("id").toString();
|
||||||
updateWeatherData();
|
search(m_cityName);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -258,6 +258,11 @@ void OpenWeatherMap::update()
|
|||||||
updateLocationData();
|
updateLocationData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OpenWeatherMap::searchAutodetect()
|
||||||
|
{
|
||||||
|
updateLocationData();
|
||||||
|
}
|
||||||
|
|
||||||
void OpenWeatherMap::search(const QString &searchString)
|
void OpenWeatherMap::search(const QString &searchString)
|
||||||
{
|
{
|
||||||
QString urlString = "http://api.openweathermap.org/data/2.5/find?q=" + searchString + "&type=like&units=metric&mode=json";
|
QString urlString = "http://api.openweathermap.org/data/2.5/find?q=" + searchString + "&type=like&units=metric&mode=json";
|
||||||
|
|||||||
@ -72,6 +72,7 @@ signals:
|
|||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void update();
|
void update();
|
||||||
|
void searchAutodetect();
|
||||||
void search(const QString &searchString);
|
void search(const QString &searchString);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
if [ -z $2 ]; then
|
if [ -z $2 ]; then
|
||||||
echo "usage $0 host deviceclassid [paramname paramvalue]"
|
echo "usage $0 host deviceclassid [paramname paramvalue]"
|
||||||
elif [ -z $3 ]; then
|
elif [ -z $3 ]; then
|
||||||
(echo '{"id":1, "method":"Devices.GetDiscoveredDevices", "params":{"deviceClassId":"'$2'"}}'; sleep 6) | nc $1 1234
|
(echo '{"id":1, "method":"Devices.GetDiscoveredDevices", "params":{"deviceClassId":"'$2'", "discoveryParams": {"location":""}}}'; sleep 6) | nc $1 1234
|
||||||
elif [ -z $4 ]; then
|
elif [ -z $4 ]; then
|
||||||
echo "usage $0 host deviceclassid [paramname paramvalue]"
|
echo "usage $0 host deviceclassid [paramname paramvalue]"
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user