!7 Upgrade to 0.11
From: @li-long315 Reviewed-by: @dou33 Signed-off-by: @dou33
This commit is contained in:
commit
eb95335c5f
@ -1,91 +0,0 @@
|
||||
From 9c19d7fedadf38cc4fec21efdb3908572448f658 Mon Sep 17 00:00:00 2001
|
||||
From: Matthias Clasen <mclasen@redhat.com>
|
||||
Date: Thu, 30 May 2013 19:21:11 -0400
|
||||
Subject: [PATCH] Make the 'Don't ask again' checkbox work properly
|
||||
|
||||
We used to remove the user-dirs.locale file when this is checked,
|
||||
but that prevents xdg-user-dirs-gtk-update from ever running again.
|
||||
Instead, update it with the current locale. This has the effect
|
||||
of keeping xdg-user-dirs-gtk-update from running until the locale
|
||||
changes again, which is probably closer to the intended effect.
|
||||
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=968955
|
||||
---
|
||||
update.c | 40 +++++++++++++++++++++++++++++++---------
|
||||
1 file changed, 31 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/update.c b/update.c
|
||||
index 4697913..8710c79 100644
|
||||
--- a/update.c
|
||||
+++ b/update.c
|
||||
@@ -48,12 +48,40 @@ has_xdg_translation (void)
|
||||
if (strncmp (locale, "en_US", 5) == 0 ||
|
||||
strcmp (locale, "C") == 0)
|
||||
return TRUE;
|
||||
-
|
||||
+
|
||||
str = "Desktop";
|
||||
return dgettext ("xdg-user-dirs", str) != str;
|
||||
}
|
||||
|
||||
static void
|
||||
+save_locale (void)
|
||||
+{
|
||||
+ FILE *file;
|
||||
+ char *user_locale_file;
|
||||
+ char *locale, *dot;
|
||||
+
|
||||
+ user_locale_file = g_build_filename (g_get_user_config_dir (),
|
||||
+ "user-dirs.locale", NULL);
|
||||
+ file = fopen (user_locale_file, "w");
|
||||
+ g_free (user_locale_file);
|
||||
+
|
||||
+ if (file == NULL)
|
||||
+ {
|
||||
+ fprintf (stderr, "Can't save user-dirs.locale\n");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ locale = g_strdup (setlocale (LC_MESSAGES, NULL));
|
||||
+ /* Skip encoding part */
|
||||
+ dot = strchr (locale, '.');
|
||||
+ if (dot)
|
||||
+ *dot = 0;
|
||||
+ fprintf (file, "%s", locale);
|
||||
+ g_free (locale);
|
||||
+ fclose (file);
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
update_locale (XdgDirEntry *old_entries)
|
||||
{
|
||||
XdgDirEntry *new_entries, *entry;
|
||||
@@ -91,10 +119,9 @@ update_locale (XdgDirEntry *old_entries)
|
||||
g_free (std_out);
|
||||
g_free (std_err);
|
||||
g_free (cmdline);
|
||||
-
|
||||
if (!WIFEXITED(exit_status) || WEXITSTATUS(exit_status) != 0)
|
||||
return;
|
||||
-
|
||||
+
|
||||
new_entries = parse_xdg_dirs (filename);
|
||||
g_unlink (filename);
|
||||
g_free (filename);
|
||||
@@ -254,12 +281,7 @@ update_locale (XdgDirEntry *old_entries)
|
||||
|
||||
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check)))
|
||||
{
|
||||
- char *file;
|
||||
-
|
||||
- file = g_build_filename (g_get_user_config_dir (),
|
||||
- "user-dirs.locale", NULL);
|
||||
- g_unlink (file);
|
||||
- g_free (file);
|
||||
+ save_locale ();
|
||||
}
|
||||
|
||||
g_free (new_entries);
|
||||
--
|
||||
1.8.2.1
|
||||
|
||||
12
show-in-mate.patch
Normal file
12
show-in-mate.patch
Normal file
@ -0,0 +1,12 @@
|
||||
diff -up xdg-user-dirs-gtk-0.10/user-dirs-update-gtk.desktop.in.mate xdg-user-dirs-gtk-0.10/user-dirs-update-gtk.desktop.in
|
||||
--- xdg-user-dirs-gtk-0.10/user-dirs-update-gtk.desktop.in.mate 2014-01-27 19:09:55.954616086 -0500
|
||||
+++ xdg-user-dirs-gtk-0.10/user-dirs-update-gtk.desktop.in 2014-01-27 19:10:02.965602005 -0500
|
||||
@@ -4,7 +4,7 @@ Exec=xdg-user-dirs-gtk-update
|
||||
_Name=User folders update
|
||||
_Comment=Update common folders names to match current locale
|
||||
Terminal=false
|
||||
-OnlyShowIn=GNOME;LXDE;Unity;
|
||||
+OnlyShowIn=GNOME;LXDE;Unity;MATE;
|
||||
Type=Application
|
||||
StartupNotify=false
|
||||
X-KDE-autostart-after=panel
|
||||
Binary file not shown.
BIN
xdg-user-dirs-gtk-0.11.tar.xz
Normal file
BIN
xdg-user-dirs-gtk-0.11.tar.xz
Normal file
Binary file not shown.
@ -1,11 +1,12 @@
|
||||
Name: xdg-user-dirs-gtk
|
||||
Version: 0.10
|
||||
Release: 17
|
||||
Version: 0.11
|
||||
Release: 1
|
||||
Summary: Integrated tools for gnome to help manage directories
|
||||
License: GPL+
|
||||
URL: http://freedesktop.org/wiki/Software/xdg-user-dirs
|
||||
Source0: http://download.gnome.org/sources/xdg-user-dirs-gtk/%{version}/%{name}-%{version}.tar.xz
|
||||
Patch001: 0001-Make-the-Don-t-ask-again-checkbox-work-properly.patch
|
||||
Patch0: show-in-mate.patch
|
||||
|
||||
BuildRequires: desktop-file-utils gettext gtk3-devel intltool xdg-user-dirs gcc
|
||||
Requires: xdg-user-dirs
|
||||
|
||||
@ -32,6 +33,9 @@ desktop-file-validate $RPM_BUILD_ROOT%{_sysconfdir}/xdg/autostart/user-dirs-upda
|
||||
%config(noreplace) %{_sysconfdir}/xdg/autostart/user-dirs-update-gtk.desktop
|
||||
|
||||
%changelog
|
||||
* Fri Mar 17 2023 Li Long <lilong@kylinos.cn> - 0.11-1
|
||||
- Upgrade to 0.11
|
||||
|
||||
* Mon May 31 2021 huanghaitao <huanghaitao8@huawei.com> - 0.10-17
|
||||
- Completing build dependencies to fix gcc compiler missing error
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user