Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
90ee5044b3
!24 Fix crash when copying an invalid file
From: @Venland 
Reviewed-by: @open-bot 
Signed-off-by: @open-bot
2024-05-28 02:09:33 +00:00
liweigang
552b8eb9e0 Fix crash when copying an invalid file
Signed-off-by: liweigang <liweiganga@uniontech.com>
2024-05-28 09:59:50 +08:00
openeuler-ci-bot
1e324cd538
!12 Add the ability to create document
From: @ikernel-mryao 
Reviewed-by: @dwl301 
Signed-off-by: @dwl301
2022-12-23 03:51:08 +00:00
yaoguangzhong
c0cd3a0bba [PATCH]nautilus: Add the ability to create document
category: bugfix
bugzilla: https://gitee.com/src-openeuler/nautilus/issues/I66CA7?from=project-issue

Signed-off-by: Guangzhong Yao <yaoguangzhong@xfusion.com>
2022-12-15 16:29:46 +08:00
openeuler-ci-bot
85e0a5c515
!11 Add right click sort function
From: @ikernel-mryao 
Reviewed-by: @dwl301 
Signed-off-by: @dwl301
2022-12-15 08:15:51 +00:00
yaoguangzhong
cb852d1f00 [PATCH]nautilus: Add right click sort function
category: bugfix
bugzilla: https://gitee.com/src-openeuler/nautilus/issues/I65PRO?from=project-issue

Signed-off-by: Guangzhong Yao <yaoguangzhong@xfusion.com>
2022-12-15 15:51:20 +08:00
openeuler-ci-bot
b3803fa5b3
!10 translate general and show sidebar
From: @ikernel-mryao 
Reviewed-by: @dwl301 
Signed-off-by: @dwl301
2022-12-15 04:09:49 +00:00
yaoguangzhong
17e16f27f0 [PATCH]nautilus: translate general and show sidebar
Signed-off-by: Guangzhong Yao <yaoguangzhong@xfusion.com>
2022-12-14 11:21:33 +08:00
openeuler-ci-bot
989cd1e762
!9 display tooltip content
From: @ikernel-mryao 
Reviewed-by: @dwl301 
Signed-off-by: @dwl301
2022-12-13 11:18:23 +00:00
yaoguangzhong
5781cea055 [PATCH]nautius: display tooltip content
category: bugfix
bugzilla: https://gitee.com/src-openeuler/nautilus/issues/I65SOV?from=project-issue

Signed-off-by: Guangzhong Yao <yaoguangzhong@xfusion.com>
2022-12-12 16:16:01 +08:00
6 changed files with 444 additions and 1 deletions

54
CVE-2022-37290.patch Normal file
View File

@ -0,0 +1,54 @@
From 78e757fe7650033d09def2e2e1540ea7c5651aab Mon Sep 17 00:00:00 2001
From: technology208 <technology@208suo.com>
Date: Mon, 20 May 2024 13:54:01 +0800
Subject: [PATCH] CreatePatch
---
src/nautilus-dbus-manager.c | 6 ++++++
src/nautilus-file-operations.c | 6 ++++++
2 files changed, 12 insertions(+)
diff --git a/src/nautilus-dbus-manager.c b/src/nautilus-dbus-manager.c
index 43f27e1..82be3b6 100644
--- a/src/nautilus-dbus-manager.c
+++ b/src/nautilus-dbus-manager.c
@@ -126,6 +126,12 @@ handle_create_folder (NautilusDBusFileOperations *object,
file = g_file_new_for_uri (uri);
basename = g_file_get_basename (file);
parent_file = g_file_get_parent (file);
+ if (parent_file == NULL || basename == NULL)
+ {
+ g_dbus_method_invocation_return_error (invocation, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT, "Invalid uri: %s", uri);
+ return TRUE;
+ }
+
parent_file_uri = g_file_get_uri (parent_file);
g_application_hold (g_application_get_default ());
diff --git a/src/nautilus-file-operations.c b/src/nautilus-file-operations.c
index 7579cd0..ea4edb2 100644
--- a/src/nautilus-file-operations.c
+++ b/src/nautilus-file-operations.c
@@ -985,6 +985,11 @@ get_basename (GFile *file)
if (name == NULL)
{
basename = g_file_get_basename (file);
+ if (basename == NULL)
+ {
+ return g_strdup (_("unknown"));
+ }
+
if (g_utf8_validate (basename, -1, NULL))
{
name = basename;
@@ -4170,6 +4175,7 @@ get_unique_target_file (GFile *src,
if (dest == NULL)
{
basename = g_file_get_basename (src);
+ g_assert (basename == NULL);
if (g_utf8_validate (basename, -1, NULL))
{
--
2.33.0

View File

@ -1,6 +1,6 @@
Name: nautilus
Version: 3.33.90
Release: 5
Release: 10
Summary: Default file manager for GNOME
License: GPLv3+ and LGPLv2+
URL: https://wiki.gnome.org/Apps/Nautilus
@ -17,6 +17,11 @@ Obsoletes: %{name}-extensions
Patch01: nautius-3.33.90-translate-information-to-chinese.patch
Patch02: nautius-3.33.90-translate-English-tips-information-to-chinese.patch
Patch03: nautius-3.33.90-display-tooltip-content.patch
Patch04: nautius-3.33.90-translate-general-and-show-sidebar.patch
Patch05: nautius-3.33.90-Add-right-click-sort-function.patch
Patch06: nautius-3.33.90-Add-the-ability-to-create-document.patch
Patch07: CVE-2022-37290.patch
%description
It's easier to manage your files for the GNOME desktop. Ability to browse directories on local and remote systems.
@ -82,6 +87,33 @@ make test
%{_datadir}/metainfo/*
%changelog
* Tue May 21 2024 liweigang <liweiganga@uniontech.com> - 3.33.90-10
- Fix crash when copying an invalid file
* Thu Dec 15 2022 Guangzhong Yao <yaoguangzhong@xfusion.com> - 3.33.90-9
- Type:bugfix
- Id:NA
- SUG:NA
- DESC: Add the ability to create document
* Thu Dec 15 2022 Guangzhong Yao <yaoguangzhong@xfusion.com> - 3.33.90-8
- Type:bugfix
- Id:NA
- SUG:NA
- DESC: Add right click sort function
* Wed Dec 14 2022 Guangzhong Yao <yaoguangzhong@xfusion.com> - 3.33.90-7
- Type:bugfix
- Id:NA
- SUG:NA
- DESC: translate general and show sidebar into Chinese
* Mon Dec 12 2022 Guangzhong Yao <yaoguangzhong@xfusion.com> - 3.33.90-6
- Type:bugfix
- Id:NA
- SUG:NA
- DESC: display tooltop content
* Sun Dec 11 2022 Guangzhong Yao <yaoguangzhong@xfusion.com> - 3.33.90-5
- Type:bugfix
- Id:NA

View File

@ -0,0 +1,77 @@
From 2eb3624defd4d764a24c2fd6431ca01f152eaefc Mon Sep 17 00:00:00 2001
From: yangzhuangzhuang <yangzhuangzhuang@xfusion.com>
Date: Fri, 26 Aug 2022 12:02:05 +0800
Subject: [PATCH] Add right-click sort function
---
po/zh_CN.po | 3 ++
.../ui/nautilus-files-view-context-menus.ui | 37 ++++++++++++++++++-
2 files changed, 39 insertions(+), 1 deletion(-)
diff --git a/po/zh_CN.po b/po/zh_CN.po
index 55ce692..7b484cf 100644
--- a/po/zh_CN.po
+++ b/po/zh_CN.po
@@ -5884,3 +5884,6 @@ msgstr "常规"
msgid "_Show sidebar"
msgstr "显示侧边栏(S)"
+
+msgid "Sort"
+msgstr "排序"
diff --git a/src/resources/ui/nautilus-files-view-context-menus.ui b/src/resources/ui/nautilus-files-view-context-menus.ui
index 9f0d238..c9de20e 100644
--- a/src/resources/ui/nautilus-files-view-context-menus.ui
+++ b/src/resources/ui/nautilus-files-view-context-menus.ui
@@ -11,6 +11,41 @@
<attribute name="action">view.new-document</attribute>
<attribute name="hidden-when">action-disabled</attribute>
</submenu>
+ <submenu>
+ <attribute name="label" translatable="yes">Sort</attribute>
+ <section>
+ <item>
+ <attribute name="label" translatable="yes" context="Sort Criterion" comments="This is used to sort by name in the toolbar view menu">_A-Z</attribute>
+ <attribute name="action">view.sort</attribute>
+ <attribute name="target">name</attribute>
+ </item>
+ <item>
+ <attribute name="label" translatable="yes" context="Sort Criterion" comments="This is used to sort by name, in descending order in the toolbar view menu">_Z-A</attribute>
+ <attribute name="action">view.sort</attribute>
+ <attribute name="target">name-desc</attribute>
+ </item>
+ <item>
+ <attribute name="label" translatable="yes">Last _Modified</attribute>
+ <attribute name="action">view.sort</attribute>
+ <attribute name="target">modification-date-desc</attribute>
+ </item>
+ <item>
+ <attribute name="label" translatable="yes">_First Modified</attribute>
+ <attribute name="action">view.sort</attribute>
+ <attribute name="target">modification-date</attribute>
+ </item>
+ <item>
+ <attribute name="label" translatable="yes">_Size</attribute>
+ <attribute name="action">view.sort</attribute>
+ <attribute name="target">size</attribute>
+ </item>
+ <item>
+ <attribute name="label" translatable="yes">_Type</attribute>
+ <attribute name="action">view.sort</attribute>
+ <attribute name="target">type</attribute>
+ </item>
+ </section>
+ </submenu>
<section>
<item>
<attribute name="label" translatable="yes">_Paste</attribute>
@@ -239,4 +274,4 @@
</item>
</section>
</menu>
-</interface>
\ No newline at end of file
+</interface>
--
2.27.0

View File

@ -0,0 +1,164 @@
From dbb570fc748d0c2743c58f601fa7df54515f8ed0 Mon Sep 17 00:00:00 2001
From: yangzhuangzhuang <yangzhuangzhuang@xfusion.com>
Date: Thu, 1 Sep 2022 17:01:47 +0800
Subject: [PATCH] Right-click to add new text document function
Add the text document button and place the text document and new folder in the New button
---
po/zh_CN.po | 6 +++
src/nautilus-files-view.c | 47 +++++++++++++++++++
.../ui/nautilus-files-view-context-menus.ui | 23 +++++++--
3 files changed, 72 insertions(+), 4 deletions(-)
diff --git a/po/zh_CN.po b/po/zh_CN.po
index 7b484cf..7fbb840 100644
--- a/po/zh_CN.po
+++ b/po/zh_CN.po
@@ -5887,3 +5887,9 @@ msgstr "显示侧边栏(S)"
msgid "Sort"
msgstr "排序"
+
+msgid "_Document"
+msgstr "文本文档"
+
+msgid "_Create"
+msgstr "新建"
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index 666fcf3..1b2cf73 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -2413,6 +2413,16 @@ nautilus_files_view_new_file (NautilusFilesView *directory_view,
g_free (container_uri);
}
+static void
+action_new_file (GSimpleAction *action,
+ GVariant *state,
+ gpointer user_data)
+{
+ g_assert (NAUTILUS_IS_FILES_VIEW (user_data));
+
+ nautilus_files_view_new_file (NAUTILUS_FILES_VIEW (user_data), NULL, NULL);
+}
+
static void
action_new_folder (GSimpleAction *action,
GVariant *state,
@@ -6955,6 +6965,7 @@ const GActionEntry view_entries[] =
{ "paste_accel", action_paste_files_accel },
{ "create-link", action_create_links },
{ "new-document" },
+ { "new-file", action_new_file },
/* Selection menu */
{ "scripts" },
{ "new-folder-with-selection", action_new_folder_with_selection },
@@ -7353,6 +7364,11 @@ real_update_actions_state (NautilusFilesView *view)
gboolean show_star;
gboolean show_unstar;
gchar *uri;
+ GAppInfo *default_app;
+ gboolean can_create_text;
+ gboolean can_create_document;
+ gboolean can_create_spreadsheet;
+ gboolean can_create_presentation;
priv = nautilus_files_view_get_instance_private (view);
@@ -7448,6 +7464,32 @@ real_update_actions_state (NautilusFilesView *view)
"new-folder");
g_simple_action_set_enabled (G_SIMPLE_ACTION (action), can_create_files);
+ action = g_action_map_lookup_action (G_ACTION_MAP (view_action_group),
+ "new-file");
+
+ default_app = g_app_info_get_default_for_type ("text/plain", FALSE);
+ can_create_text = default_app != NULL;
+ g_object_unref (default_app);
+
+ default_app = g_app_info_get_default_for_type ("application/vnd.oasis.opendocument.text", FALSE);
+ can_create_document = default_app != NULL;
+ g_object_unref (default_app);
+
+ default_app = g_app_info_get_default_for_type ("application/vnd.oasis.opendocument.spreadsheet", FALSE);
+ can_create_spreadsheet = default_app != NULL;
+ g_object_unref (default_app);
+
+ default_app = g_app_info_get_default_for_type ("application/vnd.oasis.opendocument.presentation", FALSE);
+ can_create_presentation = default_app != NULL;
+ g_object_unref (default_app);
+
+ g_simple_action_set_enabled (G_SIMPLE_ACTION (action),
+ can_create_files && (
+ can_create_text ||
+ can_create_document ||
+ can_create_spreadsheet ||
+ can_create_presentation));
+
item_opens_in_view = selection_count != 0;
for (l = selection; l != NULL; l = l->next)
@@ -7646,6 +7688,10 @@ real_update_actions_state (NautilusFilesView *view)
!selection_contains_starred &&
priv->templates_present);
+ action = g_action_map_lookup_action (G_ACTION_MAP (view_action_group),
+ "new-file");
+ g_simple_action_set_enabled (G_SIMPLE_ACTION (action), can_create_files);
+
g_object_ref (view); /* Need to keep the object alive until we get the reply */
gtk_clipboard_request_text (nautilus_clipboard_get (GTK_WIDGET (view)),
on_clipboard_contents_received,
@@ -9776,6 +9822,7 @@ nautilus_files_view_init (NautilusFilesView *view)
nautilus_application_set_accelerator (app, "view.cut", "<control>x");
nautilus_application_set_accelerator (app, "view.copy", "<control>c");
nautilus_application_set_accelerator (app, "view.create-link-in-place", "<control><shift>m");
+ nautilus_application_set_accelerator (app, "view.new-file", "<control><shift>f");
nautilus_application_set_accelerator (app, "view.new-folder", "<control><shift>n");
/* Only accesible by shorcuts */
nautilus_application_set_accelerator (app, "view.select-pattern", "<control>s");
diff --git a/src/resources/ui/nautilus-files-view-context-menus.ui b/src/resources/ui/nautilus-files-view-context-menus.ui
index 279646d..420b0b5 100644
--- a/src/resources/ui/nautilus-files-view-context-menus.ui
+++ b/src/resources/ui/nautilus-files-view-context-menus.ui
@@ -1,10 +1,24 @@
<?xml version="1.0"?>
<interface>
<menu id="background-menu">
- <item>
- <attribute name="label" translatable="yes">New _Folder</attribute>
- <attribute name="action">view.new-folder</attribute>
- </item>
+ <section>
+ <submenu>
+ <attribute name="label" translatable="yes">_Create</attribute>
+ <section>
+ <item>
+ <attribute name="label" translatable="yes">New _Folder</attribute>
+ <attribute name="action">view.new-folder</attribute>
+ </item>
+ </section>
+ <section>
+ <item>
+ <attribute name="label" translatable="yes">_Document</attribute>
+ <attribute name="action">view.new-file</attribute>
+ </item>
+ </section>
+ </submenu>
+ </section>
+ <section>
<submenu>
<attribute name="id">templates-submenu</attribute>
<attribute name="label" translatable="yes">New _Document</attribute>
@@ -46,6 +60,7 @@
</item>
</section>
</submenu>
+ </section>
<section>
<item>
<attribute name="label" translatable="yes">_Paste</attribute>
--
2.27.0

View File

@ -0,0 +1,89 @@
From 5f431fab261657050f315663f15d5548d30b21b5 Mon Sep 17 00:00:00 2001
From: yangzhuangzhuang <yangzhuangzhuang@xfusion.com>
Date: Fri, 26 Aug 2022 11:26:25 +0800
Subject: [PATCH] display tooltip content
---
po/zh_CN.po | 8 ++++++++
src/resources/ui/nautilus-toolbar.ui | 7 +++++++
2 files changed, 15 insertions(+)
diff --git a/po/zh_CN.po b/po/zh_CN.po
index 3bab9e8..651e8c2 100644
--- a/po/zh_CN.po
+++ b/po/zh_CN.po
@@ -5870,3 +5870,11 @@ msgstr "无法粘贴文件"
msgid "Show _Sidebar"
msgstr "显示侧边栏(_S)"
+msgid "New window"
+msgstr "新建窗口"
+
+msgid "Cut"
+msgstr "剪切"
+
+msgid "Copy"
+msgstr "复制"
diff --git a/src/resources/ui/nautilus-toolbar.ui b/src/resources/ui/nautilus-toolbar.ui
index de22315..9748857 100644
--- a/src/resources/ui/nautilus-toolbar.ui
+++ b/src/resources/ui/nautilus-toolbar.ui
@@ -26,6 +26,7 @@
<property name="receives_default">True</property>
<property name="hexpand">True</property>
<property name="action_name">app.new-window</property>
+ <property name="tooltip_text" translatable="yes">New window</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
@@ -47,6 +48,7 @@
<property name="receives_default">True</property>
<property name="hexpand">True</property>
<property name="action_name">win.new-tab</property>
+ <property name="tooltip_text" translatable="yes">New tab</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
@@ -68,6 +70,7 @@
<property name="receives_default">True</property>
<property name="hexpand">True</property>
<property name="action_name">view.new-folder</property>
+ <property name="tooltip_text" translatable="yes">New Folder</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
@@ -131,6 +134,7 @@
<property name="valign">center</property>
<property name="hexpand">True</property>
<property name="action_name">view.cut</property>
+ <property name="tooltip_text" translatable="yes">Cut</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
@@ -153,6 +157,7 @@
<property name="halign">center</property>
<property name="hexpand">True</property>
<property name="action_name">view.copy</property>
+ <property name="tooltip_text" translatable="yes">Copy</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
@@ -175,6 +180,7 @@
<property name="halign">center</property>
<property name="hexpand">True</property>
<property name="action_name">view.paste</property>
+ <property name="tooltip_text" translatable="yes">Paste</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
@@ -709,6 +715,7 @@
<property name="halign">center</property>
<property name="valign">center</property>
<property name="popover">app_menu</property>
+ <property name="tooltip_text" translatable="yes">Open menu</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
--
2.27.0

View File

@ -0,0 +1,27 @@
From cb862693a3fe488346ea06138817b55cfba42717 Mon Sep 17 00:00:00 2001
From: yangzhuangzhuang <yangzhuangzhuang@xfusion.com>
Date: Thu, 25 Aug 2022 19:18:39 +0800
Subject: [PATCH] translate general and show sidebar
---
po/zh_CN.po | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/po/zh_CN.po b/po/zh_CN.po
index a6c15ae..974b2d1 100644
--- a/po/zh_CN.po
+++ b/po/zh_CN.po
@@ -5881,3 +5881,9 @@ msgstr "剪切"
msgid "Copy"
msgstr "复制"
+
+msgid "General"
+msgstr "常规"
+
+msgid "_Show sidebar"
+msgstr "显示侧边栏(S)"
--
2.27.0