[Gurlchecker-commits] r765 - in trunk: . src

esaracco at users.labs.libre-entreprise.org esaracco at users.labs.libre-entreprise.org
Fri Jan 29 22:02:50 CET 2010


Author: esaracco
Date: 2010-01-29 21:02:50 +0000 (Fri, 29 Jan 2010)
New Revision: 765

Modified:
   trunk/ChangeLog
   trunk/configure.in
   trunk/src/application.c
   trunk/src/bookmarks.c
   trunk/src/project.c
   trunk/src/report.c
   trunk/src/url.c
   trunk/src/web_site.c
Log:
Better management when gurlchecker have been built without SSL support, and some code cleaning.


Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2010-01-28 22:26:23 UTC (rev 764)
+++ trunk/ChangeLog	2010-01-29 21:02:50 UTC (rev 765)
@@ -2,6 +2,13 @@
 
 	* GUI:
 
+	  - Better management when gurlchecker have been built without SSL
+	    support.
+
+2010-01-28 Emmanuel Saracco <esaracco at users.labs.libre-entreprise.org>
+
+	* GUI:
+
 	  - Fixed a problem with main window reactivation after a suspended
 	    scan.
 

Modified: trunk/configure.in
===================================================================
--- trunk/configure.in	2010-01-28 22:26:23 UTC (rev 764)
+++ trunk/configure.in	2010-01-29 21:02:50 UTC (rev 765)
@@ -2,7 +2,7 @@
 AC_PREREQ(2.54)
 
 AC_INIT(configure.in)
-AM_INIT_AUTOMAKE(gurlchecker, 0.11.2svn2010012802)
+AM_INIT_AUTOMAKE(gurlchecker, 0.11.2svn2010012900)
 AM_CONFIG_HEADER(config.h)
 AC_CONFIG_MACRO_DIR([m4])
 

Modified: trunk/src/application.c
===================================================================
--- trunk/src/application.c	2010-01-28 22:26:23 UTC (rev 764)
+++ trunk/src/application.c	2010-01-29 21:02:50 UTC (rev 765)
@@ -1335,8 +1335,7 @@
 
   prop = uc_lists_checked_links_lookup_by_uid (id);
 
-  /* do not display information for bookmark's
-   * folders */
+  // Do not display information for bookmarks folders
   if (prop->link_type == LINK_TYPE_BOOKMARK_FOLDER)
     return;
 
@@ -1348,7 +1347,7 @@
   gtk_menu_popup (GTK_MENU (popup), NULL, NULL, NULL, NULL,
 		  event->button, event->time);
 
-  /* activate/deactivate appropriate items */
+  // Activate/deactivate appropriate items
   WSENS ("mwpopup_menu_check_email_mx", TRUE);
   WSENS ("mwpopup_view_online", TRUE);
   WSENS ("mwpopup_refresh_link", TRUE);
@@ -1360,13 +1359,10 @@
 
   WSENS ("mwpopup_view_bad_extensions",
     (prop->bad_extensions != NULL));
-
   WSENS ("mwpopup_view_similar_links_locations",
     (prop->similar_links_parents != NULL));
-
   WSENS ("mwpopup_refresh_branch",
     (prop->childs != NULL));
-
   WSENS ("mwpopup_refresh_parent",
     (prop->depth_level != 0));
 
@@ -1416,6 +1412,16 @@
       WSENS ("mwpopup_refresh_link", FALSE);
     }
 
+#ifndef ENABLE_GNUTLS
+  // Do not refresh HTTPS links if no SSL support
+  if (strcmp (prop->protocol, UC_PROTOCOL_HTTPS) == 0)
+  {
+    WSENS ("mwpopup_refresh_link", FALSE);
+    WSENS ("mwpopup_refresh_branch", FALSE);
+    WSENS ("mwpopup_refresh_parent", FALSE);
+  }
+#endif
+
   gtk_widget_show_all (popup);
 }
 
@@ -3522,6 +3528,8 @@
   gchar *auth_line = NULL;
   gchar *tmp = NULL;
   gchar *tmp_url = NULL;
+  gchar *err_msg = _("Please, check that there is no mismatch in "
+                     "your URL and try again.");
 
 
   uc_project_set_type (type);
@@ -3544,6 +3552,12 @@
     {
       g_strstrip (tmp);
 
+#ifndef ENABLE_GNUTLS
+      if (uc_utils_memcasecmp (tmp, UC_PROTOCOL_HTTPS))
+        err_msg = 
+          _("Sorry, but this version of gurlchecker have no SSL support");
+      else
+#endif
       if (strlen (tmp) > 0)
 	{
 	  tmp_url =
@@ -3648,9 +3662,7 @@
 	}
     }
 
-  uc_application_dialog_show (_("Please, check that there is no mismatch in "
-				"your URL and try again."),
-			      GTK_MESSAGE_ERROR);
+  uc_application_dialog_show (err_msg, GTK_MESSAGE_ERROR);
 
   g_free (tmp_url), tmp_url = NULL;
   g_free (tmp), tmp = NULL;

Modified: trunk/src/bookmarks.c
===================================================================
--- trunk/src/bookmarks.c	2010-01-28 22:26:23 UTC (rev 764)
+++ trunk/src/bookmarks.c	2010-01-29 21:02:50 UTC (rev 765)
@@ -505,26 +505,25 @@
 
   switch (uc_project_get_bookmarks_type ())
   {
-    /* XBEL */
+    // XBEL
     case UC_BOOKMARKS_TYPE_XBEL:
       list = uc_bookmarks_xbel_get_content (uc_project_get_bookmarks_file ());
       break;
 
 #ifdef ENABLE_SQLITE3
-    /* FF sqlite3 */
+    // FF sqlite3
     case UC_BOOKMARKS_TYPE_FF_SQLITE3:
       list = uc_bookmarks_ff_sqlite3_get_content ();
       break;
 #endif
 
-    /* Default */
+    // Default
     case UC_BOOKMARKS_TYPE_NONE:
     default:
       g_assert_not_reached ();
   }
 
-  // FIXME
-  return g_list_copy (list);
+  return list;
 }
 
 

Modified: trunk/src/project.c
===================================================================
--- trunk/src/project.c	2010-01-28 22:26:23 UTC (rev 764)
+++ trunk/src/project.c	2010-01-29 21:02:50 UTC (rev 765)
@@ -404,11 +404,15 @@
    * for bookmarks files... */
   WSENS ("mwm_project_properties", !uc_project_get_check_is_bookmarks ());
   WSENS ("mwm_refresh_all", TRUE);
-  WSENS ("mwm_refresh_main_page", TRUE);
+  WSENS ("mwm_refresh_main_page", !uc_project_get_check_is_bookmarks ());
   WSENS ("mwm_delete_project", TRUE);
   WSENS ("mwm_find", TRUE);
   WSENS ("mwm_display", TRUE);
   WSENS ("mwm_report_export", TRUE);
+#ifndef ENABLE_GNUTLS
+  if (strstr (p->location, UC_PROTOCOL_HTTPS))
+  WSENS ("mwm_refresh_main_page", FALSE);
+#endif
 #ifdef ENABLE_CLAMAV
   WSENS ("mwm_display_security_alerts", !uc_project_get_speed_check ());
 #endif
@@ -547,10 +551,10 @@
 
   pl = uc_project_projects_list_lookup_by_uid (id);
 
-  (size_t) strftime (creation_date, UC_BUFFER_DATE_LEN, "%Y-%m-%d",
-		     localtime (&pl->create));
-  (size_t) strftime (update_date, UC_BUFFER_DATE_LEN, "%Y-%m-%d",
-		     localtime (&pl->update));
+  strftime (creation_date, UC_BUFFER_DATE_LEN, "%Y-%m-%d",
+            localtime (&pl->create));
+  strftime (update_date, UC_BUFFER_DATE_LEN, "%Y-%m-%d",
+            localtime (&pl->update));
 
   widget = WGET ("opd_dates");
   tmp = g_strdup_printf (_("<i>Created on</i> %s\n"

Modified: trunk/src/report.c
===================================================================
--- trunk/src/report.c	2010-01-28 22:26:23 UTC (rev 764)
+++ trunk/src/report.c	2010-01-29 21:02:50 UTC (rev 765)
@@ -154,15 +154,14 @@
   time (&t);
   td = localtime (&t);
 
-  /* HTML */
+  // HTML
   if (format == UC_EXPORT_HTML)
   {
     gchar creation_date[UC_BUFFER_DATETIME_LEN + 1] = { 0 };
     gchar *command_line = NULL;
 
 
-    (size_t) strftime (creation_date, UC_BUFFER_DATETIME_LEN,
-                       "%Y-%m-%d %H:%M:%S", td);
+    strftime (creation_date, UC_BUFFER_DATETIME_LEN, "%Y-%m-%d %H:%M:%S", td);
     path = g_strdup_printf ("%s/projects/%u/project.xml",
                             uc_project_get_working_path (),
                             uc_project_get_id ());
@@ -184,7 +183,7 @@
     ret = g_spawn_command_line_async (command_line, &err);
     g_free (command_line), command_line = NULL;
   }
-  /* CSV */
+  // CSV
   else if (format == UC_EXPORT_CSV)
   {
     FILE *fd = NULL;

Modified: trunk/src/url.c
===================================================================
--- trunk/src/url.c	2010-01-28 22:26:23 UTC (rev 764)
+++ trunk/src/url.c	2010-01-29 21:02:50 UTC (rev 765)
@@ -390,14 +390,16 @@
   gchar *real_cpath = NULL;
   gchar *project_host = NULL;
   gchar *url = NULL;
+  gsize url_len = 0;
   gboolean ret = TRUE;
 
 
   url = uc_utils_replace (rurl, "&amp;", "&");
+  url_len = strlen (url);
   project_host = uc_project_get_current_host ();
 
-  if (!strcmp (url, "..") ||
-      (strlen (url) > 3 && !strcmp (&url[strlen (url) - 3], "/..")))
+  if (strcmp (url, "..") == 0 ||
+      (url_len > 3 && strcmp (&url[url_len - 3], "/..") == 0))
     {
       gchar *tmp = NULL;
 

Modified: trunk/src/web_site.c
===================================================================
--- trunk/src/web_site.c	2010-01-28 22:26:23 UTC (rev 764)
+++ trunk/src/web_site.c	2010-01-29 21:02:50 UTC (rev 765)
@@ -892,8 +892,12 @@
 	WSENS ("mwm_refresh_main_page", TRUE);
 	WSENS ("mwm_find", !uc_project_get_speed_check ());
 	WSENS ("mwm_project_properties", TRUE);
+#ifndef ENABLE_GNUTLS
+        if (strcmp (prop->protocol, UC_PROTOCOL_HTTPS) == 0)
+          WSENS ("mwm_refresh_main_page", FALSE);
+#endif
 #ifdef ENABLE_CLAMAV
-  WSENS ("mwm_display_security_alerts", !uc_project_get_speed_check ());
+        WSENS ("mwm_display_security_alerts", !uc_project_get_speed_check ());
 #endif
 
 	uc_project_set_save (TRUE);



More information about the Gurlchecker-commits mailing list