Android: get rid of the redundant ENVIRONMENT_VARIABLES QtActivity field

This variable supposedly holds a list of environment variables that will
be set by the Qt app, however, if a user needs to set an env variable,
it can be already done either in C++:
 qputenv(key, value);

Or in Java via (the same method that Qt plugin use):
 android.system.Os.setenv(key, value, override);

Thus, such field just makes things more confusing overall only.

Task-number: QTBUG-115017
Task-number: QTBUG-114593
Change-Id: I14856ed0720bfa2605da9c7d51173703df52bc58
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
bb10
Assam Boudjelthia 2023-11-02 21:30:24 +02:00
parent f6ad69506a
commit 1957e850ed
3 changed files with 1 additions and 19 deletions

View File

@ -22,13 +22,6 @@ import android.view.Window;
public class QtActivityBase extends Activity
{
public String m_applicationParams = null;
// use this variable to add any environment variables to your application.
// the env vars must be separated with "\t"
// e.g. "ENV_VAR1=1\tENV_VAR2=2\t"
// Currently the following vars are used by the android plugin:
// * QT_USE_ANDROID_NATIVE_DIALOGS - 1 to use the android native dialogs.
public String ENVIRONMENT_VARIABLES = "QT_USE_ANDROID_NATIVE_DIALOGS=1";
private boolean m_isCustomThemeSet = false;
private QtActivityDelegate m_delegate;
@ -101,7 +94,6 @@ public class QtActivityBase extends Activity
QtActivityLoader loader = new QtActivityLoader(this);
loader.setApplicationParameters(m_applicationParams);
loader.setEnvironmentVariables(ENVIRONMENT_VARIABLES);
loader.loadQtLibraries();
m_delegate.startNativeApplication(loader.getApplicationParameters(),

View File

@ -118,6 +118,7 @@ public class QtActivityLoader extends QtLoader {
{
super.extractContextMetaData();
setEnvironmentVariable("QT_USE_ANDROID_NATIVE_DIALOGS", String.valueOf(1));
setEnvironmentVariable("QT_ANDROID_APP_ICON_SIZE", String.valueOf(getAppIconSize()));
setupStyleExtraction();

View File

@ -13,17 +13,6 @@ public class QtActivity extends QtActivityBase
@Override
public void onCreate(Bundle savedInstanceState)
{
setAppDetails();
super.onCreate(savedInstanceState);
}
private void setAppDetails()
{
// Use this variable to add any environment variables to your application.
// the env vars must be separated with "\t"
// e.g. "ENV_VAR1=1\tENV_VAR2=2\t"
// Currently the following vars are used by the android plugin:
// * QT_USE_ANDROID_NATIVE_DIALOGS - 1 to use the android native dialogs.
ENVIRONMENT_VARIABLES = "QT_USE_ANDROID_NATIVE_DIALOGS=1";
}
}