gnome-commander r1523 - branches/gcmd-1-3/src/intviewer



Author: epiotr
Date: Wed Jan 16 23:38:23 2008
New Revision: 1523
URL: http://svn.gnome.org/viewvc/gnome-commander?rev=1523&view=rev

Log:
Code cleanup

Modified:
   branches/gcmd-1-3/src/intviewer/bm_byte.cc
   branches/gcmd-1-3/src/intviewer/fileops.cc
   branches/gcmd-1-3/src/intviewer/viewer-widget.cc
   branches/gcmd-1-3/src/intviewer/viewer-window.cc

Modified: branches/gcmd-1-3/src/intviewer/bm_byte.cc
==============================================================================
--- branches/gcmd-1-3/src/intviewer/bm_byte.cc	(original)
+++ branches/gcmd-1-3/src/intviewer/bm_byte.cc	Wed Jan 16 23:38:23 2008
@@ -115,16 +115,13 @@
     if (data==NULL)
         return;
 
-    if (data->good!=NULL)
-        g_free(data->good);
+    g_free(data->good);
     data->good=NULL;
 
-    if (data->bad!=NULL)
-        g_free(data->bad);
+    g_free(data->bad);
     data->bad = NULL;
 
-    if (data->pattern!=NULL)
-        g_free(data->pattern);
+    g_free(data->pattern);
     data->pattern = NULL;
 
     data->pattern_len = 0;

Modified: branches/gcmd-1-3/src/intviewer/fileops.cc
==============================================================================
--- branches/gcmd-1-3/src/intviewer/fileops.cc	(original)
+++ branches/gcmd-1-3/src/intviewer/fileops.cc	Wed Jan 16 23:38:23 2008
@@ -161,6 +161,7 @@
     g_return_val_if_fail (filedesc>2, -1);
 
     int fd = dup(filedesc);
+
     if (fd==-1)
     {
         g_warning("file_open_fd failed, 'dup' returned -1");

Modified: branches/gcmd-1-3/src/intviewer/viewer-widget.cc
==============================================================================
--- branches/gcmd-1-3/src/intviewer/viewer-widget.cc	(original)
+++ branches/gcmd-1-3/src/intviewer/viewer-widget.cc	Wed Jan 16 23:38:23 2008
@@ -223,7 +223,7 @@
 
     *temp = 0;
 
-    if ((status->image_width > 0) && (status->image_height > 0))
+    if (status->image_width > 0 && status->image_height > 0)
     {
         gchar zoom[10];
         char *size_string = ""; // size_string = gnome_vfs_format_file_size_for_display (bytes);

Modified: branches/gcmd-1-3/src/intviewer/viewer-window.cc
==============================================================================
--- branches/gcmd-1-3/src/intviewer/viewer-window.cc	(original)
+++ branches/gcmd-1-3/src/intviewer/viewer-window.cc	Wed Jan 16 23:38:23 2008
@@ -190,8 +190,7 @@
     g_return_if_fail (obj);
     g_return_if_fail (filename);
 
-    if (obj->priv->filename)
-        g_free(obj->priv->filename);
+    g_free(obj->priv->filename);
 
     obj->priv->filename = g_strdup (filename);
 
@@ -339,16 +338,12 @@
     GViewerWindow *w = GVIEWER_WINDOW (wnd);
 
     if (w->priv->status_bar_msg)
-    {
         gtk_statusbar_pop(GTK_STATUSBAR(w->priv->statusbar), w->priv->statusbar_ctx_id);
-        w->priv->status_bar_msg = FALSE;
-    }
 
     if (status_line)
-    {
         gtk_statusbar_push(GTK_STATUSBAR(w->priv->statusbar), w->priv->statusbar_ctx_id, status_line);
-        w->priv->status_bar_msg = TRUE;
-    }
+
+    w->priv->status_bar_msg = status_line!=NULL;
 }
 
 
@@ -363,7 +358,7 @@
     gviewer_set_tab_size(obj->priv->viewer, settings->tab_size);
 
     gviewer_set_fixed_limit(obj->priv->viewer, settings->binary_bytes_per_line);
-    switch(settings->binary_bytes_per_line)
+    switch (settings->binary_bytes_per_line)
     {
         case 20:
             gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(obj->priv->fixed_limit_menu_items[0]), TRUE);
@@ -447,8 +442,7 @@
         g_hash_table_destroy(w->priv->external_tools);
 #endif
 
-        if (w->priv->filename)
-            g_free(w->priv->filename);
+        g_free(w->priv->filename);
         w->priv->filename = NULL;
 
         if (w->priv->exit_data_fd!=-1)
@@ -566,7 +560,7 @@
 {
     GtkWidget *menuitem;
 
-    switch(type)
+    switch (type)
     {
         case MI_CHECK:
             menuitem = gtk_check_menu_item_new_with_mnemonic (_(name));
@@ -645,7 +639,7 @@
     {
         GtkWidget *item = NULL;
 
-        switch(menudata->menutype)
+        switch (menudata->menutype)
         {
             case MI_NONE:
                 break;
@@ -1164,11 +1158,8 @@
         g_object_unref(obj->priv->srchr);
         obj->priv->srchr = NULL;
 
-        if (obj->priv->search_pattern!=NULL)
-        {
-            g_free(obj->priv->search_pattern);
-            obj->priv->search_pattern = NULL;
-        }
+        g_free(obj->priv->search_pattern);
+        obj->priv->search_pattern = NULL;
     }
 
     // Get the search information from the search dialog



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