From 72c164f28c192afea1ea13ab4abc7cc6895ca65d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 2 Jan 2024 01:57:04 +0100 Subject: [PATCH] Make wxStandardPaths::AppendAppInfo() public This function can be useful to the application code and will be used by wxFileConfig in the upcoming commits. --- include/wx/stdpaths.h | 8 ++++---- interface/wx/stdpaths.h | 16 ++++++++++++++++ 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/include/wx/stdpaths.h b/include/wx/stdpaths.h index 3a0d5e5227..3afb5de4a5 100644 --- a/include/wx/stdpaths.h +++ b/include/wx/stdpaths.h @@ -184,6 +184,10 @@ public: bool UsesAppInfo(int info) const { return (m_usedAppInfo & info) != 0; } + // append application information determined by m_usedAppInfo to dir + wxString AppendAppInfo(const wxString& dir) const; + + void SetFileLayout(FileLayout layout) { m_fileLayout = layout; @@ -203,10 +207,6 @@ protected: // path separator or dot (.) is not already at the end of dir static wxString AppendPathComponent(const wxString& dir, const wxString& component); - // append application information determined by m_usedAppInfo to dir - wxString AppendAppInfo(const wxString& dir) const; - - // combination of AppInfo_XXX flags used by AppendAppInfo() int m_usedAppInfo; diff --git a/interface/wx/stdpaths.h b/interface/wx/stdpaths.h index ea83a96be6..40baffff73 100644 --- a/interface/wx/stdpaths.h +++ b/interface/wx/stdpaths.h @@ -195,6 +195,20 @@ public: ConfigFileConv_Ext }; + /** + Append application and/or vendor name to the given directory. + + By default, appends the subdirectory with the application name, as + returned by wxApp::GetAppName(), to the given directory. + + This behaviour is affected by UseAppInfo(), e.g. if this function is + called with `AppInfo_VendorName` then the vendor name would be appended + instead of the application name. + + @since 3.3.0 + */ + wxString AppendAppInfo(const wxString& dir) const; + /** MSW-specific function undoing the effect of IgnoreAppSubDir() calls. @@ -513,6 +527,8 @@ public: By default, only the application name is used. + @see AppendAppInfo() + @since 2.9.0 */ void UseAppInfo(int info);