Kaydet (Commit) 6bd8f444 authored tarafından Nick Treleaven's avatar Nick Treleaven

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).



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4137 ea778897-0a13-0410-b9d1-a72fbfd435f5
üst f195153a
......@@ -7,6 +7,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-27 Lex Trotman <elextr(at)gmail(dot)com>
......
......@@ -201,17 +201,7 @@ check to see if those features have been written in other projects first.
* 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::
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.
* Update data/filetype_extensions.conf.
filetypes.* configuration file
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
......
#*** 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;
......
......@@ -408,7 +408,7 @@ static void save_dialog_prefs(GKeyFile *config)
/* build menu */
build_save_menu( config, NULL, GEANY_BCS_PREF );
/* printing */
g_key_file_set_string(config, "printing", "print_cmd", printing_prefs.external_print_cmd ? printing_prefs.external_print_cmd : "");
g_key_file_set_boolean(config, "printing", "use_gtk_printing", printing_prefs.use_gtk_printing);
......@@ -1068,74 +1068,6 @@ void configuration_apply_settings(void)
}
#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();
......
......@@ -55,9 +55,4 @@ void configuration_save_session_files(GKeyFile *config);
* 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
......@@ -108,7 +108,6 @@ static gchar *alternate_config = NULL;
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 @@ static GOptionEntry entries[] =
{ "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 @@ static void parse_command_line_options(gint *argc, gchar ***argv)
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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment