Ticket #868: atlas-xdg-2012-01-15.patch

File atlas-xdg-2012-01-15.patch, 2.0 KB (added by leper, 13 years ago)
  • 0ad/source/tools/atlas/AtlasUI/Misc/DLLInterface.h

     
    1 /* Copyright (C) 2009 Wildfire Games.
     1/* Copyright (C) 20 Wildfire Games.
    22 * This file is part of 0 A.D.
    33 *
    44 * 0 A.D. is free software: you can redistribute it and/or modify
     
    1919#define DLLINTERFACE_INCLUDED
    2020
    2121#include <wchar.h>
     22
    2223
    2324namespace AtlasMessage { class MessagePasser; }
    2425
  • 0ad/source/tools/atlas/AtlasUI/Misc/DLLInterface.cpp

     
    1 /* Copyright (C) 2009 Wildfire Games.
     1/* Copyright (C) 20 Wildfire Games.
    22 * This file is part of 0 A.D.
    33 *
    44 * 0 A.D. is free software: you can redistribute it and/or modify
     
    187187        if (! wxIsDebuggerRunning())
    188188            wxHandleFatalExceptions();
    189189#endif
    190 
     190#if OS_UNIX && !OS_MACOSX
     191        // This should actually be fixed in the wxWidgets file
     192        // src/unix/stdpaths.cpp but since we're allowing for
     193        // external wxWidgets and are not even supplying our own
     194        // version we need to fix this here.
     195        // Ensure we are in / (NOTE: ugly hack (see above))
     196        wxString configPath = wxT("/../../../../../../../../../../..");
     197        configPath += wxGetenv(wxT("XDG_CONFIG_HOME"))?wxGetenv(wxT("XDG_CONFIG_HOME")):wxFileName::GetHomeDir() + wxT("/.config");
     198        // 0ad specific config dir
     199        configPath += wxT("/0ad/config/");
     200       
     201        // Initialise the global config file (XDG compatibility hack)
     202        wxConfigBase::Set(new wxConfig(configPath + wxT("atlas.ini"), _T("Wildfire Games")));
     203#else
    191204        // Initialise the global config file
    192205        wxConfigBase::Set(new wxConfig(_T("Atlas Editor"), _T("Wildfire Games")));
     206
    193207
    194208        if (! g_HasSetDataDirectory)
    195209        {