diff options
author | Zhang Xianwei <[email protected]> | 2018-01-15 18:15:11 +0800 |
---|---|---|
committer | monsta <[email protected]> | 2018-03-18 11:11:39 +0300 |
commit | bf899da943f62eba3b78b998334eba1c52874b7b (patch) | |
tree | d86ea6f5fcea65f995294e402bf9c8589ce9766c | |
parent | f184a1a48f0baf73bd74316d3d71566c626a6b5a (diff) | |
download | mate-control-center-bf899da943f62eba3b78b998334eba1c52874b7b.tar.bz2 mate-control-center-bf899da943f62eba3b78b998334eba1c52874b7b.tar.xz |
Support the theme compression package for installing XZ format
This closes #320.
Signed-off-by: Zhang Xianwei <[email protected]>
-rw-r--r-- | capplets/appearance/theme-installer.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/capplets/appearance/theme-installer.c b/capplets/appearance/theme-installer.c index 2ffb1158..dcb899ac 100644 --- a/capplets/appearance/theme-installer.c +++ b/capplets/appearance/theme-installer.c @@ -48,6 +48,7 @@ enum { enum { TARGZ, TARBZ, + TARXZ, DIRECTORY }; @@ -258,6 +259,8 @@ process_local_theme_archive (GtkWindow *parent, return process_local_theme_tgz_tbz (parent, "gzip", tmp_dir, archive); else if (filetype == TARBZ) return process_local_theme_tgz_tbz (parent, "bzip2", tmp_dir, archive); + else if (filetype == TARXZ) + return process_local_theme_tgz_tbz (parent, "xz", tmp_dir, archive); else return FALSE; } @@ -509,6 +512,8 @@ process_local_theme (GtkWindow *parent, filetype = TARGZ; } else if (g_str_has_suffix (path, ".tar.bz2")) { filetype = TARBZ; + } else if (g_str_has_suffix (path, ".tar.xz")) { + filetype = TARXZ; } else if (g_file_test (path, G_FILE_TEST_IS_DIR)) { filetype = DIRECTORY; } else { @@ -696,6 +701,8 @@ mate_theme_install (GFile *file, template = "mate-theme-%d.gtp"; else if (g_str_has_suffix (base, ".tar.bz2")) template = "mate-theme-%d.tar.bz2"; + else if (g_str_has_suffix (base, ".tar.xz")) + template = "mate-theme-%d.tar.xz"; else { invalid_theme_dialog (parent, base, FALSE); g_free (base); @@ -772,6 +779,7 @@ mate_theme_installer_run (GtkWindow *parent, filter = gtk_file_filter_new (); gtk_file_filter_set_name (filter, _("Theme Packages")); gtk_file_filter_add_mime_type (filter, "application/x-bzip-compressed-tar"); + gtk_file_filter_add_mime_type (filter, "application/x-xz-compressed-tar"); gtk_file_filter_add_mime_type (filter, "application/x-compressed-tar"); gtk_file_filter_add_mime_type (filter, "application/x-mate-theme-package"); gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter); |