From 0a523b5a0b23f33bac0bf14ba1dadf095c1bd034 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Thu, 13 Aug 2009 09:55:12 +0000 Subject: [PATCH] Fixed viewport and user agent. --- Cydia.mm | 11 ++++++----- UICaboodle/BrowserView.mm | 2 +- control | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Cydia.mm b/Cydia.mm index 239c5849..f00d4d71 100644 --- a/Cydia.mm +++ b/Cydia.mm @@ -3810,17 +3810,18 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { WebView *webview([webview_ webView]); Package *package([[Database sharedInstance] packageWithName:@"cydia"]); + NSString *application = package == nil ? @"Cydia" : [NSString stringWithFormat:@"Cydia/%@", [package installed] ]; - if (Product_ != nil) - application = [NSString stringWithFormat:@"%@ Version/%@", application, Product_]; - if (Build_ != nil) - application = [NSString stringWithFormat:@"%@ Mobile/%@", application, Build_]; if (Safari_ != nil) - application = [NSString stringWithFormat:@"%@ Safari/%@", application, Safari_]; + application = [NSString stringWithFormat:@"Safari/%@ %@", application, Safari_]; + if (Build_ != nil) + application = [NSString stringWithFormat:@"Mobile/%@ %@", application, Build_]; + if (Product_ != nil) + application = [NSString stringWithFormat:@"Version/%@ %@", application, Product_]; [webview setApplicationNameForUserAgent:application]; } return self; diff --git a/UICaboodle/BrowserView.mm b/UICaboodle/BrowserView.mm index 30d83718..5f984d1f 100644 --- a/UICaboodle/BrowserView.mm +++ b/UICaboodle/BrowserView.mm @@ -1171,7 +1171,7 @@ UIActionSheet *mailAlertSheet = [[UIActionSheet alloc] initWithTitle:UCLocalize( } - (void) setViewportWidth:(float)width { - width_ = width ? width != 0 : [[self class] defaultWidth]; + width_ = width != 0 ? width : [[self class] defaultWidth]; [webview_ setViewportSize:CGSizeMake(width_, UIWebViewGrowsAndShrinksToFitHeight) forDocumentTypes:0x10]; } diff --git a/control b/control index 0d4ffcd1..67163fbe 100644 --- a/control +++ b/control @@ -3,7 +3,7 @@ Priority: required Section: Packaging Maintainer: Jay Freeman (saurik) Architecture: iphoneos-arm -Version: 1.0.2987-1 +Version: 1.0.2988-1 Replaces: com.sosiphone.addcydia Depends: apr-lib, apt7-lib, apt7-key, darwintools, pcre, shell-cmds, system-cmds Pre-Depends: dpkg (>= 1.14.25-8) -- 2.45.2