summaryrefslogtreecommitdiffstats
path: root/src/android/java/src/org/qtproject/qt/android/bindings/QtLoader.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/android/java/src/org/qtproject/qt/android/bindings/QtLoader.java')
-rw-r--r--src/android/java/src/org/qtproject/qt/android/bindings/QtLoader.java50
1 files changed, 10 insertions, 40 deletions
diff --git a/src/android/java/src/org/qtproject/qt/android/bindings/QtLoader.java b/src/android/java/src/org/qtproject/qt/android/bindings/QtLoader.java
index 66ba029ace..baa4062372 100644
--- a/src/android/java/src/org/qtproject/qt/android/bindings/QtLoader.java
+++ b/src/android/java/src/org/qtproject/qt/android/bindings/QtLoader.java
@@ -1,43 +1,11 @@
-/*
- Copyright (C) 2021 The Qt Company Ltd.
- Copyright (c) 2019, BogDan Vatra <bogdan@kde.org>
- Contact: http://www.qt.io/licensing/
-
- Commercial License Usage
- Licensees holding valid commercial Qt licenses may use this file in
- accordance with the commercial license agreement provided with the
- Software or, alternatively, in accordance with the terms contained in
- a written agreement between you and The Qt Company. For licensing terms
- and conditions see http://www.qt.io/terms-conditions. For further
- information use the contact form at http://www.qt.io/contact-us.
-
- BSD License Usage
- Alternatively, this file may be used under the BSD license as follows:
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
-
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
+// Copyright (C) 2022 The Qt Company Ltd.
+// Copyright (c) 2019, BogDan Vatra <bogdan@kde.org>
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
package org.qtproject.qt.android.bindings;
import android.app.AlertDialog;
+import android.app.Dialog;
import android.content.Context;
import android.content.ContextWrapper;
import android.content.DialogInterface;
@@ -179,7 +147,8 @@ public abstract class QtLoader {
// fatal error, show the error and quit
AlertDialog errorDialog = new AlertDialog.Builder(m_context).create();
errorDialog.setMessage(loaderParams.getString(ERROR_MESSAGE_KEY));
- errorDialog.setButton(resources.getString(android.R.string.ok),
+ errorDialog.setButton(Dialog.BUTTON_POSITIVE,
+ resources.getString(android.R.string.ok),
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
@@ -230,7 +199,8 @@ public abstract class QtLoader {
int id = resources.getIdentifier("fatal_error_msg", "string",
packageName);
errorDialog.setMessage(resources.getString(id));
- errorDialog.setButton(resources.getString(android.R.string.ok),
+ errorDialog.setButton(Dialog.BUTTON_POSITIVE,
+ resources.getString(android.R.string.ok),
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
@@ -364,7 +334,7 @@ public abstract class QtLoader {
}
}
- if (!(new File(stylePath)).exists() && !extractOption.equals("none")) {
+ if (!extractOption.equals("none")) {
loaderParams.putString(EXTRACT_STYLE_KEY, stylePath);
loaderParams.putBoolean(EXTRACT_STYLE_MINIMAL_KEY, extractOption.equals("minimal"));
}
@@ -399,7 +369,7 @@ public abstract class QtLoader {
}
if (appParams != null)
- loaderParams.putString(APPLICATION_PARAMETERS_KEY, appParams.replace(' ', '\t').trim());
+ loaderParams.putString(APPLICATION_PARAMETERS_KEY, appParams);
loadApplication(loaderParams);
return;