Fix up naming of the kiplatform helpers

This commit is contained in:
Marek Roszko 2021-01-27 19:11:39 -05:00
parent 6d4bae1136
commit a47e8af0d0
6 changed files with 30 additions and 22 deletions

View File

@ -38,7 +38,7 @@ wxString PATHS::GetUserPluginsPath()
{
wxFileName tmp;
tmp.AssignDir( KIPLATFORM::ENV::GetDocumentsDir() );
tmp.AssignDir( KIPLATFORM::ENV::GetDocumentsPath() );
tmp.AppendDir( KICAD_PATH_STR );
tmp.AppendDir( SETTINGS_MANAGER::GetSettingsVersion() );
tmp.AppendDir( "plugins" );
@ -62,7 +62,7 @@ wxString PATHS::GetUserScriptingPath()
{
wxFileName tmp;
tmp.AssignDir( KIPLATFORM::ENV::GetDocumentsDir() );
tmp.AssignDir( KIPLATFORM::ENV::GetDocumentsPath() );
tmp.AppendDir( KICAD_PATH_STR );
tmp.AppendDir( SETTINGS_MANAGER::GetSettingsVersion() );
tmp.AppendDir( "scripting" );
@ -75,7 +75,7 @@ wxString PATHS::GetUserTemplatesPath()
{
wxFileName tmp;
tmp.AssignDir( KIPLATFORM::ENV::GetDocumentsDir() );
tmp.AssignDir( KIPLATFORM::ENV::GetDocumentsPath() );
tmp.AppendDir( KICAD_PATH_STR );
tmp.AppendDir( SETTINGS_MANAGER::GetSettingsVersion() );
tmp.AppendDir( "template" );
@ -88,7 +88,7 @@ wxString PATHS::GetDefaultUserProjectsPath()
{
wxFileName tmp;
tmp.AssignDir( KIPLATFORM::ENV::GetDocumentsDir() );
tmp.AssignDir( KIPLATFORM::ENV::GetDocumentsPath() );
tmp.AppendDir( KICAD_PATH_STR );
tmp.AppendDir( SETTINGS_MANAGER::GetSettingsVersion() );
tmp.AppendDir( "projects" );
@ -160,7 +160,7 @@ wxString PATHS::GetUserCachePath()
{
wxFileName tmp;
tmp.AssignDir( KIPLATFORM::ENV::GetUserCacheDir() );
tmp.AssignDir( KIPLATFORM::ENV::GetUserCachePath() );
tmp.AppendDir( KICAD_PATH_STR );
tmp.AppendDir( SETTINGS_MANAGER::GetSettingsVersion() );

View File

@ -613,7 +613,7 @@ wxString SETTINGS_MANAGER::calculateUserSettingsPath( bool aIncludeVer, bool aUs
}
else
{
cfgpath.AssignDir( KIPLATFORM::ENV::GetUserConfigDir() );
cfgpath.AssignDir( KIPLATFORM::ENV::GetUserConfigPath() );
cfgpath.AppendDir( TO_STR( KICAD_CONFIG_DIR ) );
}

View File

@ -48,19 +48,19 @@ bool KIPLATFORM::ENV::IsNetworkPath( const wxString& aPath )
}
wxString KIPLATFORM::ENV::GetDocumentsDir()
wxString KIPLATFORM::ENV::GetDocumentsPath()
{
return g_get_user_special_dir( G_USER_DIRECTORY_DOCUMENTS );
}
wxString KIPLATFORM::ENV::GetUserConfigDir()
wxString KIPLATFORM::ENV::GetUserConfigPath()
{
return g_get_user_config_dir();
}
wxString KIPLATFORM::ENV::GetUserCacheDir()
wxString KIPLATFORM::ENV::GetUserCachePath()
{
return g_get_user_cache_dir();
}

View File

@ -46,16 +46,24 @@ namespace KIPLATFORM
/**
* Retrieves the operating system specific path for a given path type
* Retrieves the operating system specific path for a user's documents
*
* @param aType is the type of path
*
* @return Path for the given aPath
* @return User documents path
*/
wxString GetDocumentsDir();
wxString GetDocumentsPath();
wxString GetUserConfigDir();
/**
* Retrieves the operating system specific path for a user's configuration store
*
* @return User config path
*/
wxString GetUserConfigPath();
wxString GetUserCacheDir();
/**
* Retrieves the operating system specific path for user's application cache
*
* @return User cache path
*/
wxString GetUserCachePath();
}
}

View File

@ -60,19 +60,19 @@ bool KIPLATFORM::ENV::IsNetworkPath( const wxString& aPath )
}
wxString KIPLATFORM::ENV::GetDocumentsDir()
wxString KIPLATFORM::ENV::GetDocumentsPath()
{
return wxStandardPaths::Get().GetDocumentsDir();
}
wxString KIPLATFORM::ENV::GetUserConfigDir()
wxString KIPLATFORM::ENV::GetUserConfigPath()
{
return wxStandardPaths::Get().GetUserConfigDir();
}
wxString KIPLATFORM::ENV::GetUserCacheDir()
wxString KIPLATFORM::ENV::GetUserCachePath()
{
// Unforunately AppData/Local is the closest analog to "Cache" directories of other platforms

View File

@ -53,19 +53,19 @@ bool KIPLATFORM::ENV::IsNetworkPath( const wxString& aPath )
}
wxString KIPLATFORM::ENV::GetDocumentsDir()
wxString KIPLATFORM::ENV::GetDocumentsPath()
{
return wxStandardPaths::Get().GetDocumentsDir();
}
wxString KIPLATFORM::ENV::GetUserConfigDir()
wxString KIPLATFORM::ENV::GetUserConfigPath()
{
return wxStandardPaths::Get().GetUserConfigDir();
}
wxString KIPLATFORM::ENV::GetUserCacheDir()
wxString KIPLATFORM::ENV::GetUserCachePath()
{
NSURL* url = [[NSFileManager defaultManager] URLForDirectory:NSCachesDirectory
inDomain:NSUserDomainMask