mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 14:51:51 +00:00
- change the way posix folders are opened - fixes issue #1707
This commit is contained in:
parent
03d76027cf
commit
a9cadd345d
2 changed files with 47 additions and 12 deletions
|
@ -173,15 +173,33 @@ unsigned int I_MakeRNGSeed()
|
||||||
|
|
||||||
void I_OpenShellFolder(const char* folder)
|
void I_OpenShellFolder(const char* folder)
|
||||||
{
|
{
|
||||||
std::string x = (std::string)"open \"" + (std::string)folder + "\"";
|
char curdir[256];
|
||||||
|
if (!getcwd (curdir, countof(curdir)))
|
||||||
|
{
|
||||||
|
Printf ("Current path too long\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
chdir(folder);
|
||||||
Printf("Opening folder: %s\n", folder);
|
Printf("Opening folder: %s\n", folder);
|
||||||
std::system(x.c_str());
|
std::system("open .");
|
||||||
|
chdir(curdir);
|
||||||
}
|
}
|
||||||
|
|
||||||
void I_OpenShellFile(const char* file)
|
void I_OpenShellFile(const char* file)
|
||||||
{
|
{
|
||||||
std::string x = (std::string)"open \"" + (std::string)file + "\"";
|
char curdir[256];
|
||||||
x.erase(x.find_last_of('/'), std::string::npos);
|
if (!getcwd (curdir, countof(curdir)))
|
||||||
Printf("Opening folder to file: %s\n", file);
|
{
|
||||||
std::system(x.c_str());
|
Printf ("Current path too long\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string folder = file;
|
||||||
|
folder.erase(folder.find_last_of('/'), std::string::npos);
|
||||||
|
chdir(folder.c_str());
|
||||||
|
Printf("Opening folder: %s\n", folder.c_str());
|
||||||
|
std::system("open .");
|
||||||
|
chdir(curdir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -434,16 +434,33 @@ unsigned int I_MakeRNGSeed()
|
||||||
|
|
||||||
void I_OpenShellFolder(const char* folder)
|
void I_OpenShellFolder(const char* folder)
|
||||||
{
|
{
|
||||||
std::string x = (std::string)"xdg-open \"" + (std::string)folder + "\"";
|
char curdir[256];
|
||||||
|
if (!getcwd (curdir, countof(curdir)))
|
||||||
|
{
|
||||||
|
Printf ("Current path too long\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
chdir(folder);
|
||||||
Printf("Opening folder: %s\n", folder);
|
Printf("Opening folder: %s\n", folder);
|
||||||
std::system(x.c_str());
|
std::system("xdg-open .");
|
||||||
|
chdir(curdir);
|
||||||
}
|
}
|
||||||
|
|
||||||
void I_OpenShellFile(const char* file)
|
void I_OpenShellFile(const char* file)
|
||||||
{
|
{
|
||||||
std::string x = (std::string)"xdg-open \"" + (std::string)file + "\"";
|
char curdir[256];
|
||||||
x.erase(x.find_last_of('/'), std::string::npos);
|
if (!getcwd (curdir, countof(curdir)))
|
||||||
Printf("Opening folder to file: %s\n", file);
|
{
|
||||||
std::system(x.c_str());
|
Printf ("Current path too long\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string folder = file;
|
||||||
|
folder.erase(folder.find_last_of('/'), std::string::npos);
|
||||||
|
chdir(folder.c_str());
|
||||||
|
Printf("Opening folder: %s\n", folder.c_str());
|
||||||
|
std::system("xdg-open .");
|
||||||
|
chdir(curdir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue