[vlc-devel] commit: skins2: assume Unicode filesystem on Windows ( Rémi Denis-Courmont )

git version control git at videolan.org
Tue Aug 18 19:28:16 CEST 2009


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Aug 18 20:22:15 2009 +0300| [e607973a1839e078ac5b125184d1ccbfb96b938c] | committer: Rémi Denis-Courmont 

skins2: assume Unicode filesystem on Windows

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e607973a1839e078ac5b125184d1ccbfb96b938c
---

 modules/gui/skins2/win32/win32_dragdrop.cpp |   45 +++++++-------------------
 1 files changed, 12 insertions(+), 33 deletions(-)

diff --git a/modules/gui/skins2/win32/win32_dragdrop.cpp b/modules/gui/skins2/win32/win32_dragdrop.cpp
index 9d37ae4..9a9c3ab 100644
--- a/modules/gui/skins2/win32/win32_dragdrop.cpp
+++ b/modules/gui/skins2/win32/win32_dragdrop.cpp
@@ -146,43 +146,22 @@ STDMETHODIMP Win32DragDrop::Drop( LPDATAOBJECT pDataObj, DWORD grfKeyState,
 
 void Win32DragDrop::HandleDrop( HDROP HDrop )
 {
-    if( GetVersion() < 0x80000000 )
-    {
-        // Use Unicode for Windows NT and above
-
-        // Get the number of dropped files
-        int nbFiles = DragQueryFileW( HDrop, 0xFFFFFFFF, NULL, 0 );
-
-        // For each dropped file
-        for( int i = 0; i < nbFiles; i++ )
-        {
-            // Get the name of the file
-            int nameLength = DragQueryFileW( HDrop, i, NULL, 0 ) + 1;
-            wchar_t *psz_fileName = new WCHAR[nameLength];
-            DragQueryFileW( HDrop, i, psz_fileName, nameLength );
-
-            // Add the file
-            CmdAddItem cmd(getIntf(),sFromWide(psz_fileName),m_playOnDrop);
-            cmd.execute();
+    // Get the number of dropped files
+    int nbFiles = DragQueryFileW( HDrop, 0xFFFFFFFF, NULL, 0 );
 
-            delete[] psz_fileName;
-        }
-    }
-    else
+    // For each dropped file
+    for( int i = 0; i < nbFiles; i++ )
     {
-        int nbFiles = DragQueryFile( HDrop, 0xFFFFFFFF, NULL, 0 );
-
-        for( int i = 0; i < nbFiles; i++ )
-        {
-            int nameLength = DragQueryFile( HDrop, i, NULL, 0 ) + 1;
-            char *psz_fileName = new char[nameLength];
-            DragQueryFile( HDrop, i, psz_fileName, nameLength );
+        // Get the name of the file
+        int nameLength = DragQueryFileW( HDrop, i, NULL, 0 ) + 1;
+        wchar_t *psz_fileName = new WCHAR[nameLength];
+        DragQueryFileW( HDrop, i, psz_fileName, nameLength );
 
-            CmdAddItem cmd(getIntf(),sFromLocale(psz_fileName),m_playOnDrop);
-            cmd.execute();
+        // Add the file
+        CmdAddItem cmd(getIntf(),sFromWide(psz_fileName),m_playOnDrop);
+        cmd.execute();
 
-            delete[] psz_fileName;
-        }
+        delete[] psz_fileName;
     }
 
     DragFinish( HDrop );




More information about the vlc-devel mailing list