Skip to content

Commit

Permalink
I had to make a lot of changes in order to get a release build to fin…
Browse files Browse the repository at this point in the history
…ish. Mostly related to missing or incorrectly names member variables for properties. 32bit builds require them to be declared, 64bit builds don't.
  • Loading branch information
Bleyddyn committed Nov 26, 2014
1 parent 2e7c920 commit 95e12d9
Show file tree
Hide file tree
Showing 34 changed files with 644 additions and 839 deletions.
2 changes: 1 addition & 1 deletion dbscripts/build_dbexport.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ XML="<?xml version=\"1.0\" encoding=\"UTF-8\"?>
</EveDatabaseExport>"


echo $XML > database.xml
echo "$XML" > database.xml

rm -f $DBEXPORT
#rm -f tempdb.db
Expand Down
40 changes: 40 additions & 0 deletions src/Core/Contracts/Contract.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,46 @@
{
@private
METIDtoName *nameFetcher;

Character *_character;
NSString *_xmlPath;
BOOL _loading;
id<ContractDelegate> _delegate;

NSString *_type;
NSString *_status;
NSUInteger _contractID;
NSUInteger _startStationID;
NSUInteger _endStationID;
double _volume;
double _price;
double _reward;
double _collateral;
double _buyout;

NSUInteger _issuerID;
NSUInteger _issuerCorpID;
NSUInteger _assigneeID;
NSUInteger _acceptorID;
NSString *_issuerName;
NSString *_issuerCorpName;
NSString *_assigneeName;
NSString *_acceptorName;

NSDate *_issued;
NSDate *_expired;
NSDate *_accepted;
NSDate *_completed;
NSString *_availability;
NSString *_title;
NSUInteger _days;
BOOL _forCorp;

NSString *_startStationName;
NSString *_endStationName;

NSDate *_cachedUntil;
NSMutableArray *_items;
}

@property (retain) Character *character;
Expand Down
98 changes: 49 additions & 49 deletions src/Core/Contracts/Contract.m
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
*/

@interface Contract()
@property (readwrite) NSString *stationName;
@property (readwrite,retain) NSDate *cachedUntil; // For contained items, not the contract itself
@property (readwrite,retain) NSString *xmlPath;
@property (readwrite,assign) BOOL loading;
Expand All @@ -66,20 +65,20 @@ @interface Contract()

@implementation Contract

@synthesize character;
@synthesize xmlPath;
@synthesize delegate;
@synthesize character = _character;
@synthesize xmlPath = _xmlPath;
@synthesize delegate = _delegate;

@synthesize type;
@synthesize status;
@synthesize contractID;
@synthesize startStationID;
@synthesize endStationID;
@synthesize type = _type;
@synthesize status = _status;
@synthesize contractID = _contractID;
@synthesize startStationID = _startStationID;
@synthesize endStationID = _endStationID;

@synthesize issuerID;
@synthesize issuerCorpID;
@synthesize acceptorID;
@synthesize assigneeID;
@synthesize issuerID = _issuerID;
@synthesize issuerCorpID = _issuerCorpID;
@synthesize acceptorID = _acceptorID;
@synthesize assigneeID = _assigneeID;
@synthesize issuerName = _issuerName;
@synthesize issuerCorpName = _issuerCorpName;
@synthesize assigneeName = _assigneeName;
Expand All @@ -88,21 +87,22 @@ @implementation Contract
@synthesize startStationName = _startStationName;
@synthesize endStationName = _endStationName;

@synthesize volume;
@synthesize price;
@synthesize reward;
@synthesize collateral;
@synthesize issued;
@synthesize expired;
@synthesize accepted;
@synthesize completed;
@synthesize availability;
@synthesize title;
@synthesize days;
@synthesize forCorp;
@synthesize cachedUntil;
@synthesize volume = _volume;
@synthesize price = _price;
@synthesize reward = _reward;
@synthesize collateral = _collateral;
@synthesize buyout = _buyout;
@synthesize issued = _issued;
@synthesize expired = _expired;
@synthesize accepted = _accepted;
@synthesize completed = _completed;
@synthesize availability = _availability;
@synthesize title = _title;
@synthesize days = _days;
@synthesize forCorp = _forCorp;
@synthesize cachedUntil = _cachedUntil;
@synthesize items = _items;
@synthesize loading;
@synthesize loading = _loading;

- (id)init
{
Expand All @@ -119,18 +119,18 @@ - (id)init
- (void)dealloc
{
[super dealloc];
[character release];
[xmlPath release];
[type release];
[status release];
[_character release];
[_xmlPath release];
[_type release];
[_status release];
[_items release];
[issued release];
[expired release];
[accepted release];
[completed release];
[availability release];
[title release];
[cachedUntil release];
[_issued release];
[_expired release];
[_accepted release];
[_completed release];
[_availability release];
[_title release];
[_cachedUntil release];
[_startStationName release];
[_endStationName release];
[nameFetcher release];
Expand All @@ -150,7 +150,7 @@ - (NSString *)startStationName
if( nil == _startStationName )
{
CCPDatabase *db = [[GlobalData sharedInstance] database];
NSDictionary *station = [db stationForID:startStationID];
NSDictionary *station = [db stationForID:[self startStationID]];
[self setStartStationName:[station objectForKey:@"name"]];
}
return _startStationName;
Expand All @@ -170,7 +170,7 @@ - (NSString *)endStationName
if( nil == _endStationName )
{
CCPDatabase *db = [[GlobalData sharedInstance] database];
NSDictionary *station = [db stationForID:endStationID];
NSDictionary *station = [db stationForID:[self endStationID]];
[self setEndStationName:[station objectForKey:@"name"]];
}
return _endStationName;
Expand All @@ -196,7 +196,7 @@ - (void)preloadItems
if( [[self type] isEqualToString:@"Courier"] )
return; // Courier contracts never include items

if( [cachedUntil isGreaterThan:[NSDate date]] )
if( [[self cachedUntil] isGreaterThan:[NSDate date]] )
{
NSLog( @"Skipping download of Contract items because of Cached Until date" );
[self setLoading:NO];
Expand All @@ -212,13 +212,13 @@ - (void)preloadItems
keyID:[template accountId]
verificationCode:[template verificationCode]
charId:[template characterId]];
apiUrl = [apiUrl stringByAppendingFormat:@"&contractID=%ld",[self contractID]];
apiUrl = [apiUrl stringByAppendingFormat:@"&contractID=%ld",(unsigned long)[self contractID]];

NSString *characterDir = [Config charDirectoryPath:[template accountId]
character:[template characterId]];
NSString *pendingDir = [characterDir stringByAppendingString:@"/pending"];

NSString *docPathID = [[[docPath stringByDeletingPathExtension] stringByAppendingFormat:@"_%ld", [self contractID]] stringByAppendingPathExtension:[docPath pathExtension]];
NSString *docPathID = [[[docPath stringByDeletingPathExtension] stringByAppendingFormat:@"_%ld", (unsigned long)[self contractID]] stringByAppendingPathExtension:[docPath pathExtension]];
[self setXmlPath:[characterDir stringByAppendingPathComponent:[docPathID lastPathComponent]]]; // this won't work. need at least the contract ID.

//create the output directory, the XMLParseOperation will clean it up
Expand Down Expand Up @@ -265,10 +265,10 @@ - (void) parserOperationDone:(id)ignore errors:(NSArray *)errors
{
// read data from marketFile and create an xmlDoc
// parse it
xmlDoc *doc = xmlReadFile( [xmlPath fileSystemRepresentation], NULL, 0 );
xmlDoc *doc = xmlReadFile( [[self xmlPath] fileSystemRepresentation], NULL, 0 );
if( doc == NULL )
{
NSLog(@"Failed to read %@",xmlPath);
NSLog(@"Failed to read %@",[self xmlPath]);
[self setLoading:NO];
return;
}
Expand Down Expand Up @@ -381,9 +381,9 @@ -(BOOL) parseXmlContractItems:(xmlDoc*)document

}

if( [delegate conformsToProtocol:@protocol(ContractDelegate)] )
if( [[self delegate] conformsToProtocol:@protocol(ContractDelegate)] )
{
[delegate contractItemsFinishedUpdating];
[[self delegate] contractItemsFinishedUpdating];
}

[self setLoading:NO];
Expand Down Expand Up @@ -439,9 +439,9 @@ - (void)namesFromIDs:(NSDictionary *)names
changed = YES;
}

if( changed && [delegate conformsToProtocol:@protocol(ContractDelegate)] )
if( changed && [[self delegate] conformsToProtocol:@protocol(ContractDelegate)] )
{
[delegate contractNamesFinishedUpdating];
[[self delegate] contractNamesFinishedUpdating];
}
}

Expand Down
9 changes: 9 additions & 0 deletions src/Core/Contracts/ContractItem.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@
#import <Foundation/Foundation.h>

@interface ContractItem : NSObject
{
NSUInteger _typeID;
long _quantity;
long _rawQuantity;
BOOL _singleton;
BOOL _included;
NSString *_name;
NSString *_description;
}
@property (assign) NSUInteger typeID;
@property (assign) long quantity;
@property (assign) long rawQuantity;
Expand Down
12 changes: 6 additions & 6 deletions src/Core/Contracts/ContractItem.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ @interface ContractItem()
@end

@implementation ContractItem
@synthesize typeID;
@synthesize quantity;
@synthesize rawQuantity;
@synthesize singleton;
@synthesize included;
@synthesize typeID = _typeID;
@synthesize quantity = _quantity;
@synthesize rawQuantity = _rawQuantity;
@synthesize singleton = _singleton;
@synthesize included = _included;
@synthesize name = _name;
@synthesize description = _description;

Expand All @@ -43,7 +43,7 @@ - (NSString *)name
}
if( nil == _name )
{
return [NSString stringWithFormat:@"(id=%ld)",[self typeID]];
return [NSString stringWithFormat:@"(id=%ld)", (unsigned long)[self typeID]];
}
return _name;
}
Expand Down
7 changes: 7 additions & 0 deletions src/Core/Contracts/Contracts.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@
@class Character;

@interface Contracts : NSObject
{
Character *_character;
NSMutableArray *_contracts;
NSString *_xmlPath;
NSDate *_cachedUntil;
id _delegate;
}

@property (retain) Character *character;
@property (retain) NSMutableArray *contracts;
Expand Down
Loading

0 comments on commit 95e12d9

Please sign in to comment.