Skip to content
Snippets Groups Projects
Verified Commit 06da8c66 authored by Burak Hançerli's avatar Burak Hançerli :headphones:
Browse files

fix: QDS-11409 and QDS-11410

parent 4c852b5d
No related branches found
No related tags found
No related merge requests found
......@@ -11,7 +11,7 @@
android:allowNativeHeapPointerTagging="false" android:icon="@mipmap/app_icon">
<activity android:name="org.qtproject.qt.android.bindings.QtActivity"
android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation|mcc|mnc|density"
android:label="Qt UI Viewer" android:launchMode="singleTop"
android:label="Qt UI Viewer" android:launchMode="singleTask"
android:screenOrientation="unspecified" android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
......
......@@ -44,7 +44,6 @@ public:
void setLogs(const QString &logs)
{
m_logs = logs;
qDebug() << "emitting logs changed signal";
emit logsChanged(m_logs);
}
......
......@@ -64,6 +64,14 @@ void messageHandler(QtMsgType type, const QMessageLogContext &context, const QSt
newLog += logPrefix + localMsg + logSuffix + "\n";
__android_log_print(ANDROID_LOG_DEBUG, "Qt_UI_Viewer", "%s", qPrintable(newLog));
static int logCounter = 0;
if (logCounter++ == 100) {
// remove the first line
int index = appLogs.indexOf('\n');
if (index > 0)
appLogs.remove(0, index + 1);
logCounter = 99;
}
if (backend)
backend->setLogs(appLogs += newLog);
}
......
......@@ -246,6 +246,7 @@ bool ProjectManager::runProject(const QString &projectPath)
qDebug() << "Loading mainQmlUrl: " << mainQmlUrl.toString();
m_qmlComponent.reset(new QQmlComponent(m_qmlEngine.data()));
m_qmlComponent->loadUrl(mainQmlUrl);
qDebug() << "Waiting for qmlComponent to load";
......@@ -333,7 +334,7 @@ bool ProjectManager::cacheProject(const QByteArray &projectData, const QJsonObje
const QString filePath = it.filePath();
const QString relativeFilePath = filePath.mid(tempProjectPath.length());
const QString newFilePath = cachePath + relativeFilePath;
qDebug() << "Copying " << filePath << " to " << newFilePath;
if (QFileInfo(filePath).isDir()) {
QDir().mkpath(newFilePath);
} else {
......@@ -425,7 +426,7 @@ bool ProjectManager::cacheDemoProject(const QByteArray &projectData, const QStri
const QString filePath = it.filePath();
const QString relativeFilePath = filePath.mid(tempProjectPath.length());
const QString newFilePath = demoProjectPath + relativeFilePath;
qDebug() << "Copying " << filePath << " to " << newFilePath;
if (QFileInfo(filePath).isDir()) {
QDir().mkpath(newFilePath);
} else if (!QFile::copy(filePath, newFilePath)) {
......@@ -494,16 +495,20 @@ void ProjectManager::orientateWindow(Qt::ScreenOrientation orientation)
void ProjectManager::showAppWindow()
{
qDebug("Initializing and showing the QML app window");
QScreen *screen = QGuiApplication::primaryScreen();
connect(screen, &QScreen::orientationChanged, this, &ProjectManager::orientateWindow);
orientateWindow(screen->orientation());
qDebug("Initializing and showing the QML app window");
connect(m_quickWindow.data(), &QQuickWindow::closing, this, [this]() {
connect(m_quickWindow.data(), &QQuickWindow::closing, this, [this, screen]() {
qDebug() << "QML app window is closing";
m_qmlEngine.reset();
m_qmlComponent.reset();
disconnect(screen, &QScreen::orientationChanged, this, &ProjectManager::orientateWindow);
});
m_quickWindow->setFlags(Qt::Window | Qt::WindowStaysOnTopHint);
m_quickWindow->showMaximized();
}
......
......@@ -87,6 +87,7 @@ Item {
id: downloadButton
text: qsTr("Download and Run")
onClicked: backend.runUserProject(urlTextField.text)
enabled: urlTextField.text !== ''
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment