Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Pierre Kim
manateecoin
Commits
6d257550
Commit
6d257550
authored
Dec 19, 2017
by
Pierre Kim
Browse files
1.2.1.2 - Fix non latin directory bug
parent
ca084172
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/Common/Util.cpp
View file @
6d257550
...
...
@@ -314,6 +314,51 @@ std::string get_nix_version_display_string()
return
config_folder
;
}
#ifdef WIN32
std
::
wstring
get_special_folder_path_w
(
int
nfolder
,
bool
iscreate
)
{
namespace
fs
=
boost
::
filesystem
;
wchar_t
wsz_path
[
MAX_PATH
]
=
L""
;
if
(
SHGetSpecialFolderPathW
(
NULL
,
wsz_path
,
nfolder
,
iscreate
))
{
return
wsz_path
;
}
return
L""
;
}
#endif
std
::
wstring
getDefaultDataDirectoryW
()
{
//namespace fs = boost::filesystem;
// Windows < Vista: C:\Documents and Settings\Username\Application Data\CRYPTONOTE_NAME
// Windows >= Vista: C:\Users\Username\AppData\Roaming\CRYPTONOTE_NAME
// Mac: ~/Library/Application Support/CRYPTONOTE_NAME
// Unix: ~/.CRYPTONOTE_NAME
std
::
wstring
config_folder
;
#ifdef WIN32
// Windows
config_folder
=
get_special_folder_path_w
(
CSIDL_APPDATA
,
true
)
+
L"
\\
manateecoin"
;
#else
std
::
string
pathRet
;
char
*
pszHome
=
getenv
(
"HOME"
);
if
(
pszHome
==
NULL
||
strlen
(
pszHome
)
==
0
)
pathRet
=
"/"
;
else
pathRet
=
pszHome
;
#ifdef MAC_OSX
// Mac
pathRet
/=
"Library/Application Support"
;
config_folder
=
(
pathRet
+
"/"
+
CryptoNote
::
CRYPTONOTE_NAME
);
#else
// Unix
config_folder
=
(
pathRet
+
"/."
+
CryptoNote
::
CRYPTONOTE_NAME
);
#endif
#endif
return
config_folder
;
}
bool
create_directories_if_necessary
(
const
std
::
string
&
path
)
{
namespace
fs
=
boost
::
filesystem
;
...
...
src/Common/Util.h
View file @
6d257550
...
...
@@ -10,6 +10,7 @@
namespace
Tools
{
std
::
string
getDefaultDataDirectory
();
std
::
wstring
getDefaultDataDirectoryW
();
std
::
string
get_os_version_string
();
bool
create_directories_if_necessary
(
const
std
::
string
&
path
);
std
::
error_code
replace_file
(
const
std
::
string
&
replacement_name
,
const
std
::
string
&
replaced_name
);
...
...
src/version.h.in
View file @
6d257550
#define BUILD_COMMIT_ID "@VERSION@"
#define PROJECT_VERSION "1.2.1"
#define PROJECT_VERSION_BUILD_NO "
1
"
#define PROJECT_VERSION_BUILD_NO "
2
"
#define PROJECT_VERSION_LONG PROJECT_VERSION "." PROJECT_VERSION_BUILD_NO
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment