]> git.saurik.com Git - winterboard.git/commitdiff
Various release engineeirng issues.
authorJay Freeman (saurik) <saurik@saurik.com>
Mon, 11 Aug 2008 23:14:09 +0000 (23:14 +0000)
committerJay Freeman (saurik) <saurik@saurik.com>
Mon, 11 Aug 2008 23:14:09 +0000 (23:14 +0000)
Application.mm
Library.mm
control
makefile

index 5f16bc40a2e03cd0f23ad1300847462c910fb994..36dc11157fd8005982b35d6a0db36b96b21b8ee4 100644 (file)
@@ -43,6 +43,7 @@
 
 static NSString *plist_;
 static NSMutableDictionary *settings_;
+static BOOL changed_;
 
 @interface WBThemeTableViewCell : UITableViewCell {
     UILabel *label;
@@ -76,8 +77,11 @@ static NSMutableDictionary *settings_;
 }
 
 - (void) applicationWillTerminate:(UIApplication *)application {
-    [settings_ writeToFile:plist_ atomically:YES];
-    system("killall SpringBoard");
+    if (changed_) {
+        if (![settings_ writeToFile:plist_ atomically:YES])
+            NSLog(@"WB:Error:writeToFile");
+        system("killall SpringBoard");
+    }
 }
 
 - (UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
@@ -99,6 +103,7 @@ static NSMutableDictionary *settings_;
     [theme setObject:[NSNumber numberWithBool:inactive] forKey:@"Active"];
     cell.accessoryType = inactive ? UITableViewCellAccessoryCheckmark : UITableViewCellAccessoryNone;
     [themesTable_ deselectRowAtIndexPath:(NSIndexPath *)indexPath animated:YES];
+    changed_ = YES;
 }
 
 - (NSInteger) tableView:(UITableView *)table numberOfRowsInSection:(NSInteger)section {
@@ -117,6 +122,7 @@ static NSMutableDictionary *settings_;
     NSMutableDictionary *theme = [[[themesArray_ objectAtIndex:fromIndex] retain] autorelease];
     [themesArray_ removeObjectAtIndex:fromIndex];
     [themesArray_ insertObject:theme atIndex:toIndex];
+    changed_ = YES;
 }
 
 - (BOOL) tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
@@ -132,6 +138,8 @@ static NSMutableDictionary *settings_;
     ] retain];
 
     settings_ = [[NSMutableDictionary alloc] initWithContentsOfFile:plist_];
+    if (settings_ == nil)
+        settings_ = [[NSMutableDictionary alloc] initWithCapacity:16];
 
     themesArray_ = [settings_ objectForKey:@"Themes"];
     if (themesArray_ == nil) {
@@ -162,9 +170,22 @@ static NSMutableDictionary *settings_;
     [themes addObjectsFromArray:[manager contentsOfDirectoryAtPath:@"/Library/Themes" error:NULL]];
     [themes addObjectsFromArray:[manager contentsOfDirectoryAtPath:[NSString stringWithFormat:@"%@/Library/SummerBoard/Themes", NSHomeDirectory()] error:NULL]];
 
-    for (NSString *theme in themes) {
+    for (NSUInteger i(0), e([themes count]); i != e; ++i) {
+        NSString *theme = [themes objectAtIndex:i];
         if ([theme hasSuffix:@".theme"])
-            theme = [theme substringWithRange:NSMakeRange(0, [theme length] - 6)];
+            [themes replaceObjectAtIndex:i withObject:[theme substringWithRange:NSMakeRange(0, [theme length] - 6)]];
+    }
+
+    for (NSUInteger i(0), e([themesArray_ count]); i != e; ++i) {
+        NSMutableDictionary *theme = [themesArray_ objectAtIndex:i];
+        NSString *name = [theme objectForKey:@"Name"];
+        if (name == nil || ![themes containsObject:name]) {
+            [themesArray_ removeObjectAtIndex:i];
+            --i; --e;
+        }
+    }
+
+    for (NSString *theme in themes) {
         if ([themesSet containsObject:theme])
             continue;
         [themesSet addObject:theme];
index 6e46c334f6b571361e73b92d0a0f063cf72693ff..c26a44ad833721303b8518030223b366ce95ec8d 100644 (file)
@@ -103,7 +103,7 @@ extern "C" {
 
 @end
 
-bool Debug_ = true;
+bool Debug_ = false;
 bool Engineer_ = false;
 
 /* WinterBoard Backend {{{ */
@@ -508,12 +508,10 @@ WBDelegate(string_)
 - (NSString *) _iconLabelStyle {
     NSString *key = docked_ ? @"DockedIconLabelStyle" : @"UndockedIconLabelStyle";
     NSString *style = [Info_ objectForKey:key];
-    NSLog(@"WB:Debug:%@ = %@", key, style);
     return style;
 }
 
 - (CGSize) drawInRect:(CGRect)rect withFont:(UIFont *)font lineBreakMode:(int)mode alignment:(int)alignment {
-    _trace();
     if (NSString *custom = [self _iconLabelStyle]) {
         NSString *style = [NSString stringWithFormat:@""
             "font-family: Helvetica; "
@@ -533,7 +531,6 @@ WBDelegate(string_)
 }
 
 - (void) drawInRect:(CGRect)rect withStyle:(NSString *)style {
-    _trace();
     if (NSString *custom = [self _iconLabelStyle]) {
         NSString *combined = [NSString stringWithFormat:@"%@; %@", style, custom];
         if (Debug_)
@@ -722,6 +719,13 @@ extern "C" void WBInitialize() {
                     [Info_ setObject:[info objectForKey:key] forKey:key];
     }
 
+    if ([Info_ objectForKey:@"UndockedIconLabels"] == nil)
+        [Info_ setObject:[NSNumber numberWithBool:(
+            [Info_ objectForKey:@"DockedIconLabelStyle"] != nil ||
+            [Info_ objectForKey:@"UndockedIconLabelStyle"] != nil
+        )] forKey:@"UndockedIconLabels"];
+
+    if (![Info_ boolForKey:@"UndockedIconLabels"])
     if (Debug_)
         NSLog(@"WB:Debug:Info = %@", [Info_ description]);
 
diff --git a/control b/control
index 43d6b8e968f772c2d4f9e7ad0644c0dc596f1f1c..bbef03c94bab87456026cc4216b1e2f62195003e 100644 (file)
--- a/control
+++ b/control
@@ -3,7 +3,7 @@ Priority: optional
 Section: System
 Maintainer: Jay Freeman (saurik) <saurik@saurik.com>
 Architecture: iphoneos-arm
-Version: 0.9.2519-1
+Version: 0.9.2520-2
 Description: more powerful, open-source SummerBoard
  This tool lets you give your device a graphical overhaul. Themes are taken from /Library/Themes (or, now, the older SummerBoard folder). Using the relatively simple frontend you can activate and deactivate multiple themes and give them a priority ordering.
  
index 405934ce871b1ab4deb20726eb50c0943f83dc0e..e347805c89873cac8e8ce285bb991bb3d5c053d4 100644 (file)
--- a/makefile
+++ b/makefile
@@ -29,6 +29,6 @@ package:
        find winterboard/Library/Themes -name .svn | while read -r line; do rm -rf "$${line}"; done
        cp -a control preinst prerm winterboard/DEBIAN
        cp -a Test.sh icon.png WinterBoard.dylib WinterBoard UIImages Info.plist winterboard/Applications/WinterBoard.app
-       dpkg-deb -b winterboard winterboard_0.9.2519-1_iphoneos-arm.deb
+       dpkg-deb -b winterboard winterboard_0.9.2520-2_iphoneos-arm.deb
 
 .PHONY: all clean package