]> git.lyx.org Git - features.git/commitdiff
reduce compiler warnings (deprecated method, uninitialized vars)
authorStephan Witt <switt@lyx.org>
Thu, 8 Apr 2010 22:41:49 +0000 (22:41 +0000)
committerStephan Witt <switt@lyx.org>
Thu, 8 Apr 2010 22:41:49 +0000 (22:41 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34097 a592a061-630c-0410-9148-cb99ea01b6c8

src/support/linkback/LinkBack.m
src/support/linkback/LinkBackProxy.m
src/support/linkback/LinkBackServer.m

index 86694bed8a9b01ef10e9ae8b4b6d1513d3165e61..ded7af664956fb47c503a75610817987e7c75926 100644 (file)
@@ -364,30 +364,27 @@ NSMutableDictionary* keyedLinkBacks = nil ;
        LinkBack* ret = [keyedLinkBacks objectForKey: aKey] ;
        
        if(nil==ret) {
-               BOOL ok ;
-               NSString* serverName = nil ;
-               NSString* serverId = nil ;
-               NSString* appName = nil ;
-               NSURL* url = nil ;
+               BOOL ok = [data isKindOfClass: [NSDictionary class]] ;
                
-               // collect server contact information from data.
-               ok = [data isKindOfClass: [NSDictionary class]] ;
                if (ok) {
-                       serverName = [data objectForKey: LinkBackServerNameKey] ;
-                       serverId = [data objectForKey: LinkBackServerBundleIdentifierKey];
-                       appName = [data linkBackSourceApplicationName] ;
-                       url = [data linkBackApplicationURL] ;
-               }
-               
-               if (!ok || !serverName || !serverId)
-                       [NSException raise: NSInvalidArgumentException format: @"LinkBackData is not of the correct format: %@", data] ;
+                       // collect server contact information from data.
+                       NSString* serverName = [data objectForKey: LinkBackServerNameKey] ;
+                       NSString* serverId = [data objectForKey: LinkBackServerBundleIdentifierKey];
+                       NSString* appName = [data linkBackSourceApplicationName] ;
+                       NSURL* url = [data linkBackApplicationURL] ;
 
-               // create the live link object and try to connect to the server.
-               ret = [[LinkBack alloc] initClientWithSourceName: aName delegate: del itemKey: aKey] ;
+                       if ( !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.
+                       ret = [[LinkBack alloc] initClientWithSourceName: aName delegate: del itemKey: aKey] ;
                
-               if (![ret connectToServerWithName: serverName inApplication: serverId fallbackURL: url appName: appName]) {
-                       [ret release] ;
-                       ret = nil ;
+                       if (![ret connectToServerWithName: serverName inApplication: serverId fallbackURL: url appName: appName]) {
+                               [ret release] ;
+                               ret = nil ;
+                       }
+               } else {
+                       [NSException raise: NSInvalidArgumentException format: @"LinkBackData is not of the correct format: %@", data] ;
                }
        }
        
@@ -401,9 +398,6 @@ NSMutableDictionary* keyedLinkBacks = nil ;
                [ret requestEdit] ;
                
        // if connection to server failed, return nil.
-       } else {
-               [ret release] ;
-               ret = nil ;
        }
 
        return ret ;
index ce6b7f7bd358ab5c44688faa39457b68bafad050..9ead1e84da2b483223d465975a070f8caf3c7754 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * \file LinkBackProxy.mm
+ * \file LinkBackProxy.m
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
@@ -195,7 +195,7 @@ int isLinkBackDataInPasteboard()
        }
 }
 
-       
+
 void getLinkBackData(void const * * buf, unsigned * len)
 {
        checkAutoReleasePool() ;
@@ -217,6 +217,7 @@ void getLinkBackData(void const * * buf, unsigned * len)
        }
 }
 
+
 int editLinkBackFile(char const * docName)
 {
        // setup Obj-C and our client
index f4fff31aed40b9ab900517a01b90aa7c1a73b320..4ca9e6bca53e90d5f692529d61c1e84c42a98371 100644 (file)
@@ -94,7 +94,7 @@ NSString* FindLinkBackServer(NSString* bundleIdentifier, NSString* serverName, N
        NSString* ret = nil ;
 
        NSFileManager* fm = [NSFileManager defaultManager] ;
-       NSArray* contents = [fm directoryContentsAtPath: dir] ;
+       NSArray* contents = [fm contentsOfDirectoryAtPath: dir error: nil] ;
        int idx ;
 
        NSLog(@"searching for %@ in folder: %@", serverName, dir) ;