show log preference item only for debug mode or flag set true (false by default)

This commit is contained in:
Andy Scherzinger 2016-05-13 17:22:34 +02:00
parent 74a05bb2a9
commit e80d1465cd
2 changed files with 3 additions and 3 deletions

View file

@ -53,7 +53,7 @@
<bool name="imprint_enabled">false</bool> <bool name="imprint_enabled">false</bool>
<bool name="recommend_enabled">true</bool> <bool name="recommend_enabled">true</bool>
<bool name="feedback_enabled">true</bool> <bool name="feedback_enabled">true</bool>
<bool name="logger_enabled">true</bool> <bool name="logger_enabled">false</bool>
<string name="url_help">http://owncloud.com/mobile/help</string> <string name="url_help">http://owncloud.com/mobile/help</string>
<string name="url_imprint"></string> <string name="url_imprint"></string>
<string name="mail_recommend">"mailto:"</string> <string name="mail_recommend">"mailto:"</string>

View file

@ -270,7 +270,8 @@ public class Preferences extends PreferenceActivity
} }
if (BuildConfig.DEBUG) { boolean loggerEnabled = getResources().getBoolean(R.bool.logger_enabled) || BuildConfig.DEBUG;
if (loggerEnabled) {
Preference pLog = findPreference("log"); Preference pLog = findPreference("log");
if (pLog != null ){ if (pLog != null ){
pLog.setOnPreferenceClickListener(new OnPreferenceClickListener() { pLog.setOnPreferenceClickListener(new OnPreferenceClickListener() {
@ -347,7 +348,6 @@ public class Preferences extends PreferenceActivity
} }
} }
boolean loggerEnabled = getResources().getBoolean(R.bool.logger_enabled);
Preference pLogger = findPreference("logger"); Preference pLogger = findPreference("logger");
if (pLogger != null){ if (pLogger != null){
if (loggerEnabled) { if (loggerEnabled) {