projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cleanup
[wxWidgets.git]
/
src
/
common
/
stdpbase.cpp
diff --git
a/src/common/stdpbase.cpp
b/src/common/stdpbase.cpp
index 04cebb8587d2f885be5ceab3e82daaa95fdea7ee..8df8c13843ec03686e51fccdc5aef617d4be8b9b 100644
(file)
--- a/
src/common/stdpbase.cpp
+++ b/
src/common/stdpbase.cpp
@@
-43,10
+43,10
@@
static wxStandardPaths gs_stdPaths;
// ============================================================================
/* static */
// ============================================================================
/* static */
-wxStandardPaths
Base
& wxStandardPathsBase::Get()
+wxStandardPaths& wxStandardPathsBase::Get()
{
wxAppTraits * const traits = wxTheApp ? wxTheApp->GetTraits() : NULL;
{
wxAppTraits * const traits = wxTheApp ? wxTheApp->GetTraits() : NULL;
- wxCHECK_MSG( traits, gs_stdPaths,
_
T("create wxApp before calling this") );
+ wxCHECK_MSG( traits, gs_stdPaths,
wx
T("create wxApp before calling this") );
return traits->GetStandardPaths();
}
return traits->GetStandardPaths();
}
@@
-72,7
+72,7
@@
wxString wxStandardPathsBase::GetExecutablePath() const
return filename.GetFullPath();
}
return filename.GetFullPath();
}
-wxStandardPaths
Base
& wxAppTraitsBase::GetStandardPaths()
+wxStandardPaths& wxAppTraitsBase::GetStandardPaths()
{
return gs_stdPaths;
}
{
return gs_stdPaths;
}
@@
-106,6
+106,14
@@
wxString wxStandardPathsBase::GetDocumentsDir() const
return wxFileName::GetHomeDir();
}
return wxFileName::GetHomeDir();
}
+wxString wxStandardPathsBase::GetAppDocumentsDir() const
+{
+ const wxString docsDir = GetDocumentsDir();
+ wxString appDocsDir = AppendAppInfo(docsDir);
+
+ return wxDirExists(appDocsDir) ? appDocsDir : docsDir;
+}
+
// return the temporary directory for the current user
wxString wxStandardPathsBase::GetTempDir() const
{
// return the temporary directory for the current user
wxString wxStandardPathsBase::GetTempDir() const
{
@@
-113,7
+121,9
@@
wxString wxStandardPathsBase::GetTempDir() const
}
/* static */
}
/* static */
-wxString wxStandardPathsBase::AppendPathComponent(const wxString& dir, const wxString& component)
+wxString
+wxStandardPathsBase::AppendPathComponent(const wxString& dir,
+ const wxString& component)
{
wxString subdir(dir);
{
wxString subdir(dir);
@@
-123,7
+133,7
@@
wxString wxStandardPathsBase::AppendPathComponent(const wxString& dir, const wxS
if ( !component.empty() )
{
const wxChar ch = *(subdir.end() - 1);
if ( !component.empty() )
{
const wxChar ch = *(subdir.end() - 1);
- if ( !wxFileName::IsPathSeparator(ch) && ch !=
_
T('.') )
+ if ( !wxFileName::IsPathSeparator(ch) && ch !=
wx
T('.') )
subdir += wxFileName::GetPathSeparator();
subdir += component;
subdir += wxFileName::GetPathSeparator();
subdir += component;