mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
waydroid: Show an error when Android ID is empty
This commit is contained in:
parent
7ebb4aa37c
commit
a3e7d98660
2 changed files with 23 additions and 0 deletions
|
|
@ -453,6 +453,10 @@ void WaydroidDBusObject::refreshAndroidId()
|
||||||
KAuth::ExecuteJob *executeJob = dynamic_cast<KAuth::ExecuteJob *>(job);
|
KAuth::ExecuteJob *executeJob = dynamic_cast<KAuth::ExecuteJob *>(job);
|
||||||
if (executeJob->error() == 0) {
|
if (executeJob->error() == 0) {
|
||||||
m_androidId = executeJob->data()["android_id"].toString();
|
m_androidId = executeJob->data()["android_id"].toString();
|
||||||
|
|
||||||
|
if (m_androidId.isEmpty()) {
|
||||||
|
Q_EMIT actionFailed(i18n("Android ID not found"));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
m_androidId = "";
|
m_androidId = "";
|
||||||
qCWarning(WAYDROIDINTEGRATIONPLUGIN) << "KAuth returned an error code:" << executeJob->error();
|
qCWarning(WAYDROIDINTEGRATIONPLUGIN) << "KAuth returned an error code:" << executeJob->error();
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,25 @@ KCM.SimpleKCM {
|
||||||
text: i18n("We fetching your Android ID.\nIt can take a few seconds.")
|
text: i18n("We fetching your Android ID.\nIt can take a few seconds.")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: AIP.WaydroidDBusClient
|
||||||
|
|
||||||
|
function onActionFailed(error: string): void {
|
||||||
|
inlineMessage.text = error
|
||||||
|
inlineMessage.visible = true
|
||||||
|
inlineMessage.type = Kirigami.MessageType.Error
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Kirigami.InlineMessage {
|
||||||
|
id: inlineMessage
|
||||||
|
|
||||||
|
Layout.fillWidth: true
|
||||||
|
|
||||||
|
visible: false
|
||||||
|
showCloseButton: true
|
||||||
|
}
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
visible: AIP.WaydroidDBusClient.androidId !== ""
|
visible: AIP.WaydroidDBusClient.androidId !== ""
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue