[Xfce4-commits] r29897 - in thunar/branches/migration-to-gio: . thunar
Jannis Pohlmann
jannis at xfce.org
Thu Apr 23 22:31:23 CEST 2009
Author: jannis
Date: 2009-04-23 20:31:23 +0000 (Thu, 23 Apr 2009)
New Revision: 29897
Modified:
thunar/branches/migration-to-gio/ChangeLog
thunar/branches/migration-to-gio/thunar/thunar-application.c
thunar/branches/migration-to-gio/thunar/thunar-io-jobs.c
thunar/branches/migration-to-gio/thunar/thunar-job.c
thunar/branches/migration-to-gio/thunar/thunar-job.h
thunar/branches/migration-to-gio/thunar/thunar-standard-view.c
thunar/branches/migration-to-gio/thunar/thunar-transfer-job.c
thunar/branches/migration-to-gio/thunar/thunar-tree-view.c
Log:
* thunar/thunar-application.c, thunar/thunar-job.{c,h},
thunar/thunar-io-jobs.c, thunar/thunar-transfer-job.c,
thunar/thunar-standard-view.c, thunar/thunar-tree-view.c: Implement
and connect to the "new-files" signal again. Update
ThunarStandardView and ThunarTreeView to use a GFile list for the
new_files_closure.
Modified: thunar/branches/migration-to-gio/ChangeLog
===================================================================
--- thunar/branches/migration-to-gio/ChangeLog 2009-04-23 20:00:34 UTC (rev 29896)
+++ thunar/branches/migration-to-gio/ChangeLog 2009-04-23 20:31:23 UTC (rev 29897)
@@ -1,5 +1,14 @@
2009-04-23 Jannis Pohlmann <jannis at xfce.org>
+ * thunar/thunar-application.c, thunar/thunar-job.{c,h},
+ thunar/thunar-io-jobs.c, thunar/thunar-transfer-job.c,
+ thunar/thunar-standard-view.c, thunar/thunar-tree-view.c: Implement
+ and connect to the "new-files" signal again. Update
+ ThunarStandardView and ThunarTreeView to use a GFile list for the
+ new_files_closure.
+
+2009-04-23 Jannis Pohlmann <jannis at xfce.org>
+
* thunar/thunar-application.{c,h}, thunar/thunar-dbus-service.c,
thunar/thunar-io-jobs.{c,h},: Add new job
thunar_io_jobs_trash_files() and a new function
Modified: thunar/branches/migration-to-gio/thunar/thunar-application.c
===================================================================
--- thunar/branches/migration-to-gio/thunar/thunar-application.c 2009-04-23 20:00:34 UTC (rev 29896)
+++ thunar/branches/migration-to-gio/thunar/thunar-application.c 2009-04-23 20:31:23 UTC (rev 29897)
@@ -420,10 +420,9 @@
/* try to allocate a new job for the operation */
job = (*launcher) (source_file_list, target_file_list);
- /* TODO connect the "new-files" closure (if any)
+ /* connect the "new-files" closure (if any) */
if (G_LIKELY (new_files_closure != NULL))
- g_signal_connect_closure (G_OBJECT (job), "new-files", new_files_closure, FALSE);
- */
+ g_signal_connect_closure (job, "new-files", new_files_closure, FALSE);
/* allocate a progress dialog for the job */
dialog = g_object_new (THUNAR_TYPE_PROGRESS_DIALOG,
Modified: thunar/branches/migration-to-gio/thunar/thunar-io-jobs.c
===================================================================
--- thunar/branches/migration-to-gio/thunar/thunar-io-jobs.c 2009-04-23 20:00:34 UTC (rev 29896)
+++ thunar/branches/migration-to-gio/thunar/thunar-io-jobs.c 2009-04-23 20:31:23 UTC (rev 29897)
@@ -203,9 +203,8 @@
if (G_UNLIKELY (thunar_job_is_cancelled (job)))
return FALSE;
- /* TODO emit the "new-files" signal with the given file list
+ /* emit the "new-files" signal with the given file list */
thunar_job_new_files (job, file_list);
- */
return TRUE;
}
@@ -338,10 +337,9 @@
if (G_UNLIKELY (thunar_job_is_cancelled (job)))
return FALSE;
- /* TODO emit the "new-files" signal with the given file list
+ /* emit the "new-files" signal with the given file list */
thunar_job_new_files (job, file_list);
- */
-
+
return TRUE;
}
@@ -595,9 +593,7 @@
}
else
{
- /* TODO
thunar_job_new_files (job, new_files_list);
- */
g_file_list_free (new_files_list);
return TRUE;
}
Modified: thunar/branches/migration-to-gio/thunar/thunar-job.c
===================================================================
--- thunar/branches/migration-to-gio/thunar/thunar-job.c 2009-04-23 20:00:34 UTC (rev 29896)
+++ thunar/branches/migration-to-gio/thunar/thunar-job.c 2009-04-23 20:31:23 UTC (rev 29897)
@@ -249,6 +249,23 @@
G_TYPE_NONE, 1, G_TYPE_STRING);
/**
+ * ThunarJob::new-files:
+ * @job : a #ThunarJob.
+ * @file_list : a list of #GFile<!---->s that were created by @job.
+ *
+ * This signal is emitted by the @job right before the @job is terminated
+ * and informs the application about the list of created files in @file_list.
+ * @file_list contains only the toplevel file items, that were specified by
+ * the application on creation of the @job.
+ **/
+ job_signals[NEW_FILES] =
+ g_signal_new (I_("new-files"),
+ G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_NO_HOOKS, 0, NULL, NULL,
+ g_cclosure_marshal_VOID__POINTER,
+ G_TYPE_NONE, 1, G_TYPE_POINTER);
+
+ /**
* ThunarJob::percent:
* @job : a #ThunarJob.
* @percent : the percentage of completeness.
@@ -771,6 +788,22 @@
void
+thunar_job_new_files (ThunarJob *job,
+ const GList *file_list)
+{
+ _thunar_return_if_fail (THUNAR_IS_JOB (job));
+
+ /* check if we have any files */
+ if (G_LIKELY (file_list != NULL))
+ {
+ /* emit the "new-files" signal */
+ thunar_job_emit (job, job_signals[NEW_FILES], 0, file_list);
+ }
+}
+
+
+
+void
thunar_job_percent (ThunarJob *job,
gdouble percent)
{
Modified: thunar/branches/migration-to-gio/thunar/thunar-job.h
===================================================================
--- thunar/branches/migration-to-gio/thunar/thunar-job.h 2009-04-23 20:00:34 UTC (rev 29896)
+++ thunar/branches/migration-to-gio/thunar/thunar-job.h 2009-04-23 20:31:23 UTC (rev 29897)
@@ -97,6 +97,8 @@
...);
void thunar_job_info_message (ThunarJob *job,
const gchar *message);
+void thunar_job_new_files (ThunarJob *job,
+ const GList *file_list);
void thunar_job_percent (ThunarJob *job,
gdouble percent);
Modified: thunar/branches/migration-to-gio/thunar/thunar-standard-view.c
===================================================================
--- thunar/branches/migration-to-gio/thunar/thunar-standard-view.c 2009-04-23 20:00:34 UTC (rev 29896)
+++ thunar/branches/migration-to-gio/thunar/thunar-standard-view.c 2009-04-23 20:31:23 UTC (rev 29897)
@@ -787,7 +787,7 @@
}
/* drop any remaining "new-files" paths */
- thunar_vfs_path_list_free (standard_view->priv->new_files_path_list);
+ g_file_list_free (standard_view->priv->new_files_path_list);
/* release our reference on the preferences */
g_object_unref (G_OBJECT (standard_view->preferences));
@@ -1283,7 +1283,7 @@
thunar_standard_view_new_files (standard_view, new_files_path_list);
/* cleanup */
- thunar_vfs_path_list_free (new_files_path_list);
+ g_file_list_free (new_files_path_list);
}
/* notify listeners */
@@ -2307,7 +2307,7 @@
/* release the previous "new-files" paths (if any) */
if (G_UNLIKELY (standard_view->priv->new_files_path_list != NULL))
{
- thunar_vfs_path_list_free (standard_view->priv->new_files_path_list);
+ g_file_list_free (standard_view->priv->new_files_path_list);
standard_view->priv->new_files_path_list = NULL;
}
@@ -2315,14 +2315,14 @@
if (G_UNLIKELY (standard_view->loading))
{
/* schedule the "new-files" paths for later processing */
- standard_view->priv->new_files_path_list = thunar_vfs_path_list_copy (path_list);
+ standard_view->priv->new_files_path_list = g_file_list_copy (path_list);
}
else if (G_LIKELY (path_list != NULL))
{
/* determine the files for the paths */
for (lp = path_list; lp != NULL; lp = lp->next)
{
- file = thunar_file_cache_lookup_path (lp->data);
+ file = thunar_file_cache_lookup (lp->data);
if (G_LIKELY (file != NULL))
file_list = g_list_prepend (file_list, file);
}
Modified: thunar/branches/migration-to-gio/thunar/thunar-transfer-job.c
===================================================================
--- thunar/branches/migration-to-gio/thunar/thunar-transfer-job.c 2009-04-23 20:00:34 UTC (rev 29896)
+++ thunar/branches/migration-to-gio/thunar/thunar-transfer-job.c 2009-04-23 20:31:23 UTC (rev 29897)
@@ -732,10 +732,8 @@
}
else
{
- /* TODO
thunar_job_new_files (job, new_files_list);
g_file_list_free (new_files_list);
- */
return TRUE;
}
}
Modified: thunar/branches/migration-to-gio/thunar/thunar-tree-view.c
===================================================================
--- thunar/branches/migration-to-gio/thunar/thunar-tree-view.c 2009-04-23 20:00:34 UTC (rev 29896)
+++ thunar/branches/migration-to-gio/thunar/thunar-tree-view.c 2009-04-23 20:31:23 UTC (rev 29897)
@@ -1906,7 +1906,7 @@
return;
/* determine the file for the first path */
- file = thunar_file_cache_lookup_path (path_list->data);
+ file = thunar_file_cache_lookup (path_list->data);
if (G_LIKELY (file != NULL && thunar_file_is_directory (file)))
{
/* change to the newly created folder */
More information about the Xfce4-commits
mailing list