Brion VIBBER has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/88780


Change subject: Made debug mode actually work on release builds.
......................................................................

Made debug mode actually work on release builds.

The settings is still hidden unless settings screen is tapped 6 times.
Also ensured that any old installs won’t be stuck with debug mode activated.
Note that once activated the debug mode setting only persists until the app 
quits - the setting is not remembered. (Technically it is, but it’s overridden 
each time app starts to be “NO” to ensure old installs aren’t stuck in debug 
mode).

Change-Id: I82167f0287525b1f36f30fa784a2ece32776e4e1
---
M Commons-iOS/AppDelegate.m
M Commons-iOS/CommonsApp.m
2 files changed, 5 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/apps/ios/commons 
refs/changes/80/88780/1

diff --git a/Commons-iOS/AppDelegate.m b/Commons-iOS/AppDelegate.m
index 8b0f225..36fb5a3 100644
--- a/Commons-iOS/AppDelegate.m
+++ b/Commons-iOS/AppDelegate.m
@@ -62,6 +62,11 @@
     //[CommonsApp.singleton initializeApp];
 
     CommonsApp *app = CommonsApp.singleton;
+
+    // Ensure debug mode is initally off in case app is upgraded from old 
version in which user could
+    // change debug mode from settings screen.
+    [app setDebugMode:NO];
+    
     [app initializeApp];
 
     // We seem to get a second ping after launching, wtf?
diff --git a/Commons-iOS/CommonsApp.m b/Commons-iOS/CommonsApp.m
index 316040a..1ab69ec 100644
--- a/Commons-iOS/CommonsApp.m
+++ b/Commons-iOS/CommonsApp.m
@@ -147,17 +147,7 @@
 
 - (BOOL)debugMode
 {
-
-#ifdef DEBUG
     return [[NSUserDefaults standardUserDefaults] boolForKey:@"DebugMode"];
-#else
-    // Force NO if release build - needed because release builds no longer 
show settings
-    // option to change DebugMode. Otherwise user would be stuck with 
DebugMode YES if
-    // they had previously had it enabled then upgraded to new version which 
no longer
-    // provides a way to change the debug mode setting.
-    return NO;
-#endif
-
 }
 
 - (void)setDebugMode:(BOOL)value {

-- 
To view, visit https://gerrit.wikimedia.org/r/88780
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I82167f0287525b1f36f30fa784a2ece32776e4e1
Gerrit-PatchSet: 1
Gerrit-Project: apps/ios/commons
Gerrit-Branch: master
Gerrit-Owner: Brion VIBBER <br...@wikimedia.org>
Gerrit-Reviewer: Mhurd <mh...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to