diff options
author | raveit65 <[email protected]> | 2024-01-28 02:53:56 +0100 |
---|---|---|
committer | raveit65 <[email protected]> | 2024-02-04 18:37:58 +0100 |
commit | e663fbaeba760003b4088e567af0883534891e59 (patch) | |
tree | fd7b6805cc5d0e022f526e6343bb2539aa12f54e | |
parent | 6a9848eb8388807d13c38cdaceabfc143f6640aa (diff) | |
download | mate-panel-e663fbaeba760003b4088e567af0883534891e59.tar.bz2 mate-panel-e663fbaeba760003b4088e567af0883534891e59.tar.xz |
Revert "Reduce scope of variables"
This reverts commit 96c7ebc6dc9e8b8327db04a9570054ee78743353.
-rw-r--r-- | applets/clock/calendar-window.c | 4 | ||||
-rw-r--r-- | applets/clock/clock.c | 15 | ||||
-rw-r--r-- | applets/notification_area/na-grid.c | 5 | ||||
-rw-r--r-- | applets/notification_area/status-notifier/sn-host-v0.c | 3 | ||||
-rw-r--r-- | applets/notification_area/status-notifier/sn-item-v0.c | 3 | ||||
-rw-r--r-- | applets/notification_area/system-tray/na-tray-manager.c | 3 | ||||
-rw-r--r-- | libmate-panel-applet/mate-panel-applet-gsettings.c | 8 | ||||
-rw-r--r-- | mate-panel/button-widget.c | 6 | ||||
-rw-r--r-- | mate-panel/libmate-panel-applet-private/panel-applets-manager-dbus.c | 13 | ||||
-rw-r--r-- | mate-panel/libpanel-util/panel-color.c | 8 | ||||
-rw-r--r-- | mate-panel/libpanel-util/panel-gtk.c | 3 | ||||
-rw-r--r-- | mate-panel/libpanel-util/panel-keyfile.c | 5 | ||||
-rw-r--r-- | mate-panel/mate-desktop-item-edit.c | 3 | ||||
-rw-r--r-- | mate-panel/panel-lockdown.c | 8 | ||||
-rw-r--r-- | mate-panel/panel-menu-items.c | 24 | ||||
-rw-r--r-- | mate-panel/panel-multimonitor.c | 3 | ||||
-rw-r--r-- | mate-panel/panel-profile.c | 4 | ||||
-rw-r--r-- | mate-panel/panel-test-applets.c | 5 | ||||
-rw-r--r-- | mate-panel/panel-widget.c | 9 |
19 files changed, 74 insertions, 58 deletions
diff --git a/applets/clock/calendar-window.c b/applets/clock/calendar-window.c index b4157344..cf6ef670 100644 --- a/applets/clock/calendar-window.c +++ b/applets/clock/calendar-window.c @@ -543,6 +543,8 @@ void calendar_window_set_show_weeks (CalendarWindow *calwin, gboolean show_weeks) { + GtkCalendarDisplayOptions options; + g_return_if_fail (CALENDAR_IS_WINDOW (calwin)); if (show_weeks == calwin->priv->show_weeks) @@ -551,8 +553,6 @@ calendar_window_set_show_weeks (CalendarWindow *calwin, calwin->priv->show_weeks = show_weeks; if (calwin->priv->calendar) { - GtkCalendarDisplayOptions options; - options = gtk_calendar_get_display_options (GTK_CALENDAR (calwin->priv->calendar)); if (show_weeks) 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); diff --git a/applets/notification_area/na-grid.c b/applets/notification_area/na-grid.c index 9a4c45d9..9698be6c 100644 --- a/applets/notification_area/na-grid.c +++ b/applets/notification_area/na-grid.c @@ -317,6 +317,8 @@ na_grid_realize (GtkWidget *widget) NaGrid *self = NA_GRID (widget); GdkScreen *screen; GdkDisplay *display; + GtkOrientation orientation; + NaHost *tray_host; GSettings *settings; GTK_WIDGET_CLASS (na_grid_parent_class)->realize (widget); @@ -326,9 +328,6 @@ na_grid_realize (GtkWidget *widget) screen = gtk_widget_get_screen (GTK_WIDGET (self)); if (GDK_IS_X11_DISPLAY (display)) { - GtkOrientation orientation; - NaHost *tray_host; - orientation = gtk_orientable_get_orientation (GTK_ORIENTABLE (self)); tray_host = na_tray_new_for_screen (screen, orientation); g_object_bind_property (self, "orientation", diff --git a/applets/notification_area/status-notifier/sn-host-v0.c b/applets/notification_area/status-notifier/sn-host-v0.c index 4ad6b359..64da5da9 100644 --- a/applets/notification_area/status-notifier/sn-host-v0.c +++ b/applets/notification_area/status-notifier/sn-host-v0.c @@ -193,6 +193,7 @@ register_host_cb (GObject *source_object, GError *error; SnHostV0 *v0; gchar **items; + gint i; error = NULL; sn_watcher_v0_gen_call_register_host_finish (SN_WATCHER_V0_GEN (source_object), @@ -223,7 +224,7 @@ register_host_cb (GObject *source_object, items = sn_watcher_v0_gen_dup_registered_items (v0->watcher); if (items) { - for (gint i = 0; items[i] != NULL; i++) + for (i = 0; items[i] != NULL; i++) add_registered_item (v0, items[i]); } diff --git a/applets/notification_area/status-notifier/sn-item-v0.c b/applets/notification_area/status-notifier/sn-item-v0.c index 9deab9d3..fd963c31 100644 --- a/applets/notification_area/status-notifier/sn-item-v0.c +++ b/applets/notification_area/status-notifier/sn-item-v0.c @@ -244,6 +244,7 @@ update (SnItemV0 *v0) GtkImage *image; SnTooltip *tip; gint icon_size; + gboolean visible; const gchar *icon_name; SnIconPixmap **icon_pixmap; @@ -361,7 +362,7 @@ update (SnItemV0 *v0) /* TODO: hide "Passive" items with a setting? */ /*Special case mate-polkit*/ if (g_strcmp0 (v0->status, "password-dialog") != 0){ - gboolean visible = g_strcmp0 (v0->status, "Passive") != 0; + visible = g_strcmp0 (v0->status, "Passive") != 0; gtk_widget_set_visible (GTK_WIDGET (v0), visible); } else diff --git a/applets/notification_area/system-tray/na-tray-manager.c b/applets/notification_area/system-tray/na-tray-manager.c index 2bb679d8..d4f27ff3 100644 --- a/applets/notification_area/system-tray/na-tray-manager.c +++ b/applets/notification_area/system-tray/na-tray-manager.c @@ -537,6 +537,7 @@ na_tray_manager_unmanage (NaTrayManager *manager) { #ifdef GDK_WINDOWING_X11 GdkDisplay *display; + guint32 timestamp; GtkWidget *invisible; GdkWindow *window; @@ -555,7 +556,7 @@ na_tray_manager_unmanage (NaTrayManager *manager) if (gdk_selection_owner_get_for_display (display, manager->selection_atom) == window) { - guint32 timestamp = gdk_x11_get_server_time (window); + timestamp = gdk_x11_get_server_time (window); gdk_selection_owner_set_for_display (display, NULL, manager->selection_atom, diff --git a/libmate-panel-applet/mate-panel-applet-gsettings.c b/libmate-panel-applet/mate-panel-applet-gsettings.c index 82867639..a4bd3db1 100644 --- a/libmate-panel-applet/mate-panel-applet-gsettings.c +++ b/libmate-panel-applet/mate-panel-applet-gsettings.c @@ -149,9 +149,9 @@ void mate_panel_applet_settings_set_glist (GSettings *settings, gchar *key, GList *list) { GArray *array; - + GList *l; array = g_array_new (TRUE, TRUE, sizeof (gchar *)); - for (GList *l = list; l; l = l->next) { + for (l = list; l; l = l->next) { array = g_array_append_val (array, l->data); } g_settings_set_strv (settings, key, (const gchar **) array->data); @@ -178,9 +178,9 @@ void mate_panel_applet_settings_set_gslist (GSettings *settings, gchar *key, GSList *list) { GArray *array; - + GSList *l; array = g_array_new (TRUE, TRUE, sizeof (gchar *)); - for (GSList *l = list; l; l = l->next) { + for (l = list; l; l = l->next) { array = g_array_append_val (array, l->data); } g_settings_set_strv (settings, key, (const gchar **) array->data); diff --git a/mate-panel/button-widget.c b/mate-panel/button-widget.c index 00753b99..43d432a9 100644 --- a/mate-panel/button-widget.c +++ b/mate-panel/button-widget.c @@ -161,6 +161,8 @@ button_widget_unset_surfaces (ButtonWidget *button) static void button_widget_reload_surface (ButtonWidget *button) { + GdkDisplay *display; + gint scale; button_widget_unset_surfaces (button); button->priv->needs_move = FALSE; @@ -168,9 +170,7 @@ button_widget_reload_surface (ButtonWidget *button) return; if (button->priv->filename != NULL && button->priv->filename [0] != '\0') { - GdkDisplay *display; - gint scale; - char *error = NULL; + char *error = NULL; /* icons findable in the icon theme can be handled by gtk directly*/ display = gdk_display_get_default (); scale = gtk_widget_get_scale_factor (GTK_WIDGET (button)); diff --git a/mate-panel/libmate-panel-applet-private/panel-applets-manager-dbus.c b/mate-panel/libmate-panel-applet-private/panel-applets-manager-dbus.c index b65fe4a7..115919b0 100644 --- a/mate-panel/libmate-panel-applet-private/panel-applets-manager-dbus.c +++ b/mate-panel/libmate-panel-applet-private/panel-applets-manager-dbus.c @@ -159,6 +159,7 @@ mate_panel_applets_manager_get_applet_factory_info_from_file (const gchar *filen { MatePanelAppletFactoryInfo *info; GKeyFile *applet_file; + const char *lib_prefix; gchar **groups; gsize n_groups; gsize i; @@ -188,8 +189,6 @@ mate_panel_applets_manager_get_applet_factory_info_from_file (const gchar *filen info->in_process = g_key_file_get_boolean (applet_file, MATE_PANEL_APPLET_FACTORY_GROUP, "InProcess", NULL); if (info->in_process) { - const char *lib_prefix; - info->location = g_key_file_get_string (applet_file, MATE_PANEL_APPLET_FACTORY_GROUP, "Location", NULL); if (!info->location) { @@ -336,15 +335,15 @@ applets_directory_changed (GFileMonitor *monitor, static void mate_panel_applets_manager_dbus_load_applet_infos (MatePanelAppletsManagerDBus *manager) { - GSList *dirs; + GSList *dirs, *d; + GDir *dir; + const gchar *dirent; + GError *error = NULL; dirs = mate_panel_applets_manager_get_applets_dirs (); - for (GSList *d = dirs; d; d = g_slist_next (d)) { - GDir *dir; - const gchar *dirent; + for (d = dirs; d; d = g_slist_next (d)) { GFileMonitor *monitor; GFile *dir_file; - GError *error = NULL; gchar *path = (gchar *) d->data; dir = g_dir_open (path, 0, &error); diff --git a/mate-panel/libpanel-util/panel-color.c b/mate-panel/libpanel-util/panel-color.c index 661e6fb5..f6148aaa 100644 --- a/mate-panel/libpanel-util/panel-color.c +++ b/mate-panel/libpanel-util/panel-color.c @@ -17,6 +17,7 @@ rgb_to_hls (gdouble *r, gdouble *g, gdouble *b) gdouble green; gdouble blue; gdouble h, l, s; + gdouble delta; red = *r; green = *g; @@ -49,8 +50,6 @@ rgb_to_hls (gdouble *r, gdouble *g, gdouble *b) h = 0; if (max != min) { - gdouble delta; - if (l <= 0.5) s = (max - min) / (max + min); else @@ -85,9 +84,11 @@ rgb_to_hls (gdouble *r, gdouble *g, gdouble *b) static void hls_to_rgb (gdouble *h, gdouble *l, gdouble *s) { + gdouble hue; gdouble lightness; gdouble saturation; gdouble m1, m2; + gdouble r, g, b; lightness = *l; saturation = *s; @@ -103,9 +104,6 @@ hls_to_rgb (gdouble *h, gdouble *l, gdouble *s) *l = lightness; *s = lightness; } else { - gdouble hue; - gdouble r, g, b; - hue = *h + 120; while (hue > 360) hue -= 360; diff --git a/mate-panel/libpanel-util/panel-gtk.c b/mate-panel/libpanel-util/panel-gtk.c index 3672fca8..d638d75d 100644 --- a/mate-panel/libpanel-util/panel-gtk.c +++ b/mate-panel/libpanel-util/panel-gtk.c @@ -119,6 +119,7 @@ panel_file_chooser_dialog_new_valist (const gchar *title, { GtkWidget *result; const char *button_text = first_button_text; + gint response_id; result = g_object_new (GTK_TYPE_FILE_CHOOSER_DIALOG, "title", title, @@ -130,7 +131,7 @@ panel_file_chooser_dialog_new_valist (const gchar *title, while (button_text) { - gint response_id = va_arg (varargs, gint); + response_id = va_arg (varargs, gint); if (g_strcmp0 (button_text, "process-stop") == 0) panel_dialog_add_button (GTK_DIALOG (result), _("_Cancel"), button_text, response_id); diff --git a/mate-panel/libpanel-util/panel-keyfile.c b/mate-panel/libpanel-util/panel-keyfile.c index b98058c3..0b0104ef 100644 --- a/mate-panel/libpanel-util/panel-keyfile.c +++ b/mate-panel/libpanel-util/panel-keyfile.c @@ -53,6 +53,8 @@ _panel_key_file_make_executable (const gchar *path) { GFile *file; GFileInfo *info; + guint32 current_perms; + guint32 new_perms; file = g_file_new_for_path (path); @@ -70,9 +72,6 @@ _panel_key_file_make_executable (const gchar *path) } if (g_file_info_has_attribute (info, G_FILE_ATTRIBUTE_UNIX_MODE)) { - guint32 current_perms; - guint32 new_perms; - current_perms = g_file_info_get_attribute_uint32 (info, G_FILE_ATTRIBUTE_UNIX_MODE); new_perms = current_perms | S_IXGRP | S_IXUSR | S_IXOTH; diff --git a/mate-panel/mate-desktop-item-edit.c b/mate-panel/mate-desktop-item-edit.c index b37f43ed..b0912405 100644 --- a/mate-panel/mate-desktop-item-edit.c +++ b/mate-panel/mate-desktop-item-edit.c @@ -123,6 +123,7 @@ main (int argc, char * argv[]) for (i = 0; desktops[i] != NULL; i++) { GFile *file; GFileInfo *info; + GFileType type; char *uri; char *path; GtkWidget *dlg = NULL; @@ -135,7 +136,7 @@ main (int argc, char * argv[]) g_object_unref (file); if (info) { - GFileType type = g_file_info_get_file_type (info); + type = g_file_info_get_file_type (info); if (type == G_FILE_TYPE_DIRECTORY && create_new) { diff --git a/mate-panel/panel-lockdown.c b/mate-panel/panel-lockdown.c index 8750be81..16648ee3 100644 --- a/mate-panel/panel-lockdown.c +++ b/mate-panel/panel-lockdown.c @@ -269,10 +269,12 @@ panel_lockdown_get_disable_force_quit (void) gboolean panel_lockdown_is_applet_disabled (const char *iid) { + gint i; + g_assert (panel_lockdown.initialized != FALSE); if (panel_lockdown.disabled_applets) - for (gint i = 0; panel_lockdown.disabled_applets[i]; i++) + for (i = 0; panel_lockdown.disabled_applets[i]; i++) if (!strcmp (panel_lockdown.disabled_applets[i], iid)) return TRUE; @@ -284,7 +286,9 @@ panel_lockdown_notify_find (GSList *closures, GCallback callback_func, gpointer user_data) { - for (GSList *l = closures; l; l = l->next) { + GSList *l; + + for (l = closures; l; l = l->next) { GCClosure *cclosure = l->data; GClosure *closure = l->data; diff --git a/mate-panel/panel-menu-items.c b/mate-panel/panel-menu-items.c index 14b58701..05af4969 100644 --- a/mate-panel/panel-menu-items.c +++ b/mate-panel/panel-menu-items.c @@ -143,6 +143,7 @@ panel_menu_items_append_from_desktop (GtkWidget *menu, char *uri; char *type; gboolean is_application; + char *tryexec; char *icon; char *name; char *comment; @@ -197,7 +198,7 @@ panel_menu_items_append_from_desktop (GtkWidget *menu, g_free (type); if (is_application) { - char *tryexec = panel_key_file_get_string (key_file, "TryExec"); + tryexec = panel_key_file_get_string (key_file, "TryExec"); if (tryexec) { char *prog; @@ -408,6 +409,7 @@ panel_place_menu_item_append_gtk_bookmarks (GtkWidget *menu, guint max_items_or_ char *line = (char*) l->data; if (line[0] && !g_hash_table_lookup (table, line)) { + GFile *file; char *space; char *label; gboolean keep; @@ -428,7 +430,7 @@ panel_place_menu_item_append_gtk_bookmarks (GtkWidget *menu, guint max_items_or_ keep = TRUE; if (!keep) { - GFile *file = g_file_new_for_uri (line); + file = g_file_new_for_uri (line); keep = !g_file_is_native (file) || g_file_query_exists (file, NULL); g_object_unref (file); @@ -542,16 +544,15 @@ drive_poll_for_media_cb (GObject *source_object, GAsyncResult *res, gpointer user_data) { - GError *error; + GdkScreen *screen; + GError *error; + char *primary; + char *name; error = NULL; if (!g_drive_poll_for_media_finish (G_DRIVE (source_object), res, &error)) { if (error->code != G_IO_ERROR_FAILED_HANDLED) { - GdkScreen *screen; - char *primary; - char *name; - screen = GDK_SCREEN (user_data); name = g_drive_get_name (G_DRIVE (source_object)); @@ -632,10 +633,10 @@ volume_mount_cb (GObject *source_object, error = NULL; if (!g_volume_mount_finish (G_VOLUME (source_object), res, &error)) { - if (error->code != G_IO_ERROR_FAILED_HANDLED) { - char *primary; - char *name; + char *primary; + char *name; + if (error->code != G_IO_ERROR_FAILED_HANDLED) { name = g_volume_get_name (G_VOLUME (source_object)); primary = g_strdup_printf (_("Unable to mount %s"), name); @@ -1018,6 +1019,7 @@ static GtkWidget * panel_place_menu_item_create_menu (PanelPlaceMenuItem *place_item) { GtkWidget *places_menu; + GtkWidget *item; char *gsettings_name = NULL; char *name; char *uri; @@ -1099,7 +1101,7 @@ panel_place_menu_item_create_menu (PanelPlaceMenuItem *place_item) if (panel_is_program_in_path ("caja-connect-server") || panel_is_program_in_path ("nautilus-connect-server") || panel_is_program_in_path ("nemo-connect-server")) { - GtkWidget *item = panel_menu_items_create_action_item (PANEL_ACTION_CONNECT_SERVER); + item = panel_menu_items_create_action_item (PANEL_ACTION_CONNECT_SERVER); if (item != NULL) gtk_menu_shell_append (GTK_MENU_SHELL (places_menu), item); diff --git a/mate-panel/panel-multimonitor.c b/mate-panel/panel-multimonitor.c index c7ac14cc..b2723f12 100644 --- a/mate-panel/panel-multimonitor.c +++ b/mate-panel/panel-multimonitor.c @@ -71,6 +71,7 @@ _panel_multimonitor_output_should_be_first (Display *xdisplay, unsigned long nitems; unsigned long bytes_after; unsigned char *prop; + gboolean retval; connector_type_atom = XInternAtom (xdisplay, "ConnectorType", False); @@ -80,7 +81,7 @@ _panel_multimonitor_output_should_be_first (Display *xdisplay, &nitems, &bytes_after, &prop) == Success) { if (actual_type == XA_ATOM && nitems == 1 && actual_format == 32) { char *connector_type = XGetAtomName (xdisplay, prop[0]); - gboolean retval = g_strcmp0 (connector_type, "Panel") == 0; + retval = g_strcmp0 (connector_type, "Panel") == 0; XFree (connector_type); return retval; } diff --git a/mate-panel/panel-profile.c b/mate-panel/panel-profile.c index e2b6841d..47d6d95b 100644 --- a/mate-panel/panel-profile.c +++ b/mate-panel/panel-profile.c @@ -1618,9 +1618,11 @@ panel_profile_load_list (GSettings *settings, PanelProfileLoadFunc load_handler, GCallback notify_handler) { + const gchar *key = key_from_type (type); gchar *changed_signal; gchar **list; + gint i; changed_signal = g_strdup_printf ("changed::%s", key); g_signal_connect (settings, changed_signal, G_CALLBACK (notify_handler), NULL); @@ -1628,7 +1630,7 @@ panel_profile_load_list (GSettings *settings, list = g_settings_get_strv (settings, key); - for (gint i = 0; list[i]; i++) { + for (i = 0; list[i]; i++) { load_handler (list[i]); } diff --git a/mate-panel/panel-test-applets.c b/mate-panel/panel-test-applets.c index 79b48d36..f14c3888 100644 --- a/mate-panel/panel-test-applets.c +++ b/mate-panel/panel-test-applets.c @@ -178,12 +178,13 @@ static void load_applet_from_command_line (void) { guint size = 24, orient = PANEL_ORIENTATION_TOP; + gsize i; g_assert (cli_iid != NULL); if (cli_size || cli_orient) { if (cli_size) { - for (gsize i = 0; i < G_N_ELEMENTS (size_items); i++) { + for (i = 0; i < G_N_ELEMENTS (size_items); i++) { if (strcmp (g_dpgettext2 (NULL, "Size", size_items[i].name), cli_size) == 0) { size = size_items[i].value; break; @@ -192,7 +193,7 @@ load_applet_from_command_line (void) } if (cli_orient) { - for (gsize i = 0; i < G_N_ELEMENTS (orient_items); i++) { + for (i = 0; i < G_N_ELEMENTS (orient_items); i++) { if (strcmp (g_dpgettext2 (NULL, "Orientation", orient_items[i].name), cli_orient) == 0) { orient = orient_items[i].value; break; diff --git a/mate-panel/panel-widget.c b/mate-panel/panel-widget.c index 9a9ce829..dd8f6d11 100644 --- a/mate-panel/panel-widget.c +++ b/mate-panel/panel-widget.c @@ -1504,6 +1504,7 @@ panel_widget_size_allocate(GtkWidget *widget, GtkAllocation *allocation) AppletData *ad = list->data; GtkRequisition chreq; const char *id; + AppletInfo *info; int position = ad->pos; PanelObjectEdgeRelativity edge_relativity = PANEL_EDGE_START; gboolean right_stuck = FALSE; @@ -1525,7 +1526,7 @@ panel_widget_size_allocate(GtkWidget *widget, GtkAllocation *allocation) id = mate_panel_applet_get_id_by_widget (ad->applet); if (id) { - AppletInfo *info = mate_panel_applet_get_by_id (id); + info = mate_panel_applet_get_by_id (id); position = g_settings_get_int (info->settings, PANEL_OBJECT_POSITION_KEY); edge_relativity = g_settings_get_enum (info->settings, @@ -1671,8 +1672,10 @@ panel_widget_size_allocate(GtkWidget *widget, GtkAllocation *allocation) if (ad->expand_major) { const char *id; + AppletInfo *info; PanelObjectEdgeRelativity edge_relativity = PANEL_EDGE_START; gboolean right_stuck; + AppletData *pad; int prior_space; int following_space; int additional_space; @@ -1680,7 +1683,7 @@ panel_widget_size_allocate(GtkWidget *widget, GtkAllocation *allocation) id = mate_panel_applet_get_id_by_widget (ad->applet); if (id) { - AppletInfo *info = mate_panel_applet_get_by_id (id); + info = mate_panel_applet_get_by_id (id); edge_relativity = g_settings_get_enum (info->settings, PANEL_OBJECT_RELATIVE_TO_EDGE_KEY); right_stuck = g_settings_get_boolean (info->settings, @@ -1690,7 +1693,7 @@ panel_widget_size_allocate(GtkWidget *widget, GtkAllocation *allocation) prior_space = ad->constrained; if (list->prev) { - AppletData *pad = list->prev->data; + pad = list->prev->data; prior_space -= pad->constrained + pad->min_cells; } |