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
Tobias Hunger
qt-creator
Commits
65a30b06
Commit
65a30b06
authored
Apr 12, 2010
by
Lasse Holmstedt
Browse files
Some more fixes to exception handling in bauhaus
Reviewed-by: thomas hartmann
parent
0f7db6de
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/plugins/qmldesigner/core/exceptions/exception.cpp
View file @
65a30b06
...
...
@@ -135,7 +135,7 @@ QString Exception::backTrace() const
*/
QString
Exception
::
description
()
const
{
return
QString
();
return
QString
(
"file: %1, function: %2, line: %3"
).
arg
(
m_file
,
m_function
,
QString
::
number
(
m_line
)
);
}
/*!
...
...
src/plugins/qmldesigner/core/exceptions/invalidargumentexception.cpp
View file @
65a30b06
...
...
@@ -28,6 +28,7 @@
**************************************************************************/
#include "invalidargumentexception.h"
#include <QString>
/*!
\class QmlDesigner::InvalidArgumentException
...
...
@@ -50,6 +51,15 @@ InvalidArgumentException::InvalidArgumentException(int line,
const
QString
&
argument
)
:
Exception
(
line
,
function
,
file
),
m_argument
(
argument
)
{
}
QString
InvalidArgumentException
::
description
()
const
{
if
(
function
()
==
"createNode"
)
return
QString
(
QObject
::
tr
(
"Failed to create item of type %1"
)).
arg
(
m_argument
);
return
Exception
::
description
();
}
/*!
...
...
src/plugins/qmldesigner/core/include/invalidargumentexception.h
View file @
65a30b06
...
...
@@ -45,6 +45,7 @@ public:
QString
type
()
const
;
QString
argument
()
const
;
QString
description
()
const
;
private:
const
QString
m_argument
;
...
...
src/plugins/qmldesigner/core/model/model.cpp
View file @
65a30b06
...
...
@@ -169,9 +169,9 @@ InternalNode::Pointer ModelPrivate::createNode(const QString &typeString,
const
QList
<
QPair
<
QString
,
QVariant
>
>
&
propertyList
)
{
if
(
typeString
.
isEmpty
())
throw
InvalidArgumentException
(
__LINE__
,
__FUNCTION__
,
__FILE__
,
"typeString"
);
throw
InvalidArgumentException
(
__LINE__
,
__FUNCTION__
,
__FILE__
,
tr
(
"invalid type"
)
);
if
(
!
m_metaInfo
.
nodeMetaInfo
(
typeString
).
isValid
())
throw
InvalidArgumentException
(
__LINE__
,
__FUNCTION__
,
__FILE__
,
"
typeString
"
);
throw
InvalidArgumentException
(
__LINE__
,
__FUNCTION__
,
__FILE__
,
typeString
);
InternalNode
::
Pointer
newInternalNodePointer
=
InternalNode
::
create
(
typeString
,
majorVersion
,
minorVersion
);
...
...
src/plugins/qmldesigner/designmodewidget.cpp
View file @
65a30b06
...
...
@@ -106,8 +106,10 @@ void DocumentWarningWidget::setError(const RewriterView::Error &error)
QString
str
;
if
(
error
.
type
()
==
RewriterView
::
Error
::
ParseError
)
{
str
=
tr
(
"%3 (%1:%2)"
).
arg
(
QString
::
number
(
error
.
line
()),
QString
::
number
(
error
.
column
()),
error
.
description
());
m_goToError
->
show
();
}
else
if
(
error
.
type
()
==
RewriterView
::
Error
::
InternalError
)
{
str
=
tr
(
"Internal error (%1)"
)
.
arg
(
error
.
description
());
str
=
tr
(
"Internal error (%1)"
).
arg
(
error
.
description
());
m_goToError
->
hide
();
}
m_errorMessage
->
setText
(
str
);
...
...
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