summaryrefslogtreecommitdiff
path: root/applets/clock/clock.c
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2024-01-28 02:53:56 +0100
committerraveit65 <[email protected]>2024-02-04 18:37:58 +0100
commite663fbaeba760003b4088e567af0883534891e59 (patch)
treefd7b6805cc5d0e022f526e6343bb2539aa12f54e /applets/clock/clock.c
parent6a9848eb8388807d13c38cdaceabfc143f6640aa (diff)
downloadmate-panel-e663fbaeba760003b4088e567af0883534891e59.tar.bz2
mate-panel-e663fbaeba760003b4088e567af0883534891e59.tar.xz
Revert "Reduce scope of variables"
This reverts commit 96c7ebc6dc9e8b8327db04a9570054ee78743353.
Diffstat (limited to 'applets/clock/clock.c')
-rw-r--r--applets/clock/clock.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/applets/clock/clock.c b/applets/clock/clock.c
index f97e56af..309d4884 100644
--- a/applets/clock/clock.c
+++ b/applets/clock/clock.c
@@ -2219,6 +2219,9 @@ location_set_current_cb (ClockLocation *loc,
static void
locations_changed (ClockData *cd)
{
+ GSList *l;
+ glong id;
+
if (!cd->locations) {
if (cd->weather_obox)
gtk_widget_hide (cd->weather_obox);
@@ -2233,9 +2236,8 @@ locations_changed (ClockData *cd)
gtk_widget_show (cd->weather_obox);
}
- for (GSList *l = cd->locations; l; l = l->next) {
+ for (l = cd->locations; l; l = l->next) {
ClockLocation *loc = l->data;
- glong id;
id = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (loc), "weather-updated"));
if (id == 0) {
@@ -2512,6 +2514,7 @@ setup_gsettings (ClockData *cd)
static GSList *
parse_gsettings_cities (ClockData *cd, gchar **values)
{
+ gint i;
LocationParserData data;
GMarkupParseContext *context;
@@ -2521,7 +2524,7 @@ parse_gsettings_cities (ClockData *cd, gchar **values)
context = g_markup_parse_context_new (&location_parser, 0, &data, NULL);
if (values) {
- for (gint i = 0; values[i]; i++) {
+ for (i = 0; values[i]; i++) {
g_markup_parse_context_parse (context, values[i], strlen(values[i]), NULL);
}
}
@@ -2586,11 +2589,11 @@ system_manager_signal_cb (GDBusProxy *proxy,
GVariant *parameters,
ClockData *cd)
{
+ GVariant *variant;
+ gboolean active;
+
if (g_strcmp0 (signal_name, "PrepareForSleep") == 0)
{
- GVariant *variant;
- gboolean active;
-
variant = g_variant_get_child_value (parameters, 0);
active = g_variant_get_boolean (variant);
g_variant_unref (variant);