[nautilus] Update directory async test case
- From: William Jon McCann <mccann src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] Update directory async test case
- Date: Wed, 8 Aug 2012 19:56:58 +0000 (UTC)
commit 292314dd32084aa3d38d2e1bed14169744bc1b57
Author: William Jon McCann <jmccann redhat com>
Date: Tue Aug 7 19:37:24 2012 -0400
Update directory async test case
.gitignore | 1 -
test/test-nautilus-directory-async.c | 56 +++++++++++++---------------------
2 files changed, 21 insertions(+), 36 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index be5140a..487f1a8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,7 +11,6 @@ Makefile.in
*.tar.xz
.deps
.libs
-test
aclocal.m4
autom4te.cache
config.cache
diff --git a/test/test-nautilus-directory-async.c b/test/test-nautilus-directory-async.c
index a625bbd..b551bfe 100644
--- a/test/test-nautilus-directory-async.c
+++ b/test/test-nautilus-directory-async.c
@@ -6,16 +6,6 @@
void *client1, *client2;
-#if 0
-static gboolean
-quit_cb (gpointer data)
-{
- gtk_main_quit ();
-
- return FALSE;
-}
-#endif
-
static void
files_added (NautilusDirectory *directory,
GList *added_files)
@@ -51,51 +41,47 @@ files_changed (NautilusDirectory *directory,
g_list_length (changed_files));
}
-static gboolean
-force_reload (NautilusDirectory *directory)
-{
- g_print ("forcing reload!\n");
-
- nautilus_directory_force_reload (directory);
-
- return FALSE;
-}
-
static void
done_loading (NautilusDirectory *directory)
{
- static int i = 0;
-
g_print ("done loading\n");
-
- if (i == 0) {
- g_timeout_add (5000, (GSourceFunc)force_reload, directory);
- i++;
- } else {
- }
+ gtk_main_quit ();
}
int
main (int argc, char **argv)
{
NautilusDirectory *directory;
- NautilusQuery *query;
+ NautilusFileAttributes attributes;
+ const char *uri;
+
client1 = g_new0 (int, 1);
client2 = g_new0 (int, 1);
gtk_init (&argc, &argv);
- query = nautilus_query_new ();
- nautilus_query_set_text (query, "richard hult");
- directory = nautilus_directory_get_by_uri ("x-nautilus-search://0/");
- nautilus_search_directory_set_query (NAUTILUS_SEARCH_DIRECTORY (directory), query);
- g_object_unref (query);
+ if (argv[1] == NULL) {
+ uri = "file:///tmp";
+ } else {
+ uri = argv[1];
+ }
+ g_print ("loading %s", uri);
+ directory = nautilus_directory_get_by_uri (uri);
g_signal_connect (directory, "files-added", G_CALLBACK (files_added), NULL);
g_signal_connect (directory, "files-changed", G_CALLBACK (files_changed), NULL);
g_signal_connect (directory, "done-loading", G_CALLBACK (done_loading), NULL);
+
+ attributes =
+ NAUTILUS_FILE_ATTRIBUTES_FOR_ICON |
+ NAUTILUS_FILE_ATTRIBUTE_DIRECTORY_ITEM_COUNT |
+ NAUTILUS_FILE_ATTRIBUTE_INFO |
+ NAUTILUS_FILE_ATTRIBUTE_LINK_INFO |
+ NAUTILUS_FILE_ATTRIBUTE_MOUNT |
+ NAUTILUS_FILE_ATTRIBUTE_EXTENSION_INFO;
+
nautilus_directory_file_monitor_add (directory, client1, TRUE,
- NAUTILUS_FILE_ATTRIBUTE_INFO,
+ attributes,
NULL, NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]