X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=gio%2Fgpollfilemonitor.c;h=10c2d86d2dd533bf9ef90cd731447d0a514f988b;hb=33b9935efc82f8cc4747dfea2743129dfc418d19;hp=f6e853a27907c31f5d6844aec71ef1d2ba1bcc7a;hpb=7f3280230bc9448a5750fc17a6eabef691ba25f4;p=platform%2Fupstream%2Fglib.git diff --git a/gio/gpollfilemonitor.c b/gio/gpollfilemonitor.c index f6e853a..10c2d86 100644 --- a/gio/gpollfilemonitor.c +++ b/gio/gpollfilemonitor.c @@ -13,20 +13,19 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General - * Public License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place, Suite 330, - * Boston, MA 02111-1307, USA. + * Public License along with this library; if not, see . * * Author: Alexander Larsson */ -#include +#include "config.h" #include #include "gpollfilemonitor.h" +#include "gfile.h" #include "gfilemonitor.h" +#include "gfileinfo.h" -#include "gioalias.h" static gboolean g_poll_file_monitor_cancel (GFileMonitor* monitor); static void schedule_poll_timeout (GPollFileMonitor* poll_monitor); @@ -41,6 +40,7 @@ struct _GPollFileMonitor #define POLL_TIME_SECS 5 +#define g_poll_file_monitor_get_type _g_poll_file_monitor_get_type G_DEFINE_TYPE (GPollFileMonitor, g_poll_file_monitor, G_TYPE_FILE_MONITOR) static void @@ -52,8 +52,7 @@ g_poll_file_monitor_finalize (GObject* object) g_object_unref (poll_monitor->file); - if (G_OBJECT_CLASS (g_poll_file_monitor_parent_class)->finalize) - (*G_OBJECT_CLASS (g_poll_file_monitor_parent_class)->finalize) (object); + G_OBJECT_CLASS (g_poll_file_monitor_parent_class)->finalize (object); } @@ -74,7 +73,8 @@ g_poll_file_monitor_init (GPollFileMonitor* poll_monitor) } static int -safe_strcmp (const char *a, const char *b) +safe_strcmp (const char *a, + const char *b) { if (a == NULL && b == NULL) return 0; @@ -111,9 +111,9 @@ calc_event_type (GFileInfo *last, } static void -got_new_info (GObject *source_object, - GAsyncResult *res, - gpointer user_data) +got_new_info (GObject *source_object, + GAsyncResult *res, + gpointer user_data) { GPollFileMonitor* poll_monitor = user_data; GFileInfo *info; @@ -162,10 +162,10 @@ poll_file_timeout (gpointer data) poll_monitor->timeout = FALSE; - g_file_query_info_async (poll_monitor->file, G_FILE_ATTRIBUTE_ETAG_VALUE "," G_FILE_ATTRIBUTE_STD_SIZE, + g_file_query_info_async (poll_monitor->file, G_FILE_ATTRIBUTE_ETAG_VALUE "," G_FILE_ATTRIBUTE_STANDARD_SIZE, 0, 0, NULL, got_new_info, g_object_ref (poll_monitor)); - return FALSE; + return G_SOURCE_REMOVE; } static void @@ -175,9 +175,9 @@ schedule_poll_timeout (GPollFileMonitor* poll_monitor) } static void -got_initial_info (GObject *source_object, - GAsyncResult *res, - gpointer user_data) +got_initial_info (GObject *source_object, + GAsyncResult *res, + gpointer user_data) { GPollFileMonitor* poll_monitor = user_data; GFileInfo *info; @@ -201,7 +201,7 @@ got_initial_info (GObject *source_object, * Returns: a new #GFileMonitor for the given #GFile. **/ GFileMonitor* -g_poll_file_monitor_new (GFile *file) +_g_poll_file_monitor_new (GFile *file) { GPollFileMonitor* poll_monitor; @@ -209,7 +209,7 @@ g_poll_file_monitor_new (GFile *file) poll_monitor->file = g_object_ref (file); - g_file_query_info_async (file, G_FILE_ATTRIBUTE_ETAG_VALUE "," G_FILE_ATTRIBUTE_STD_SIZE, + g_file_query_info_async (file, G_FILE_ATTRIBUTE_ETAG_VALUE "," G_FILE_ATTRIBUTE_STANDARD_SIZE, 0, 0, NULL, got_initial_info, g_object_ref (poll_monitor)); return G_FILE_MONITOR (poll_monitor);