return text;
}
+
+NSString *Simplify(NSString *title) {
+ const char *data = [title UTF8String];
+ size_t size = [title length];
+
+ Pcre title_r("^(.*?)( \\(.*\\))?$");
+ if (title_r(data, size))
+ return title_r[1];
+ else
+ return title;
+}
/* }}} */
@class Package;
if ([pages_ count] != 0)
[[pages_ lastObject] setPageActive:NO];
- NSString *title = [page title]; {
- const char *data = [title UTF8String];
- size_t size = [title length];
-
- Pcre title_r("^(.*?)( \\(.*\\))?$");
- if (title_r(data, size))
- title = title_r[1];
- }
+ NSString *title = Simplify([page title]);
NSString *backButtonTitle = [page backButtonTitle];
if (backButtonTitle == nil)
trusted = false;
}
- [source_ setText:[NSString stringWithFormat:@"from %@", label]];
+ [source_ setText:[NSString stringWithFormat:@"from %@ (%@)", label, Simplify([package section])]];
if (trusted)
[self addSubview:trusted_];