Bug 546582 - Callbacks from GFileMonitor present a GFile in the wrong

2008-08-13  Tor Lillqvist  <tml@novell.com>

	Bug 546582 - Callbacks from GFileMonitor present a GFile in the
	wrong folder

	* win32/gwin32directorymonitor.c
	(g_win32_directory_monitor_callback): Patch by Erik van Pienbroek.


svn path=/trunk/; revision=7347
This commit is contained in:
Tor Lillqvist 2008-08-13 06:56:31 +00:00 committed by Tor Lillqvist
parent cec561c2cd
commit 7ffb2b3366
2 changed files with 12 additions and 1 deletions

View File

@ -1,3 +1,11 @@
2008-08-13 Tor Lillqvist <tml@novell.com>
Bug 546582 - Callbacks from GFileMonitor present a GFile in the
wrong folder
* win32/gwin32directorymonitor.c
(g_win32_directory_monitor_callback): Patch by Erik van Pienbroek.
2008-08-13 Matthias Clasen <mclasen@redhat.com> 2008-08-13 Matthias Clasen <mclasen@redhat.com>
* ginputstream.c: * ginputstream.c:

View File

@ -96,6 +96,7 @@ g_win32_directory_monitor_callback (DWORD error,
PFILE_NOTIFY_INFORMATION pfile_notify_walker; PFILE_NOTIFY_INFORMATION pfile_notify_walker;
gulong file_name_len; gulong file_name_len;
gchar *file_name; gchar *file_name;
gchar *path;
GFile *file; GFile *file;
GWin32DirectoryMonitorPrivate *priv = (GWin32DirectoryMonitorPrivate *) lpOverlapped; GWin32DirectoryMonitorPrivate *priv = (GWin32DirectoryMonitorPrivate *) lpOverlapped;
@ -120,9 +121,11 @@ g_win32_directory_monitor_callback (DWORD error,
pfile_notify_walker = (PFILE_NOTIFY_INFORMATION)(priv->file_notify_buffer + offset); pfile_notify_walker = (PFILE_NOTIFY_INFORMATION)(priv->file_notify_buffer + offset);
offset += pfile_notify_walker->NextEntryOffset; offset += pfile_notify_walker->NextEntryOffset;
file_name = g_utf16_to_utf8 (pfile_notify_walker->FileName, pfile_notify_walker->FileNameLength / sizeof(WCHAR), NULL, &file_name_len, NULL); file_name = g_utf16_to_utf8 (pfile_notify_walker->FileName, pfile_notify_walker->FileNameLength / sizeof(WCHAR), NULL, &file_name_len, NULL);
file = g_file_new_for_path (file_name); path = g_build_filename(G_LOCAL_DIRECTORY_MONITOR (priv->self)->dirname, file_name, NULL);
file = g_file_new_for_path (path);
g_file_monitor_emit_event (priv->self, file, NULL, events [pfile_notify_walker->Action]); g_file_monitor_emit_event (priv->self, file, NULL, events [pfile_notify_walker->Action]);
g_object_unref (file); g_object_unref (file);
g_free (path);
g_free (file_name); g_free (file_name);
} while (pfile_notify_walker->NextEntryOffset); } while (pfile_notify_walker->NextEntryOffset);