Commit 61f64e1f authored by Marco Bubke's avatar Marco Bubke
Browse files

QmlDesigner: Skip the puppet creation



Task-number: QTCREATORBUG-12554
Change-Id: I664fa943e6b5399c01cdcb8cfe5cf72ba8b3ae58
Reviewed-by: default avatarTim Jenssen <tim.jenssen@digia.com>
parent b0ee5e60
......@@ -41,11 +41,13 @@ namespace QmlDesigner {
PuppetBuildProgressDialog::PuppetBuildProgressDialog() :
QDialog(Core::ICore::dialogParent()),
ui(new Ui::PuppetBuildProgressDialog),
m_lineCount(0)
m_lineCount(0),
m_useFallbackPuppet(false)
{
setWindowFlags(Qt::SplashScreen);
ui->setupUi(this);
ui->buildProgressBar->setMaximum(85);
connect(ui->useFallbackPuppetPushButton, SIGNAL(clicked()), this, SLOT(setUseFallbackPuppet()));
}
PuppetBuildProgressDialog::~PuppetBuildProgressDialog()
......@@ -56,13 +58,24 @@ PuppetBuildProgressDialog::~PuppetBuildProgressDialog()
void PuppetBuildProgressDialog::setProgress(int progress)
{
ui->buildProgressBar->setValue(progress);
QApplication::processEvents(QEventLoop::ExcludeUserInputEvents | QEventLoop::ExcludeSocketNotifiers);
QApplication::processEvents(QEventLoop::ExcludeSocketNotifiers);
}
bool PuppetBuildProgressDialog::useFallbackPuppet() const
{
return m_useFallbackPuppet;
}
void PuppetBuildProgressDialog::setUseFallbackPuppet()
{
m_useFallbackPuppet = true;
}
void PuppetBuildProgressDialog::newBuildOutput(const QByteArray &standardOutput)
{
m_lineCount += standardOutput.count('\n');
setProgress(m_lineCount);
qDebug() << m_lineCount;
}
}
......@@ -49,12 +49,16 @@ public:
~PuppetBuildProgressDialog();
void setProgress(int progress);
void newBuildOutput(const QByteArray &standardOutput);
bool useFallbackPuppet() const;
private slots:
void setUseFallbackPuppet();
private:
Ui::PuppetBuildProgressDialog *ui;
int m_lineCount;
bool m_useFallbackPuppet;
};
}
......
......@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>609</width>
<height>67</height>
<width>695</width>
<height>99</height>
</rect>
</property>
<property name="windowTitle">
......@@ -31,6 +31,33 @@
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="useFallbackPuppetPushButton">
<property name="text">
<string>Use fallback QML emulation layer</string>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
......
......@@ -195,7 +195,7 @@ bool PuppetCreator::build(const QString &qmlPuppetProjectFilePath) const
qmakeArguments.append(QStringLiteral("CONFIG+=release"));
#endif
qmakeArguments.append(qmlPuppetProjectFilePath);
buildSucceeded = startBuildProcess(buildDirectory.path(), qmakeCommand(), qmakeArguments);
buildSucceeded = startBuildProcess(buildDirectory.path(), qmakeCommand(), qmakeArguments, &progressDialog);
if (buildSucceeded) {
progressDialog.show();
QString buildingCommand = buildCommand();
......@@ -370,7 +370,7 @@ bool PuppetCreator::startBuildProcess(const QString &buildDirectoryPath,
process.setWorkingDirectory(buildDirectoryPath);
process.start(command, processArguments);
process.waitForStarted();
while (process.waitForReadyRead(-1)) {
while (!progressDialog->useFallbackPuppet() && process.waitForReadyRead(-1)) {
QByteArray newOutput = process.readAllStandardOutput();
if (progressDialog)
progressDialog->newBuildOutput(newOutput);
......@@ -380,10 +380,12 @@ bool PuppetCreator::startBuildProcess(const QString &buildDirectoryPath,
process.waitForFinished();
if (process.exitStatus() == QProcess::NormalExit && process.exitCode() == 0)
if (process.exitStatus() == QProcess::NormalExit
&& process.exitCode() == 0
&& !progressDialog->useFallbackPuppet())
return true;
else
return false;
return false;
}
QString PuppetCreator::puppetSourceDirectoryPath()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment