]> git.saurik.com Git - wxWidgets.git/commitdiff
test for remote drive existence using wxDirExists() first if it's mapped locally...
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 17 Nov 2007 15:31:17 +0000 (15:31 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 17 Nov 2007 15:31:17 +0000 (15:31 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50029 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/volume.cpp

index fb471ddf5ff157dc25cc79c379151b381345e9ef..9c9eecef83725136c30bf458460b28a235d006de 100644 (file)
@@ -264,6 +264,17 @@ static void BuildListFromNN(wxArrayString& list, NETRESOURCE* pResSrc,
                 {
                     wxString filename(pRes->lpRemoteName);
 
+                    // if the drive is unavailable, FilteredAdd() can hang for
+                    // a long time and, moreover, its failure appears to be not
+                    // cached so this will happen every time we use it, so try
+                    // a much quicker wxDirExists() test (which still hangs but
+                    // for much shorter time) for locally mapped drives first
+                    // to try to avoid this
+                    if ( pRes->lpLocalName &&
+                            *pRes->lpLocalName &&
+                                !wxDirExists(pRes->lpLocalName) )
+                        continue;
+
                     if (!filename.empty())
                     {
                         if (filename.Last() != '\\')