QtSupport: Fix handling of not yet saved *.ui files

Since

  commit fb3e18bd4b
  Fix missing header guards in UI files

the uic input comes from a file (on disk) and thus the source contents
from the edited and not yet saved *.ui file (Designer mode) was ignored.

Revert the relevant part. This should not introduce a regression as

  commit 47312b04c0
  QtSupport: Fix header guard for ui files

basically superseded the first change, handling the proper inclusion of
the generated header file.

Fixes: QTCREATORBUG-22740
Change-Id: Iec6550817941eea99f823c377680b9a6fa5564e8
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Nikolai Kosjar
2019-07-18 16:09:54 +02:00
parent c65e480cbd
commit 524cdf54bc
2 changed files with 8 additions and 1 deletions

View File

@@ -67,7 +67,7 @@ Utils::FilePath UicGenerator::command() const
QStringList UicGenerator::arguments() const
{
return {"-p", source().toString()};
return {"-p"};
}
FileNameToContentsHash UicGenerator::handleProcessFinished(QProcess *process)
@@ -87,6 +87,12 @@ FileNameToContentsHash UicGenerator::handleProcessFinished(QProcess *process)
return result;
}
void UicGenerator::handleProcessStarted(QProcess *process, const QByteArray &sourceContents)
{
process->write(sourceContents);
process->closeWriteChannel();
}
FileType UicGeneratorFactory::sourceType() const
{
return FileType::Form;

View File

@@ -43,6 +43,7 @@ protected:
Utils::FilePath command() const override;
QStringList arguments() const override;
ProjectExplorer::FileNameToContentsHash handleProcessFinished(QProcess *process) override;
void handleProcessStarted(QProcess *process, const QByteArray &sourceContents) override;
};
class UicGeneratorFactory : public ProjectExplorer::ExtraCompilerFactory