forked from qt-creator/qt-creator
QtSupport: Fix handling of not yet saved *.ui files
Since commitfb3e18bd4b
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 commit47312b04c0
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:
@@ -67,7 +67,7 @@ Utils::FilePath UicGenerator::command() const
|
|||||||
|
|
||||||
QStringList UicGenerator::arguments() const
|
QStringList UicGenerator::arguments() const
|
||||||
{
|
{
|
||||||
return {"-p", source().toString()};
|
return {"-p"};
|
||||||
}
|
}
|
||||||
|
|
||||||
FileNameToContentsHash UicGenerator::handleProcessFinished(QProcess *process)
|
FileNameToContentsHash UicGenerator::handleProcessFinished(QProcess *process)
|
||||||
@@ -87,6 +87,12 @@ FileNameToContentsHash UicGenerator::handleProcessFinished(QProcess *process)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void UicGenerator::handleProcessStarted(QProcess *process, const QByteArray &sourceContents)
|
||||||
|
{
|
||||||
|
process->write(sourceContents);
|
||||||
|
process->closeWriteChannel();
|
||||||
|
}
|
||||||
|
|
||||||
FileType UicGeneratorFactory::sourceType() const
|
FileType UicGeneratorFactory::sourceType() const
|
||||||
{
|
{
|
||||||
return FileType::Form;
|
return FileType::Form;
|
||||||
|
@@ -43,6 +43,7 @@ protected:
|
|||||||
Utils::FilePath command() const override;
|
Utils::FilePath command() const override;
|
||||||
QStringList arguments() const override;
|
QStringList arguments() const override;
|
||||||
ProjectExplorer::FileNameToContentsHash handleProcessFinished(QProcess *process) override;
|
ProjectExplorer::FileNameToContentsHash handleProcessFinished(QProcess *process) override;
|
||||||
|
void handleProcessStarted(QProcess *process, const QByteArray &sourceContents) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class UicGeneratorFactory : public ProjectExplorer::ExtraCompilerFactory
|
class UicGeneratorFactory : public ProjectExplorer::ExtraCompilerFactory
|
||||||
|
Reference in New Issue
Block a user