[Cxplorer-cvs 00923] CVS update: libcxp/src

Back to archive index

Yasumichi Akahoshi yasum****@users*****
2005年 3月 28日 (月) 22:20:52 JST


Index: libcxp/src/Makefile.am
diff -u libcxp/src/Makefile.am:1.3 libcxp/src/Makefile.am:1.4
--- libcxp/src/Makefile.am:1.3	Tue Mar 22 22:04:04 2005
+++ libcxp/src/Makefile.am	Mon Mar 28 22:20:51 2005
@@ -1,11 +1,12 @@
 INCLUDES = \
 	   -I$(top_builddir)/include \
+	   -DCONFDIR=\"$(sysconfdir)\" \
 	   $(GTK_CFLAGS)
 
 lib_LTLIBRARIES = libcxp.la
 
 libcxp_la_LIBADD = $(GTK_LIBS)
-libcxp_la_LDFLAGS = -release 0.1.2
+libcxp_la_LDFLAGS = -release $(VERSION)
 libcxp_la_SOURCES = cxp-profile.c \
 		    cxp-utils.c \
 		    cxp-entry-dialog.c
Index: libcxp/src/Makefile.in
diff -u libcxp/src/Makefile.in:1.4 libcxp/src/Makefile.in:1.5
--- libcxp/src/Makefile.in:1.4	Tue Mar 22 22:04:04 2005
+++ libcxp/src/Makefile.in	Mon Mar 28 22:20:51 2005
@@ -174,11 +174,12 @@
 target_alias = @target_alias@
 INCLUDES = \
 	   -I$(top_builddir)/include \
+	   -DCONFDIR=\"$(sysconfdir)\" \
 	   $(GTK_CFLAGS)
 
 lib_LTLIBRARIES = libcxp.la
 libcxp_la_LIBADD = $(GTK_LIBS)
-libcxp_la_LDFLAGS = -release 0.1.2
+libcxp_la_LDFLAGS = -release $(VERSION)
 libcxp_la_SOURCES = cxp-profile.c \
 		    cxp-utils.c \
 		    cxp-entry-dialog.c
Index: libcxp/src/cxp-profile.c
diff -u libcxp/src/cxp-profile.c:1.1.1.1 libcxp/src/cxp-profile.c:1.2
--- libcxp/src/cxp-profile.c:1.1.1.1	Sat Jan 22 01:34:46 2005
+++ libcxp/src/cxp-profile.c	Mon Mar 28 22:20:51 2005
@@ -186,8 +186,7 @@
 	return profile;
 }
 
-gint cxp_profile_get_integer (CxpProfile * profile, const gchar * name,
-			      gint def)
+gint cxp_profile_get_integer (CxpProfile * profile, const gchar * name)
 {
 	gint retval;
 	gchar *value;
@@ -195,9 +194,9 @@
 	value = (gchar *) g_hash_table_lookup (profile->priv->config, name);
 	if (value == NULL)
 	{
-		retval = def;
+		retval = 0;
 		g_hash_table_replace (profile->priv->config, g_strdup (name),
-				      g_strdup_printf ("%d", def));
+				      g_strdup ("0"));
 	}
 	else
 	{
@@ -207,18 +206,11 @@
 	return retval;
 }
 
-gchar *cxp_profile_get_string (CxpProfile * profile, const gchar * name,
-			       const gchar * def)
+gchar *cxp_profile_get_string (CxpProfile * profile, const gchar * name)
 {
 	gchar *value;
 
 	value = (gchar *) g_hash_table_lookup (profile->priv->config, name);
-	if (value == NULL)
-	{
-		value = g_strdup (def);
-		g_hash_table_replace (profile->priv->config, g_strdup (name),
-				      value);
-	}
 
 	return g_strdup (value);
 }
@@ -254,7 +246,14 @@
 			profile->priv->appname,
 			profile->priv->section,
 			NULL );
-	if ((channel = g_io_channel_new_file (filename, "r", NULL)) != NULL)
+	if ((channel = g_io_channel_new_file (filename, "r", NULL)) == NULL)
+	{
+		g_free(filename);
+		filename = g_build_filename (CONFDIR, profile->priv->appname, profile->priv->section, NULL);
+		channel = g_io_channel_new_file (filename, "r", NULL);
+	}
+
+	if (channel != NULL)
 	{
 		while (g_io_channel_read_line
 		       (channel, &line, NULL, NULL, NULL) == G_IO_STATUS_NORMAL)


Cxplorer-cvs メーリングリストの案内
Back to archive index