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
628375a5
Commit
628375a5
authored
May 11, 2010
by
Marco Bubke
Committed by
Kai Koehne
May 17, 2010
Browse files
Extent the rewriter exception with a document text attribute
This makes it easier to find problems. Reviewed-by: kkoehne
parent
386dac2c
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/plugins/qmldesigner/designercore/exceptions/rewritingexception.cpp
View file @
628375a5
...
...
@@ -4,8 +4,10 @@ using namespace QmlDesigner;
RewritingException
::
RewritingException
(
int
line
,
const
QString
&
function
,
const
QString
&
file
,
const
QString
&
description
)
:
Exception
(
line
,
function
,
file
),
m_description
(
description
)
const
QString
&
file
,
const
QString
&
description
,
const
QString
&
documentTextContent
)
:
Exception
(
line
,
function
,
file
),
m_description
(
description
),
m_documentTextContent
(
documentTextContent
)
{
}
...
...
@@ -18,3 +20,8 @@ QString RewritingException::description() const
{
return
m_description
;
}
QString
RewritingException
::
documentTextContent
()
const
{
return
m_documentTextContent
;
}
src/plugins/qmldesigner/designercore/include/rewriterview.h
View file @
628375a5
...
...
@@ -134,6 +134,7 @@ public:
TextModifier
*
textModifier
()
const
;
void
setTextModifier
(
TextModifier
*
textModifier
);
QString
textModifierContent
()
const
;
Internal
::
ModelNodePositionStorage
*
positionStorage
()
const
{
return
m_positionStorage
;
}
...
...
src/plugins/qmldesigner/designercore/include/rewritingexception.h
View file @
628375a5
...
...
@@ -10,12 +10,16 @@ class RewritingException: public Exception
public:
RewritingException
(
int
line
,
const
QString
&
function
,
const
QString
&
file
,
const
QString
&
description
);
const
QString
&
file
,
const
QString
&
description
,
const
QString
&
documentTextContent
);
virtual
QString
type
()
const
;
virtual
QString
description
()
const
;
QString
documentTextContent
()
const
;
private:
QString
m_description
;
QString
m_documentTextContent
;
};
}
// namespace QmlDesigner
...
...
src/plugins/qmldesigner/designercore/model/model.cpp
View file @
628375a5
...
...
@@ -403,7 +403,7 @@ void ModelPrivate::resetModelByRewriter(const QString &description)
}
Q_ASSERT
(
rewriterView
);
rewriterView
->
resetToLastCorrectQml
();
throw
RewritingException
(
__LINE__
,
__FUNCTION__
,
__FILE__
,
description
);
throw
RewritingException
(
__LINE__
,
__FUNCTION__
,
__FILE__
,
description
,
rewriterView
->
textModifierContent
()
);
}
...
...
src/plugins/qmldesigner/designercore/model/rewriterview.cpp
View file @
628375a5
...
...
@@ -382,6 +382,14 @@ void RewriterView::setTextModifier(TextModifier *textModifier)
connect
(
m_textModifier
,
SIGNAL
(
textChanged
()),
this
,
SLOT
(
qmlTextChanged
()));
}
QString
RewriterView
::
textModifierContent
()
const
{
if
(
textModifier
())
return
textModifier
()
->
text
();
return
QString
();
}
void
RewriterView
::
applyModificationGroupChanges
()
{
Q_ASSERT
(
transactionLevel
==
0
);
...
...
@@ -397,7 +405,7 @@ void RewriterView::applyChanges()
if
(
inErrorState
())
{
qDebug
()
<<
"RewriterView::applyChanges() got called while in error state. Will do a quick-exit now."
;
throw
RewritingException
(
__LINE__
,
__FUNCTION__
,
__FILE__
,
"RewriterView::applyChanges() already in error state"
);
throw
RewritingException
(
__LINE__
,
__FUNCTION__
,
__FILE__
,
"RewriterView::applyChanges() already in error state"
,
textModifierContent
()
);
}
try
{
...
...
@@ -410,7 +418,7 @@ void RewriterView::applyChanges()
}
if
(
inErrorState
())
{
throw
RewritingException
(
__LINE__
,
__FUNCTION__
,
__FILE__
,
m_rewritingErrorMessage
);
throw
RewritingException
(
__LINE__
,
__FUNCTION__
,
__FILE__
,
m_rewritingErrorMessage
,
textModifierContent
()
);
}
}
...
...
Write
Preview
Markdown
is supported
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