Ticket #40390: patch-wxWidgets30-compatibility-plugins-codesnippets.diff

File patch-wxWidgets30-compatibility-plugins-codesnippets.diff, 2.6 KB (added by mojca (Mojca Miklavec), 11 years ago)

some patches for compatibility of Code::Blocks plugin codesnippets with wxWidgets 2.9

  • src/plugins/contrib/codesnippets/codesnippetsapp.cpp

    old new  
    9595END_EVENT_TABLE()
    9696
    9797#ifdef __WXMAC__
    98     #include "wx/mac/corefoundation/cfstring.h"
     98    #if wxCHECK_VERSION(2,9,0)
     99        #include "wx/osx/core/cfstring.h"
     100    #else
     101        #include "wx/mac/corefoundation/cfstring.h"
     102    #endif
    99103    #include "wx/intl.h"
    100104
    101105    #include <CoreFoundation/CFBundle.h>
     
    112116        CFRelease(resourcesURL);
    113117        CFStringRef cfStrPath = CFURLCopyFileSystemPath(absoluteURL,kCFURLPOSIXPathStyle);
    114118        CFRelease(absoluteURL);
    115         return wxMacCFStringHolder(cfStrPath).AsString(wxLocale::GetSystemEncoding());
     119        #if wxCHECK_VERSION(2,9,0)
     120          return wxCFStringRef(cfStrPath).AsString(wxLocale::GetSystemEncoding());
     121        #else
     122          return wxMacCFStringHolder(cfStrPath).AsString(wxLocale::GetSystemEncoding());
     123        #endif
    116124    }
    117125#endif
    118126
     
    268276    m_KeepAliveFileName = wxEmptyString;
    269277    m_pFilesHistory = 0;
    270278
    271     wxStandardPaths stdPaths;
    272 
    273279    // -------------------------------
    274280    // initialize version and logging
    275281    // -------------------------------
     
    325331    // Find Config File
    326332    // -----------------------------------------
    327333    // Create filename like {%HOME%}\codesnippets.ini
    328     m_ConfigFolder = Normalize(stdPaths.GetUserDataDir());
     334    m_ConfigFolder = Normalize(wxStandardPaths::Get().GetUserDataDir());
    329335    wxString m_ExecuteFolder = Normalize(FindAppPath(wxTheApp->argv[0], ::wxGetCwd(), wxEmptyString));
    330336
    331337    #if defined(LOGGING)
     
    13871393void CodeSnippetsAppFrame::ImportCBResources()
    13881394// ----------------------------------------------------------------------------
    13891395{
    1390     wxStandardPaths stdPaths;
    1391 
    13921396    // Location of app config folder
    13931397    wxString appConfigFolder =  Normalize(m_ConfigFolder) ;
    13941398
     
    13991403    wxString cbExeFolder = Normalize(GetCBExeFolder());
    14001404
    14011405    // location of CodeBlocks config folder
    1402     wxString cbConfigFolder = Normalize(stdPaths.GetUserDataDir());
     1406    wxString cbConfigFolder = Normalize(wxStandardPaths::Get().GetUserDataDir());
    14031407    wxString appParent = GetConfig()->GetAppParent();
    14041408    if ( appParent.empty()) appParent =_T("codeblocks");
    14051409    wxString prefixPath;
  • src/plugins/contrib/codesnippets/snippetsconfig.cpp

    old new  
    128128{
    129129        // file will be saved in $HOME/codesnippets.ini
    130130
    131     wxStandardPaths stdPaths;
    132 
    133131    #ifdef LOGGING
    134132     wxString fn(__FUNCTION__, wxConvUTF8);
    135133     LOGIT( _T("--- [%s] ---"),fn.c_str() );