From 058e35c0ec1ceee037f99d1cd6bcd3b16a352041 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 2 Dec 2015 23:01:06 +0100 Subject: [PATCH] Remove commented out code from wxMSW wxMimeTypesManager Just clean up; we don't need all this old and unused code in this file. --- src/msw/mimetype.cpp | 78 +------------------------------------------- 1 file changed, 1 insertion(+), 77 deletions(-) diff --git a/src/msw/mimetype.cpp b/src/msw/mimetype.cpp index 2a11ce52b1..ce7280ad4f 100644 --- a/src/msw/mimetype.cpp +++ b/src/msw/mimetype.cpp @@ -490,20 +490,6 @@ wxMimeTypesManagerImpl::GetFileTypeFromExtension(const wxString& ext) return CreateFileType(wxEmptyString, ext); } -/* -wxFileType * -wxMimeTypesManagerImpl::GetOrAllocateFileTypeFromExtension(const wxString& ext) -{ - wxFileType *fileType = GetFileTypeFromExtension(ext); - if ( !fileType ) - { - fileType = CreateFileType(wxEmptyString, ext); - } - - return fileType; -} -*/ - // MIME type -> extension -> file type wxFileType * wxMimeTypesManagerImpl::GetFileTypeFromMimeType(const wxString& mimeType) @@ -701,65 +687,13 @@ bool wxFileTypeImpl::SetCommand(const wxString& cmd, return false; wxRegKey rkey(wxRegKey::HKCR, GetVerbPath(verb)); -#if 0 - if ( rkey.Exists() && overwriteprompt ) - { -#if wxUSE_GUI - wxString old; - rkey.QueryValue(wxEmptyString, old); - if ( wxMessageBox - ( - wxString::Format( - _("Do you want to overwrite the command used to %s " - "files with extension \"%s\" ?\nCurrent value is \n%s, " - "\nNew value is \n%s %1"), // bug here FIX need %1 ?? - verb.c_str(), - m_ext.c_str(), - old.c_str(), - cmd.c_str()), - _("Confirm registry update"), - wxYES_NO | wxICON_QUESTION - ) != wxYES ) -#endif // wxUSE_GUI - { - // cancelled by user - return false; - } - } -#endif + // TODO: // 1. translate '%s' to '%1' instead of always adding it // 2. create DDEExec value if needed (undo GetCommand) return rkey.Create() && rkey.SetValue(wxEmptyString, cmd + wxT(" \"%1\"") ); } -/* // no longer used -bool wxFileTypeImpl::SetMimeType(const wxString& mimeTypeOrig) -{ - wxCHECK_MSG( !m_ext.empty(), false, wxT("SetMimeType() needs extension") ); - - if ( !EnsureExtKeyExists() ) - return false; - - // VZ: is this really useful? (FIXME) - wxString mimeType; - if ( !mimeTypeOrig ) - { - // make up a default value for it - wxString cmd; - wxFileName::SplitPath(GetCommand(wxT("open")), NULL, &cmd, NULL); - mimeType << wxT("application/x-") << cmd; - } - else - { - mimeType = mimeTypeOrig; - } - - wxRegKey rkey(wxRegKey::HKCR, m_ext); - return rkey.Create() && rkey.SetValue(wxT("Content Type"), mimeType); -} -*/ - bool wxFileTypeImpl::SetDefaultIcon(const wxString& cmd, int index) { wxCHECK_MSG( !m_ext.empty(), false, wxT("SetDefaultIcon() needs extension") ); @@ -807,16 +741,6 @@ bool wxFileTypeImpl::Unassociate() if ( !RemoveDescription() ) result = false; -/* - //this might hold other keys, eg some have CSLID keys - if ( result ) - { - // delete the root key - wxRegKey key(wxRegKey::HKCR, m_ext); - if ( key.Exists() ) - result = key.DeleteSelf(); - } -*/ return result; }