~ubuntu-branches/ubuntu/trusty/glib2.0/trusty-proposed

« back to all changes in this revision

Viewing changes to gio/gwin32volumemonitor.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Dröge
  • Date: 2008-08-18 16:04:30 UTC
  • mto: (3.2.7 intrepid) (1.2.44 upstream)
  • mto: This revision was merged to the branch mainline in revision 5.
  • Revision ID: james.westby@ubuntu.com-20080818160430-155dx04fee19rrtz
Tags: upstream-2.17.7
Import upstream version 2.17.7

Show diffs side-by-side

added added

removed removed

Lines of Context:
175
175
  
176
176
  monitor = G_WIN32_VOLUME_MONITOR (volume_monitor);
177
177
 
 
178
#if 0
178
179
  find_handle = FindFirstVolumeW (wc_name, MAX_PATH);
179
180
  found = (find_handle != INVALID_HANDLE_VALUE);
180
181
  while (found)
181
182
    {
 
183
      /* I don't know what this code is supposed to do; clearly it now
 
184
       * does nothing, the returned GList is always NULL. But what was
 
185
       * this code supposed to be a start of? The volume names that
 
186
       * the FindFirstVolume/FindNextVolume loop iterates over returns
 
187
       * device names like
 
188
       *
 
189
       *   \Device\HarddiskVolume1
 
190
       *   \Device\HarddiskVolume2
 
191
       *   \Device\CdRom0
 
192
       *
 
193
       * No DOS devices there, so I don't see the point with the
 
194
       * QueryDosDevice call below. Probably this code is confusing volumes
 
195
       * with something else that does contain the mapping from DOS devices
 
196
       * to volumes.
 
197
       */
182
198
      wchar_t wc_dev_name[MAX_PATH+1];
183
 
      guint trailing = wcslen(wc_name) - 1;
 
199
      guint trailing = wcslen (wc_name) - 1;
184
200
 
185
201
      /* remove trailing backslash and leading \\?\\ */
186
202
      wc_name[trailing] = L'\0';
187
 
      if (QueryDosDeviceW(&wc_name[4], wc_dev_name, MAX_PATH))
 
203
      if (QueryDosDeviceW (&wc_name[4], wc_dev_name, MAX_PATH))
188
204
        {
189
205
          gchar *name = g_utf16_to_utf8 (wc_dev_name, -1, NULL, NULL, NULL);
190
206
          g_print ("%s\n", name);
195
211
    }
196
212
  if (find_handle != INVALID_HANDLE_VALUE)
197
213
    FindVolumeClose (find_handle);
 
214
#endif
198
215
 
199
216
  return list;
200
217
}
256
273
  unix_monitor->mount_monitor = g_win32_mount_monitor_new ();
257
274
 
258
275
  g_signal_connect (win32_monitor->mount_monitor,
259
 
                    "mounts_changed", G_CALLBACK (mounts_changed),
 
276
                    "mounts-changed", G_CALLBACK (mounts_changed),
260
277
                    win32_monitor);
261
278
  
262
279
  g_signal_connect (win32_monitor->mount_monitor,
263
 
                    "mountpoints_changed", G_CALLBACK (mountpoints_changed),
 
280
                    "mountpoints-changed", G_CALLBACK (mountpoints_changed),
264
281
                    win32_monitor);
265
282
                    
266
283
  update_volumes (win32_monitor);