mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-12 21:47:00 -04:00
Don't use wxMkDir, it shows stupid error messages
This commit is contained in:
@@ -113,6 +113,14 @@ time_t file_modified_time(const String& path) {
|
|||||||
|
|
||||||
// ----------------------------------------------------------------------------- : Directories
|
// ----------------------------------------------------------------------------- : Directories
|
||||||
|
|
||||||
|
bool create_directory(const String& path) {
|
||||||
|
#if defined(__WX_MSW__)
|
||||||
|
return _wmkdir(path.fn_str()) == 0;
|
||||||
|
#else
|
||||||
|
return mkdir(path.fn_str()) == 0;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
bool create_parent_dirs(const String& file) {
|
bool create_parent_dirs(const String& file) {
|
||||||
for (size_t pos = file.find_first_of(_("\\/"), 1) ;
|
for (size_t pos = file.find_first_of(_("\\/"), 1) ;
|
||||||
pos != String::npos ;
|
pos != String::npos ;
|
||||||
|
|||||||
@@ -45,6 +45,8 @@ time_t file_modified_time(const String& name);
|
|||||||
|
|
||||||
// ----------------------------------------------------------------------------- : Removing and renaming
|
// ----------------------------------------------------------------------------- : Removing and renaming
|
||||||
|
|
||||||
|
bool create_directory(const String& path);
|
||||||
|
|
||||||
/// Ensure that the parent directories of the given filename exist
|
/// Ensure that the parent directories of the given filename exist
|
||||||
bool create_parent_dirs(const String& file);
|
bool create_parent_dirs(const String& file);
|
||||||
|
|
||||||
|
|||||||
@@ -401,7 +401,7 @@ void Package::openZipfile() {
|
|||||||
|
|
||||||
void Package::saveToDirectory(const String& saveAs, bool remove_unused, bool is_copy) {
|
void Package::saveToDirectory(const String& saveAs, bool remove_unused, bool is_copy) {
|
||||||
// create directory?
|
// create directory?
|
||||||
wxMkdir(saveAs);
|
create_directory(saveAs);
|
||||||
// write to a directory
|
// write to a directory
|
||||||
VCSP vcs = getVCS();
|
VCSP vcs = getVCS();
|
||||||
FOR_EACH(f, files) {
|
FOR_EACH(f, files) {
|
||||||
|
|||||||
Reference in New Issue
Block a user