Commit 12a3162d authored by Emmanuele Bassi's avatar Emmanuele Bassi Committed by Emmanuele Bassi

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
parent 50af4931
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.
2007-05-13 Cody Russell <bratsche@gnome.org> 2007-05-13 Cody Russell <bratsche@gnome.org>
* gdk/win32/gdkevents-win32.c: Only do the configure event context * gdk/win32/gdkevents-win32.c: Only do the configure event context
......
...@@ -30,7 +30,11 @@ ...@@ -30,7 +30,11 @@
#include "xdgmime/xdgmime.h" #include "xdgmime/xdgmime.h"
#include <string.h> #include <string.h>
#ifdef HAVE_FTW_H
#include <ftw.h> #include <ftw.h>
#endif
#include <glib/gstrfuncs.h> #include <glib/gstrfuncs.h>
#define BATCH_SIZE 500 #define BATCH_SIZE 500
...@@ -184,6 +188,7 @@ send_batch (SearchThreadData *data) ...@@ -184,6 +188,7 @@ send_batch (SearchThreadData *data)
static GStaticPrivate search_thread_data = G_STATIC_PRIVATE_INIT; static GStaticPrivate search_thread_data = G_STATIC_PRIVATE_INIT;
#ifdef HAVE_FTW_H
static int static int
search_visit_func (const char *fpath, search_visit_func (const char *fpath,
const struct stat *sb, const struct stat *sb,
...@@ -256,16 +261,18 @@ search_visit_func (const char *fpath, ...@@ -256,16 +261,18 @@ search_visit_func (const char *fpath,
if (data->n_processed_files > BATCH_SIZE) if (data->n_processed_files > BATCH_SIZE)
send_batch (data); send_batch (data);
if (is_hidden) if (is_hidden)
return FTW_SKIP_SUBTREE; return FTW_SKIP_SUBTREE;
else else
return FTW_CONTINUE; return FTW_CONTINUE;
} }
#endif /* HAVE_FTW_H */
static gpointer static gpointer
search_thread_func (gpointer user_data) search_thread_func (gpointer user_data)
{ {
#ifdef HAVE_FTW_H
SearchThreadData *data; SearchThreadData *data;
data = user_data; data = user_data;
...@@ -277,6 +284,7 @@ search_thread_func (gpointer user_data) ...@@ -277,6 +284,7 @@ search_thread_func (gpointer user_data)
send_batch (data); send_batch (data);
g_idle_add (search_thread_done_idle, data); g_idle_add (search_thread_done_idle, data);
#endif
return NULL; return NULL;
} }
...@@ -366,9 +374,9 @@ _gtk_search_engine_simple_init (GtkSearchEngineSimple *engine) ...@@ -366,9 +374,9 @@ _gtk_search_engine_simple_init (GtkSearchEngineSimple *engine)
GtkSearchEngine * GtkSearchEngine *
_gtk_search_engine_simple_new (void) _gtk_search_engine_simple_new (void)
{ {
GtkSearchEngine *engine; #ifdef HAVE_FTW_H
return g_object_new (GTK_TYPE_SEARCH_ENGINE_SIMPLE, NULL);
engine = g_object_new (GTK_TYPE_SEARCH_ENGINE_SIMPLE, NULL); #else
return NULL;
return engine; #endif
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment