X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7d8d6163ad4e9aeea1d18341462c23693a42b9a3..534f87c6c442aa2710a44352bd26d215fec1714b:/src/common/webviewarchivehandler.cpp diff --git a/src/common/webviewarchivehandler.cpp b/src/common/webviewarchivehandler.cpp index 9a445526c3..cb8f608a29 100644 --- a/src/common/webviewarchivehandler.cpp +++ b/src/common/webviewarchivehandler.cpp @@ -2,7 +2,6 @@ // Name: webviewfilehandler.cpp // Purpose: Custom webview handler to allow archive browsing // Author: Steven Lamerton -// Id: $Id$ // Copyright: (c) 2011 Steven Lamerton // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -10,7 +9,7 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" -#if wxUSE_WEB +#if wxUSE_WEBVIEW #if defined(__BORLANDC__) #pragma hdrstop @@ -50,6 +49,11 @@ wxWebViewArchiveHandler::wxWebViewArchiveHandler(const wxString& scheme) : m_fileSystem = new wxFileSystem(); } +wxWebViewArchiveHandler::~wxWebViewArchiveHandler() +{ + wxDELETE(m_fileSystem); +} + wxFSFile* wxWebViewArchiveHandler::GetFile(const wxString &uri) { //If there is a fragment at the end of the path then we need to strip it @@ -81,7 +85,7 @@ wxFSFile* wxWebViewArchiveHandler::GetFile(const wxString &uri) return NULL; wxString fspath = "file:" + - EscapeFileNameCharsInURL(path.substr(doubleslash + 2)); + EscapeFileNameCharsInURL(path.substr(doubleslash + 2).c_str()); return m_fileSystem->OpenFile(fspath); } //Otherwise we need to extract the protocol @@ -104,10 +108,10 @@ wxFSFile* wxWebViewArchiveHandler::GetFile(const wxString &uri) return NULL; wxString fspath = "file:" + - EscapeFileNameCharsInURL(mainpath.substr(doubleslash + 2)) + EscapeFileNameCharsInURL(mainpath.substr(doubleslash + 2).c_str()) + "#" + protocol +":" + archivepath; return m_fileSystem->OpenFile(fspath); } } -#endif // wxUSE_WEB +#endif // wxUSE_WEBVIEW