Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
56bb5449
Commit
56bb5449
authored
Jan 13, 2011
by
Marco Bubke
Browse files
QmlDesigner: Prevent endless restart of qmlpuppet
parent
8512f1ed
Changes
3
Show whitespace changes
Inline
Side-by-side
src/plugins/qmldesigner/designercore/include/nodeinstanceview.h
View file @
56bb5449
...
...
@@ -46,6 +46,7 @@
#include <QImage>
#include <QWeakPointer>
#include <QRectF>
#include <QTime>
QT_BEGIN_NAMESPACE
class
QDeclarativeEngine
;
...
...
@@ -165,9 +166,11 @@ private: // functions
void
resetHorizontalAnchors
(
const
ModelNode
&
node
);
void
resetVerticalAnchors
(
const
ModelNode
&
node
);
private
slots
:
void
restartProcess
();
private
slots
:
void
handleChrash
();
private:
//variables
NodeInstance
m_rootNodeInstance
;
NodeInstance
m_activeStateInstance
;
...
...
@@ -178,6 +181,7 @@ private: //variables
uint
m_blockUpdates
;
QWeakPointer
<
NodeInstanceServerInterface
>
m_nodeInstanceServer
;
QImage
m_baseStatePreviewImage
;
QTime
m_lastCrashTime
;
};
}
// namespace ProxyNodeInstanceView
...
...
src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.cpp
View file @
56bb5449
...
...
@@ -159,10 +159,11 @@ void NodeInstanceServerProxy::writeCommand(const QVariant &command)
writeCommandToSocket
(
command
,
m_secondSocket
.
data
());
}
void
NodeInstanceServerProxy
::
processFinished
(
int
/*exitCode*/
,
QProcess
::
ExitStatus
/*
exitStatus
*/
)
void
NodeInstanceServerProxy
::
processFinished
(
int
/*exitCode*/
,
QProcess
::
ExitStatus
exitStatus
)
{
m_firstSocket
->
close
();
m_secondSocket
->
close
();
if
(
exitStatus
==
QProcess
::
CrashExit
)
emit
processCrashed
();
}
...
...
src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp
View file @
56bb5449
...
...
@@ -142,7 +142,8 @@ void NodeInstanceView::modelAttached(Model *model)
{
AbstractView
::
modelAttached
(
model
);
m_nodeInstanceServer
=
new
NodeInstanceServerProxy
(
this
);
connect
(
m_nodeInstanceServer
.
data
(),
SIGNAL
(
processCrashed
()),
this
,
SLOT
(
restartProcess
()));
m_lastCrashTime
.
start
();
connect
(
m_nodeInstanceServer
.
data
(),
SIGNAL
(
processCrashed
()),
this
,
SLOT
(
handleChrash
()));
nodeInstanceServer
()
->
createScene
(
createCreateSceneCommand
());
}
...
...
@@ -155,6 +156,13 @@ void NodeInstanceView::modelAboutToBeDetached(Model * model)
AbstractView
::
modelAboutToBeDetached
(
model
);
}
void
NodeInstanceView
::
handleChrash
()
{
int
elaspsedTimeSinceLastCrash
=
m_lastCrashTime
.
restart
();
if
(
elaspsedTimeSinceLastCrash
>
10000
)
restartProcess
();
}
void
NodeInstanceView
::
restartProcess
()
{
...
...
@@ -162,7 +170,7 @@ void NodeInstanceView::restartProcess()
delete
nodeInstanceServer
();
m_nodeInstanceServer
=
new
NodeInstanceServerProxy
(
this
);
connect
(
m_nodeInstanceServer
.
data
(),
SIGNAL
(
processCrashed
()),
this
,
SLOT
(
restartProcess
()));
connect
(
m_nodeInstanceServer
.
data
(),
SIGNAL
(
processCrashed
()),
this
,
SLOT
(
handleChrash
()));
nodeInstanceServer
()
->
createScene
(
createCreateSceneCommand
());
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment