Merge pull request #485 from techee/ft_menu
Move filetypes.* and *.tags to separate directories
This commit is contained in:
commit
9febf02261
146
data/Makefile.am
146
data/Makefile.am
@ -3,81 +3,81 @@ colorschemes = \
|
||||
colorschemes/alt.conf
|
||||
|
||||
filetypes = \
|
||||
filetypes.abaqus \
|
||||
filetypes.abc \
|
||||
filetypes.actionscript \
|
||||
filetypes.ada \
|
||||
filetypes.asciidoc \
|
||||
filetypes.asm \
|
||||
filetypes.batch \
|
||||
filetypes.c \
|
||||
filetypes.caml \
|
||||
filetypes.Clojure.conf \
|
||||
filetypes.cmake \
|
||||
filetypes.cobol \
|
||||
filetypes.coffeescript \
|
||||
filetypes.common \
|
||||
filetypes.conf \
|
||||
filetypes.cpp \
|
||||
filetypes.cs \
|
||||
filetypes.css \
|
||||
filetypes.CUDA.conf \
|
||||
filetypes.Cython.conf \
|
||||
filetypes.d \
|
||||
filetypes.diff \
|
||||
filetypes.docbook \
|
||||
filetypes.erlang \
|
||||
filetypes.f77 \
|
||||
filetypes.ferite \
|
||||
filetypes.forth \
|
||||
filetypes.fortran \
|
||||
filetypes.freebasic \
|
||||
filetypes.Genie.conf \
|
||||
filetypes.glsl \
|
||||
filetypes.go \
|
||||
filetypes.Graphviz.conf \
|
||||
filetypes.haskell \
|
||||
filetypes.haxe \
|
||||
filetypes.html \
|
||||
filetypes.java \
|
||||
filetypes.javascript \
|
||||
filetypes.JSON.conf \
|
||||
filetypes.latex \
|
||||
filetypes.lisp \
|
||||
filetypes.lua \
|
||||
filetypes.makefile \
|
||||
filetypes.markdown \
|
||||
filetypes.matlab \
|
||||
filetypes.nsis \
|
||||
filetypes.objectivec \
|
||||
filetypes.pascal \
|
||||
filetypes.perl \
|
||||
filetypes.php \
|
||||
filetypes.po \
|
||||
filetypes.powershell \
|
||||
filetypes.python \
|
||||
filetypes.r \
|
||||
filetypes.restructuredtext \
|
||||
filetypes.ruby \
|
||||
filetypes.rust \
|
||||
filetypes.Scala.conf \
|
||||
filetypes.sh \
|
||||
filetypes.sql \
|
||||
filetypes.tcl \
|
||||
filetypes.txt2tags \
|
||||
filetypes.vala \
|
||||
filetypes.verilog \
|
||||
filetypes.vhdl \
|
||||
filetypes.xml \
|
||||
filetypes.yaml \
|
||||
filetypes.zephir
|
||||
filedefs/filetypes.abaqus \
|
||||
filedefs/filetypes.abc \
|
||||
filedefs/filetypes.actionscript \
|
||||
filedefs/filetypes.ada \
|
||||
filedefs/filetypes.asciidoc \
|
||||
filedefs/filetypes.asm \
|
||||
filedefs/filetypes.batch \
|
||||
filedefs/filetypes.c \
|
||||
filedefs/filetypes.caml \
|
||||
filedefs/filetypes.Clojure.conf \
|
||||
filedefs/filetypes.cmake \
|
||||
filedefs/filetypes.cobol \
|
||||
filedefs/filetypes.coffeescript \
|
||||
filedefs/filetypes.common \
|
||||
filedefs/filetypes.conf \
|
||||
filedefs/filetypes.cpp \
|
||||
filedefs/filetypes.cs \
|
||||
filedefs/filetypes.css \
|
||||
filedefs/filetypes.CUDA.conf \
|
||||
filedefs/filetypes.Cython.conf \
|
||||
filedefs/filetypes.d \
|
||||
filedefs/filetypes.diff \
|
||||
filedefs/filetypes.docbook \
|
||||
filedefs/filetypes.erlang \
|
||||
filedefs/filetypes.f77 \
|
||||
filedefs/filetypes.ferite \
|
||||
filedefs/filetypes.forth \
|
||||
filedefs/filetypes.fortran \
|
||||
filedefs/filetypes.freebasic \
|
||||
filedefs/filetypes.Genie.conf \
|
||||
filedefs/filetypes.glsl \
|
||||
filedefs/filetypes.go \
|
||||
filedefs/filetypes.Graphviz.conf \
|
||||
filedefs/filetypes.haskell \
|
||||
filedefs/filetypes.haxe \
|
||||
filedefs/filetypes.html \
|
||||
filedefs/filetypes.java \
|
||||
filedefs/filetypes.javascript \
|
||||
filedefs/filetypes.JSON.conf \
|
||||
filedefs/filetypes.latex \
|
||||
filedefs/filetypes.lisp \
|
||||
filedefs/filetypes.lua \
|
||||
filedefs/filetypes.makefile \
|
||||
filedefs/filetypes.markdown \
|
||||
filedefs/filetypes.matlab \
|
||||
filedefs/filetypes.nsis \
|
||||
filedefs/filetypes.objectivec \
|
||||
filedefs/filetypes.pascal \
|
||||
filedefs/filetypes.perl \
|
||||
filedefs/filetypes.php \
|
||||
filedefs/filetypes.po \
|
||||
filedefs/filetypes.powershell \
|
||||
filedefs/filetypes.python \
|
||||
filedefs/filetypes.r \
|
||||
filedefs/filetypes.restructuredtext \
|
||||
filedefs/filetypes.ruby \
|
||||
filedefs/filetypes.rust \
|
||||
filedefs/filetypes.Scala.conf \
|
||||
filedefs/filetypes.sh \
|
||||
filedefs/filetypes.sql \
|
||||
filedefs/filetypes.tcl \
|
||||
filedefs/filetypes.txt2tags \
|
||||
filedefs/filetypes.vala \
|
||||
filedefs/filetypes.verilog \
|
||||
filedefs/filetypes.vhdl \
|
||||
filedefs/filetypes.xml \
|
||||
filedefs/filetypes.yaml \
|
||||
filedefs/filetypes.zephir
|
||||
|
||||
tagfiles = \
|
||||
c99.tags \
|
||||
php.tags \
|
||||
python.tags \
|
||||
pascal.tags \
|
||||
html_entities.tags
|
||||
tags/c99.tags \
|
||||
tags/php.tags \
|
||||
tags/python.tags \
|
||||
tags/pascal.tags \
|
||||
tags/html_entities.tags
|
||||
|
||||
template_files = \
|
||||
templates/files/file.html \
|
||||
|
@ -346,7 +346,9 @@ void filetypes_init_types(void)
|
||||
{
|
||||
filetype_add(filetypes[ft_id]);
|
||||
}
|
||||
init_custom_filetypes(app->datadir);
|
||||
f = g_build_filename(app->datadir, GEANY_FILEDEFS_SUBDIR, NULL);
|
||||
init_custom_filetypes(f);
|
||||
g_free(f);
|
||||
f = g_build_filename(app->configdir, GEANY_FILEDEFS_SUBDIR, NULL);
|
||||
init_custom_filetypes(f);
|
||||
g_free(f);
|
||||
@ -536,7 +538,7 @@ static GeanyFiletype *check_builtin_filenames(const gchar *utf8_filename)
|
||||
if (g_str_has_prefix(lfn, path))
|
||||
found = TRUE;
|
||||
|
||||
SETPTR(path, g_build_filename(app->datadir, "filetypes.", NULL));
|
||||
SETPTR(path, g_build_filename(app->datadir, GEANY_FILEDEFS_SUBDIR, "filetypes.", NULL));
|
||||
if (g_str_has_prefix(lfn, path))
|
||||
found = TRUE;
|
||||
|
||||
@ -1012,7 +1014,7 @@ static gchar *filetypes_get_filename(GeanyFiletype *ft, gboolean user)
|
||||
if (user)
|
||||
file_name = g_build_filename(app->configdir, GEANY_FILEDEFS_SUBDIR, base_name, NULL);
|
||||
else
|
||||
file_name = g_build_filename(app->datadir, base_name, NULL);
|
||||
file_name = g_build_filename(app->datadir, GEANY_FILEDEFS_SUBDIR, base_name, NULL);
|
||||
|
||||
g_free(ext);
|
||||
g_free(base_name);
|
||||
|
@ -41,6 +41,7 @@ G_BEGIN_DECLS
|
||||
* listed in the documentation should not be changed */
|
||||
#define GEANY_FILEDEFS_SUBDIR "filedefs"
|
||||
#define GEANY_TEMPLATES_SUBDIR "templates"
|
||||
#define GEANY_TAGS_SUBDIR "tags"
|
||||
#define GEANY_CODENAME "Malvek"
|
||||
#define GEANY_HOMEPAGE "http://www.geany.org/"
|
||||
#define GEANY_WIKI "http://wiki.geany.org/"
|
||||
|
@ -704,7 +704,7 @@ static gint create_config_dir(void)
|
||||
if (saved_errno == 0 && ! g_file_test(filedefs_readme, G_FILE_TEST_EXISTS))
|
||||
{
|
||||
gchar *text = g_strconcat(
|
||||
"Copy files from ", app->datadir, " to this directory to overwrite "
|
||||
"Copy files from ", app->datadir, "/filedefs to this directory to overwrite "
|
||||
"them. To use the defaults, just delete the file in this directory.\nFor more information read "
|
||||
"the documentation (in ", app->docdir, G_DIR_SEPARATOR_S "index.html or visit " GEANY_HOMEPAGE ").", NULL);
|
||||
utils_write_file(filedefs_readme, text);
|
||||
|
@ -243,7 +243,7 @@ void symbols_global_tags_loaded(guint file_type_idx)
|
||||
|
||||
if (! tfi->tags_loaded)
|
||||
{
|
||||
gchar *fname = g_build_filename(app->datadir, tfi->tag_file, NULL);
|
||||
gchar *fname = g_build_filename(app->datadir, GEANY_TAGS_SUBDIR, tfi->tag_file, NULL);
|
||||
|
||||
symbols_load_global_tags(fname, filetypes[file_type_idx]);
|
||||
tfi->tags_loaded = TRUE;
|
||||
@ -263,7 +263,7 @@ static void html_tags_loaded(void)
|
||||
tfi = &tag_file_info[GTF_HTML_ENTITIES];
|
||||
if (! tfi->tags_loaded)
|
||||
{
|
||||
gchar *file = g_build_filename(app->datadir, tfi->tag_file, NULL);
|
||||
gchar *file = g_build_filename(app->datadir, GEANY_TAGS_SUBDIR, tfi->tag_file, NULL);
|
||||
|
||||
html_entities = utils_read_file_in_array(file);
|
||||
tfi->tags_loaded = TRUE;
|
||||
@ -1762,13 +1762,13 @@ static void init_user_tags(void)
|
||||
const GSList *node;
|
||||
gchar *dir;
|
||||
|
||||
dir = g_build_filename(app->configdir, "tags", NULL);
|
||||
dir = g_build_filename(app->configdir, GEANY_TAGS_SUBDIR, NULL);
|
||||
/* create the user tags dir for next time if it doesn't exist */
|
||||
if (! g_file_test(dir, G_FILE_TEST_IS_DIR))
|
||||
utils_mkdir(dir, FALSE);
|
||||
file_list = utils_get_file_list_full(dir, TRUE, FALSE, NULL);
|
||||
|
||||
SETPTR(dir, g_build_filename(app->datadir, "tags", NULL));
|
||||
SETPTR(dir, g_build_filename(app->datadir, GEANY_TAGS_SUBDIR, NULL));
|
||||
list = utils_get_file_list_full(dir, TRUE, FALSE, NULL);
|
||||
g_free(dir);
|
||||
|
||||
|
@ -15,7 +15,7 @@ trap 'rm -rf "$TMPDIR"' EXIT
|
||||
mkdir -p "$CONFDIR" || exit 99
|
||||
mkdir -p "$CONFDIR/filedefs/" || exit 99
|
||||
cp "${srcdir:-.}"/../../data/filetype_extensions.conf "$CONFDIR" || exit 99
|
||||
cp "${srcdir:-.}"/../../data/filetypes.* "$CONFDIR/filedefs/" || exit 99
|
||||
cp "${srcdir:-.}"/../../data/filedefs/filetypes.* "$CONFDIR/filedefs/" || exit 99
|
||||
|
||||
result="$1"
|
||||
source="${result%.*}"
|
||||
|
Loading…
x
Reference in New Issue
Block a user