From 2ed13a3238663fce738d86b68b3c0ccb44c998b2 Mon Sep 17 00:00:00 2001 From: Filippo Cucchetto Date: Tue, 29 Dec 2015 15:50:43 +0100 Subject: [PATCH] Added auto when necessary --- lib/src/DOtherSide.cpp | 44 +++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/lib/src/DOtherSide.cpp b/lib/src/DOtherSide.cpp index 4912474..783152e 100644 --- a/lib/src/DOtherSide.cpp +++ b/lib/src/DOtherSide.cpp @@ -83,39 +83,39 @@ void dos_qqmlapplicationengine_create(void** vptr) void dos_qqmlapplicationengine_load(void* vptr, const char* filename) { - QQmlApplicationEngine* engine = reinterpret_cast(vptr); + auto engine = reinterpret_cast(vptr); engine->load(QUrl::fromLocalFile(QCoreApplication::applicationDirPath() + QDir::separator() + QString(filename))); } void dos_qqmlapplicationengine_load_url(void* vptr, void* url) { - QQmlApplicationEngine* engine = reinterpret_cast(vptr); - QUrl* qurl = reinterpret_cast(url); + auto engine = reinterpret_cast(vptr); + auto qurl = reinterpret_cast(url); engine->load(*qurl); } void dos_qqmlapplicationengine_load_data(void *vptr, const char *data) { - QQmlApplicationEngine* engine = reinterpret_cast(vptr); + auto engine = reinterpret_cast(vptr); engine->loadData(data); } void dos_qqmlapplicationengine_add_import_path(void* vptr, const char* path) { - QQmlApplicationEngine* engine = reinterpret_cast(vptr); + auto engine = reinterpret_cast(vptr); engine->addImportPath(QString(path)); } void dos_qqmlapplicationengine_context(void* vptr, void** context) { - QQmlApplicationEngine* engine = reinterpret_cast(vptr); + auto engine = reinterpret_cast(vptr); engine->rootContext(); *context = engine->rootContext(); } void dos_qqmlapplicationengine_rootObjects(void* vptr, void*** array, int* array_length) { - QQmlApplicationEngine* engine = reinterpret_cast(vptr); + auto engine = reinterpret_cast(vptr); QList list = engine->rootObjects(); auto objects = new QObject*[list.size()]; if (objects == nullptr) return; @@ -126,7 +126,7 @@ void dos_qqmlapplicationengine_rootObjects(void* vptr, void*** array, int* array void dos_qqmlapplicationengine_delete(void* vptr) { - QQmlApplicationEngine* engine = reinterpret_cast(vptr); + auto engine = reinterpret_cast(vptr); delete engine; } @@ -137,45 +137,45 @@ void dos_qquickview_create(void** vptr) void dos_qquickview_show(void* vptr) { - QQuickView* view = reinterpret_cast(vptr); + auto view = reinterpret_cast(vptr); view->show(); } void dos_qquickview_delete(void* vptr) { - QQuickView* view = reinterpret_cast(vptr); + auto view = reinterpret_cast(vptr); delete view; } void dos_qquickview_source(void* vptr, char** result) { - QQuickView* view = reinterpret_cast(vptr); + auto view = reinterpret_cast(vptr); QUrl url = view->source(); convert_to_cstring(url.toString(), result); } void dos_qquickview_set_source(void* vptr, const char* filename) { - QQuickView* view = reinterpret_cast(vptr); + auto view = reinterpret_cast(vptr); view->setSource(QUrl::fromLocalFile(QCoreApplication::applicationDirPath() + QDir::separator() + QString(filename))); } void dos_qquickview_set_source_url(void* vptr, void* url) { - QQuickView* view = reinterpret_cast(vptr); - QUrl* _url = reinterpret_cast(url); + auto view = reinterpret_cast(vptr); + auto _url = reinterpret_cast(url); view->setSource(*_url); } void dos_qquickview_set_resize_mode(void* vptr, int resizeMode) { - QQuickView* view = reinterpret_cast(vptr); + auto view = reinterpret_cast(vptr); view->setResizeMode((QQuickView::ResizeMode) resizeMode); } void dos_qquickview_rootContext(void* vptr, void** context) { - QQuickView* view = reinterpret_cast(vptr); + auto view = reinterpret_cast(vptr); *context = view->rootContext(); } @@ -191,14 +191,14 @@ void dos_qobjectptr_array_delete(void** ptr) void dos_qqmlcontext_baseUrl(void* vptr, char** result) { - QQmlContext* context = reinterpret_cast(vptr); + auto context = reinterpret_cast(vptr); QUrl url = context->baseUrl(); convert_to_cstring(url.toString(), result); } void dos_qqmlcontext_setcontextproperty(void* vptr, const char* name, void* value) { - QQmlContext* context = reinterpret_cast(vptr); + auto context = reinterpret_cast(vptr); auto variant = reinterpret_cast(value); context->setContextProperty(QString::fromUtf8(name), *variant); } @@ -399,13 +399,13 @@ void dos_qobject_signal_disconnect(void* senderVPtr, void dos_qobject_objectName(void* vptr, char** result) { - QObject* object = reinterpret_cast(vptr); + auto object = reinterpret_cast(vptr); convert_to_cstring(object->objectName(), result); } void dos_qobject_findChild(void* vptr, const char* name, int options, void** child) { - QObject* object = reinterpret_cast(vptr); + auto object = reinterpret_cast(vptr); *child = object->findChild(QString::fromUtf8(name), (Qt::FindChildOptions) options); } @@ -503,13 +503,13 @@ void dos_qurl_create(void** vptr, const char* url, int parsingMode) void dos_qurl_delete(void* vptr) { - QUrl* url = reinterpret_cast(vptr); + auto url = reinterpret_cast(vptr); delete url; } void dos_qurl_to_string(void* vptr, char** result) { - QUrl* url = reinterpret_cast(vptr); + auto url = reinterpret_cast(vptr); convert_to_cstring(url->toString(), result); }