mirror of https://github.com/vitalif/openscad
Revert "Backported 2e3729ab22
to master; redo assemblePath for Win. redo openscad.com to handle spaces in filenames"
This reverts commit 55192e46a4
.
issue406^2
parent
d2024c12bb
commit
7bb18bae69
|
@ -453,16 +453,12 @@ int cmdline(const char *deps_output_file, const std::string &filename, Camera &c
|
|||
#include <QApplication>
|
||||
#include <QString>
|
||||
#include <QDir>
|
||||
#include <QFileInfo>
|
||||
|
||||
// Only if "fileName" is not absolute, prepend the "absoluteBase".
|
||||
static QString assemblePath(const fs::path& absoluteBaseDir,
|
||||
static QString assemblePath(const fs::path& absoluteBase,
|
||||
const string& fileName) {
|
||||
if (fileName.empty()) return "";
|
||||
QString qsDir( boosty::stringy( absoluteBaseDir ).c_str() );
|
||||
QString qsFile( fileName.c_str() );
|
||||
QFileInfo info( qsDir, qsFile ); // if qsfile is absolute, dir is ignored.
|
||||
return info.absoluteFilePath();
|
||||
return fileName.empty() ? "" : QDir(QString::fromStdString((const string&) absoluteBase))
|
||||
.absoluteFilePath(QString::fromStdString(fileName));
|
||||
}
|
||||
|
||||
bool QtUseGUI()
|
||||
|
|
|
@ -40,24 +40,16 @@ int main( int argc, char * argv[] )
|
|||
int eof = 0;
|
||||
int pclose_result;
|
||||
int i;
|
||||
const char * argchar;
|
||||
int result = 0;
|
||||
int quotify_arg = 0;
|
||||
|
||||
strcat( cmd, "\0" );
|
||||
strcat( cmd, "openscad.exe" );
|
||||
for ( i = 1 ; i < argc ; ++i ) {
|
||||
quotify_arg = 0;
|
||||
for ( argchar = argv[i]; *argchar!=0; argchar++ ) {
|
||||
if ((char)(*argchar)==' ') quotify_arg = 1;
|
||||
strcat( cmd, " " );
|
||||
strcat( cmd, argv[i] );
|
||||
}
|
||||
strcat( cmd, " ");
|
||||
if (quotify_arg) strcat( cmd, "\"");
|
||||
strcat( cmd, argv[i] );
|
||||
if (quotify_arg) strcat( cmd, "\"");
|
||||
}
|
||||
strcat( cmd, " 2>&1"); // capture stderr and stdout
|
||||
printf("openscad.com: running command: %s\n", cmd );
|
||||
|
||||
cmd_stdout = _popen( cmd, "rt" );
|
||||
if ( cmd_stdout == NULL ) {
|
||||
|
|
Loading…
Reference in New Issue