Commit 143c2c83 authored by Sébastien Wilmet's avatar Sébastien Wilmet

latexila -> gnome-latex migration: handle most used symbols

Requires GIO 2.56 for g_file_new_build_filename().
parent 3af415b6
...@@ -18,7 +18,7 @@ The web site: ...@@ -18,7 +18,7 @@ The web site:
Dependencies Dependencies
------------ ------------
* GLib >= 2.50 * GLib >= 2.56
* GTK+ >= 3.22 * GTK+ >= 3.22
* GtkSourceView >= 4.0 * GtkSourceView >= 4.0
* Tepl >= 3.99.1 - https://wiki.gnome.org/Projects/Tepl * Tepl >= 3.99.1 - https://wiki.gnome.org/Projects/Tepl
......
...@@ -29,7 +29,7 @@ LT_INIT ...@@ -29,7 +29,7 @@ LT_INIT
# Required dependencies versions # Required dependencies versions
# Update also the --target-glib option in src/Makefile.am. # Update also the --target-glib option in src/Makefile.am.
GLIB_REQUIRED_VERSION="2.50" GLIB_REQUIRED_VERSION="2.56"
GTK_REQUIRED_VERSION="3.22" GTK_REQUIRED_VERSION="3.22"
GTKSOURCEVIEW_REQUIRED_VERSION="4.0" GTKSOURCEVIEW_REQUIRED_VERSION="4.0"
TEPL_REQUIRED_VERSION="3.99.1" TEPL_REQUIRED_VERSION="3.99.1"
......
...@@ -576,14 +576,56 @@ out: ...@@ -576,14 +576,56 @@ out:
g_object_unref (settings); g_object_unref (settings);
} }
static void
migrate_latexila_to_gnome_latex_most_used_symbols (void)
{
GFile *latexila_file;
GFile *glatex_file;
GError *error = NULL;
latexila_file = g_file_new_build_filename (g_get_user_data_dir (),
"latexila",
"most_used_symbols.xml",
NULL);
glatex_file = g_file_new_build_filename (g_get_user_data_dir (),
"gnome-latex",
"most_used_symbols.xml",
NULL);
latexila_utils_create_parent_directories (glatex_file, &error);
if (error != NULL)
{
goto out;
}
g_file_copy (latexila_file,
glatex_file,
G_FILE_COPY_TARGET_DEFAULT_PERMS,
NULL, NULL, NULL,
&error);
out:
if (error != NULL)
{
g_warning ("Error when migrating LaTeXila to GNOME LaTeX most used symbols: %s",
error->message);
g_clear_error (&error);
}
g_object_unref (latexila_file);
g_object_unref (glatex_file);
}
/** /**
* latexila_utils_migrate_latexila_to_gnome_latex: * latexila_utils_migrate_latexila_to_gnome_latex:
* *
* Migrates the #GSettings values from LaTeXila to GNOME LaTeX, so that users * Migrates the #GSettings values and user data/config files from LaTeXila to
* don't lose all their settings. * GNOME LaTeX, so that users don't lose all their settings.
*/ */
void void
latexila_utils_migrate_latexila_to_gnome_latex (void) latexila_utils_migrate_latexila_to_gnome_latex (void)
{ {
migrate_latexila_to_gnome_latex_gsettings (); migrate_latexila_to_gnome_latex_gsettings ();
migrate_latexila_to_gnome_latex_most_used_symbols ();
} }
...@@ -130,7 +130,7 @@ public class MostUsedSymbols : GLib.Object ...@@ -130,7 +130,7 @@ public class MostUsedSymbols : GLib.Object
private File get_xml_file () private File get_xml_file ()
{ {
string path = Path.build_filename (Environment.get_user_data_dir (), string path = Path.build_filename (Environment.get_user_data_dir (),
"latexila", "most_used_symbols.xml"); "gnome-latex", "most_used_symbols.xml");
return File.new_for_path (path); return File.new_for_path (path);
} }
......
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