diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2007-05-13 21:21:39 +0000 |
---|---|---|
committer | Emmanuele Bassi <ebassi@src.gnome.org> | 2007-05-13 21:21:39 +0000 |
commit | 12a3162dd54e469effc8d777c3a739d8110684b2 (patch) | |
tree | 0fd51d82dfca0c789ba6af3f0e0a98cca7806a9f /gtk/gtksearchenginesimple.c | |
parent | 50af49319ad07682cd15913d264cb4a9570e1f8c (diff) | |
download | gtk+-12a3162dd54e469effc8d777c3a739d8110684b2.tar.gz |
Include <ftw.h> and use nftw() and all the symbols defined in <ftw.h>
2007-05-13 Emmanuele Bassi <ebassi@gnome.org>
* gtk/gtksearchenginesimple.c: Include <ftw.h> and use nftw() and
all the symbols defined in <ftw.h> conditionally.
svn path=/trunk/; revision=17836
Diffstat (limited to 'gtk/gtksearchenginesimple.c')
-rw-r--r-- | gtk/gtksearchenginesimple.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/gtk/gtksearchenginesimple.c b/gtk/gtksearchenginesimple.c index cfc6da850e..26768488ee 100644 --- a/gtk/gtksearchenginesimple.c +++ b/gtk/gtksearchenginesimple.c @@ -30,7 +30,11 @@ #include "xdgmime/xdgmime.h" #include <string.h> + +#ifdef HAVE_FTW_H #include <ftw.h> +#endif + #include <glib/gstrfuncs.h> #define BATCH_SIZE 500 @@ -184,6 +188,7 @@ send_batch (SearchThreadData *data) static GStaticPrivate search_thread_data = G_STATIC_PRIVATE_INIT; +#ifdef HAVE_FTW_H static int search_visit_func (const char *fpath, const struct stat *sb, @@ -256,16 +261,18 @@ search_visit_func (const char *fpath, if (data->n_processed_files > BATCH_SIZE) send_batch (data); - + if (is_hidden) return FTW_SKIP_SUBTREE; else return FTW_CONTINUE; } +#endif /* HAVE_FTW_H */ static gpointer search_thread_func (gpointer user_data) { +#ifdef HAVE_FTW_H SearchThreadData *data; data = user_data; @@ -277,6 +284,7 @@ search_thread_func (gpointer user_data) send_batch (data); g_idle_add (search_thread_done_idle, data); +#endif return NULL; } @@ -366,9 +374,9 @@ _gtk_search_engine_simple_init (GtkSearchEngineSimple *engine) GtkSearchEngine * _gtk_search_engine_simple_new (void) { - GtkSearchEngine *engine; - - engine = g_object_new (GTK_TYPE_SEARCH_ENGINE_SIMPLE, NULL); - - return engine; +#ifdef HAVE_FTW_H + return g_object_new (GTK_TYPE_SEARCH_ENGINE_SIMPLE, NULL); +#else + return NULL; +#endif } |