[Xfce4-commits] <thunar:master> Drop some unused variables.

Nick Schermer noreply at xfce.org
Fri Apr 22 22:10:01 CEST 2011


Updating branch refs/heads/master
         to 32c528a8e9a36ab522b73590a03332027316040b (commit)
       from 9b80264fa596e18468066ffb3f03804421f3872e (commit)

commit 32c528a8e9a36ab522b73590a03332027316040b
Author: Nick Schermer <nick at xfce.org>
Date:   Fri Apr 22 21:17:01 2011 +0200

    Drop some unused variables.

 plugins/thunar-sbr/thunar-sbr-number-renamer.c |    3 +--
 tdb/tdbtool.c                                  |    9 ++++++++-
 thunar/thunar-column-editor.c                  |   20 ++------------------
 thunar/thunar-location-dialog.c                |    3 +--
 thunar/thunar-renamer-model.c                  |    4 ++--
 5 files changed, 14 insertions(+), 25 deletions(-)

diff --git a/plugins/thunar-sbr/thunar-sbr-number-renamer.c b/plugins/thunar-sbr/thunar-sbr-number-renamer.c
index 52d8fd8..18e1783 100644
--- a/plugins/thunar-sbr/thunar-sbr-number-renamer.c
+++ b/plugins/thunar-sbr/thunar-sbr-number-renamer.c
@@ -471,13 +471,12 @@ thunar_sbr_number_renamer_update (ThunarSbrNumberRenamer *number_renamer)
   GdkColor back;
   GdkColor text;
   gchar   *endp;
-  guint    number;
 
   /* check whether "start" is valid for the "mode" */
   if (number_renamer->mode < THUNAR_SBR_NUMBER_MODE_ABC)
     {
       /* "start" must be a positive number */
-      number = strtoul (number_renamer->start, &endp, 10);
+      strtoul (number_renamer->start, &endp, 10);
       invalid = (endp <= number_renamer->start || *endp != '\0');
     }
   else if (number_renamer->mode == THUNAR_SBR_NUMBER_MODE_ABC)
diff --git a/tdb/tdbtool.c b/tdb/tdbtool.c
index ab59474..5da5066 100644
--- a/tdb/tdbtool.c
+++ b/tdb/tdbtool.c
@@ -68,6 +68,12 @@
 #include <unistd.h>
 #endif
 
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
+#define G_GNUC_UNUSED __attribute__((__unused__))
+#else
+#define G_GNUC_UNUSED
+#endif
+
 #include <tdb/tdb.h>
 
 /* a tdb tool for manipulating a tdb database */
@@ -419,7 +425,8 @@ static void next_record(TDB_CONTEXT *context, TDB_DATA *pkey)
 
 int main(int argc, char *argv[])
 {
-    int bIterate = 0, ignore;
+    int bIterate = 0;
+    int ignore G_GNUC_UNUSED;
     char *line;
     char *tok;
   TDB_DATA iterate_kbuf;
diff --git a/thunar/thunar-column-editor.c b/thunar/thunar-column-editor.c
index 9c53d4d..abe03b3 100644
--- a/thunar/thunar-column-editor.c
+++ b/thunar/thunar-column-editor.c
@@ -541,27 +541,11 @@ thunar_show_column_editor (gpointer parent)
 {
   GtkWidget *window = NULL;
   GtkWidget *dialog;
-  GdkScreen *screen;
 
   _thunar_return_if_fail (parent == NULL || GDK_IS_SCREEN (parent) || GTK_IS_WIDGET (parent));
 
-  /* determine the screen for the dialog */
-  if (G_UNLIKELY (parent == NULL))
-    {
-      /* just use the default screen, no toplevel window */
-      screen = gdk_screen_get_default ();
-    }
-  else if (GTK_IS_WIDGET (parent))
-    {
-      /* use the screen for the widget and the toplevel window */
-      screen = gtk_widget_get_screen (parent);
-      window = gtk_widget_get_toplevel (parent);
-    }
-  else
-    {
-      /* parent is a screen, no toplevel window */
-      screen = GDK_SCREEN (parent);
-    }
+  if (GTK_IS_WIDGET (parent))
+    window = gtk_widget_get_toplevel (parent);
 
   /* display the column editor */
   dialog = thunar_column_editor_new ();
diff --git a/thunar/thunar-location-dialog.c b/thunar/thunar-location-dialog.c
index 7fde5f9..272f8cd 100644
--- a/thunar/thunar-location-dialog.c
+++ b/thunar/thunar-location-dialog.c
@@ -55,7 +55,6 @@ thunar_location_dialog_class_init (ThunarLocationDialogClass *klass)
 static void
 thunar_location_dialog_init (ThunarLocationDialog *location_dialog)
 {
-  GtkWidget *cancel_button;
   GtkWidget *open_button;
   GtkWidget *hbox;
   GtkWidget *label;
@@ -66,7 +65,7 @@ thunar_location_dialog_init (ThunarLocationDialog *location_dialog)
   gtk_window_set_default_size (GTK_WINDOW (location_dialog), 350, -1);
   gtk_window_set_title (GTK_WINDOW (location_dialog), _("Open Location"));
 
-  cancel_button = gtk_dialog_add_button (GTK_DIALOG (location_dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
+  gtk_dialog_add_button (GTK_DIALOG (location_dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
 
   open_button = gtk_dialog_add_button (GTK_DIALOG (location_dialog), GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT);
   gtk_window_set_default (GTK_WINDOW (location_dialog), open_button);
diff --git a/thunar/thunar-renamer-model.c b/thunar/thunar-renamer-model.c
index 05e7900..1aa7b77 100644
--- a/thunar/thunar-renamer-model.c
+++ b/thunar/thunar-renamer-model.c
@@ -609,10 +609,10 @@ thunar_renamer_model_file_changed (ThunarRenamerModel *renamer_model,
         if (G_LIKELY (!renamer_model->frozen))
           {
             /* the file changed */
-            THUNAR_RENAMER_MODEL_ITEM (lp->data)->changed = TRUE;
+            item->changed = TRUE;
 
             /* invalidate the item */
-            thunar_renamer_model_invalidate_item (renamer_model, lp->data);
+            thunar_renamer_model_invalidate_item (renamer_model, item);
             break;
           }
 



More information about the Xfce4-commits mailing list