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

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

     
    1 /* Copyright (C) 2009 Wildfire Games.
     1/* Copyright (C) 2012 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#include "../../../../lib/sysdep/os.h"
    2223
    2324namespace AtlasMessage { class MessagePasser; }
    2425
  • 0ad/source/tools/atlas/AtlasUI/Misc/DLLInterface.cpp

     
    1 /* Copyright (C) 2009 Wildfire Games.
     1/* Copyright (C) 2012 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        // Get basedir compilant config directory (wxWidgets doesn't
     192        // support this so we need to do this on our own)
     193        wxString configPath = wxGetenv(wxT("XDG_CONFIG_HOME"))?wxGetenv(wxT("XDG_CONFIG_HOME")):wxFileName::GetHomeDir() + wxT("/.config");
     194        // 0ad specific config dir
     195        configPath += wxT("/0ad/config/");
     196       
    191197        // Initialise the global config file
     198        wxConfigBase::Set(new wxConfig(_T("Atlas Editor"), _T("Wildfire Games"), configPath + wxT("atlas.ini")));
     199#else
     200        // Initialise the global config file
    192201        wxConfigBase::Set(new wxConfig(_T("Atlas Editor"), _T("Wildfire Games")));
     202#endif //OS_UNIX
    193203
    194204        if (! g_HasSetDataDirectory)
    195205        {