[nautilus/wip/ernestask/tasks: 298/312] files-view: use task API for extracting
- From: Ernestas Kulik <ernestask src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/wip/ernestask/tasks: 298/312] files-view: use task API for extracting
- Date: Mon, 8 Jan 2018 16:05:49 +0000 (UTC)
commit 723663c0506aa0ded006c6977b269544d2125f92
Author: Ernestas Kulik <ernestask gnome org>
Date: Thu Jun 1 10:00:07 2017 +0300
files-view: use task API for extracting
src/nautilus-files-view.c | 24 +++++++++++++++++-------
1 file changed, 17 insertions(+), 7 deletions(-)
---
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index ab782af76..ebdebaf68 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -93,6 +93,9 @@
#define DEBUG_FLAG NAUTILUS_DEBUG_DIRECTORY_VIEW
#include "nautilus-debug.h"
+#include "nautilus-task-manager.h"
+#include "tasks/nautilus-extract-task.h"
+
/* Minimum starting update inverval */
#define UPDATE_INTERVAL_MIN 100
/* Maximum update interval */
@@ -6228,8 +6231,9 @@ typedef struct
} ExtractData;
static void
-extract_done (GList *outputs,
- gpointer user_data)
+on_extract_task_completed (NautilusExtractTask *task,
+ GList *outputs,
+ gpointer user_data)
{
NautilusFilesViewPrivate *priv;
ExtractData *data;
@@ -6330,6 +6334,8 @@ extract_files (NautilusFilesView *view,
if (extracting_to_current_directory)
{
+ g_autoptr (NautilusTaskManager) manager = NULL;
+ g_autoptr (NautilusTask) task = NULL;
ExtractData *data;
data = g_new (ExtractData, 1);
@@ -6349,11 +6355,15 @@ extract_files (NautilusFilesView *view,
NULL,
G_CONNECT_AFTER);
- nautilus_file_operations_extract_files (locations,
- destination_directory,
- nautilus_files_view_get_containing_window (view),
- extract_done,
- data);
+ manager = nautilus_task_manager_dup_singleton ();
+ task = nautilus_extract_task_new (nautilus_files_view_get_containing_window (view),
+ locations,
+ destination_directory);
+
+ g_signal_connect (task, "completed",
+ G_CALLBACK (on_extract_task_completed), data);
+
+ nautilus_task_manager_queue_task (manager, task);
}
else
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]