summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTeemu Ikonen <tpikonen@mailbox.org>2023-07-08 19:15:49 +0300
committerTeemu Ikonen <tpikonen@mailbox.org>2023-07-17 13:28:49 +0000
commit5c9c5c8a76c22ca9248b82a3a080b942b47be605 (patch)
treeb6b4d75dee0c781f4b6acbd883025b2511e61736
parent89511c08eba50135a41f03e543b0fb9c531c376e (diff)
location: Remove error arg from gclue_location_create_from_nmeas
Also adapt callers.
-rw-r--r--src/gclue-location.c9
-rw-r--r--src/gclue-location.h3
-rw-r--r--src/gclue-modem-gps.c14
-rw-r--r--src/gclue-nmea-source.c8
4 files changed, 8 insertions, 26 deletions
diff --git a/src/gclue-location.c b/src/gclue-location.c
index 9530d27..51cd056 100644
--- a/src/gclue-location.c
+++ b/src/gclue-location.c
@@ -715,7 +715,6 @@ gclue_location_create_from_rmc (const char *rmc,
* gclue_location_create_from_nmeas:
* @nmea: A NULL terminated array NMEA sentence strings
* @prev_location: Previous location provided from the location source
- * @error: Place-holder for errors.
*
* Creates a new #GClueLocation object by combining data from multiple NMEA
* sentences.
@@ -726,8 +725,7 @@ gclue_location_create_from_rmc (const char *rmc,
**/
GClueLocation *
gclue_location_create_from_nmeas (const char *nmeas[],
- GClueLocation *prev_location,
- GError **error)
+ GClueLocation *prev_location)
{
GClueLocation *gga_loc = NULL;
GClueLocation *rmc_loc = NULL;
@@ -758,10 +756,7 @@ gclue_location_create_from_nmeas (const char *nmeas[],
if (rmc_loc)
return rmc_loc;
- g_set_error_literal (error,
- G_IO_ERROR,
- G_IO_ERROR_INVALID_ARGUMENT,
- "Valid NMEA GGA or RMC sentence not found");
+ g_debug ("Valid NMEA GGA or RMC sentence not found");
return NULL;
}
diff --git a/src/gclue-location.h b/src/gclue-location.h
index bbe2daa..40f2d6a 100644
--- a/src/gclue-location.h
+++ b/src/gclue-location.h
@@ -160,8 +160,7 @@ GClueLocation *gclue_location_new_full
GClueLocation *gclue_location_create_from_nmeas
(const char *nmeas[],
- GClueLocation *prev_location,
- GError **error);
+ GClueLocation *prev_location);
GClueLocation *gclue_location_duplicate
(GClueLocation *location);
diff --git a/src/gclue-modem-gps.c b/src/gclue-modem-gps.c
index df2a5ab..888a76d 100644
--- a/src/gclue-modem-gps.c
+++ b/src/gclue-modem-gps.c
@@ -216,21 +216,13 @@ on_fix_gps (GClueModem *modem,
GClueLocationSource *source = GCLUE_LOCATION_SOURCE (user_data);
GClueLocation *prev_location;
g_autoptr(GClueLocation) location = NULL;
- g_autoptr(GError) error = NULL;
prev_location = gclue_location_source_get_location (source);
- location = gclue_location_create_from_nmeas (nmeas,
- prev_location,
- &error);
-
- if (error != NULL) {
- g_warning ("Error: %s", error->message);
+ location = gclue_location_create_from_nmeas (nmeas, prev_location);
- return;
+ if (location) {
+ gclue_location_source_set_location (source, location);
}
-
- gclue_location_source_set_location (source,
- location);
}
static GClueLocationSourceStartResult
diff --git a/src/gclue-nmea-source.c b/src/gclue-nmea-source.c
index 7484f0b..8ea8bae 100644
--- a/src/gclue-nmea-source.c
+++ b/src/gclue-nmea-source.c
@@ -771,12 +771,8 @@ on_read_nmea_sentence (GObject *object,
prev_location = gclue_location_source_get_location
(GCLUE_LOCATION_SOURCE (source));
location = gclue_location_create_from_nmeas (sentences,
- prev_location,
- &error);
-
- if (error != NULL) {
- g_warning ("Error: %s", error->message);
- } else {
+ prev_location);
+ if (location) {
gclue_location_source_set_location
(GCLUE_LOCATION_SOURCE (source), location);
}