mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-04-20 14:19:16 +02:00
gwin32filemonitor: some cleanups
Make the code a bit more consistent and get it into preparation to merge the fs monitor stuff that uses the private struct directly.
This commit is contained in:
parent
9c7c74c587
commit
45ccd3f951
@ -40,17 +40,15 @@ g_win32_file_monitor_start (GLocalFileMonitor *monitor,
|
|||||||
GFileMonitorSource *source)
|
GFileMonitorSource *source)
|
||||||
{
|
{
|
||||||
GWin32FileMonitor *win32_monitor = G_WIN32_FILE_MONITOR (monitor);
|
GWin32FileMonitor *win32_monitor = G_WIN32_FILE_MONITOR (monitor);
|
||||||
gboolean isfile = (filename == NULL && basename == NULL) ? FALSE : TRUE;
|
|
||||||
|
|
||||||
win32_monitor->priv->fms = source;
|
win32_monitor->priv->fms = source;
|
||||||
|
|
||||||
if (isfile)
|
if (filename == NULL && basename == NULL)
|
||||||
if (basename != NULL)
|
g_win32_fs_monitor_init (win32_monitor->priv, dirname, NULL, FALSE);
|
||||||
|
else if (basename != NULL)
|
||||||
g_win32_fs_monitor_init (win32_monitor->priv, dirname, basename, TRUE);
|
g_win32_fs_monitor_init (win32_monitor->priv, dirname, basename, TRUE);
|
||||||
else
|
else
|
||||||
g_win32_fs_monitor_init (win32_monitor->priv, NULL, filename, TRUE);
|
g_win32_fs_monitor_init (win32_monitor->priv, NULL, filename, TRUE);
|
||||||
else
|
|
||||||
g_win32_fs_monitor_init (win32_monitor->priv, dirname, NULL, FALSE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
@ -60,7 +58,7 @@ g_win32_file_monitor_is_supported (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
g_win32_file_monitor_init (GWin32FileMonitor* monitor)
|
g_win32_file_monitor_init (GWin32FileMonitor *monitor)
|
||||||
{
|
{
|
||||||
monitor->priv = g_win32_fs_monitor_create (TRUE);
|
monitor->priv = g_win32_fs_monitor_create (TRUE);
|
||||||
|
|
||||||
@ -68,21 +66,22 @@ g_win32_file_monitor_init (GWin32FileMonitor* monitor)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
g_win32_file_monitor_finalize (GObject *base)
|
g_win32_file_monitor_finalize (GObject *object)
|
||||||
{
|
{
|
||||||
GWin32FileMonitor *monitor;
|
GWin32FileMonitor *monitor;
|
||||||
monitor = G_WIN32_FILE_MONITOR (base);
|
|
||||||
|
monitor = G_WIN32_FILE_MONITOR (object);
|
||||||
|
|
||||||
g_win32_fs_monitor_finalize (monitor->priv);
|
g_win32_fs_monitor_finalize (monitor->priv);
|
||||||
|
|
||||||
if (G_OBJECT_CLASS (g_win32_file_monitor_parent_class)->finalize)
|
G_OBJECT_CLASS (g_win32_file_monitor_parent_class)->finalize (object);
|
||||||
(*G_OBJECT_CLASS (g_win32_file_monitor_parent_class)->finalize) (base);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
g_win32_file_monitor_cancel (GFileMonitor* monitor)
|
g_win32_file_monitor_cancel (GFileMonitor* monitor)
|
||||||
{
|
{
|
||||||
GWin32FileMonitor *file_monitor;
|
GWin32FileMonitor *file_monitor;
|
||||||
|
|
||||||
file_monitor = G_WIN32_FILE_MONITOR (monitor);
|
file_monitor = G_WIN32_FILE_MONITOR (monitor);
|
||||||
|
|
||||||
g_win32_fs_monitor_close_handle (file_monitor->priv);
|
g_win32_fs_monitor_close_handle (file_monitor->priv);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user