Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' into develop

Conflicts:
	Classes/WebServerBackup.m
	Classes/controllers/AssetVC.m
	Classes/controllers/BackupVC.m
	Classes/controllers/CalcVC.m
	Classes/controllers/ExportVC.m
	Classes/controllers/ReportVC.m
	Classes/models/Asset.m
	Classes/models/CatReport.m
	Classes/models/DataModel.m
	Classes/models/Report.m
  • Loading branch information...
commit 1d685cf1a2f7cf4d5a21eba598edf54f2dfa0d77 2 parents 2f5b198 + 7ed4f2f
@tmurakam authored
Showing with 58 additions and 59 deletions.
  1. +1 −1  Classes/AppDelegate.m
  2. +1 −1  Classes/CurrencyManager.m
  3. +2 −2 Classes/ExportBase.m
  4. +1 −1  Classes/ExportCsv.m
  5. +2 −2 Classes/ExportOfx.m
  6. +1 −1  Classes/WebServerBackup.m
  7. +7 −7 Classes/controllers/AssetListVC.m
  8. +1 −1  Classes/controllers/AssetVC.m
  9. +1 −1  Classes/controllers/BackupVC.m
  10. +1 −1  Classes/controllers/CalcVC.m
  11. +2 −2 Classes/controllers/ConfigViewController.m
  12. +3 −3 Classes/controllers/ExportVC.m
  13. +1 −1  Classes/controllers/ReportCatVC.m
  14. +4 −4 Classes/controllers/ReportVC.m
  15. +5 −5 Classes/controllers/TransactionListVC.m
  16. +5 −5 Classes/controllers/TransactionVC.m
  17. +3 −4 Classes/models/Asset.m
  18. +1 −1  Classes/models/AssetEntry.m
  19. +3 −3 Classes/models/CashflowDatabase.m
  20. +1 −1  Classes/models/CatReport.m
  21. +1 −1  Classes/models/Category.m
  22. +4 −4 Classes/models/DataModel.m
  23. +1 −1  Classes/models/Report.m
  24. +1 −1  Classes/models/Transaction.m
  25. +1 −1  Classes/ormapper/Database.m
  26. +1 −1  LogicTests/Common/TestCommon.m
  27. +2 −2 LogicTests/JournalTests.m
  28. +1 −1  LogicTests/ReportTests.m
View
2  Classes/AppDelegate.m
@@ -82,7 +82,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
assetListViewController.splitTransactionListViewController = transactionListViewController;
transactionListViewController.splitAssetListViewController = assetListViewController;
- self.splitViewController = [[UISplitViewController alloc] init];
+ self.splitViewController = [UISplitViewController new];
self.splitViewController.delegate = transactionListViewController;
self.splitViewController.viewControllers = @[masterNavigationController, detailNavigationController];
View
2  Classes/CurrencyManager.m
@@ -30,7 +30,7 @@ - (id)init
NSNumberFormatter *nf;
- nf = [[NSNumberFormatter alloc] init];
+ nf = [NSNumberFormatter new];
[nf setNumberStyle:NSNumberFormatterCurrencyStyle];
[nf setLocale:[NSLocale currentLocale]];
_numberFormatter = nf;
View
4 Classes/ExportBase.m
@@ -51,7 +51,7 @@ - (BOOL)sendMail:(UIViewController *)parent error:(NSError **)error
return NO;
}
- MFMailComposeViewController *vc = [[MFMailComposeViewController alloc] init];
+ MFMailComposeViewController *vc = [MFMailComposeViewController new];
vc.mailComposeDelegate = self;
[vc setSubject:[self mailSubject]];
@@ -81,7 +81,7 @@ - (BOOL)sendWithWebServer
NSString *message = nil;
if (mWebServer == nil) {
- mWebServer = [[ExportServer alloc] init];
+ mWebServer = [ExportServer new];
}
mWebServer.contentBody = contentBody;
mWebServer.contentType = [self contentType];
View
2  Classes/ExportCsv.m
@@ -58,7 +58,7 @@ - (NSData *)generateBody
if (self.firstDate != nil && [e.transaction.date compare:self.firstDate] == NSOrderedAscending) continue;
- NSMutableString *d = [[NSMutableString alloc] init];
+ NSMutableString *d = [NSMutableString new];
[d appendFormat:@"%d,", e.transaction.pid];
[d appendFormat:@"%@,", [dateFormatter stringFromDate:e.transaction.date]];
[d appendFormat:@"%.2f,", e.value];
View
4 Classes/ExportOfx.m
@@ -214,7 +214,7 @@ - (NSString*)_dateStr:(NSDate *)date
{
if (mGregCalendar == nil) {
mGregCalendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
- mDateFormatter = [[NSDateFormatter alloc] init];
+ mDateFormatter = [NSDateFormatter new];
}
NSTimeZone *tz = [mDateFormatter timeZone];
@@ -242,7 +242,7 @@ - (NSString*)_fitIdWithAssetEntry:(AssetEntry*)e
*/
- (NSString *)_escapeXmlString:(NSString *)s
{
- NSMutableString *str = [[NSMutableString alloc] init];
+ NSMutableString *str = [NSMutableString new];
[str setString:s];
REPLACE(@"&", @"&");
REPLACE(@"<", @"&lt;");
View
2  Classes/WebServerBackup.m
@@ -23,7 +23,7 @@ - (void)execute
sWebServerBackup = self;
- _backupServer = [[BackupServer alloc] init];
+ _backupServer = [BackupServer new];
NSString *url = [_backupServer serverUrl];
if (url != nil) {
result = [_backupServer startServer];
View
14 Classes/controllers/AssetListVC.m
@@ -181,7 +181,7 @@ - (void)_showInitialAsset
[self.splitTransactionListViewController reload];
} else {
TransactionListViewController *vc =
- [[TransactionListViewController alloc] init];
+ [TransactionListViewController new];
vc.assetKey = asset.pid;
[self.navigationController pushViewController:vc animated:NO];
}
@@ -378,7 +378,7 @@ - (void)tableView:(UITableView *)tv didSelectRowAtIndexPath:(NSIndexPath *)index
[self.splitTransactionListViewController reload];
} else {
TransactionListViewController *vc =
- [[TransactionListViewController alloc] init];
+ [TransactionListViewController new];
vc.assetKey = asset.pid;
[self.navigationController pushViewController:vc animated:YES];
@@ -388,7 +388,7 @@ - (void)tableView:(UITableView *)tv didSelectRowAtIndexPath:(NSIndexPath *)index
// アクセサリボタンをタップしたときの処理 : アセット変更
- (void)tableView:(UITableView *)tv accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath
{
- AssetViewController *vc = [[AssetViewController alloc] init];
+ AssetViewController *vc = [AssetViewController new];
int assetIndex = [self _assetIndex:indexPath];
if (assetIndex >= 0) {
[vc setAssetIndex:indexPath.row];
@@ -399,7 +399,7 @@ - (void)tableView:(UITableView *)tv accessoryButtonTappedForRowWithIndexPath:(NS
// 新規アセット追加
- (void)addAsset
{
- AssetViewController *vc = [[AssetViewController alloc] init];
+ AssetViewController *vc = [AssetViewController new];
[vc setAssetIndex:-1];
[self.navigationController pushViewController:vc animated:YES];
}
@@ -570,12 +570,12 @@ - (void)_actionActionButton:(NSInteger)buttonIndex
break;
case 2:
- configVC = [[ConfigViewController alloc] init];
+ configVC = [ConfigViewController new];
vc = configVC;
break;
case 3:
- infoVC = [[InfoVC alloc] init];
+ infoVC = [InfoVC new];
vc = infoVC;
break;
@@ -620,7 +620,7 @@ - (void)backupViewFinished:(BackupViewController *)backupViewController
/*
- (IBAction)showHelp:(id)sender
{
- InfoVC *v = [[[InfoVC alloc] init] autorelease];
+ InfoVC *v = [InfoVC new];
//[self.navigationController pushViewController:v animated:YES];
UINavigationController *nc = [[UINavigationController alloc] initWithRootViewController:v];
View
2  Classes/controllers/AssetVC.m
@@ -65,7 +65,7 @@ - (void)setAssetIndex:(int)n
if (_assetIndex < 0) {
// 新規
- _asset = [[Asset alloc] init];
+ _asset = [Asset new];
_asset.name = @"";
_asset.sorder = 99999;
} else {
View
2  Classes/controllers/BackupVC.m
@@ -174,7 +174,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
case 1:
// internal web server
[AppDelegate trackEvent:@"backup" action:@"web" label:@"start" value:nil];
- webBackup = [[WebServerBackup alloc] init];
+ webBackup = [WebServerBackup new];
[webBackup execute];
break;
}
View
2  Classes/controllers/CalcVC.m
@@ -65,7 +65,7 @@ - (id)init
self = [super initWithNibName:@"CalculatorView" bundle:nil];
if (self) {
[self allClear];
- _numberFormatter = [[NSNumberFormatter alloc] init];
+ _numberFormatter = [NSNumberFormatter new];
[_numberFormatter setNumberStyle:NSNumberFormatterDecimalStyle];
[_numberFormatter setLocale:[NSLocale currentLocale]];
}
View
4 Classes/controllers/ConfigViewController.m
@@ -214,7 +214,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
break;
case ROW_CUTOFF_DATE:
- typeArray = [[NSMutableArray alloc] init];
+ typeArray = [NSMutableArray new];
[typeArray addObject:_L(@"End of month")];
for (int i = 1; i <= 28; i++) {
[typeArray addObject:[NSString stringWithFormat:@"%d", i]];
@@ -252,7 +252,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
break;
case 1:
- categoryVC = [[CategoryListViewController alloc] init];
+ categoryVC = [CategoryListViewController new];
categoryVC.isSelectMode = NO;
[self.navigationController pushViewController:categoryVC animated:YES];
break;
View
6 Classes/controllers/ExportVC.m
@@ -128,7 +128,7 @@ - (IBAction)doExport
NSDate *date = nil;
if (range > 0) {
- date = [[NSDate alloc] init];
+ date = [NSDate new];
date = [date dateByAddingTimeInterval:(- range * 24.0 * 60 * 60)];
}
@@ -147,7 +147,7 @@ - (IBAction)doExport
case 0:
default:
if (_csv == nil) {
- _csv = [[ExportCsv alloc] init];
+ _csv = [ExportCsv new];
}
_csv.assets = assets;
ex = _csv;
@@ -155,7 +155,7 @@ - (IBAction)doExport
case 1:
if (_ofx == nil) {
- _ofx = [[ExportOfx alloc] init];
+ _ofx = [ExportOfx new];
}
_ofx.assets = assets;
ex = _ofx;
View
2  Classes/controllers/ReportCatVC.m
@@ -149,7 +149,7 @@ - (void)tableView:(UITableView *)tv didSelectRowAtIndexPath:(NSIndexPath *)index
break;
}
- CatReportDetailViewController *vc = [[CatReportDetailViewController alloc] init];
+ CatReportDetailViewController *vc = [CatReportDetailViewController new];
vc.title = [cr title];
vc.catReport = cr;
View
8 Classes/controllers/ReportVC.m
@@ -1,4 +1,4 @@
-// -*- Mode:ObjC; c-basic-offset:4; tab-width:8; indent-tabs-mode:nil -*-
+1;2c// -*- Mode:ObjC; c-basic-offset:4; tab-width:8; indent-tabs-mode:nil -*-
/*
* CashFlow for iOS
* Copyright (C) 2008-2011, Takuya Murakami, All rights reserved.
@@ -30,7 +30,7 @@ - (id)initWithAsset:(Asset*)asset type:(int)type
_type = type;
- _dateFormatter = [[NSDateFormatter alloc] init];
+ _dateFormatter = [NSDateFormatter new];
[self _updateReport];
}
return self;
@@ -106,7 +106,7 @@ - (void)_updateReport
// レポート生成
if (_reports == nil) {
- _reports = [[Report alloc] init];
+ _reports = [Report new];
}
[_reports generate:_type asset:_designatedAsset];
_maxAbsValue = [_reports getMaxAbsValue];
@@ -194,7 +194,7 @@ - (void)tableView:(UITableView *)tv didSelectRowAtIndexPath:(NSIndexPath *)index
int count = [_reports.reportEntries count];
ReportEntry *re = (_reports.reportEntries)[count - indexPath.row - 1];
- CatReportViewController *vc = [[CatReportViewController alloc] init];
+ CatReportViewController *vc = [CatReportViewController new];
vc.title = [self _reportTitle:re];
vc.reportEntry = re;
[self.navigationController pushViewController:vc animated:YES];
View
10 Classes/controllers/TransactionListVC.m
@@ -369,7 +369,7 @@ - (void)tableView:(UITableView *)tv didSelectRowAtIndexPath:(NSIndexPath *)index
int idx = [self entryIndexWithIndexPath:indexPath tableView:tv];
if (idx == -1) {
// initial balance cell
- CalculatorViewController *v = [[CalculatorViewController alloc] init];
+ CalculatorViewController *v = [CalculatorViewController new];
v.delegate = self;
v.value = self.asset.initialBalance;
@@ -416,7 +416,7 @@ - (void)addTransaction
return;
}
- TransactionViewController *vc = [[TransactionViewController alloc] init];
+ TransactionViewController *vc = [TransactionViewController new];
vc.asset = self.asset;
[vc setTransactionIndex:-1];
[self.navigationController pushViewController:vc animated:YES];
@@ -552,12 +552,12 @@ - (void)actionSheet:(UIActionSheet*)as clickedButtonAtIndex:(NSInteger)buttonInd
break;
case 3:
- configVC = [[ConfigViewController alloc] init];
+ configVC = [ConfigViewController new];
vc = configVC;
break;
case 4:
- infoVC = [[InfoVC alloc] init];
+ infoVC = [InfoVC new];
vc = infoVC;
break;
@@ -577,7 +577,7 @@ - (void)actionSheet:(UIActionSheet*)as clickedButtonAtIndex:(NSInteger)buttonInd
/*
- (IBAction)showHelp:(id)sender
{
- InfoVC *v = [[[InfoVC alloc] init] autorelease];
+ InfoVC *v = [InfoVC new];
//[self.navigationController pushViewController:v animated:YES];
UINavigationController *nc = [[UINavigationController alloc] initWithRootViewController:v];
View
10 Classes/controllers/TransactionVC.m
@@ -292,7 +292,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
[calendarVc setCalendarViewControllerDelegate:self];
vc = calendarVc;
} else {
- EditDateViewController *editDateVC = [[EditDateViewController alloc] init];
+ EditDateViewController *editDateVC = [EditDateViewController new];
editDateVC.delegate = self;
editDateVC.date = _editingEntry.transaction.date;
vc = editDateVC;
@@ -300,7 +300,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
break;
case ROW_TYPE:
- editTypeVC = [[EditTypeViewController alloc] init];
+ editTypeVC = [EditTypeViewController new];
editTypeVC.delegate = self;
editTypeVC.type = _editingEntry.transaction.type;
editTypeVC.dstAsset = [_editingEntry dstAsset];
@@ -308,14 +308,14 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
break;
case ROW_VALUE:
- calcVC = [[CalculatorViewController alloc] init];
+ calcVC = [CalculatorViewController new];
calcVC.delegate = self;
calcVC.value = _editingEntry.evalue;
vc = calcVC;
break;
case ROW_DESC:
- editDescVC = [[EditDescViewController alloc] init];
+ editDescVC = [EditDescViewController new];
editDescVC.delegate = self;
editDescVC.description = _editingEntry.transaction.description;
editDescVC.category = _editingEntry.transaction.category;
@@ -332,7 +332,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
break;
case ROW_CATEGORY:
- editCategoryVC = [[CategoryListViewController alloc] init];
+ editCategoryVC = [CategoryListViewController new];
editCategoryVC.isSelectMode = YES;
editCategoryVC.delegate = self;
editCategoryVC.selectedIndex = [[DataModel categories] categoryIndexWithKey:_editingEntry.transaction.category];
View
7 Classes/models/Asset.m
@@ -77,7 +77,7 @@ - (id)init
{
self = [super init];
- _entries = [[NSMutableArray alloc] init];
+ _entries = [NSMutableArray new];
self.type = ASSET_CASH;
return self;
@@ -89,8 +89,7 @@ - (id)init
//
- (void)rebuild
{
-
- _entries = [[NSMutableArray alloc] init];
+ _entries = [NSMutableArray new];
double balance = self.initialBalance;
@@ -238,7 +237,7 @@ + (BOOL)migrate
if (ret) {
// newly created...
- Asset *as = [[Asset alloc] init];
+ Asset *as = [Asset new];
as.name = _L(@"Cash");
as.type = ASSET_CASH;
as.initialBalance = 0;
View
2  Classes/models/AssetEntry.m
@@ -191,7 +191,7 @@ - (void)setDstAsset:(int)as
- (id)copyWithZone:(NSZone *)zone
{
- AssetEntry *e = [[AssetEntry alloc] init];
+ AssetEntry *e = [AssetEntry new];
e.assetKey = self.assetKey;
e.value = self.value;
e.balance = self.balance;
View
6 Classes/models/CashflowDatabase.m
@@ -35,7 +35,7 @@ - (id)init
_needFixDateFormat = false;
- dateFormatter = [[NSDateFormatter alloc] init];
+ dateFormatter = [NSDateFormatter new];
[dateFormatter setTimeZone:[NSTimeZone timeZoneWithAbbreviation:@"UTC"]];
[dateFormatter setDateFormat: @"yyyyMMddHHmmss"];
@@ -45,12 +45,12 @@ - (id)init
[dateFormatter setLocale:us];
// backward compat.
- dateFormatter2 = [[DateFormatter2 alloc] init];
+ dateFormatter2 = [DateFormatter2 new];
[dateFormatter2 setTimeZone:[NSTimeZone timeZoneWithAbbreviation:@"UTC"]];
[dateFormatter2 setDateFormat: @"yyyyMMddHHmm"];
// for broken data...
- dateFormatter3 = [[DateFormatter2 alloc] init];
+ dateFormatter3 = [DateFormatter2 new];
[dateFormatter3 setTimeZone:[NSTimeZone timeZoneWithAbbreviation:@"UTC"]];
[dateFormatter3 setDateFormat: @"yyyyMMdd"];
View
2  Classes/models/CatReport.m
@@ -16,7 +16,7 @@ - (id)initWithCategory:(int)category withAsset:(int)assetKey
if (self != nil) {
_category = category;
_assetKey = assetKey;
- _transactions = [[NSMutableArray alloc] init];
+ _transactions = [NSMutableArray new];
_sum = 0.0;
}
return self;
View
2  Classes/models/Category.m
@@ -65,7 +65,7 @@ -(NSString*)categoryStringWithKey:(int)key
-(TCategory*)addCategory:(NSString *)name
{
- TCategory *c = [[TCategory alloc] init];
+ TCategory *c = [TCategory new];
c.name = name;
[_categories addObject:c];
View
8 Classes/models/DataModel.m
@@ -52,9 +52,9 @@ - (id)init
{
self = [super init];
- _journal = [[Journal alloc] init];
- _ledger = [[Ledger alloc] init];
- _categories = [[Categories alloc] init];
+ _journal = [Journal new];
+ _ledger = [Ledger new];
+ _categories = [Categories new];
_isLoadDone = NO;
return self;
@@ -162,7 +162,7 @@ + (NSDateFormatter *)dateFormatter:(BOOL)withDayOfWeek
+ (NSDateFormatter *)dateFormatter:(NSDateFormatterStyle)timeStyle withDayOfWeek:(BOOL)withDayOfWeek
{
- NSDateFormatter *df = [[NSDateFormatter alloc] init];
+ NSDateFormatter *df = [NSDateFormatter new];
[df setDateStyle:NSDateFormatterMediumStyle];
[df setTimeStyle:timeStyle];
View
2  Classes/models/Report.m
@@ -53,7 +53,7 @@ - (void)generate:(int)type asset:(Asset*)asset
NSDateComponents *dateComponents, *steps;
NSDate *nextStartDay = nil;
- steps = [[NSDateComponents alloc] init];
+ steps = [NSDateComponents new];
switch (self.type) {
case REPORT_DAILY:;
dateComponents = [greg components:(NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit) fromDate:firstDate];
View
2  Classes/models/Transaction.m
@@ -67,7 +67,7 @@ - (id)initWithDate: (NSDate*)dt description:(NSString*)desc value:(double)v
- (id)copyWithZone:(NSZone*)zone
{
- Transaction *n = [[Transaction alloc] init];
+ Transaction *n = [Transaction new];
n.pid = self.pid;
n.asset = self.asset;
n.dstAsset = self.dstAsset;
View
2  Classes/ormapper/Database.m
@@ -253,7 +253,7 @@ - (NSDateFormatter *)dateFormatter
{
static NSDateFormatter *dateFormatter = nil;
if (dateFormatter == nil) {
- dateFormatter = [[NSDateFormatter alloc] init];
+ dateFormatter = [NSDateFormatter new];
[dateFormatter setTimeZone:[NSTimeZone timeZoneWithAbbreviation:@"UTC"]];
[dateFormatter setDateFormat: @"yyyyMMddHHmmss"];
View
2  LogicTests/Common/TestCommon.m
@@ -12,7 +12,7 @@ + (DateFormatter2 *)dateFormatter
{
static DateFormatter2 *df = nil;
if (df == nil) {
- df = [[DateFormatter2 alloc] init];
+ df = [DateFormatter2 new];
[df setTimeZone: [NSTimeZone timeZoneWithAbbreviation:@"UTC"]];
[df setDateFormat: @"yyyyMMddHHmmss"];
}
View
4 LogicTests/JournalTests.m
@@ -185,7 +185,7 @@ - (void)testJournalInsertUpperLimit
int i;
for (i = 0; i < MAX_TRANSACTIONS; i++) {
- t = [[Transaction alloc] init];
+ t = [Transaction new];
t.asset = 1; // cash
[journal insertTransaction:t];
[t release];
@@ -199,7 +199,7 @@ - (void)testJournalInsertUpperLimit
Assert([asset entryCount] == MAX_TRANSACTIONS);
// 上限数+1個目
- t = [[Transaction alloc] init];
+ t = [Transaction new];
t.asset = 1; // cash
[journal insertTransaction:t];
[t release];
View
2  LogicTests/ReportTests.m
@@ -16,7 +16,7 @@ - (void)setUp
[TestCommon installDatabase:@"testdata1"];
[DataModel instance];
- mReports = [[Report alloc] init];
+ mReports = [Report new];
}
- (void)tearDown
Please sign in to comment.
Something went wrong with that request. Please try again.