Revision: 5747 http://geany.svn.sourceforge.net/geany/?rev=5747&view=rev Author: ntrel Date: 2011-04-29 16:49:32 +0000 (Fri, 29 Apr 2011)
Log Message: ----------- Make custom filetype titles use 'source file' only if their group is Compiled or Script. Use 'source file' for reStructuredText title.
Modified Paths: -------------- trunk/ChangeLog trunk/src/filetypes.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2011-04-29 16:27:40 UTC (rev 5746) +++ trunk/ChangeLog 2011-04-29 16:49:32 UTC (rev 5747) @@ -9,6 +9,10 @@ Fix filetype title for some languages. Don't use 'Languages' for Miscellaneous group label. These changes mostly proposed by Matthew Brush (thanks). + * src/filetypes.c: + Make custom filetype titles use 'source file' only if their group + is Compiled or Script. + Use 'source file' for reStructuredText title.
2011-04-26 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
Modified: trunk/src/filetypes.c =================================================================== --- trunk/src/filetypes.c 2011-04-29 16:27:40 UTC (rev 5746) +++ trunk/src/filetypes.c 2011-04-29 16:49:32 UTC (rev 5747) @@ -442,7 +442,7 @@ ft = filetypes[GEANY_FILETYPES_REST]; ft->lang = 28; ft->name = g_strdup("reStructuredText"); - filetype_make_title(ft, TITLE_FILE); + filetype_make_title(ft, TITLE_SOURCE_FILE); ft->group = GEANY_FILETYPE_GROUP_MARKUP;
#define MATLAB @@ -573,7 +573,7 @@
ft = filetype_new(); ft->name = g_strdup(fn); - filetype_make_title(ft, TITLE_SOURCE_FILE); + filetype_make_title(ft, TITLE_FILE); ft->priv->custom = TRUE; filetype_add(ft); geany_debug("Added filetype %s (%d).", ft->name, ft->id); @@ -1640,7 +1640,15 @@ GeanyFiletype *ft = filetypes_lookup_by_name(*name);
if (ft) + { ft->group = group_id; + if (ft->priv->custom && + (group_id == GEANY_FILETYPE_GROUP_COMPILED || group_id == GEANY_FILETYPE_GROUP_SCRIPT)) + { + setptr(ft->title, NULL); + filetype_make_title(ft, TITLE_SOURCE_FILE); + } + } else geany_debug("Filetype '%s' not found for group '%s'!", *name, group_name); }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.