Skip to content

Commit 62a78e7

Browse files
author
hekra
committed
add log
1 parent 9f7fe69 commit 62a78e7

File tree

4 files changed

+10
-13
lines changed

4 files changed

+10
-13
lines changed

src/webdriver/extension_qt/qml_view_util.cc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ QQmlEngine* QQmlViewUtil::getQMLEngine(QQuickWindow* qquickWindow) {
122122
return NULL;
123123
}
124124

125-
void QQmlViewUtil::setSource(const QUrl &url, bool sync, QQuickWindow* qquickWindow) {
125+
void QQmlViewUtil::setSource(const Logger& logger, const QUrl &url, bool sync, QQuickWindow* qquickWindow) {
126126
QQuickView* pView = qobject_cast<QQuickView*>(qquickWindow);
127127

128128
if (pView != NULL) {
@@ -134,8 +134,14 @@ void QQmlViewUtil::setSource(const QUrl &url, bool sync, QQuickWindow* qquickWin
134134
if (QQuickView::Loading == pView->status()) {
135135
loop.exec();
136136
}
137+
138+
if (QQuickView::Ready != pView->status()) {
139+
logger.Log(kWarningLogLevel, "QML sync load, smth wrong. View is not in READY state.");
140+
}
141+
137142
} else {
138143
pView->setSource(url);
144+
logger.Log(kFineLogLevel, "QML async load - ");
139145
}
140146
}
141147
else {

src/webdriver/extension_qt/qml_view_util.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include <QtCore/QDebug>
2626

2727
#include "common_util.h"
28+
#include "webdriver_logging.h"
2829

2930
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
3031
class QWindow;
@@ -53,7 +54,7 @@ class QQmlViewUtil {
5354
static QWindow* getQWindowView(Session* session, const ViewId& viewId);
5455
static QQuickWindow* getQMLView(Session* session, const ViewId& viewId);
5556
static QQmlEngine* getQMLEngine(QQuickWindow* qquickWindow);
56-
static void setSource(const QUrl &url, bool sync, QQuickWindow* qquickWindow);
57+
static void setSource(const Logger& logger, const QUrl &url, bool sync, QQuickWindow* qquickWindow);
5758
static const QUrl getSource(QQuickWindow* qquickWindow);
5859
#else
5960
static QDeclarativeView* getQMLView(Session* session, const ViewId& viewId);

src/webdriver/extension_qt/quick2_view_enumerator.cc

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,23 +38,13 @@ void Quick2ViewEnumeratorImpl::EnumerateViews(Session* session, std::set<ViewId>
3838

3939
foreach(QWindow* pWindow, QGuiApplication::allWindows())
4040
{
41-
session->logger().Log(kInfoLogLevel,
42-
"Quick2ViewEnumerator found new view ");
4341
if (!pWindow->isVisible()) continue;
44-
session->logger().Log(kInfoLogLevel,
45-
"Quick2ViewEnumerator found new view visible ");
4642

4743
QQuickWindow* pView = qobject_cast<QQuickWindow*>(pWindow);
4844
if (pView != NULL) {
49-
session->logger().Log(kInfoLogLevel,
50-
"Quick2ViewEnumerator found new view QQuickWindow ");
51-
5245
ViewHandlePtr handle(new QWindowViewHandle(pView));
5346
ViewId viewId = session->GetViewForHandle(handle);
5447
if (!viewId.is_valid()) {
55-
session->logger().Log(kInfoLogLevel,
56-
"Quick2ViewEnumerator found new view is_valid");
57-
5848
if (session->AddNewView(handle, &viewId)) {
5949
session->logger().Log(kInfoLogLevel,
6050
"Quick2ViewEnumerator found new view("+viewId.id()+")");

src/webdriver/extension_qt/quick2_view_executor.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@ void Quick2ViewCmdExecutor::NavigateToURL(const std::string& url, bool sync, Err
776776
rootContext->setContextProperty("QmlWindow", view);
777777
}
778778

779-
QQmlViewUtil::setSource(address, sync, view);
779+
QQmlViewUtil::setSource(session_->logger(), address, sync, view);
780780
}
781781

782782
void Quick2ViewCmdExecutor::GetURL(std::string* url, Error** error) {

0 commit comments

Comments
 (0)