forked from mia/Aegisub
Cosmetics in standard_paths.cpp
Originally committed to SVN as r6233.
This commit is contained in:
parent
01646d7cf4
commit
43d4e785fb
2 changed files with 22 additions and 47 deletions
|
@ -34,9 +34,6 @@
|
|||
/// @ingroup utility
|
||||
///
|
||||
|
||||
|
||||
///////////
|
||||
// Headers
|
||||
#include "config.h"
|
||||
|
||||
#ifndef AGI_PRE
|
||||
|
@ -46,19 +43,11 @@
|
|||
|
||||
#include "standard_paths.h"
|
||||
|
||||
|
||||
/// @brief Get instance
|
||||
/// @return
|
||||
///
|
||||
StandardPaths &StandardPaths::GetInstance() {
|
||||
static StandardPaths instance;
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// @brief Constructor
|
||||
///
|
||||
StandardPaths::StandardPaths() {
|
||||
wxStandardPathsBase &paths = wxStandardPaths::Get();
|
||||
|
||||
|
@ -91,15 +80,10 @@ StandardPaths::StandardPaths() {
|
|||
if (!folder.DirExists()) folder.Mkdir(0777,wxPATH_MKDIR_FULL);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// @brief Decode path
|
||||
/// @param path
|
||||
/// @return
|
||||
///
|
||||
wxString StandardPaths::DoDecodePath(wxString path) {
|
||||
// Decode
|
||||
if (path[0] == '?') {
|
||||
if (!path || path[0] != '?')
|
||||
return path;
|
||||
|
||||
// Split ?part from rest
|
||||
path.Replace("\\","/");
|
||||
int pos = path.Find("/");
|
||||
|
@ -121,14 +105,6 @@ wxString StandardPaths::DoDecodePath(wxString path) {
|
|||
return final;
|
||||
}
|
||||
|
||||
// Nothing to decode
|
||||
else return path;
|
||||
}
|
||||
|
||||
/// @brief Set value of a ? path
|
||||
/// @param path
|
||||
/// @param value
|
||||
///
|
||||
void StandardPaths::DoSetPathValue(const wxString &path, const wxString &value) {
|
||||
paths[path] = value;
|
||||
}
|
||||
|
|
|
@ -58,7 +58,6 @@ class StandardPaths {
|
|||
void DoSetPathValue(const wxString &path, const wxString &value);
|
||||
|
||||
public:
|
||||
|
||||
static wxString DecodePath(const wxString &path) { return GetInstance().DoDecodePath(path); }
|
||||
static void SetPathValue(const wxString &path, const wxString &value) { GetInstance().DoSetPathValue(path,value); }
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue