Changeset 11374

Timestamp:
Mar 19, 2012, 11:40:06 PM (12 years ago)
Author:
philip
Message:

Fix #868 (move wxWidgets Unix config files to XDG basedir location), based on patch from leper.
Fix handling of set but empty XDG environment variables.

Location:
ps/trunk/source
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • ps/trunk/source/ps/GameSetup/Paths.cpp

    r11074 r11374  
    112112{
    113113    const char* path = getenv(envname);
    114     if(path)
     114    // Use if set and non-empty
     115    if(path && path[0] != '\0')
    115116    {
    116117        if(path[0] != '/')  // relative to $HOME
  • ps/trunk/source/tools/atlas/AtlasUI/Misc/DLLInterface.cpp

    r10909 r11374  
    1 /* Copyright (C) 2009 Wildfire Games.
     1/* Copyright (C) 20 Wildfire Games.
    22 * This file is part of 0 A.D.
    33 *
     
    113113}
    114114
     115
     116
     117
     118
     119
     120
     121
    115122ATLASDLLIMPEXP void Atlas_StartWindow(const wchar_t* type)
    116123{
     
    189196#endif
    190197
     198
     199
     200
     201
     202
     203
     204
     205
     206
     207
     208
     209
     210
     211
     212
     213
     214
     215
     216
    191217        // Initialise the global config file
    192         wxConfigBase::Set(new wxConfig(_T("Atlas Editor"), _T("Wildfire Games")));
     218        wxConfigBase::Set(new wxConfig(_T("Atlas Editor"), _T("Wildfire Games")
     219#ifndef __WXMSW__ // On Windows we use wxRegConfig and setting this changes the Registry key
     220            , configPath + _T("atlas.ini")
     221#endif
     222            ));
    193223
    194224        if (! g_HasSetDataDirectory)
  • ps/trunk/source/tools/atlas/GameInterface/GameLoop.cpp

    r11232 r11374  
    5353void (*Atlas_StartWindow)(const wchar_t* type);
    5454void (*Atlas_SetDataDirectory)(const wchar_t* path);
     55
    5556void (*Atlas_SetMessagePasser)(MessagePasser*);
    5657void (*Atlas_GLSetCurrent)(void* cavas);
     
    278279        dll.LoadSymbol("Atlas_SetMessagePasser", Atlas_SetMessagePasser);
    279280        dll.LoadSymbol("Atlas_SetDataDirectory", Atlas_SetDataDirectory);
     281
    280282        dll.LoadSymbol("Atlas_GLSetCurrent", Atlas_GLSetCurrent);
    281283        dll.LoadSymbol("Atlas_GLSwapBuffers", Atlas_GLSwapBuffers);
     
    304306    Atlas_SetDataDirectory(paths.RData().string().c_str());
    305307
     308
     309
     310
    306311    // Run the engine loop in a new thread
    307312    pthread_t engineThread;
Note: See TracChangeset for help on using the changeset viewer.