Implement bash completion for gsettings
[platform/upstream/glib.git] / gio / gwin32volumemonitor.c
index 3c62c4e..88cdece 100644 (file)
@@ -64,9 +64,9 @@ g_win32_volume_monitor_finalize (GObject *object)
     (*G_OBJECT_CLASS (g_win32_volume_monitor_parent_class)->finalize) (object);
 }
 
-/**
+/*
  * get_viewable_logical_drives:
- * 
+ *
  * Returns the list of logical and viewable drives as defined by
  * GetLogicalDrives() and the registry keys
  * Software\Microsoft\Windows\CurrentVersion\Policies\Explorer under
@@ -74,7 +74,7 @@ g_win32_volume_monitor_finalize (GObject *object)
  * GetLogicalDrives() is returned.
  *
  * Return value: bitmask with same meaning as returned by GetLogicalDrives()
-**/
+ */
 static guint32 
 get_viewable_logical_drives (void)
 {
@@ -175,16 +175,32 @@ get_connected_drives (GVolumeMonitor *volume_monitor)
   
   monitor = G_WIN32_VOLUME_MONITOR (volume_monitor);
 
+#if 0
   find_handle = FindFirstVolumeW (wc_name, MAX_PATH);
   found = (find_handle != INVALID_HANDLE_VALUE);
   while (found)
     {
+      /* I don't know what this code is supposed to do; clearly it now
+       * does nothing, the returned GList is always NULL. But what was
+       * this code supposed to be a start of? The volume names that
+       * the FindFirstVolume/FindNextVolume loop iterates over returns
+       * device names like
+       *
+       *   \Device\HarddiskVolume1
+       *   \Device\HarddiskVolume2
+       *   \Device\CdRom0
+       *
+       * No DOS devices there, so I don't see the point with the
+       * QueryDosDevice call below. Probably this code is confusing volumes
+       * with something else that does contain the mapping from DOS devices
+       * to volumes.
+       */
       wchar_t wc_dev_name[MAX_PATH+1];
-      guint trailing = wcslen(wc_name) - 1;
+      guint trailing = wcslen (wc_name) - 1;
 
       /* remove trailing backslash and leading \\?\\ */
       wc_name[trailing] = L'\0';
-      if (QueryDosDeviceW(&wc_name[4], wc_dev_name, MAX_PATH))
+      if (QueryDosDeviceW (&wc_name[4], wc_dev_name, MAX_PATH))
         {
           gchar *name = g_utf16_to_utf8 (wc_dev_name, -1, NULL, NULL, NULL);
           g_print ("%s\n", name);
@@ -195,6 +211,7 @@ get_connected_drives (GVolumeMonitor *volume_monitor)
     }
   if (find_handle != INVALID_HANDLE_VALUE)
     FindVolumeClose (find_handle);
+#endif
 
   return list;
 }
@@ -256,11 +273,11 @@ g_win32_volume_monitor_init (GWin32VolumeMonitor *win32_monitor)
   unix_monitor->mount_monitor = g_win32_mount_monitor_new ();
 
   g_signal_connect (win32_monitor->mount_monitor,
-                   "mounts_changed", G_CALLBACK (mounts_changed),
+                   "mounts-changed", G_CALLBACK (mounts_changed),
                    win32_monitor);
   
   g_signal_connect (win32_monitor->mount_monitor,
-                   "mountpoints_changed", G_CALLBACK (mountpoints_changed),
+                   "mountpoints-changed", G_CALLBACK (mountpoints_changed),
                    win32_monitor);
                    
   update_volumes (win32_monitor);