forked from qt-creator/qt-creator
Revert "QmlDesigner.NodeInstanceView: introducing delay in setPathToQt()"
This reverts commit 94011a12f1. It was a
hot fix which is not needed anymore.
Change-Id: I64ad1d6be54982ddd9b0ef790508a15bd0f73f72
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
This commit is contained in:
committed by
Thomas Hartmann
parent
54ed620f35
commit
26b51c7a95
@@ -43,7 +43,6 @@
|
|||||||
#include <QWeakPointer>
|
#include <QWeakPointer>
|
||||||
#include <QRectF>
|
#include <QRectF>
|
||||||
#include <QTime>
|
#include <QTime>
|
||||||
#include <QTimer>
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
class QDeclarativeEngine;
|
class QDeclarativeEngine;
|
||||||
@@ -197,11 +196,9 @@ private: // functions
|
|||||||
void resetVerticalAnchors(const ModelNode &node);
|
void resetVerticalAnchors(const ModelNode &node);
|
||||||
|
|
||||||
void restartProcess();
|
void restartProcess();
|
||||||
void restartProcessDelayed();
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void handleChrash();
|
void handleChrash();
|
||||||
void restartProcessDelayedTimeOut();
|
|
||||||
|
|
||||||
private: //variables
|
private: //variables
|
||||||
NodeInstance m_rootNodeInstance;
|
NodeInstance m_rootNodeInstance;
|
||||||
@@ -216,8 +213,6 @@ private: //variables
|
|||||||
QTime m_lastCrashTime;
|
QTime m_lastCrashTime;
|
||||||
NodeInstanceServerInterface::RunModus m_runModus;
|
NodeInstanceServerInterface::RunModus m_runModus;
|
||||||
QString m_pathToQt;
|
QString m_pathToQt;
|
||||||
bool m_puppetRestarted;
|
|
||||||
QTimer m_singleShotTimerRestartProcessDelayed;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ProxyNodeInstanceView
|
} // namespace ProxyNodeInstanceView
|
||||||
|
|||||||
@@ -103,13 +103,9 @@ d too.
|
|||||||
NodeInstanceView::NodeInstanceView(QObject *parent, NodeInstanceServerInterface::RunModus runModus)
|
NodeInstanceView::NodeInstanceView(QObject *parent, NodeInstanceServerInterface::RunModus runModus)
|
||||||
: AbstractView(parent),
|
: AbstractView(parent),
|
||||||
m_baseStatePreviewImage(QSize(100, 100), QImage::Format_ARGB32),
|
m_baseStatePreviewImage(QSize(100, 100), QImage::Format_ARGB32),
|
||||||
m_runModus(runModus),
|
m_runModus(runModus)
|
||||||
m_puppetRestarted(false)
|
|
||||||
{
|
{
|
||||||
m_baseStatePreviewImage.fill(0xFFFFFF);
|
m_baseStatePreviewImage.fill(0xFFFFFF);
|
||||||
m_singleShotTimerRestartProcessDelayed.setSingleShot(true);
|
|
||||||
m_singleShotTimerRestartProcessDelayed.setInterval(400);
|
|
||||||
connect(&m_singleShotTimerRestartProcessDelayed, SIGNAL(timeout()), this, SLOT(restartProcessDelayedTimeOut()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -194,15 +190,10 @@ void NodeInstanceView::handleChrash()
|
|||||||
emit qmlPuppetCrashed();
|
emit qmlPuppetCrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
void NodeInstanceView::restartProcessDelayedTimeOut()
|
|
||||||
{
|
|
||||||
if (!m_puppetRestarted)
|
|
||||||
restartProcess();
|
|
||||||
}
|
|
||||||
|
|
||||||
void NodeInstanceView::restartProcess()
|
void NodeInstanceView::restartProcess()
|
||||||
{
|
{
|
||||||
m_puppetRestarted = true;
|
|
||||||
if (model()) {
|
if (model()) {
|
||||||
delete nodeInstanceServer();
|
delete nodeInstanceServer();
|
||||||
|
|
||||||
@@ -220,12 +211,6 @@ void NodeInstanceView::restartProcess()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void NodeInstanceView::restartProcessDelayed()
|
|
||||||
{
|
|
||||||
m_puppetRestarted = false;
|
|
||||||
m_singleShotTimerRestartProcessDelayed.start();
|
|
||||||
}
|
|
||||||
|
|
||||||
void NodeInstanceView::nodeCreated(const ModelNode &createdNode)
|
void NodeInstanceView::nodeCreated(const ModelNode &createdNode)
|
||||||
{
|
{
|
||||||
NodeInstance instance = loadNode(createdNode);
|
NodeInstance instance = loadNode(createdNode);
|
||||||
@@ -1136,16 +1121,7 @@ void NodeInstanceView::setPathToQt(const QString &pathToQt)
|
|||||||
{
|
{
|
||||||
if (m_pathToQt != pathToQt) {
|
if (m_pathToQt != pathToQt) {
|
||||||
m_pathToQt = pathToQt;
|
m_pathToQt = pathToQt;
|
||||||
|
restartProcess();
|
||||||
/* The restart is done delayed, because when creating a new project we switch to that project
|
|
||||||
* before we open the new file. This means the user can get an error about a missing puppet,
|
|
||||||
* because the new project is based on another Qt version.
|
|
||||||
*
|
|
||||||
* See QTCREATORBUG-8756 for more details.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
restartProcessDelayed();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user