[nautilus-actions] Move na_utils_print_version() to console_print_version()



commit 40219d48ad6d4d7369f90a1826cb3c4c67854bd8
Author: Pierre Wieser <pwieser trychlos org>
Date:   Wed Oct 28 20:06:48 2009 +0100

    Move na_utils_print_version() to console_print_version()

 ChangeLog                            |    9 +++++++++
 src/common/na-utils.c                |   31 -------------------------------
 src/common/na-utils.h                |    5 -----
 src/utils/console-utils.c            |   33 +++++++++++++++++++++++++++++++++
 src/utils/console-utils.h            |    2 ++
 src/utils/nautilus-actions-new.c     |    2 +-
 src/utils/nautilus-actions-schemas.c |    2 +-
 7 files changed, 46 insertions(+), 38 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 4690951..99c3179 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2009-10-28 Pierre Wieser <pwieser trychlos org>
 
+	* src/common/na-utils.c:
+	* src/common/na-utils.h:
+	* src/utils/console-utils.c:
+	* src/utils/console-utils.h:
+	Move na_utils_print_version() to console_print_version().
+
+	* src/utils/nautilus-actions-new.c:
+	* src/utils/nautilus-actions-schemas.c: Updated accordingly.
+
 	* src/utils/console-utils.c:
 	* src/utils/console-utils.h: New files.
 
diff --git a/src/common/na-utils.c b/src/common/na-utils.c
index 381ec2e..71d8abe 100644
--- a/src/common/na-utils.c
+++ b/src/common/na-utils.c
@@ -36,8 +36,6 @@
 #include <glib-object.h>
 #include <string.h>
 
-#include <runtime/na-iabout.h>
-
 #include "na-utils.h"
 
 static GSList *text_to_string_list( const gchar *text, const gchar *separator, const gchar *default_value );
@@ -447,32 +445,3 @@ na_utils_exist_file( const gchar *uri )
 
 	return( exists );
 }
-
-/**
- * na_utils_print_version:
- *
- * Prints the current version of the program to stdout. This function
- * is to be used by console programs.
- */
-/*
- * nautilus-actions-new (Nautilus-Actions) v 2.29.1
- * Copyright (C) 2005-2007 Frederic Ruaudel
- * Copyright (C) 2009 Pierre Wieser
- * Nautilus-Actions is free software, licensed under GPLv2 or later.
- */
-void
-na_utils_print_version( void )
-{
-	gchar *copyright;
-
-	g_print( "\n" );
-	g_print( "%s (%s) v %s\n", g_get_prgname(), PACKAGE_NAME, PACKAGE_VERSION );
-	copyright = na_iabout_get_copyright( TRUE );
-	g_print( "%s\n", copyright );
-	g_free( copyright );
-
-	g_print( "%s is free software, and is provided without any warranty. You may\n", PACKAGE_NAME );
-	g_print( "redistribute copies of %s under the terms of the GNU General Public\n", PACKAGE_NAME );
-	g_print( "License (see COPYING).\n" );
-	g_print( "\n" );
-}
diff --git a/src/common/na-utils.h b/src/common/na-utils.h
index 44f5436..6e3402a 100644
--- a/src/common/na-utils.h
+++ b/src/common/na-utils.h
@@ -67,11 +67,6 @@ gchar   *na_utils_remove_last_level_from_path( const gchar *path );
 gboolean na_utils_is_writable_dir( const gchar *uri );
 gboolean na_utils_exist_file( const gchar *uri );
 
-/*
- * misc
- */
-void     na_utils_print_version( void );
-
 G_END_DECLS
 
 #endif /* __NA_COMMON_UTILS_H__ */
diff --git a/src/utils/console-utils.c b/src/utils/console-utils.c
index 31e1fe2..1c53879 100644
--- a/src/utils/console-utils.c
+++ b/src/utils/console-utils.c
@@ -34,12 +34,17 @@
 
 #include <glib.h>
 
+#include <runtime/na-iabout.h>
+
 #include "console-utils.h"
 
 static void log_handler( const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer user_data );
 
 /**
  * console_init_log_handler:
+ *
+ * Initialize log handler so that debug messages are not outputed when
+ * not in maintainer mode.
  */
 void
 console_init_log_handler( void )
@@ -49,6 +54,34 @@ console_init_log_handler( void )
 	g_log_set_handler( NA_LOGDOMAIN_UTILS, G_LOG_LEVEL_DEBUG, log_handler, NULL );
 }
 
+/**
+ * console_print_version:
+ *
+ * Prints the current version of the program to stdout.
+ */
+/*
+ * nautilus-actions-new (Nautilus-Actions) v 2.29.1
+ * Copyright (C) 2005-2007 Frederic Ruaudel
+ * Copyright (C) 2009 Pierre Wieser
+ * Nautilus-Actions is free software, licensed under GPLv2 or later.
+ */
+void
+console_print_version( void )
+{
+	gchar *copyright;
+
+	g_print( "\n" );
+	g_print( "%s (%s) v %s\n", g_get_prgname(), PACKAGE_NAME, PACKAGE_VERSION );
+	copyright = na_iabout_get_copyright( TRUE );
+	g_print( "%s\n", copyright );
+	g_free( copyright );
+
+	g_print( "%s is free software, and is provided without any warranty. You may\n", PACKAGE_NAME );
+	g_print( "redistribute copies of %s under the terms of the GNU General Public\n", PACKAGE_NAME );
+	g_print( "License (see COPYING).\n" );
+	g_print( "\n" );
+}
+
 static void
 log_handler( const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer user_data )
 {
diff --git a/src/utils/console-utils.h b/src/utils/console-utils.h
index a8e11a3..2350205 100644
--- a/src/utils/console-utils.h
+++ b/src/utils/console-utils.h
@@ -39,4 +39,6 @@
 
 void console_init_log_handler( void );
 
+void console_print_version( void );
+
 #endif /* __CONSOLE_UTILS_H__ */
diff --git a/src/utils/nautilus-actions-new.c b/src/utils/nautilus-actions-new.c
index 030fb9d..7894c08 100644
--- a/src/utils/nautilus-actions-new.c
+++ b/src/utils/nautilus-actions-new.c
@@ -166,7 +166,7 @@ main( int argc, char** argv )
 	}
 
 	if( version ){
-		na_utils_print_version();
+		console_print_version();
 		exit( status );
 	}
 
diff --git a/src/utils/nautilus-actions-schemas.c b/src/utils/nautilus-actions-schemas.c
index 07562ea..d66a5e7 100644
--- a/src/utils/nautilus-actions-schemas.c
+++ b/src/utils/nautilus-actions-schemas.c
@@ -100,7 +100,7 @@ main( int argc, char** argv )
 	}
 
 	if( version ){
-		na_utils_print_version();
+		console_print_version();
 		exit( status );
 	}
 



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