Commit 8e3dae0e authored by Morten Welinder's avatar Morten Welinder

Templates: Allow version-agnostic template files. [#630247]

parent 10f7640b
2011-01-20 Morten Welinder <terra@gnome.org>
* src/gutils.c (gnm_usr_dir): Add parameter controlling whether to
return versioned or unversioned directory. All callers changed.
* src/file-autoft.c (category_group_list_get): Search both
unversioned and versioned directories.
* src/wbc-gtk.c (wbc_gtk_reload_templates): Ditto.
2011-01-16 Andreas J. Guelzow <aguelzow@pyrshep.ca>
* src/commands.c (cmd_set_text_full): do not enter expressions
into text-formatted cells
2011-01-13 Andreas J. Guelzow <aguelzow@pyrshep.ca>
* src/value.c (find_rows_that_match): only one criteria row has
* src/value.c (find_rows_that_match): only one criteria row has
to match!
2011-01-11 Morten Welinder <terra@gnome.org>
......
......@@ -29,6 +29,7 @@ Morten:
* Plug a few leaks.
* Fix number-match issue regarding fraction.
* Fix problems with pivot reading from xls. [#638776]
* Allow version-agnostic template files. [#630247]
--------------------------------------------------------------------------
Gnumeric 1.10.12
......
......@@ -265,6 +265,8 @@ go_plugin_init (GOPlugin *plugin, GOCmdContext *cc)
GTypeModule *module;
char const *env_var;
GSList *dir_list;
const char *usr_dir = gnm_usr_dir (TRUE);
bindtextdomain (GETTEXT_PACKAGE, gnm_locale_dir ());
bindtextdomain (GETTEXT_PACKAGE "-functions", gnm_locale_dir ());
#ifdef ENABLE_NLS
......@@ -277,8 +279,8 @@ go_plugin_init (GOPlugin *plugin, GOCmdContext *cc)
gutils_init ();
dir_list = go_slist_create (
g_build_filename (gnm_sys_lib_dir (), PLUGIN_SUBDIR, NULL),
(gnm_usr_dir () == NULL ? NULL :
g_build_filename (gnm_usr_dir (), PLUGIN_SUBDIR, NULL)),
(usr_dir == NULL ? NULL :
g_build_filename (usr_dir, PLUGIN_SUBDIR, NULL)),
NULL);
dir_list = g_slist_concat
(dir_list,
......
......@@ -223,8 +223,8 @@ pm_gui_load_directory_page (PluginManagerGUI *pm_gui)
{
GtkTreeIter iter;
char * sys_plugins = g_build_filename (gnm_sys_lib_dir (), PLUGIN_SUBDIR, NULL);
char * usr_plugins = (gnm_usr_dir () == NULL ? NULL :
g_build_filename (gnm_usr_dir (), PLUGIN_SUBDIR, NULL));
char * usr_plugins = (gnm_usr_dir (TRUE) == NULL ? NULL :
g_build_filename (gnm_usr_dir (TRUE), PLUGIN_SUBDIR, NULL));
char * go_plugins = go_plugins_get_plugin_dir ();
GSList *plugin_dirs;
gchar const *plugin_path_env;
......
......@@ -212,7 +212,10 @@ category_group_list_get (void)
gnm_sys_data_dir ());
add_dir (&dir_list,
gnm_conf_get_autoformat_usr_dir (),
gnm_usr_dir ());
gnm_usr_dir (FALSE));
add_dir (&dir_list,
gnm_conf_get_autoformat_usr_dir (),
gnm_usr_dir (TRUE));
for (sl = gnm_conf_get_autoformat_extra_dirs (); sl; sl = sl->next) {
const char *dir = sl->data;
......
......@@ -920,8 +920,8 @@ gnm_plugins_init (GOCmdContext *context)
char const *env_var;
GSList *dir_list = go_slist_create (
g_build_filename (gnm_sys_lib_dir (), PLUGIN_SUBDIR, NULL),
(gnm_usr_dir () == NULL ? NULL :
g_build_filename (gnm_usr_dir (), PLUGIN_SUBDIR, NULL)),
(gnm_usr_dir (TRUE) == NULL ? NULL :
g_build_filename (gnm_usr_dir (TRUE), PLUGIN_SUBDIR, NULL)),
NULL);
dir_list = g_slist_concat (dir_list,
go_string_slist_copy (gnm_conf_get_plugins_extra_dirs ()));
......
......@@ -36,6 +36,7 @@ static char *gnumeric_data_dir;
static char *gnumeric_icon_dir;
static char *gnumeric_locale_dir;
static char *gnumeric_usr_dir;
static char *gnumeric_usr_dir_unversioned;
static gboolean
running_in_tree (void)
......@@ -105,8 +106,12 @@ gutils_init (void)
gnumeric_locale_dir = g_strdup (GNUMERIC_LOCALEDIR);
#endif
home_dir = g_get_home_dir ();
gnumeric_usr_dir = (home_dir == NULL ? NULL :
g_build_filename (home_dir, ".gnumeric", GNM_VERSION_FULL, NULL));
gnumeric_usr_dir_unversioned = home_dir
? g_build_filename (home_dir, ".gnumeric", NULL)
: NULL;
gnumeric_usr_dir = gnumeric_usr_dir_unversioned
? g_build_filename (gnumeric_usr_dir_unversioned, GNM_VERSION_FULL, NULL)
: NULL;
}
void
......@@ -122,6 +127,8 @@ gutils_shutdown (void)
gnumeric_locale_dir = NULL;
g_free (gnumeric_usr_dir);
gnumeric_usr_dir = NULL;
g_free (gnumeric_usr_dir_unversioned);
gnumeric_usr_dir_unversioned = NULL;
}
char const *
......@@ -149,9 +156,9 @@ gnm_locale_dir (void)
}
char const *
gnm_usr_dir (void)
gnm_usr_dir (gboolean versioned)
{
return gnumeric_usr_dir;
return versioned ? gnumeric_usr_dir : gnumeric_usr_dir_unversioned;
}
int
......
......@@ -16,7 +16,7 @@ char const *gnm_sys_lib_dir (void);
char const *gnm_sys_data_dir (void);
char const *gnm_icon_dir (void);
char const *gnm_locale_dir (void);
char const *gnm_usr_dir (void);
char const *gnm_usr_dir (gboolean versioned);
#define PLUGIN_SUBDIR "plugins"
......
......@@ -5073,8 +5073,13 @@ wbc_gtk_reload_templates (WBCGtk *gtk)
add_template_dir (path, h);
g_free (path);
/* Let user override system templates by doing this last. */
path = g_build_filename (gnm_usr_dir (), "templates", NULL);
/* Possibly override the above with user templates without version. */
path = g_build_filename (gnm_usr_dir (FALSE), "templates", NULL);
add_template_dir (path, h);
g_free (path);
/* Possibly override the above with user templates with version. */
path = g_build_filename (gnm_usr_dir (TRUE), "templates", NULL);
add_template_dir (path, h);
g_free (path);
......
2011-01-20 Morten Welinder <terra@gnome.org>
* gnumeric-expr-entry.c: Fix warning.
2011-01-16 Andreas J. Guelzow <aguelzow@pyrshep.ca>
* gnumeric-expr-entry.c (gee_update_lexer_items): check for text
* gnumeric-expr-entry.c (gee_update_lexer_items): check for text
formatted cells
2011-01-15 Andreas J. Guelzow <aguelzow@pyrshep.ca>
* gnm-cell-combo-view.c (gnm_cell_combo_view_popdown): wait for the
gdkwindow to be set before rtetrieving it.
2011-01-12 Jean Brefort <jean.brefort@normalesup.org>
* gnumeric-expr-entry.c (gee_class_init): dynamically test for
......
......@@ -25,6 +25,7 @@
#include <func.h>
#include <dependent.h>
#include <sheet.h>
#include <sheet-style.h>
#include <workbook.h>
#include <sheet-view.h>
#include <selection.h>
......
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