]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/fs_inet.cpp
fix for HP-UX
[wxWidgets.git] / src / common / fs_inet.cpp
index 7c0b89d38a45105cf3136b1b8b47513f3a752c77..457f9a51fd2980172402070d175820a9894ef599 100644 (file)
@@ -29,6 +29,11 @@ limitation)
 #pragma hdrstop
 #endif
 
+#if !wxUSE_SOCKETS
+    #undef wxUSE_FS_INET
+    #define wxUSE_FS_INET 0
+#endif
+
 #if wxUSE_FS_INET
 
 #ifndef WXPRECOMP
@@ -78,7 +83,7 @@ wxFSFile* wxInternetFSHandler::OpenFile(wxFileSystem& WXUNUSED(fs), const wxStri
     info = (wxInetCacheNode*) m_Cache.Get(right);
 
     // Add item into cache:
-    if (info != NULL)
+    if (info == NULL)
     {
         wxURL url(right);
         s = url.GetInputStream();
@@ -132,4 +137,19 @@ wxInternetFSHandler::~wxInternetFSHandler()
     }
 }
 
+class wxFileSystemInternetModule : public wxModule
+{
+    DECLARE_DYNAMIC_CLASS(wxFileSystemInternetModule)
+
+    public:
+        virtual bool OnInit()
+        {
+            wxFileSystem::AddHandler(new wxInternetFSHandler);
+            return TRUE;
+        }
+        virtual void OnExit() {}
+};
+
+IMPLEMENT_DYNAMIC_CLASS(wxFileSystemInternetModule, wxModule)
+
 #endif // wxUSE_FS_INET