Revert "Backported 2e3729ab22 to master; redo assemblePath for Win. redo openscad.com to handle spaces in filenames"

This reverts commit 55192e46a4.
issue406^2
Marius Kintel 2014-02-17 20:53:09 -05:00
parent d2024c12bb
commit 7bb18bae69
2 changed files with 4 additions and 16 deletions

View File

@ -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()

View File

@ -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, " " );
if (quotify_arg) strcat( cmd, "\"");
strcat( cmd, argv[i] );
if (quotify_arg) strcat( cmd, "\"");
}
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 ) {