forked from qt-creator/qt-creator
QmlDesigner: Change the raw pointer to uniqeptr and rename the main file
Change-Id: I751359d65735b1be9b3e6b27946c23c278a78a6e Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
@@ -45,7 +45,7 @@ add_qtc_executable(qml2puppet
|
|||||||
INCLUDES
|
INCLUDES
|
||||||
${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
|
${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
SOURCES
|
SOURCES
|
||||||
qml2puppet/main.cpp
|
qml2puppet/qml2puppetmain.cpp
|
||||||
qml2puppet/qmlbase.h qml2puppet/appmetadata.h
|
qml2puppet/qmlbase.h qml2puppet/appmetadata.h
|
||||||
qml2puppet/qmlpuppet.h qml2puppet/qmlpuppet.cpp qml2puppet/configcrashpad.h
|
qml2puppet/qmlpuppet.h qml2puppet/qmlpuppet.cpp qml2puppet/configcrashpad.h
|
||||||
qmlpuppet.qrc
|
qmlpuppet.qrc
|
||||||
|
@@ -7,25 +7,24 @@
|
|||||||
#include "runner/qmlruntime.h"
|
#include "runner/qmlruntime.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
QmlBase *getQmlRunner(int &argc, char **argv)
|
auto getQmlRunner(int &argc, char **argv)
|
||||||
{
|
{
|
||||||
#ifdef ENABLE_INTERNAL_QML_RUNTIME
|
#ifdef ENABLE_INTERNAL_QML_RUNTIME
|
||||||
|
QString qmlRuntime("--qml-runtime");
|
||||||
for (int i = 0; i < argc; i++) {
|
for (int i = 0; i < argc; i++) {
|
||||||
if (!strcmp(argv[i], "--qml-runtime")){
|
if (!qmlRuntime.compare(QString::fromLocal8Bit(argv[i]))) {
|
||||||
qInfo() << "Starting QML Runtime";
|
qInfo() << "Starting QML Runtime";
|
||||||
return new QmlRuntime(argc, argv);
|
return std::unique_ptr<QmlBase>(new QmlRuntime(argc, argv));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
qInfo() << "Starting QML Puppet";
|
qInfo() << "Starting QML Puppet";
|
||||||
return new QmlPuppet(argc, argv);
|
return std::unique_ptr<QmlBase>(new QmlPuppet(argc, argv));
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
QDSMeta::Logging::registerMessageHandler();
|
QDSMeta::Logging::registerMessageHandler();
|
||||||
QDSMeta::AppInfo::registerAppInfo("Qml2Puppet");
|
QDSMeta::AppInfo::registerAppInfo("Qml2Puppet");
|
||||||
|
return getQmlRunner(argc, argv)->run();
|
||||||
QmlBase *qmlRunner = getQmlRunner(argc, argv);
|
|
||||||
return qmlRunner->run();
|
|
||||||
}
|
}
|
Reference in New Issue
Block a user