Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Archive
gnome-latex
Commits
1211e3d8
Commit
1211e3d8
authored
Mar 27, 2018
by
swilmet
Browse files
latexila -> gnome-latex migration: handle projects
Factor out a common function to migrate a user data file.
parent
0b7bf011
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/liblatexila/latexila-utils.c
View file @
1211e3d8
...
...
@@ -565,22 +565,11 @@ migrate_latexila_to_gnome_latex_gsettings (void)
}
static
void
migrate_latexila_to_gnome_latex_most_used_symbols
(
void
)
migrate_latexila_to_gnome_latex_copy_file
(
GFile
*
latexila_file
,
GFile
*
glatex_file
)
{
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
)
{
...
...
@@ -602,10 +591,51 @@ migrate_latexila_to_gnome_latex_most_used_symbols (void)
out:
if
(
error
!=
NULL
)
{
g_warning
(
"Error when migrating LaTeXila to GNOME LaTeX
most used symbols
: %s"
,
g_warning
(
"Error when migrating LaTeXila to GNOME LaTeX
user data file
: %s"
,
error
->
message
);
g_clear_error
(
&
error
);
}
}
static
void
migrate_latexila_to_gnome_latex_most_used_symbols
(
void
)
{
GFile
*
latexila_file
;
GFile
*
glatex_file
;
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
);
migrate_latexila_to_gnome_latex_copy_file
(
latexila_file
,
glatex_file
);
g_object_unref
(
latexila_file
);
g_object_unref
(
glatex_file
);
}
static
void
migrate_latexila_to_gnome_latex_projects
(
void
)
{
GFile
*
latexila_file
;
GFile
*
glatex_file
;
latexila_file
=
g_file_new_build_filename
(
g_get_user_data_dir
(),
"latexila"
,
"projects.xml"
,
NULL
);
glatex_file
=
g_file_new_build_filename
(
g_get_user_data_dir
(),
"gnome-latex"
,
"projects.xml"
,
NULL
);
migrate_latexila_to_gnome_latex_copy_file
(
latexila_file
,
glatex_file
);
g_object_unref
(
latexila_file
);
g_object_unref
(
glatex_file
);
...
...
@@ -628,6 +658,7 @@ latexila_utils_migrate_latexila_to_gnome_latex (void)
{
migrate_latexila_to_gnome_latex_gsettings
();
migrate_latexila_to_gnome_latex_most_used_symbols
();
migrate_latexila_to_gnome_latex_projects
();
g_settings_set_boolean
(
settings
,
"latexila-to-gnome-latex-migration-done"
,
TRUE
);
}
...
...
src/projects.vala
View file @
1211e3d8
...
...
@@ -234,7 +234,7 @@ public class Projects
private
File
get_xml_file
()
{
string
path
=
Path
.
build_filename
(
Environment
.
get_user_data_dir
(),
"latex
ila
"
,
"projects.xml"
,
null
);
"
gnome-
latex"
,
"projects.xml"
,
null
);
return
File
.
new_for_path
(
path
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment