reduce compiler warnings (deprecated method, uninitialized vars)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34097 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Stephan Witt 2010-04-08 22:41:49 +00:00
parent c720965eb9
commit 4b0a8f2dfb
3 changed files with 21 additions and 26 deletions

View File

@ -364,30 +364,27 @@ NSMutableDictionary* keyedLinkBacks = nil ;
LinkBack* ret = [keyedLinkBacks objectForKey: aKey] ; LinkBack* ret = [keyedLinkBacks objectForKey: aKey] ;
if(nil==ret) { if(nil==ret) {
BOOL ok ; BOOL ok = [data isKindOfClass: [NSDictionary class]] ;
NSString* serverName = nil ;
NSString* serverId = nil ;
NSString* appName = nil ;
NSURL* url = nil ;
// collect server contact information from data.
ok = [data isKindOfClass: [NSDictionary class]] ;
if (ok) { if (ok) {
serverName = [data objectForKey: LinkBackServerNameKey] ; // collect server contact information from data.
serverId = [data objectForKey: LinkBackServerBundleIdentifierKey]; NSString* serverName = [data objectForKey: LinkBackServerNameKey] ;
appName = [data linkBackSourceApplicationName] ; NSString* serverId = [data objectForKey: LinkBackServerBundleIdentifierKey];
url = [data linkBackApplicationURL] ; NSString* appName = [data linkBackSourceApplicationName] ;
} NSURL* url = [data linkBackApplicationURL] ;
if (!ok || !serverName || !serverId)
[NSException raise: NSInvalidArgumentException format: @"LinkBackData is not of the correct format: %@", data] ;
// create the live link object and try to connect to the server. if ( !serverName || !serverId)
ret = [[LinkBack alloc] initClientWithSourceName: aName delegate: del itemKey: aKey] ; [NSException raise: NSInvalidArgumentException format: @"LinkBackData is not of the correct format: %@", data] ;
// create the live link object and try to connect to the server.
ret = [[LinkBack alloc] initClientWithSourceName: aName delegate: del itemKey: aKey] ;
if (![ret connectToServerWithName: serverName inApplication: serverId fallbackURL: url appName: appName]) { if (![ret connectToServerWithName: serverName inApplication: serverId fallbackURL: url appName: appName]) {
[ret release] ; [ret release] ;
ret = nil ; ret = nil ;
}
} else {
[NSException raise: NSInvalidArgumentException format: @"LinkBackData is not of the correct format: %@", data] ;
} }
} }
@ -401,9 +398,6 @@ NSMutableDictionary* keyedLinkBacks = nil ;
[ret requestEdit] ; [ret requestEdit] ;
// if connection to server failed, return nil. // if connection to server failed, return nil.
} else {
[ret release] ;
ret = nil ;
} }
return ret ; return ret ;

View File

@ -1,5 +1,5 @@
/** /**
* \file LinkBackProxy.mm * \file LinkBackProxy.m
* This file is part of LyX, the document processor. * This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING. * Licence details can be found in the file COPYING.
* *
@ -195,7 +195,7 @@ int isLinkBackDataInPasteboard()
} }
} }
void getLinkBackData(void const * * buf, unsigned * len) void getLinkBackData(void const * * buf, unsigned * len)
{ {
checkAutoReleasePool() ; checkAutoReleasePool() ;
@ -217,6 +217,7 @@ void getLinkBackData(void const * * buf, unsigned * len)
} }
} }
int editLinkBackFile(char const * docName) int editLinkBackFile(char const * docName)
{ {
// setup Obj-C and our client // setup Obj-C and our client

View File

@ -94,7 +94,7 @@ NSString* FindLinkBackServer(NSString* bundleIdentifier, NSString* serverName, N
NSString* ret = nil ; NSString* ret = nil ;
NSFileManager* fm = [NSFileManager defaultManager] ; NSFileManager* fm = [NSFileManager defaultManager] ;
NSArray* contents = [fm directoryContentsAtPath: dir] ; NSArray* contents = [fm contentsOfDirectoryAtPath: dir error: nil] ;
int idx ; int idx ;
NSLog(@"searching for %@ in folder: %@", serverName, dir) ; NSLog(@"searching for %@ in folder: %@", serverName, dir) ;