Commit a6b616af authored by Jasem Mutlaq's avatar Jasem Mutlaq

Return whether city was found or not

parent f60080d1
......@@ -330,8 +330,9 @@ public Q_SLOTS:
* @param city the city name of the location
* @param province the province name of the location
* @param country the country name of the location
* @return True if geographic location is found and set, false otherwise.
*/
Q_SCRIPTABLE Q_NOREPLY void setGeoLocation( const QString &city, const QString &province, const QString &country );
Q_SCRIPTABLE bool setGeoLocation( const QString &city, const QString &province, const QString &country );
/** DBUS interface function. Modify a color.
* @param colorName the name of the color to be modified (e.g., "SkyColor")
......
......@@ -187,7 +187,7 @@ void KStars::drawLine( int /*x1*/, int /*y1*/, int /*x2*/, int /*y2*/, int /*spe
//Draw a line on the skymap display
}
void KStars::setGeoLocation( const QString &city, const QString &province, const QString &country ) {
bool KStars::setGeoLocation( const QString &city, const QString &province, const QString &country ) {
//Set the geographic location
bool cityFound( false );
......@@ -230,8 +230,10 @@ void KStars::setGeoLocation( const QString &city, const QString &province, const
if ( province.isEmpty() )
qDebug() << QString("Error [D-Bus setGeoLocation]: city %1, %2 not found in database.").arg(city).arg(country);
else
qDebug() << QString("Error [D-Bus setGeoLocation]: city %1, %2, %3 not found in database.").arg(city).arg(province).arg(country);
qDebug() << QString("Error [D-Bus setGeoLocation]: city %1, %2, %3 not found in database.").arg(city).arg(province).arg(country);
}
return cityFound;
}
void KStars::readConfig() {
......
......@@ -97,7 +97,7 @@
<arg name="city" type="s" direction="in"/>
<arg name="province" type="s" direction="in"/>
<arg name="country" type="s" direction="in"/>
<annotation name="org.freedesktop.DBus.Method.NoReply" value="true"/>
<arg type="b" direction="out"/>
</method>
<method name="setColor">
<arg name="colorName" type="s" direction="in"/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment