|
From: <cre...@us...> - 2006-08-25 23:36:02
|
Revision: 1484 Author: creecode Date: 2006-08-25 16:35:59 -0700 (Fri, 25 Aug 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1484&view=rev Log Message: ----------- in sfdialog function try to deal better with various states of undefined/partially defined tyfilespecs Modified Paths: -------------- Frontier/branches/FSRef_Migration/Common/source/filedialog.c Modified: Frontier/branches/FSRef_Migration/Common/source/filedialog.c =================================================================== --- Frontier/branches/FSRef_Migration/Common/source/filedialog.c 2006-08-25 23:31:17 UTC (rev 1483) +++ Frontier/branches/FSRef_Migration/Common/source/filedialog.c 2006-08-25 23:35:59 UTC (rev 1484) @@ -495,7 +495,7 @@ #ifdef MACVERSION // - // 2006-08-16 creedon: minimally FSRef-ized + // 2006-08-25 creedon: minimally FSRef-ized // // 2005-10-06 creedon: added filecreator parameter, used for get file // dialog @@ -539,27 +539,27 @@ FSSpec *fs = &sfdata.sfreply.sfFile, fspect; OSErr err = noErr; - extendfilespec ( fspec, fspec ); + clearbytes ( &fspect, sizeof ( fspect ) ); - if ( ( *fspec ).path == NULL ) - FSGetCatalogInfo ( &( *fspec ).fsref, kFSCatInfoNone, NULL, NULL, &fspect, NULL ); - else { - FSCatalogInfo catalogInfo; + if ( extendfilespec ( fspec, fspec ) ) { - FSGetCatalogInfo ( &( *fspec ).fsref, kFSCatInfoVolume | kFSCatInfoNodeID, &catalogInfo, NULL, NULL, NULL ); - - fspect.vRefNum = catalogInfo.volume; - fspect.parID = catalogInfo.nodeID; - - CFStringRefToStr255 ( ( *fspec ).path, fspect.name ); + if ( ( *fspec ).path == NULL ) + FSGetCatalogInfo ( &( *fspec ).fsref, kFSCatInfoNone, NULL, NULL, &fspect, NULL ); + else { + FSCatalogInfo catalogInfo; + + FSGetCatalogInfo ( &( *fspec ).fsref, kFSCatInfoVolume | kFSCatInfoNodeID, &catalogInfo, NULL, NULL, NULL ); + + fspect.vRefNum = catalogInfo.volume; + fspect.parID = catalogInfo.nodeID; + + CFStringRefToStr255 ( ( *fspec ).path, fspect.name ); + } } - - #ifdef flcomponent - - long appA5; - - #endif - + else + if ( ( *fspec ).path != NULL ) + CFStringRefToStr255 ( ( *fspec ).path, fspect.name ); + // move the switch statement to below because it's smarter to call it there when using the new routines for Nav services. clearbytes (&sfdata, sizeof (sfdata)); @@ -588,12 +588,6 @@ shellactivate (); - #ifdef flcomponent - - appA5 = SetUpCurA5 (); /*for system*/ - - #endif - switch (sfverb) { case sfputfileverb: @@ -621,12 +615,6 @@ break; } - #ifdef flcomponent - - RestoreA5 (appA5); - - #endif - //if the user canceled return false //I know that oserror can handle this, but lets make it //obvious that we are checking. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |