Index: xbmc/win32/Win32StorageProvider.cpp =================================================================== --- xbmc/win32/Win32StorageProvider.cpp (revision 23879) +++ xbmc/win32/Win32StorageProvider.cpp (arbetskopia) @@ -15,6 +15,7 @@ void CWin32StorageProvider::GetRemovableDrives(VECSOURCES &removableDrives) { + CWIN32Util::GetDrivesByType(removableDrives, REMOVABLE_DRIVES); } bool CWin32StorageProvider::Eject(CStdString mountpath) @@ -30,3 +31,10 @@ { return CWIN32Util::GetDiskUsage(); } + +bool CWin32StorageProvider::PumpDriveChangeEvents() +{ + bool b = event; + event = false; + return b; +} Index: xbmc/win32/Win32StorageProvider.h =================================================================== --- xbmc/win32/Win32StorageProvider.h (revision 23879) +++ xbmc/win32/Win32StorageProvider.h (arbetskopia) @@ -17,4 +17,7 @@ virtual std::vector GetDiskUsage(); virtual bool PumpDriveChangeEvents() { return false; } + + static void SetEvent() { event = true; } + static bool event; }; Index: xbmc/WinEventsWin32.cpp =================================================================== --- xbmc/WinEventsWin32.cpp (revision 23879) +++ xbmc/WinEventsWin32.cpp (arbetskopia) @@ -23,6 +23,7 @@ #include "Windowsx.h" #include "WinEvents.h" #include "WIN32Util.h" +#include "Win32StorageProvider.h" #include "Application.h" #include "XBMC_vkeys.h" #include "MouseStat.h" @@ -520,12 +521,7 @@ else { // USB drive inserted - CMediaSource share; - share.strPath.Format("%c:",CWIN32Util::FirstDriveFromMask(lpdbv ->dbcv_unitmask)); - share.strName.Format("%s (%s)", g_localizeStrings.Get(437), share.strPath); - share.m_ignore = true; - share.m_iDriveType = CMediaSource::SOURCE_TYPE_REMOVABLE; - g_mediaManager.AddAutoSource(share); + Win32StorageProvider::SetEvent(); } } break; @@ -546,10 +542,7 @@ else { // USB drive was removed - CMediaSource share; - share.strPath.Format("%c:",CWIN32Util::FirstDriveFromMask(lpdbv ->dbcv_unitmask)); - share.strName.Format("%s (%s)", g_localizeStrings.Get(437), share.strPath); - g_mediaManager.RemoveAutoSource(share); + Win32StorageProvider::SetEvent(); } } break;