SF.net SVN: geany:[4568] branches/geany-0.18.1

ntrel at users.sourceforge.net ntrel at xxxxx
Thu Jan 28 12:49:13 UTC 2010


Revision: 4568
          http://geany.svn.sourceforge.net/geany/?rev=4568&view=rev
Author:   ntrel
Date:     2010-01-28 12:48:53 +0000 (Thu, 28 Jan 2010)

Log Message:
-----------
Backport from trunk:
Remove --generate-data-files argument & code - just edit
filetype_extensions.conf by hand (filetype order was broken
anyway).
Add *.H extension for C++ (useful for non-Windows systems).

Modified Paths:
--------------
    branches/geany-0.18.1/ChangeLog
    branches/geany-0.18.1/HACKING
    branches/geany-0.18.1/data/filetype_extensions.conf
    branches/geany-0.18.1/src/keyfile.c
    branches/geany-0.18.1/src/keyfile.h
    branches/geany-0.18.1/src/main.c

Modified: branches/geany-0.18.1/ChangeLog
===================================================================
--- branches/geany-0.18.1/ChangeLog	2010-01-25 21:17:04 UTC (rev 4567)
+++ branches/geany-0.18.1/ChangeLog	2010-01-28 12:48:53 UTC (rev 4568)
@@ -5,6 +5,12 @@
  * doc/plugins.dox:
    Mention Files link at top for header files; demoplugin.c.
    Minor edits; remove 'far from being complete'.
+ * src/keyfile.c, src/keyfile.h, src/main.c,
+   data/filetype_extensions.conf, HACKING:
+   Remove --generate-data-files argument & code - just edit
+   filetype_extensions.conf by hand (filetype order was broken
+   anyway).
+   Add *.H extension for C++ (useful for non-Windows systems).
 
 
 2009-08-26  Nick Treleaven  <nick(dot)treleaven(at)btinternet(dot)com>

Modified: branches/geany-0.18.1/HACKING
===================================================================
--- branches/geany-0.18.1/HACKING	2010-01-25 21:17:04 UTC (rev 4567)
+++ branches/geany-0.18.1/HACKING	2010-01-28 12:48:53 UTC (rev 4568)
@@ -201,18 +201,8 @@
 * Add GEANY_FILETYPES_FOO to filetypes.h.
 * Initialize GEANY_FILETYPES_FOO in init_builtin_filetypes() of
   filetypes.c.
-* Rebuild Geany.
-* From your geany/ directory, run::
+* Update data/filetype_extensions.conf.
 
-	src/geany --generate-data-files
-
-(The src/ prefix may be different, depending on where the binary is
-generated.)
-This will update data/filetype_extensions.conf. Note that
-you need GEANY_DEBUG to be defined when building Geany for the
---generate-data-files argument to work - this is always defined in the
-SVN version. Alternatively, edit the file by hand.
-
 filetypes.* configuration file
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 All languages need a data/filetypes.foo configuration file. See

Modified: branches/geany-0.18.1/data/filetype_extensions.conf
===================================================================
--- branches/geany-0.18.1/data/filetype_extensions.conf	2010-01-25 21:17:04 UTC (rev 4567)
+++ branches/geany-0.18.1/data/filetype_extensions.conf	2010-01-28 12:48:53 UTC (rev 4568)
@@ -1,13 +1,11 @@
-#*** This file generated by: geany --generate-data-files ***
-
-#Filetype extension configuration file for Geany
-#Insert as many items as you want, seperate them with a ";".
-#See Geany's main documentation for details.
+# Filetype extension configuration file for Geany
+# Insert as many items as you want, seperate them with a ";".
+# See Geany's main documentation for details.
 [Extensions]
 ASM=*.asm;
 Ada=*.adb;*.ads;
 C=*.c;*.h;
-C++=*.cpp;*.cxx;*.c++;*.cc;*.h;*.hpp;*.hxx;*.h++;*.hh;*.C;
+C++=*.cpp;*.cxx;*.c++;*.cc;*.h;*.hpp;*.hxx;*.h++;*.hh;*.C;*.H;
 C#=*.cs;
 CAML=*.ml;*.mli;
 D=*.d;*.di;

Modified: branches/geany-0.18.1/src/keyfile.c
===================================================================
--- branches/geany-0.18.1/src/keyfile.c	2010-01-25 21:17:04 UTC (rev 4567)
+++ branches/geany-0.18.1/src/keyfile.c	2010-01-28 12:48:53 UTC (rev 4568)
@@ -1061,74 +1061,6 @@
 }
 
 
-#ifdef GEANY_DEBUG
-/* Geany data file generation is only available with a debug build of Geany. */
-
-static void generate_filetype_extensions(const gchar *output_dir);
-
-
-/* Generate the config files in "data/" from defaults */
-void configuration_generate_data_files(void)
-{
-	gchar *cur_dir, *gen_dir;
-
-	cur_dir = g_get_current_dir();
-	gen_dir = g_strconcat(cur_dir, G_DIR_SEPARATOR_S, "data", NULL);
-	g_free(cur_dir);
-
-	if (! g_file_test(gen_dir, G_FILE_TEST_IS_DIR))
-	{
-		g_print("%s does not exist!\n", gen_dir);
-		return;
-	}
-	g_print("Generating system files in %s:\n", gen_dir);
-	/* currently only filetype extensions are auto-generated. */
-	generate_filetype_extensions(gen_dir);
-	g_free(gen_dir);
-}
-
-
-/* This will write the default settings for the system filetype_extensions.conf */
-static void generate_filetype_extensions(const gchar *output_dir)
-{
-	guint i;
-	gchar *configfile = g_strconcat(output_dir, G_DIR_SEPARATOR_S, "filetype_extensions.conf", NULL);
-	gchar *data, *basename;
-	GKeyFile *config;
-
-	config = g_key_file_new();
-	g_key_file_set_comment(config, NULL, NULL,
-		"*** This file generated by: geany --generate-data-files ***", NULL);
-	/* add filetype keys */
-	for (i = 0; i < filetypes_array->len; i++)
-	{
-		g_key_file_set_string_list(config, "Extensions", filetypes[i]->name,
-			(const gchar**) filetypes[i]->pattern, g_strv_length(filetypes[i]->pattern));
-	}
-	/* add comment */
-	g_key_file_set_comment(config, "Extensions", NULL,
-		"Filetype extension configuration file for Geany\n"
-		"Insert as many items as you want, seperate them with a \";\".\n"
-		"See Geany's main documentation for details.", NULL);
-
-	/* write the file */
-	g_print("%s: ", G_STRFUNC);
-	data = g_key_file_to_data(config, NULL, NULL);
-	basename = g_path_get_basename(configfile);
-
-	if (utils_write_file(configfile, data) == 0)
-		g_print("wrote file %s.\n", basename);
-	else
-		g_print("*** ERROR: error writing file %s\n", basename);
-	g_free(basename);
-
-	g_free(data);
-	g_key_file_free(config);
-}
-
-#endif
-
-
 void configuration_init(void)
 {
 	keyfile_groups = g_ptr_array_new();

Modified: branches/geany-0.18.1/src/keyfile.h
===================================================================
--- branches/geany-0.18.1/src/keyfile.h	2010-01-25 21:17:04 UTC (rev 4567)
+++ branches/geany-0.18.1/src/keyfile.h	2010-01-28 12:48:53 UTC (rev 4568)
@@ -55,9 +55,4 @@
  * realisation of the main window */
 void configuration_apply_settings(void);
 
-#ifdef GEANY_DEBUG
-/* Generate the config files in "data/" from defaults */
-void configuration_generate_data_files(void);
 #endif
-
-#endif

Modified: branches/geany-0.18.1/src/main.c
===================================================================
--- branches/geany-0.18.1/src/main.c	2010-01-25 21:17:04 UTC (rev 4567)
+++ branches/geany-0.18.1/src/main.c	2010-01-28 12:48:53 UTC (rev 4568)
@@ -108,7 +108,6 @@
 static gboolean no_vte = FALSE;
 static gchar *lib_vte = NULL;
 #endif
-static gboolean generate_datafiles = FALSE;
 static gboolean generate_tags = FALSE;
 static gboolean no_preprocessing = FALSE;
 static gboolean ft_names = FALSE;
@@ -127,7 +126,6 @@
 	{ "ft-names", 0, 0, G_OPTION_ARG_NONE, &ft_names, N_("Print internal filetype names"), NULL },
 	{ "generate-tags", 'g', 0, G_OPTION_ARG_NONE, &generate_tags, N_("Generate global tags file (see documentation)"), NULL },
 	{ "no-preprocessing", 'P', 0, G_OPTION_ARG_NONE, &no_preprocessing, N_("Don't preprocess C/C++ files when generating tags"), NULL },
-	{ "generate-data-files", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, &generate_datafiles, NULL, NULL },
 #ifdef HAVE_SOCKET
 	{ "new-instance", 'i', 0, G_OPTION_ARG_NONE, &cl_options.new_instance, N_("Don't open files in a running instance, force opening a new instance"), NULL },
 #endif
@@ -523,14 +521,6 @@
 		app->configdir = g_build_filename(g_get_user_config_dir(), "geany", NULL);
 	}
 
-#ifdef GEANY_DEBUG
-	if (generate_datafiles)
-	{
-		filetypes_init_types();
-		configuration_generate_data_files();	/* currently only filetype_extensions.conf */
-		exit(0);
-	}
-#endif
 	if (generate_tags)
 	{
 		gboolean ret;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list