Skip to content
GitLab
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
fa79add2
Commit
fa79add2
authored
Jun 02, 2010
by
Christian Kamm
Browse files
QmlJS: Check for existance of qmldump binary before using it.
parent
f9d78727
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/libs/qmljs/qmljsinterpreter.cpp
View file @
fa79add2
...
...
@@ -1933,6 +1933,24 @@ const Value *Function::invoke(const Activation *activation) const
// typing environment
////////////////////////////////////////////////////////////////////////////////
CppQmlTypesLoader
::
CppQmlTypesLoader
()
{
QDir
qmldumpExecutable
(
QCoreApplication
::
applicationDirPath
());
#ifndef Q_OS_WIN
m_qmldumpPath
=
qmldumpExecutable
.
absoluteFilePath
(
QLatin1String
(
"qmldump"
));
#else
m_qmldumpPath
=
qmldumpExecutable
.
absoluteFilePath
(
QLatin1String
(
"qmldump.exe"
));
#endif
QFileInfo
qmldumpFileInfo
(
m_qmldumpPath
);
if
(
!
qmldumpFileInfo
.
exists
())
{
qWarning
()
<<
"QmlJS::Interpreter::CppQmlTypesLoader: qmldump executable does not exist at"
<<
m_qmldumpPath
;
m_qmldumpPath
.
clear
();
}
else
if
(
!
qmldumpFileInfo
.
isFile
())
{
qWarning
()
<<
"QmlJS::Interpreter::CppQmlTypesLoader: "
<<
m_qmldumpPath
<<
" is not a file"
;
m_qmldumpPath
.
clear
();
}
}
CppQmlTypesLoader
*
CppQmlTypesLoader
::
instance
()
{
static
CppQmlTypesLoader
_instance
;
...
...
@@ -1966,10 +1984,12 @@ QStringList CppQmlTypesLoader::load(const QFileInfoList &xmlFiles)
void
CppQmlTypesLoader
::
loadPluginTypes
(
const
QString
&
pluginPath
)
{
if
(
m_qmldumpPath
.
isEmpty
())
return
;
QProcess
*
process
=
new
QProcess
(
this
);
connect
(
process
,
SIGNAL
(
finished
(
int
)),
SLOT
(
processDone
(
int
)));
QDir
qmldumpExecutable
(
QCoreApplication
::
applicationDirPath
());
process
->
start
(
qmldumpExecutable
.
filePath
(
"qmldump"
),
QStringList
(
pluginPath
));
process
->
start
(
m_qmldumpPath
,
QStringList
(
pluginPath
));
}
void
CppQmlTypesLoader
::
processDone
(
int
exitCode
)
...
...
src/libs/qmljs/qmljsinterpreter.h
View file @
fa79add2
...
...
@@ -516,6 +516,7 @@ class QMLJS_EXPORT CppQmlTypesLoader : public QObject
{
Q_OBJECT
public:
CppQmlTypesLoader
();
static
CppQmlTypesLoader
*
instance
();
QHash
<
QString
,
FakeMetaObject
*>
objects
;
...
...
@@ -530,6 +531,7 @@ private slots:
private:
void
addObjects
(
QMap
<
QString
,
FakeMetaObject
*>
&
newObjects
);
QString
m_qmldumpPath
;
};
class
QMLJS_EXPORT
CppQmlTypes
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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