[Goodies-commits] r6948 - in xfce4-screenshooter/trunk: . lib

Jerome Guelfucci jeromeg at xfce.org
Thu Mar 19 13:55:14 CET 2009


Author: jeromeg
Date: 2009-03-19 12:55:14 +0000 (Thu, 19 Mar 2009)
New Revision: 6948

Modified:
   xfce4-screenshooter/trunk/ChangeLog
   xfce4-screenshooter/trunk/lib/screenshooter-utils.c
Log:
* lib/screenshooter-utils.c:
  - (get_rectangle_screenshot) use a dotted rectangle, with a 2px
    wide border.
  - (screenshooter_open_screenshot) simplify the function.
  - (screenshooter_get_home_uri) use g_getenv and g_get_homedir.


Modified: xfce4-screenshooter/trunk/ChangeLog
===================================================================
--- xfce4-screenshooter/trunk/ChangeLog	2009-03-18 23:12:31 UTC (rev 6947)
+++ xfce4-screenshooter/trunk/ChangeLog	2009-03-19 12:55:14 UTC (rev 6948)
@@ -1,3 +1,11 @@
+2009-03-19 jeromeg
+
+  * lib/screenshooter-utils.c:
+    - (get_rectangle_screenshot) use a dotted rectangle, with a 2px
+      wide border.
+    - (screenshooter_open_screenshot) simplify the function.
+    - (screenshooter_get_home_uri) use g_getenv and g_get_homedir.
+
 2009-03-15 jeromeg
 
   * Add the Italian documentation.

Modified: xfce4-screenshooter/trunk/lib/screenshooter-utils.c
===================================================================
--- xfce4-screenshooter/trunk/lib/screenshooter-utils.c	2009-03-18 23:12:31 UTC (rev 6947)
+++ xfce4-screenshooter/trunk/lib/screenshooter-utils.c	2009-03-19 12:55:14 UTC (rev 6948)
@@ -243,8 +243,8 @@
   TRACE ("Initialize the graphics context");
   
   gc_values.function           = GDK_XOR;
-  gc_values.line_width         = 0;
-  gc_values.line_style         = GDK_LINE_SOLID;
+  gc_values.line_width         = 2;
+  gc_values.line_style         = GDK_LINE_ON_OFF_DASH;
   gc_values.fill               = GDK_SOLID;
   gc_values.cap_style          = GDK_CAP_BUTT;
   gc_values.join_style         = GDK_JOIN_MITER;
@@ -625,33 +625,33 @@
 screenshooter_open_screenshot (gchar *screenshot_path,
                                gchar *application)
 {
-  if (screenshot_path != NULL)
-    {
-      TRACE ("Path was != NULL");
+  g_return_if_fail (screenshot_path != NULL);
+  
+  TRACE ("Path was != NULL");
 
-      if (!g_str_equal (application, "none"))
-        {
-          gchar *command = 
-            g_strconcat (application, " ", screenshot_path, NULL);
-    
-          GError *error = NULL;
+  g_return_if_fail (!g_str_equal (application, "none"));
 
-          TRACE ("Launch the command");
-          
-          /* Execute the command and show an error dialog if there was 
-          * an error. */
-          if (!xfce_exec_on_screen (gdk_screen_get_default (), command, 
-                                    FALSE, TRUE, &error))
-            {
-              TRACE ("An error occured");
+  TRACE ("Application was not none");
 
-              xfce_err (error->message);
-              g_error_free (error);
-            }
-          
-          g_free (command);
-       }
+  gchar *command = 
+    g_strconcat (application, " ", screenshot_path, NULL);
+
+  GError *error = NULL;
+
+  TRACE ("Launch the command");
+  
+  /* Execute the command and show an error dialog if there was 
+  * an error. */
+  if (!xfce_exec_on_screen (gdk_screen_get_default (), command, 
+                            FALSE, TRUE, &error))
+    {
+      TRACE ("An error occured");
+
+      xfce_err (error->message);
+      g_error_free (error);
     }
+  
+  g_free (command);
 }
 
 
@@ -660,8 +660,11 @@
 *screenshooter_get_home_uri ()
 {
   gchar *result = NULL;
-  const gchar *home_path = xfce_get_homedir ();
+  const gchar *home_path = g_getenv ("HOME");
 
+  if (!home_path)
+    home_path = g_get_home_dir ();
+
   result = g_strconcat ("file://", home_path, NULL);
 
   return result;




More information about the Goodies-commits mailing list