remove pretenses of supporting projects on stdin

this may have worked a decade ago, but now it only produces funny
Makefiles (and needs hacking main.cpp). the feature doesn't seem *too*
important, so just clean it out.

Change-Id: I50a60b0e30341f0b523e4a5731c770c9c1013f8b
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
This commit is contained in:
Oswald Buddenhagen 2012-08-28 10:12:36 +02:00 committed by Qt by Nokia
parent 791cb02463
commit b32f3ba9e4
6 changed files with 13 additions and 28 deletions

View File

@ -461,9 +461,7 @@ ProjectBuilderSources::files(QMakeProject *project) const
{
QStringList ret = project->values(key);
if(key == "QMAKE_INTERNAL_INCLUDED_FILES") {
QString pfile = project->projectFile();
if(pfile != "(stdin)")
ret.prepend(pfile);
ret.prepend(project->projectFile());
for(int i = 0; i < ret.size(); ++i) {
QStringList newret;
if(!ret.at(i).endsWith(Option::prf_ext))
@ -496,7 +494,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
<< "\t" << "objects = {" << endl;
//MAKE QMAKE equivelant
if(!project->isActiveConfig("no_autoqmake") && project->projectFile() != "(stdin)") {
if (!project->isActiveConfig("no_autoqmake")) {
QString mkfile = pbx_dir + Option::dir_sep + "qt_makeqmake.mak";
QFile mkf(mkfile);
if(mkf.open(QIODevice::WriteOnly | QIODevice::Text)) {

View File

@ -961,8 +961,7 @@ MakefileGenerator::writePrlFile(QTextStream &t)
bdir = qmake_getpwd();
t << "QMAKE_PRL_BUILD_DIR = " << bdir << endl;
if(!project->projectFile().isEmpty() && project->projectFile() != "-")
t << "QMAKE_PRO_INPUT = " << project->projectFile().section('/', -1) << endl;
t << "QMAKE_PRO_INPUT = " << project->projectFile().section('/', -1) << endl;
if(!project->isEmpty("QMAKE_ABSOLUTE_SOURCE_PATH"))
t << "QMAKE_PRL_SOURCE_DIR = " << project->first("QMAKE_ABSOLUTE_SOURCE_PATH") << endl;
@ -2595,11 +2594,10 @@ MakefileGenerator::writeMakeQmake(QTextStream &t, bool noDummyQmakeAll)
<< "@$(QMAKE) -prl " << buildArgs() << " " << files.join(" ") << endl;
}
QString pfile = project->projectFile();
if(pfile != "(stdin)") {
QString qmake = build_args();
if(!ofile.isEmpty() && !project->isActiveConfig("no_autoqmake")) {
t << escapeFilePath(ofile) << ": " << escapeDependencyPath(fileFixify(pfile)) << " ";
t << escapeFilePath(ofile) << ": "
<< escapeDependencyPath(fileFixify(project->projectFile())) << " ";
if (Option::mkfile::do_cache) {
if (!project->confFile().isEmpty())
t << escapeDependencyPath(fileFixify(project->confFile())) << " ";
@ -2624,7 +2622,6 @@ MakefileGenerator::writeMakeQmake(QTextStream &t, bool noDummyQmakeAll)
if (!noDummyQmakeAll)
t << "qmake_all: FORCE" << endl << endl;
}
}
}
QFileInfo

View File

@ -163,8 +163,7 @@ int runQMake(int argc, char **argv)
// read project..
if(!project.read(fn)) {
fprintf(stderr, "Error processing project file: %s\n",
fn == QLatin1String("-") ?
"(stdin)" : QDir::toNativeSeparators(*pfile).toLatin1().constData());
QDir::toNativeSeparators(*pfile).toLatin1().constData());
exit_val = 3;
continue;
}

View File

@ -512,8 +512,7 @@ Option::init(int argc, char **argv)
void Option::prepareProject(const QString &pfile)
{
QString srcpath = (pfile != "-")
? QDir::cleanPath(QFileInfo(pfile).absolutePath()) : qmake_getpwd();
QString srcpath = QDir::cleanPath(QFileInfo(pfile).absolutePath());
if (srcpath != output_dir) {
if (!srcpath.endsWith(QLatin1Char('/')))
srcpath += QLatin1Char('/');

View File

@ -1279,13 +1279,9 @@ QMakeProject::read(const QString &file, QHash<QString, QStringList> &place)
const QString oldpwd = qmake_getpwd();
QString filename = Option::normalizePath(file, false);
bool ret = false, using_stdin = false;
bool ret = false;
QFile qfile;
if(filename == QLatin1String("-")) {
qfile.setFileName("");
ret = qfile.open(stdin, QIODevice::ReadOnly);
using_stdin = true;
} else if(QFileInfo(file).isDir()) {
if (QFileInfo(file).isDir()) {
return false;
} else {
qfile.setFileName(filename);
@ -1306,8 +1302,7 @@ QMakeProject::read(const QString &file, QHash<QString, QStringList> &place)
QTextStream t(&qfile);
ret = read(t, place);
}
if(!using_stdin)
qfile.close();
qfile.close();
}
if (!need_restart && scope_blocks.count() != 1) {
qmake_error_msg("Unterminated conditional block at end of file");
@ -1561,7 +1556,7 @@ QMakeProject::read(uchar cmd)
if(cmd & ReadProFile) { // parse project file
debug_msg(1, "Project file: reading %s", pfile.toLatin1().constData());
if(pfile != "-" && !QFile::exists(pfile) && !pfile.endsWith(Option::pro_ext))
if (!QFile::exists(pfile) && !pfile.endsWith(Option::pro_ext))
pfile += Option::pro_ext;
if(!read(pfile, vars))
return false;
@ -1627,8 +1622,7 @@ void
QMakeProject::setupProject()
{
setTemplate(vars["TEMPLATE"]);
if (pfile != "-")
vars["TARGET"] << QFileInfo(pfile).baseName();
vars["TARGET"] << QFileInfo(pfile).baseName();
vars["_PRO_FILE_"] << pfile;
vars["_PRO_FILE_PWD_"] << (pfile.isEmpty() ? qmake_getpwd() : QFileInfo(pfile).absolutePath());
vars["OUT_PWD"] << Option::output_dir;
@ -2640,7 +2634,7 @@ QMakeProject::doProjectExpand(QString func, QList<QStringList> args_list,
if(args.count() != 1) {
fprintf(stderr, "%s:%d prompt(question) requires one argument.\n",
parser.file.toLatin1().constData(), parser.line_no);
} else if(pfile == "-") {
} else if (Option::output.fileName() == "-") {
fprintf(stderr, "%s:%d prompt(question) cannot be used when '-o -' is used.\n",
parser.file.toLatin1().constData(), parser.line_no);
} else {

View File

@ -188,8 +188,6 @@ Q_DECLARE_METATYPE(QMakeProject*)
inline QString QMakeProject::projectFile()
{
if (pfile == "-")
return QString("(stdin)");
return pfile;
}