[Gurlchecker-commits] r704 - trunk/src

esaracco at users.labs.libre-entreprise.org esaracco at users.labs.libre-entreprise.org
Wed Jan 20 20:19:28 CET 2010


Author: esaracco
Date: 2010-01-20 19:19:28 +0000 (Wed, 20 Jan 2010)
New Revision: 704

Modified:
   trunk/src/application.c
   trunk/src/bookmarks.c
   trunk/src/cookies.c
   trunk/src/project.c
   trunk/src/url.c
Log:
Some code cleaning.


Modified: trunk/src/application.c
===================================================================
--- trunk/src/application.c	2010-01-20 18:22:41 UTC (rev 703)
+++ trunk/src/application.c	2010-01-20 19:19:28 UTC (rev 704)
@@ -600,7 +600,7 @@
   widget = WGET ("ifd_input_text");
   input_text = gtk_entry_get_text (GTK_ENTRY (widget));
 
-  if (res == GTK_RESPONSE_OK && !strlen (input_text))
+  if (res == GTK_RESPONSE_OK && strlen (input_text) == 0)
     goto again;
   else
     {
@@ -3779,7 +3779,7 @@
 
   file = gnome_file_entry_get_full_path (GNOME_FILE_ENTRY (widget), FALSE);
 
-  if (!file || !strlen (file))
+  if (file == NULL || strlen (file) == 0)
     {
       uc_application_dialog_show (
         _("Please choose a bookmarks file to check."), GTK_MESSAGE_ERROR);
@@ -4048,7 +4048,7 @@
 			   (gpointer) value);
   if (a == NULL)
     {
-      if (value != NULL && strlen (value))
+      if (value != NULL && strlen (value) > 0)
 	{
 	  a = g_new0 (UCURLsUserActions, 1);
 	  a->id = g_strdup (value);
@@ -4082,7 +4082,7 @@
 
   if (a == NULL)
     {
-      if (key != NULL && strlen (key))
+      if (key != NULL && strlen (key) > 0)
 	{
 	  a = g_new0 (UCURLsUserActions, 1);
 	  a->id = g_strdup (key);

Modified: trunk/src/bookmarks.c
===================================================================
--- trunk/src/bookmarks.c	2010-01-20 18:22:41 UTC (rev 703)
+++ trunk/src/bookmarks.c	2010-01-20 19:19:28 UTC (rev 704)
@@ -329,7 +329,7 @@
   }
 
   // Folder
-  if (strcmp (key, "") == 0)
+  if (strlen (key) == 0)
   {
     prop = uc_check_link_properties_node_new ();
     prop->bookmark_folder_id = folder_id;

Modified: trunk/src/cookies.c
===================================================================
--- trunk/src/cookies.c	2010-01-20 18:22:41 UTC (rev 703)
+++ trunk/src/cookies.c	2010-01-20 19:19:28 UTC (rev 704)
@@ -217,7 +217,7 @@
 	      found = TRUE;
 
 	      /* if value is empty, or cookie has expires */
-	      if (!strlen (value) ||
+	      if (strlen (value) == 0 ||
 		  (expires && (uc_utils_http_atotm (expires) <= now)))
 		{
 		  if (uc_project_get_cookies_warn_deleted ()

Modified: trunk/src/project.c
===================================================================
--- trunk/src/project.c	2010-01-20 18:22:41 UTC (rev 703)
+++ trunk/src/project.c	2010-01-20 19:19:28 UTC (rev 704)
@@ -1351,7 +1351,7 @@
   if (res != GTK_RESPONSE_YES)
     return res;
 
-  if (!strlen (uc_project_get_title ()) &&
+  if (strlen (uc_project_get_title ()) == 0 &&
       !uc_application_project_information_dialog_show ())
     return GTK_RESPONSE_CANCEL;
 

Modified: trunk/src/url.c
===================================================================
--- trunk/src/url.c	2010-01-20 18:22:41 UTC (rev 703)
+++ trunk/src/url.c	2010-01-20 19:19:28 UTC (rev 704)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2002-2005 
+ * Copyright (C) 2002-2010
  * Emmanuel Saracco <esaracco at users.labs.libre-entreprise.org>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -643,8 +643,8 @@
       goto end;
     }
 
-  if ((!url) || (!strlen (url))
-      || (!(host = uc_url_get_hostname (NULL, url))))
+  if (url == NULL || strlen (url) == 0 ||
+      !(host = uc_url_get_hostname (NULL, url)))
     goto end;
 
   if (!(test = uc_utils_get_ip (host)))



More information about the Gurlchecker-commits mailing list