[gnome-panel] panel: Fix -Wunused-but-set-variable warnings
- From: Vincent Untz <vuntz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-panel] panel: Fix -Wunused-but-set-variable warnings
- Date: Mon, 27 Jun 2011 20:51:09 +0000 (UTC)
commit 8f58ed39ac07fadc5a6154b82f726e6c9425e5e5
Author: Vincent Untz <vuntz gnome org>
Date: Mon Jun 27 22:41:44 2011 +0200
panel: Fix -Wunused-but-set-variable warnings
gnome-panel/applet.c | 9 ---------
gnome-panel/button-widget.c | 9 ++++-----
gnome-panel/libpanel-util/panel-launch.c | 24 +++++++++++-------------
gnome-panel/panel-applet-frame.c | 3 ---
gnome-panel/panel-frame.c | 2 --
gnome-panel/panel-layout.c | 13 ++++---------
gnome-panel/panel-menu-button.c | 11 +++++++++++
gnome-panel/panel-separator.c | 2 --
gnome-panel/panel-toplevel.c | 5 +----
gnome-panel/panel.c | 2 --
10 files changed, 31 insertions(+), 49 deletions(-)
---
diff --git a/gnome-panel/applet.c b/gnome-panel/applet.c
index a5f3b8a..3148b42 100644
--- a/gnome-panel/applet.c
+++ b/gnome-panel/applet.c
@@ -167,12 +167,8 @@ static void
applet_callback_callback (GtkWidget *widget,
AppletUserMenu *menu)
{
- GdkScreen *screen;
-
g_return_if_fail (menu->info != NULL);
- screen = applet_user_menu_get_screen (menu);
-
switch (menu->info->type) {
case PANEL_OBJECT_LAUNCHER:
if (!strcmp (menu->name, "launch"))
@@ -484,7 +480,6 @@ panel_applet_get_edit_menu (AppletInfo *info)
{
GtkWidget *menu;
GtkWidget *menuitem;
- PanelWidget *panel_widget;
GtkWidget *image;
gboolean movable;
gboolean removable;
@@ -496,7 +491,6 @@ panel_applet_get_edit_menu (AppletInfo *info)
return NULL;
menu = panel_applet_create_bare_menu (info);
- panel_widget = panel_applet_get_panel_widget (info);
movable = panel_applet_can_freely_move (info);
removable = panel_layout_is_writable ();
@@ -831,7 +825,6 @@ panel_applet_save_position (AppletInfo *applet_info,
const char *id,
gboolean immediate)
{
- PanelWidget *panel_widget;
const char *toplevel_id;
AppletData *applet_data;
@@ -855,8 +848,6 @@ panel_applet_save_position (AppletInfo *applet_info,
if (!(toplevel_id = panel_applet_get_toplevel_id (applet_info)))
return;
- panel_widget = panel_applet_get_panel_widget (applet_info);
-
applet_data = g_object_get_data (G_OBJECT (applet_info->widget),
PANEL_APPLET_DATA);
diff --git a/gnome-panel/button-widget.c b/gnome-panel/button-widget.c
index 85d59e7..e61cec6 100644
--- a/gnome-panel/button-widget.c
+++ b/gnome-panel/button-widget.c
@@ -381,16 +381,15 @@ button_widget_draw (GtkWidget *widget,
context = gtk_widget_get_style_context (widget);
if (button_widget->priv->arrow) {
- GtkArrowType arrow_type;
gdouble angle, size;
gtk_style_context_save (context);
gtk_style_context_set_state (context, state_flags);
- arrow_type = calc_arrow (button_widget->priv->orientation,
- width, height,
- &x, &y,
- &angle, &size);
+ calc_arrow (button_widget->priv->orientation,
+ width, height,
+ &x, &y,
+ &angle, &size);
cairo_save (cr);
gtk_render_arrow (context, cr, angle, x, y, size);
diff --git a/gnome-panel/libpanel-util/panel-launch.c b/gnome-panel/libpanel-util/panel-launch.c
index f8a2aa8..530f685 100644
--- a/gnome-panel/libpanel-util/panel-launch.c
+++ b/gnome-panel/libpanel-util/panel-launch.c
@@ -91,7 +91,6 @@ panel_app_info_launch_uris (GAppInfo *appinfo,
{
GdkAppLaunchContext *context;
GError *local_error;
- gboolean retval;
GdkDisplay *display;
g_return_val_if_fail (G_IS_APP_INFO (appinfo), FALSE);
@@ -104,9 +103,9 @@ panel_app_info_launch_uris (GAppInfo *appinfo,
gdk_app_launch_context_set_timestamp (context, timestamp);
local_error = NULL;
- retval = g_app_info_launch_uris (appinfo, uris,
- (GAppLaunchContext *) context,
- &local_error);
+ g_app_info_launch_uris (appinfo, uris,
+ (GAppLaunchContext *) context,
+ &local_error);
g_object_unref (context);
@@ -223,7 +222,6 @@ panel_launch_desktop_file_with_fallback (const char *desktop_file,
{
char *argv[2] = { (char *) fallback_exec, NULL };
GError *local_error;
- gboolean retval;
char *display;
g_return_val_if_fail (desktop_file != NULL, FALSE);
@@ -243,14 +241,14 @@ panel_launch_desktop_file_with_fallback (const char *desktop_file,
display = gdk_screen_make_display_name (screen);
- retval = g_spawn_async (NULL, /* working directory */
- argv,
- NULL, /* envp */
- G_SPAWN_SEARCH_PATH,
- set_environment,
- display,
- NULL,
- &local_error);
+ g_spawn_async (NULL, /* working directory */
+ argv,
+ NULL, /* envp */
+ G_SPAWN_SEARCH_PATH,
+ set_environment,
+ display,
+ NULL,
+ &local_error);
g_free (display);
diff --git a/gnome-panel/panel-applet-frame.c b/gnome-panel/panel-applet-frame.c
index 025fe20..f2cfc38 100644
--- a/gnome-panel/panel-applet-frame.c
+++ b/gnome-panel/panel-applet-frame.c
@@ -460,13 +460,10 @@ panel_applet_frame_sync_menu_state (PanelLockdown *lockdown,
gpointer user_data)
{
PanelAppletFrame *frame = PANEL_APPLET_FRAME (user_data);
- PanelWidget *panel_widget;
gboolean locked_down;
gboolean movable;
gboolean removable;
- panel_widget = PANEL_WIDGET (gtk_widget_get_parent (GTK_WIDGET (frame)));
-
movable = panel_applet_can_freely_move (frame->priv->applet_info);
removable = panel_layout_is_writable ();
locked_down = panel_lockdown_get_panels_locked_down_s ();
diff --git a/gnome-panel/panel-frame.c b/gnome-panel/panel-frame.c
index 0e0c3ce..4307aa7 100644
--- a/gnome-panel/panel-frame.c
+++ b/gnome-panel/panel-frame.c
@@ -165,7 +165,6 @@ panel_frame_draw (GtkWidget *widget,
PanelFrameEdge edges)
{
PanelFrame *frame = (PanelFrame *) widget;
- GdkWindow *window;
GtkStyleContext *context;
GtkStateFlags state;
GdkRGBA bg, dark, light;
@@ -176,7 +175,6 @@ panel_frame_draw (GtkWidget *widget,
if (edges == PANEL_EDGE_NONE)
return;
- window = gtk_widget_get_window (widget);
context = gtk_widget_get_style_context (widget);
state = gtk_widget_get_state_flags (widget);
width = gtk_widget_get_allocated_width (widget);
diff --git a/gnome-panel/panel-layout.c b/gnome-panel/panel-layout.c
index e101c35..d52a6a0 100644
--- a/gnome-panel/panel-layout.c
+++ b/gnome-panel/panel-layout.c
@@ -889,7 +889,6 @@ panel_layout_changed_object (void)
{
char **ids;
GSList *to_remove;
- gboolean loading;
gboolean found;
const char *id;
GSList *l;
@@ -924,8 +923,6 @@ panel_layout_changed_object (void)
/* Add what appeared in the layout */
- loading = FALSE;
-
for (i = 0; ids[i] != NULL; i++) {
found = FALSE;
@@ -940,17 +937,15 @@ panel_layout_changed_object (void)
}
}
- if (!found) {
+ if (!found)
panel_layout_load_object (ids[i]);
- loading = TRUE;
- }
}
g_strfreev (ids);
- /* Always do this, even if loading is FALSE: if a panel has been
- * created, we want a do_load() to unhide it, even if there is no
- * object to load */
+ /* Always do this, even if there is no object that got loaded: if a
+ * panel has been created, we want a do_load() to unhide it, even if
+ * there is no object to load */
panel_object_loader_do_load (FALSE);
}
diff --git a/gnome-panel/panel-menu-button.c b/gnome-panel/panel-menu-button.c
index 77e8121..97d5c17 100644
--- a/gnome-panel/panel-menu-button.c
+++ b/gnome-panel/panel-menu-button.c
@@ -749,6 +749,17 @@ panel_menu_button_load (PanelWidget *panel,
root = panel_menu_scheme_to_path_root (scheme);
g_free (scheme);
+ if (root == LAST_MENU) {
+ g_printerr ("Unknown menu scheme, cannot load menu button\n");
+
+ g_free (menu_path);
+ g_free (custom_icon);
+ g_free (tooltip);
+ g_object_unref (settings_instance);
+
+ return;
+ }
+
panel_menu_button_load_helper (menu_path,
custom_icon,
tooltip,
diff --git a/gnome-panel/panel-separator.c b/gnome-panel/panel-separator.c
index 869ab67..4d46787 100644
--- a/gnome-panel/panel-separator.c
+++ b/gnome-panel/panel-separator.c
@@ -47,7 +47,6 @@ panel_separator_draw (GtkWidget *widget,
cairo_t *cr)
{
PanelSeparator *separator = PANEL_SEPARATOR (widget);
- GdkWindow *window;
GtkStyleContext *context;
GtkStateFlags state;
GtkBorder padding;
@@ -56,7 +55,6 @@ panel_separator_draw (GtkWidget *widget,
if (GTK_WIDGET_CLASS (panel_separator_parent_class)->draw)
GTK_WIDGET_CLASS (panel_separator_parent_class)->draw (widget, cr);
- window = gtk_widget_get_window (widget);
state = gtk_widget_get_state_flags (widget);
width = gtk_widget_get_allocated_width (widget);
height = gtk_widget_get_allocated_height (widget);
diff --git a/gnome-panel/panel-toplevel.c b/gnome-panel/panel-toplevel.c
index 5f53b6a..466d7da 100644
--- a/gnome-panel/panel-toplevel.c
+++ b/gnome-panel/panel-toplevel.c
@@ -2846,7 +2846,6 @@ panel_toplevel_draw (GtkWidget *widget,
PanelToplevel *toplevel = (PanelToplevel *) widget;
PanelFrameEdge edges;
gboolean retval = FALSE;
- GdkWindow *window;
GtkStyleContext *context;
GtkStateFlags state;
GtkBorder padding;
@@ -2863,7 +2862,6 @@ panel_toplevel_draw (GtkWidget *widget,
toplevel->priv->buttons_enabled)
return retval;
- window = gtk_widget_get_window (widget);
state = gtk_widget_get_state_flags (widget);
awidth = gtk_widget_get_allocated_width (widget);
aheight = gtk_widget_get_allocated_height (widget);
@@ -3085,7 +3083,6 @@ panel_toplevel_get_animation_time (PanelToplevel *toplevel)
static void
panel_toplevel_calculate_animation_end_geometry (PanelToplevel *toplevel)
{
- GdkScreen *screen;
int monitor_width, monitor_height;
toplevel->priv->animation_end_x = toplevel->priv->x;
@@ -3093,7 +3090,7 @@ panel_toplevel_calculate_animation_end_geometry (PanelToplevel *toplevel)
toplevel->priv->animation_end_width = -1;
toplevel->priv->animation_end_height = -1;
- screen = panel_toplevel_get_monitor_geometry (
+ panel_toplevel_get_monitor_geometry (
toplevel, NULL, NULL, &monitor_width, &monitor_height);
if (!toplevel->priv->expand) {
diff --git a/gnome-panel/panel.c b/gnome-panel/panel.c
index f3a4e91..b236e27 100644
--- a/gnome-panel/panel.c
+++ b/gnome-panel/panel.c
@@ -613,7 +613,6 @@ drop_nautilus_desktop_uri (PanelWidget *panel,
const char *uri)
{
gboolean success;
- const char *id;
const char *basename;
if (g_ascii_strncasecmp (uri, "x-nautilus-desktop:///",
@@ -621,7 +620,6 @@ drop_nautilus_desktop_uri (PanelWidget *panel,
return FALSE;
success = TRUE;
- id = panel_toplevel_get_id (panel->toplevel);
basename = uri + strlen ("x-nautilus-desktop:///");
if (strncmp (basename, "trash", strlen ("trash")) == 0)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]