|
|
@@ -45,11 +45,15 @@ FileUtils::~FileUtils()
|
|
|
String FileUtils::OpenProjectFileDialog()
|
|
|
{
|
|
|
nfdchar_t *outPath = NULL;
|
|
|
-
|
|
|
- String upath = GetSubsystem<FileSystem>()->GetUserDocumentsDir();
|
|
|
+
|
|
|
+ String upath;
|
|
|
+
|
|
|
+#ifdef ATOMIC_PLATFORM_LINUX
|
|
|
+ upath = GetSubsystem<FileSystem>()->GetUserDocumentsDir();
|
|
|
+#endif
|
|
|
|
|
|
nfdresult_t result = NFD_OpenDialog( "atomic",
|
|
|
- GetNativePath(upath).CString(),
|
|
|
+ upath.Length() ? GetNativePath(upath).CString() : "",
|
|
|
&outPath);
|
|
|
|
|
|
String fullpath;
|
|
|
@@ -86,10 +90,14 @@ String FileUtils::NewProjectFileDialog()
|
|
|
|
|
|
nfdchar_t *outPath = NULL;
|
|
|
|
|
|
- String upath = GetSubsystem<FileSystem>()->GetUserDocumentsDir();
|
|
|
+ String upath;
|
|
|
+
|
|
|
+#ifdef ATOMIC_PLATFORM_LINUX
|
|
|
+ upath = GetSubsystem<FileSystem>()->GetUserDocumentsDir();
|
|
|
+#endif
|
|
|
|
|
|
nfdresult_t result = NFD_ChooseDirectory( "Please choose the root folder for your project",
|
|
|
- GetNativePath(upath).CString(),
|
|
|
+ upath.Length() ? GetNativePath(upath).CString() : "",
|
|
|
&outPath);
|
|
|
|
|
|
|
|
|
@@ -113,11 +121,8 @@ String FileUtils::GetBuildPath(const String& defaultPath)
|
|
|
|
|
|
nfdchar_t *outPath = NULL;
|
|
|
|
|
|
- String ppath = GetSubsystem<FileSystem>()->GetProgramDir();
|
|
|
- if ( defaultPath.Length() > 0) ppath = defaultPath;
|
|
|
-
|
|
|
nfdresult_t result = NFD_ChooseDirectory( "Please choose the build folder",
|
|
|
- GetNativePath(ppath).CString(),
|
|
|
+ defaultPath.Length() ? GetNativePath(defaultPath).CString() : "",
|
|
|
&outPath);
|
|
|
|
|
|
if (outPath && result == NFD_OKAY)
|
|
|
@@ -146,11 +151,8 @@ String FileUtils::GetAntPath(const String& defaultPath)
|
|
|
String msg = "Please select the folder which contains the ant executable";
|
|
|
#endif
|
|
|
|
|
|
- String ppath = GetSubsystem<FileSystem>()->GetProgramDir();
|
|
|
- if ( defaultPath.Length() > 0) ppath = defaultPath;
|
|
|
-
|
|
|
nfdresult_t result = NFD_ChooseDirectory(msg.CString(),
|
|
|
- GetNativePath(ppath).CString(),
|
|
|
+ defaultPath.Length() ? GetNativePath(defaultPath).CString() : "",
|
|
|
&outPath);
|
|
|
|
|
|
if (outPath && result == NFD_OKAY)
|
|
|
@@ -170,10 +172,8 @@ String FileUtils::GetMobileProvisionPath()
|
|
|
{
|
|
|
nfdchar_t *outPath = NULL;
|
|
|
|
|
|
- String upath = GetSubsystem<FileSystem>()->GetUserDocumentsDir();
|
|
|
-
|
|
|
nfdresult_t result = NFD_OpenDialog( "mobileprovision",
|
|
|
- GetNativePath(upath).CString(),
|
|
|
+ "",
|
|
|
&outPath);
|
|
|
|
|
|
String fullpath;
|
|
|
@@ -208,12 +208,9 @@ String FileUtils::FindPath(const String& title, const String& defaultPath)
|
|
|
String resultPath;
|
|
|
nfdchar_t *outPath = NULL;
|
|
|
|
|
|
- String upath = GetSubsystem<FileSystem>()->GetUserDocumentsDir();
|
|
|
- if ( defaultPath.Length() > 0) upath = defaultPath;
|
|
|
-
|
|
|
nfdresult_t result = NFD_ChooseDirectory(title.CString(),
|
|
|
- GetNativePath(upath).CString(),
|
|
|
- &outPath);
|
|
|
+ defaultPath.Length() ? GetNativePath(defaultPath).CString() : "",
|
|
|
+ &outPath);
|
|
|
|
|
|
if (outPath && result == NFD_OKAY)
|
|
|
{
|
|
|
@@ -233,11 +230,8 @@ String FileUtils::FindFile (const String& filterlist, const String& defaultPath)
|
|
|
String fullpath;
|
|
|
nfdchar_t *outPath = NULL;
|
|
|
|
|
|
- String upath = GetSubsystem<FileSystem>()->GetUserDocumentsDir();
|
|
|
- if ( defaultPath.Length() > 0) upath = defaultPath;
|
|
|
-
|
|
|
nfdresult_t result = NFD_OpenDialog( filterlist.CString(),
|
|
|
- GetNativePath(upath).CString(),
|
|
|
+ defaultPath.Length() ? GetNativePath(defaultPath).CString() : "",
|
|
|
&outPath);
|
|
|
|
|
|
if (outPath && result == NFD_OKAY)
|