From: Thomas Debesse Date: Mon, 20 Jun 2022 02:29:25 +0000 (+0200) Subject: Merge commit 'ce0ea4bdc1521a3926994077fc104e7a155d299d' into master-merge X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=82224c4441e6ce60c89b0fbd15c3c1f4edab4a40;p=xonotic%2Fnetradiant.git Merge commit 'ce0ea4bdc1521a3926994077fc104e7a155d299d' into master-merge --- 82224c4441e6ce60c89b0fbd15c3c1f4edab4a40 diff --cc radiant/mru.cpp index 640fd391,72660b91..70987648 --- a/radiant/mru.cpp +++ b/radiant/mru.cpp @@@ -49,30 -50,28 +49,30 @@@ inline const char* MRU_GetText( std::si class EscapedMnemonic { -StringBuffer m_buffer; +private: + std::string m_buffer; + public: -EscapedMnemonic( std::size_t capacity ) : m_buffer( capacity ){ + EscapedMnemonic() : m_buffer(){ - m_buffer.push_back( '_' ); - } - const char* c_str() const { - return m_buffer.c_str(); - } - void push_back( char c ){ // not escaped - m_buffer.push_back( c ); - } - std::size_t write( const char* buffer, std::size_t length ){ - for ( const char* end = buffer + length; buffer != end; ++buffer ) - { - if ( *buffer == '_' ) { - m_buffer.push_back( '_' ); - } - - m_buffer.push_back( *buffer ); + m_buffer.push_back( '_' ); + } + const char* c_str() const { + return m_buffer.c_str(); + } + void push_back( char c ){ // not escaped + m_buffer.push_back( c ); + } + std::size_t write( const char* buffer, std::size_t length ){ + for ( const char* end = buffer + length; buffer != end; ++buffer ) + { + if ( *buffer == '_' ) { + m_buffer.push_back( '_' ); } - return length; + + m_buffer.push_back( *buffer ); } + return length; + } }; template @@@ -174,18 -173,16 +174,18 @@@ void MRU_Activate( std::size_t index ) class LoadMRU { +private: - std::size_t m_number; + std::size_t m_number; + public: - LoadMRU( std::size_t number ) - : m_number( number ){ - } - void load(){ - if ( ConfirmModified( "Open Map" ) ) { - MRU_Activate( m_number - 1 ); - } + LoadMRU( std::size_t number ) + : m_number( number ){ + } + void load(){ + if ( ConfirmModified( "Open Map" ) ) { + MRU_Activate( m_number - 1 ); } + } }; typedef MemberCaller LoadMRUCaller; diff --cc radiant/preferences.cpp index 7372a74a,7299a3f9..f308ebcf --- a/radiant/preferences.cpp +++ b/radiant/preferences.cpp @@@ -279,18 -281,7 +279,18 @@@ void CGameDialog::GameFileImport( int v { ++iGame; } + + if ( ( *iGame )->mGameFile != m_sGameFile ) { - m_sGameFile = ( *iGame )->mGameFile; + m_sGameFile = ( *iGame )->mGameFile; + + // do not trigger radiant restart when switching game on startup using Global Preferences dialog + if ( !onStartup ) { + PreferencesDialog_restartRequired( "Selected Game" ); + } + } + + // onStartup can only be true once, when Global Preferences are displayed at startup + onStartup = false; } void CGameDialog::GameFileExport( const Callback & importCallback ) const {