Index: src/trackerd/tracker-inotify.c =================================================================== --- src/trackerd/tracker-inotify.c (Revision 979) +++ src/trackerd/tracker-inotify.c (Arbeitskopie) @@ -23,8 +23,18 @@ #include #include -#include "tracker-inotify.h" +#include "tracker-watch.h" +#include "config.h" + + +#ifdef HAVE_INOTIFY_LINUX +#include +#include "linux-inotify-syscalls.h" +#else +#include +#endif + #define INOTIFY_WATCH_LIMIT "/proc/sys/fs/inotify/max_user_watches" /* project wide global vars */ Index: src/trackerd/tracker-email-utils.c =================================================================== --- src/trackerd/tracker-email-utils.c (Revision 979) +++ src/trackerd/tracker-email-utils.c (Arbeitskopie) @@ -36,16 +36,9 @@ #include "tracker-email-evolution.h" #include "tracker-email-thunderbird.h" #include "tracker-email-kmail.h" +#include "tracker-watch.h" -#ifdef HAVE_INOTIFY -# include "tracker-inotify.h" -#else -# ifdef HAVE_FAM -# include "tracker-fam.h" -# endif -#endif - extern Tracker *tracker; Index: src/trackerd/tracker-inotify.h =================================================================== --- src/trackerd/tracker-inotify.h (Revision 979) +++ src/trackerd/tracker-inotify.h (Arbeitskopie) @@ -1,47 +0,0 @@ -/* Tracker - indexer and metadata database engine - * Copyright (C) 2006, Mr Jamie McCracken (jamiemcc gnome org) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - - - -#ifndef _TRACKER_INOTIFY_H_ -#define _TRACKER_INOTIFY_H_ - -#include "config.h" - - -#ifdef HAVE_INOTIFY_LINUX -#include -#include "linux-inotify-syscalls.h" -#else -# include -#endif - -#include "tracker-db.h" - -gboolean tracker_start_watching (void); -void tracker_end_watching (void); - -gboolean tracker_add_watch_dir (const char *dir, DBConnection *db_con); -void tracker_remove_watch_dir (const char *dir, gboolean delete_subdirs, DBConnection *db_con); - -gboolean tracker_is_directory_watched (const char *dir, DBConnection *db_con); -int tracker_count_watch_dirs (void); - - -#endif Index: src/trackerd/tracker-email-thunderbird.c =================================================================== --- src/trackerd/tracker-email-thunderbird.c (Revision 979) +++ src/trackerd/tracker-email-thunderbird.c (Arbeitskopie) @@ -25,14 +25,8 @@ #include "tracker-email-thunderbird.h" #include "tracker-db-email.h" +#include "tracker-watch.h" -#ifdef HAVE_INOTIFY -# include "tracker-inotify.h" -#else -# ifdef HAVE_FAM -# include "tracker-fam.h" -# endif -#endif typedef enum { Index: src/trackerd/tracker-fam.c =================================================================== --- src/trackerd/tracker-fam.c (Revision 979) +++ src/trackerd/tracker-fam.c (Arbeitskopie) @@ -22,7 +22,7 @@ #include #include -#include "tracker-fam.h" +#include "tracker-watch.h" extern Tracker *tracker; Index: src/trackerd/trackerd.c =================================================================== --- src/trackerd/trackerd.c (Revision 979) +++ src/trackerd/trackerd.c (Arbeitskopie) @@ -44,13 +44,6 @@ #include "tracker-ioprio.h" #endif -#ifdef HAVE_INOTIFY -# include "tracker-inotify.h" -#else -# ifdef HAVE_FAM -# include "tracker-fam.h" -# endif -#endif #ifndef HAVE_INOTIFY # ifndef HAVE_FAM @@ -77,6 +70,7 @@ #include "tracker-email-utils.h" #include "tracker-cache.h" #include "tracker-indexer.h" +#include "tracker-watch.h" #include "tracker-os-dependant.h" Index: src/trackerd/tracker-fam.h =================================================================== --- src/trackerd/tracker-fam.h (Revision 979) +++ src/trackerd/tracker-fam.h (Arbeitskopie) @@ -1,36 +0,0 @@ -/* Tracker - indexer and metadata database engine - * Copyright (C) 2006, Mr Jamie McCracken (jamiemcc gnome org) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - - - -#ifndef _TRACKER_FAM_H_ -#define _TRACKER_FAM_H_ - -#include "tracker-db.h" - -gboolean tracker_start_watching (void); -void tracker_end_watching (void); - -gboolean tracker_add_watch_dir (const char *dir, DBConnection *db_con); -void tracker_remove_watch_dir (const char *dir, gboolean delete_subdirs, DBConnection *db_con); - -gboolean tracker_is_directory_watched (const char *dir, DBConnection *db_con); -int tracker_count_watch_dirs (void); - -#endif Index: src/trackerd/tracker-email-evolution.c =================================================================== --- src/trackerd/tracker-email-evolution.c (Revision 979) +++ src/trackerd/tracker-email-evolution.c (Arbeitskopie) @@ -35,16 +35,9 @@ #include "tracker-db-email.h" #include "tracker-cache.h" #include "tracker-dbus.h" +#include "tracker-watch.h" -#ifdef HAVE_INOTIFY -# include "tracker-inotify.h" -#else -# ifdef HAVE_FAM -# include "tracker-fam.h" -# endif -#endif - #define EVOLUTION_MAIL_DIR_S ".evolution/mail" Index: src/trackerd/tracker-watch.h =================================================================== --- src/trackerd/tracker-watch.h (Revision 0) +++ src/trackerd/tracker-watch.h (Revision 0) @@ -0,0 +1,38 @@ +/* Tracker - indexer and metadata database engine + * Copyright (C) 2006, Mr Jamie McCracken (jamiemcc gnome org) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + + + +#ifndef _TRACKER_WATCH_H_ +#define _TRACKER_WATCH_H_ + + +#include "tracker-db.h" + +gboolean tracker_start_watching (void); +void tracker_end_watching (void); + +gboolean tracker_add_watch_dir (const char *dir, DBConnection *db_con); +void tracker_remove_watch_dir (const char *dir, gboolean delete_subdirs, DBConnection *db_con); + +gboolean tracker_is_directory_watched (const char *dir, DBConnection *db_con); +int tracker_count_watch_dirs (void); + + +#endif Index: src/trackerd/tracker-email-kmail.c =================================================================== --- src/trackerd/tracker-email-kmail.c (Revision 979) +++ src/trackerd/tracker-email-kmail.c (Arbeitskopie) @@ -27,16 +27,9 @@ #include "tracker-email-kmail.h" #include "tracker-email-utils.h" #include "tracker-db-email.h" +#include "tracker-watch.h" -#ifdef HAVE_INOTIFY -# include "tracker-inotify.h" -#else -# ifdef HAVE_FAM -# include "tracker-fam.h" -# endif -#endif - typedef struct { gchar *imap_path; gchar *file; Index: src/trackerd/tracker-db-sqlite.c =================================================================== --- src/trackerd/tracker-db-sqlite.c (Revision 979) +++ src/trackerd/tracker-db-sqlite.c (Arbeitskopie) @@ -41,6 +41,7 @@ #include "tracker-cache.h" #include "tracker-metadata.h" #include "tracker-utils.h" +#include "tracker-watch.h" #include "config.h" Index: src/trackerd/tracker-db-sqlite.h =================================================================== --- src/trackerd/tracker-db-sqlite.h (Revision 979) +++ src/trackerd/tracker-db-sqlite.h (Arbeitskopie) @@ -216,11 +216,6 @@ void tracker_db_delete_service (DBConnection *db_con, guint32 id, const char *uri); -gboolean tracker_add_watch_dir (const char *dir, DBConnection *db_con); -void tracker_remove_watch_dir (const char *dir, gboolean delete_subdirs, DBConnection *db_con); -gboolean tracker_is_directory_watched (const char *dir, DBConnection *db_con); -int tracker_count_watch_dirs (void); - FieldData * tracker_db_get_metadata_field (DBConnection *db_con, const char *service, const char *field_name, int field_count, gboolean is_select, gboolean is_condition); void tracker_db_start_index_transaction (DBConnection *db_con); Index: src/trackerd/Makefile.am =================================================================== --- src/trackerd/Makefile.am (Revision 979) +++ src/trackerd/Makefile.am (Arbeitskopie) @@ -16,13 +16,11 @@ if HAVE_INOTIFY inotify_sources = \ linux-inotify-syscalls.h \ - tracker-inotify.c \ - tracker-inotify.h + tracker-inotify.c else if HAVE_FAM fam_sources = \ - tracker-fam.c \ - tracker-fam.h + tracker-fam.c endif endif @@ -94,7 +92,8 @@ tracker-utils.h \ tracker-ioprio.c \ tracker-ioprio.h \ - tracker-os-dependant.h + tracker-os-dependant.h \ + tracker-watch.h if OS_WIN32 trackerd_win_libs = -lws2_32 -lkernel32