Don't open a room by default on mobile

Since the room window is fullscreen on mobile and you can't see the room list,
the first thing you'll be doing is backing out so you can choose the actual room you want to see


(cherry picked from commit 17da652152)

Co-authored-by: Bart Ribbers <bribbers@disroot.org>
This commit is contained in:
Carl Schwan
2024-09-15 20:59:12 +00:00
parent 63dc8a5857
commit f2f6406403

View File

@@ -16,6 +16,7 @@
#include "urlhelper.h"
#include <KLocalizedString>
#include <KRuntimePlatform>
#include <QDesktopServices>
#include <QQuickTextDocument>
#include <QStandardPaths>
@@ -239,6 +240,12 @@ void RoomManager::loadInitialRoom()
resolveResource(m_arg);
}
const auto runtimePlatform = KRuntimePlatform::runtimePlatform();
if (runtimePlatform.contains(QStringLiteral("phone")) || runtimePlatform.contains(QStringLiteral("handset"))) {
// We don't want to open a room on startup on mobile
return;
}
if (m_currentRoom) {
// we opened a room with the arg parsing already
return;