Put questionable code that didn't actually do anything inside #if 0, and
authorTor Lillqvist <tml@novell.com>
Fri, 8 Aug 2008 05:36:56 +0000 (05:36 +0000)
committerTor Lillqvist <tml@src.gnome.org>
Fri, 8 Aug 2008 05:36:56 +0000 (05:36 +0000)
2008-08-08  Tor Lillqvist  <tml@novell.com>

* gwin32volumemonitor.c (get_connected_drives): Put questionable
code that didn't actually do anything inside #if 0, and add a
comment wondering what the code was supposed to do. This also gets
rid of a leftover debugging printout.

svn path=/trunk/; revision=7321

gio/ChangeLog
gio/gwin32volumemonitor.c

index 4f86e8d8e9d0feabd5afd987bdd8a1649e6fae0a..123a323c0c3854eb51f13feffdfb9a4a4cf12f77 100644 (file)
@@ -1,3 +1,10 @@
+2008-08-08  Tor Lillqvist  <tml@novell.com>
+
+       * gwin32volumemonitor.c (get_connected_drives): Put questionable
+       code that didn't actually do anything inside #if 0, and add a
+       comment wondering what the code was supposed to do. This also gets
+       rid of a leftover debugging printout.
+
 2008-08-07  Paul Pogonyshev  <pogonyshev@gmx.net>
 
        * gfileicon.c (g_file_icon_get_property)
index 3c62c4e169c1d836e704cc182a276fb77b9575d1..b30ad89fee4fd92c8e8cb76acdef13cdf6acfaac 100644 (file)
@@ -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;
 }