[gnome-applets/wip/muktupavels/gweather-4] gweather: port to libgweather 4




commit 7bdc6b1bff5fe4209061587ca61f84670f63fd6e
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Fri Feb 25 23:34:47 2022 +0200

    gweather: port to libgweather 4
    
    https://gitlab.gnome.org/GNOME/gnome-panel/-/issues/38

 .gitlab-ci.yml                           |  2 +-
 configure.ac                             |  4 ++--
 gnome-applets/gweather/gweather-applet.c |  6 +++---
 gnome-applets/gweather/gweather-applet.h |  1 -
 gnome-applets/gweather/gweather-pref.c   |  1 -
 gnome-applets/gweather/gweather-xml.c    | 13 ++++++-------
 6 files changed, 12 insertions(+), 15 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index d597f9267..71b49c25d 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -23,7 +23,7 @@ variables:
                   libgtk-3-dev
                   libgtop2-dev
                   libgucharmap-2-90-dev
-                  libgweather-3-dev
+                  libgweather-4-dev
                   libnotify-dev
                   libpolkit-gobject-1-dev
                   libtracker-sparql-3.0-dev
diff --git a/configure.ac b/configure.ac
index 47900c603..9ec7b3163 100644
--- a/configure.ac
+++ b/configure.ac
@@ -75,7 +75,7 @@ LIBNOTIFY_REQUIRED=0.7
 UPOWER_REQUIRED=0.99.8
 ADWAITA_ICON_THEME_REQUIRED=3.14.0
 LIBXML_REQUIRED=2.5.0
-GWEATHER_REQUIRED=40.beta
+GWEATHER_REQUIRED=3.91.0
 GUCHARMAP3_REQUIRED=2.33.0
 POLKIT_REQUIRED=0.97
 dnl ***************************************************************************
@@ -171,7 +171,7 @@ dnl -- check for libxml2 (required) ------------------------------------------
 PKG_CHECK_MODULES(XML2, libxml-2.0 >= $LIBXML_REQUIRED)
 
  dnl -- check for libgweather (required) ------------------
-PKG_CHECK_MODULES(LIBGWEATHER, gweather-3.0 >= $GWEATHER_REQUIRED)
+PKG_CHECK_MODULES(LIBGWEATHER, gweather4 >= $GWEATHER_REQUIRED)
 
  dnl -- check for tracker-sparql (required for tracker-search-bar) ------------
 PKG_CHECK_MODULES([TRACKER_SEARCH_BAR], [
diff --git a/gnome-applets/gweather/gweather-applet.c b/gnome-applets/gweather/gweather-applet.c
index bfdca7248..7744bf137 100644
--- a/gnome-applets/gweather/gweather-applet.c
+++ b/gnome-applets/gweather/gweather-applet.c
@@ -56,7 +56,7 @@ get_default_location (GWeatherApplet *gw_applet)
     location = gweather_location_find_by_station_code (world, station_code);
     g_variant_unref (default_loc);
 
-    gweather_location_unref (world);
+    g_object_unref (world);
 
     return location;
 }
@@ -372,7 +372,7 @@ void gweather_applet_create (GWeatherApplet *gw_applet)
 
     location = get_default_location (gw_applet);
     gw_applet->gweather_info = gweather_info_new (location);
-    gweather_location_unref (location);
+    g_object_unref (location);
 
     gweather_info_set_application_id (gw_applet->gweather_info, "org.gnome.gnome-applets");
 
@@ -540,7 +540,7 @@ void gweather_update (GWeatherApplet *gw_applet)
 
     location = get_default_location (gw_applet);
     gweather_info_set_location (gw_applet->gweather_info, location);
-    gweather_location_unref (location);
+    g_object_unref (location);
 
     gweather_info_update (gw_applet->gweather_info);
 }
diff --git a/gnome-applets/gweather/gweather-applet.h b/gnome-applets/gweather/gweather-applet.h
index d156e9c11..5acbc878f 100644
--- a/gnome-applets/gweather/gweather-applet.h
+++ b/gnome-applets/gweather/gweather-applet.h
@@ -21,7 +21,6 @@
 
 #include <glib/gi18n-lib.h>
 
-#define GWEATHER_I_KNOW_THIS_IS_UNSTABLE
 #include <libgweather/gweather.h>
 
 #include <libgnome-panel/gp-applet.h>
diff --git a/gnome-applets/gweather/gweather-pref.c b/gnome-applets/gweather/gweather-pref.c
index 285632658..5e65eafc4 100644
--- a/gnome-applets/gweather/gweather-pref.c
+++ b/gnome-applets/gweather/gweather-pref.c
@@ -26,7 +26,6 @@
 #include <ctype.h>
 #include <locale.h>
 
-#define GWEATHER_I_KNOW_THIS_IS_UNSTABLE
 #include <libgweather/gweather.h>
 
 #include "gweather-xml.h"
diff --git a/gnome-applets/gweather/gweather-xml.c b/gnome-applets/gweather/gweather-xml.c
index d7124c2e5..bdfce7f94 100644
--- a/gnome-applets/gweather/gweather-xml.c
+++ b/gnome-applets/gweather/gweather-xml.c
@@ -28,7 +28,6 @@
 #include <gtk/gtk.h>
 #include <libxml/xmlreader.h>
 
-#define GWEATHER_I_KNOW_THIS_IS_UNSTABLE
 #include <libgweather/gweather.h>
 
 #include "gweather-xml.h"
@@ -88,7 +87,7 @@ gweather_xml_parse_node (GWeatherLocation *gloc,
                            -1);
 
        if (first_child != NULL) {
-           gweather_location_ref (first_child);
+           g_object_ref (first_child);
            second_child = gweather_location_next_child (gloc, first_child);
 
            if (second_child == NULL) {
@@ -107,7 +106,7 @@ gweather_xml_parse_node (GWeatherLocation *gloc,
                                    -1);
            }
 
-           g_clear_pointer (&second_child, gweather_location_unref);
+           g_clear_object (&second_child);
        }
        break;
 
@@ -122,7 +121,7 @@ gweather_xml_parse_node (GWeatherLocation *gloc,
                if (gweather_location_get_level (parent_loc) == GWEATHER_LOCATION_CITY)
                        name = gweather_location_get_name (parent_loc);
 
-               gweather_location_unref (parent_loc);
+               g_object_unref (parent_loc);
        }
 
        code = gweather_location_get_code (gloc);
@@ -150,12 +149,12 @@ gweather_xml_parse_node (GWeatherLocation *gloc,
        break;
     }
 
-    g_clear_pointer (&first_child, gweather_location_unref);
+    g_clear_object (&first_child);
 
     child = NULL;
     while ((child = gweather_location_next_child (gloc, child)) != NULL) {
        if (!gweather_xml_parse_node (child, store, self)) {
-           gweather_location_unref (child);
+           g_object_unref (child);
            return FALSE;
        }
     }
@@ -180,7 +179,7 @@ gweather_xml_load_locations (void)
        store = NULL;
     }
 
-    gweather_location_unref (world);
+    g_object_unref (world);
 
     return (GtkTreeModel *)store;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]