From f8776f40895fe2d6a02f97b1571810026d3c5b2c Mon Sep 17 00:00:00 2001 From: "smfr%smfr.org" Date: Thu, 25 Aug 2005 22:23:48 +0000 Subject: [PATCH] Fix bug 279982: remove "Use system homepage" and associated Internet Config code, other than the code to fetch the downloads folder. r=pinkerton --- camino/PreferencePanes/Downloads/Downloads.mm | 98 +++++++++--------- .../English.lproj/Navigation.nib/classes.nib | 7 +- .../English.lproj/Navigation.nib/info.nib | 4 +- .../Navigation.nib/keyedobjects.nib | Bin 7208 -> 7849 bytes .../PreferencePanes/Navigation/Navigation.h | 2 - .../PreferencePanes/Navigation/Navigation.mm | 67 +----------- camino/src/preferences/PreferenceManager.h | 3 - camino/src/preferences/PreferenceManager.mm | 82 +-------------- 8 files changed, 56 insertions(+), 207 deletions(-) diff --git a/camino/PreferencePanes/Downloads/Downloads.mm b/camino/PreferencePanes/Downloads/Downloads.mm index b0491799788a..d8faa5a3a7e1 100644 --- a/camino/PreferencePanes/Downloads/Downloads.mm +++ b/camino/PreferencePanes/Downloads/Downloads.mm @@ -50,9 +50,37 @@ const int kDefaultExpireDays = 9; +// handly stack-based class to start and stop an Internet Config session +class StInternetConfigSession +{ +public: + + StInternetConfigSession(OSType inSignature) + : mICInstance(NULL) + , mStartedOK(false) + { + mStartedOK = (::ICStart(&mICInstance, inSignature) == noErr); + } + + ~StInternetConfigSession() + { + if (mStartedOK) + ::ICStop(mICInstance); + } + + bool Available() const { return mStartedOK; } + ICInstance Instance() const { return mICInstance; } + +private: + + ICInstance mICInstance; + bool mStartedOK; +}; + + + @interface OrgMozillaChimeraPreferenceDownloads(Private) -- (NSString*)getInternetConfigString:(ConstStr255Param)icPref; - (NSString*)getDownloadFolderDescription; - (void)setupDownloadMenuWithPath:(NSString*)inDLPath; - (void)setDownloadFolder:(NSString*)inNewFolder; @@ -132,8 +160,8 @@ const int kDefaultExpireDays = 9; return [NSString stringWithUTF8String:(const char*)utf8path]; } -// Sets the IC download pref to the given path -// NOTE: THIS DOES NOT WORK. +// Sets the IC download pref to the given path. We write to Internet Config +// because Gecko reads from IC when getting NS_MAC_DEFAULT_DOWNLOAD_DIR. - (void)setDownloadFolder:(NSString*)inNewFolder { if (!inNewFolder) @@ -141,68 +169,38 @@ const int kDefaultExpireDays = 9; // it would be nice to use PreferenceManager, but I don't want to drag // all that code into the plugin - ICInstance icInstance = nil; - OSStatus error = ::ICStart(&icInstance, 'CHIM'); - if (error != noErr) + StInternetConfigSession icSession('CHIM'); + if (!icSession.Available()) return; // make a ICFileSpec out of our path and shove it into IC. This requires - // creating an FSSpec and an alias. We can't just bail on error because - // we have to make sure we call ICStop() below. - BOOL noErrors = NO; + // creating an FSSpec and an alias. FSRef fsRef; Boolean isDir; - AliasHandle alias = nil; + OSStatus error = ::FSPathMakeRef((UInt8 *)[inNewFolder fileSystemRepresentation], &fsRef, &isDir); + if (error != noErr) + return; + FSSpec fsSpec; - error = ::FSPathMakeRef((UInt8 *)[inNewFolder fileSystemRepresentation], &fsRef, &isDir); - if (!error) { - error = ::FSGetCatalogInfo(&fsRef, kFSCatInfoNone, nil, nil, &fsSpec, nil); - if (!error) { - error = ::FSNewAlias(nil, &fsRef, &alias); - if (!error) - noErrors = YES; - } - } + error = ::FSGetCatalogInfo(&fsRef, kFSCatInfoNone, nil, nil, &fsSpec, nil); + if (error != noErr) + return; + + AliasHandle alias = nil; + error = ::FSNewAlias(nil, &fsRef, &alias); // copy the data out of our variables into the ICFileSpec and hand it to IC. - if (noErrors) { + if (error == noErr && alias) + { long headerSize = offsetof(ICFileSpec, alias); long aliasSize = ::GetHandleSize((Handle)alias); ICFileSpec* realbuffer = (ICFileSpec*) calloc(headerSize + aliasSize, 1); realbuffer->fss = fsSpec; memcpy(&realbuffer->alias, *alias, aliasSize); - ::ICSetPref(icInstance, kICDownloadFolder, kICAttrNoChange, (const void*)realbuffer, headerSize + aliasSize); + ::ICSetPref(icSession.Instance(), kICDownloadFolder, kICAttrNoChange, (const void*)realbuffer, headerSize + aliasSize); free(realbuffer); + ::DisposeHandle((Handle)alias); } - - ::ICStop(icInstance); -} - -- (NSString*)getInternetConfigString:(ConstStr255Param)icPref -{ - NSString* resultString = @""; - ICInstance icInstance = NULL; - - // it would be nice to use PreferenceManager, but I don't want to drag - // all that code into the plugin - OSStatus error = ICStart(&icInstance, 'CHIM'); - if (error != noErr) { - NSLog(@"Error from ICStart"); - return resultString; - } - - ICAttr dummyAttr; - Str255 homePagePStr; - long prefSize = sizeof(homePagePStr); - error = ICGetPref(icInstance, icPref, &dummyAttr, homePagePStr, &prefSize); - if (error == noErr) - resultString = [NSString stringWithCString: (const char*)&homePagePStr[1] length:homePagePStr[0]]; - else - NSLog(@"Error getting pref from Internet Config"); - - ICStop(icInstance); - - return resultString; } // Given a full path to the d/l dir, display the leaf name and the finder icon associated diff --git a/camino/PreferencePanes/Navigation/English.lproj/Navigation.nib/classes.nib b/camino/PreferencePanes/Navigation/English.lproj/Navigation.nib/classes.nib index d6084439da73..58f11f1414af 100644 --- a/camino/PreferencePanes/Navigation/English.lproj/Navigation.nib/classes.nib +++ b/camino/PreferencePanes/Navigation/English.lproj/Navigation.nib/classes.nib @@ -13,17 +13,12 @@ SUPERCLASS = NSObject; }, { - ACTIONS = { - checkboxStartPageClicked = id; - checkboxUseSystemHomePageClicked = id; - defaultBrowserChange = id; - }; + ACTIONS = {checkboxStartPageClicked = id; defaultBrowserChange = id; }; CLASS = OrgMozillaChimeraPreferenceNavigation; LANGUAGE = ObjC; OUTLETS = { checkboxNewTabBlank = NSButton; checkboxNewWindowBlank = NSButton; - checkboxUseSystemHomePage = NSButton; defaultBrowserPopUp = NSPopUpButton; textFieldHomePage = NSTextField; }; diff --git a/camino/PreferencePanes/Navigation/English.lproj/Navigation.nib/info.nib b/camino/PreferencePanes/Navigation/English.lproj/Navigation.nib/info.nib index 69462a91f110..ea38a8631d7c 100644 --- a/camino/PreferencePanes/Navigation/English.lproj/Navigation.nib/info.nib +++ b/camino/PreferencePanes/Navigation/English.lproj/Navigation.nib/info.nib @@ -5,8 +5,8 @@ IBDocumentLocation 257 70 522 320 0 0 1920 1178 IBFramework Version - 364.0 + 437.0 IBSystem Version - 7W98 + 8C46 diff --git a/camino/PreferencePanes/Navigation/English.lproj/Navigation.nib/keyedobjects.nib b/camino/PreferencePanes/Navigation/English.lproj/Navigation.nib/keyedobjects.nib index f6a07685681923705070ae9831d2b20a19ad6fae..8696de049ed109ca416791b79b158cb7d2b65804 100644 GIT binary patch literal 7849 zcmb7J2Y6If_CNQ&>Gi#tdGiJk2~7|XQfL7SAxIID027h`!7wC`Fk~_lrX-;q%gigMpWi*_+{>hjP%sux zPCfwyC~%+yJs7|Uma!cI(c&q=N;z840l#9wNI17cJW^56Au?&ITpW)T@y=}jaCy31 zlF>lu0B!l=nc2S9gqQc!&nHwbeI7%VHPmB z4;I53sDpZV0bYc^!)tI9-hp@F7`%tyAHr$)1ipkb@B>_cU*SK*K#ash?8HetL?k}a zinJlOkWM6-q>#QOoeUruWEi=Jj3ML5cycc(CMBedgvdOykUT&(kvdXOc9LCWFL{*g zBae|M$RTnVum48g!0$K7yW}`|pL|F@Ctr{=HZ=+KS#p+tPNlBYtJVr_%@M zdUA?xpbycFFoSL)t?6dEg@ox=`Y^4d+vzU)I{l8Gqu^apx@UZj`kkMt+{Grdgz zO|Q^jNP_-K|3iPHSLrnlIKoj5zc?MI=M0>YGjV3l#yL6Hm=57YDD)}s0y{Xs2|Nhk z0ylU-1TRS7gBH*dTER`w8g7O*kOXa^9khoI&=GEdPS6={g)Yz)y1{MG9eO~rihvvq z4S9i3LPkuq$o6Lx7t66&a8fW7j8D&ugu{rINL0g1W+)Jg$uW(3T(&KYM}c83<$vqsK7hsgMRe(R0;X#U`d>ToK*f{MXjDqT*AN0Q$B`0F> zNV(=G_320~^%WWpfmkMYh*!~+;$ zzZ@Tv?Zp&1SG!>@SS5x$Hi+faRZnaWEdODTHLW7m8pahI^14iwDE1-}%}85rIi^2;K2V z647FrQ6{s=%Af^rB$1S((}L?H%oNI)f2L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snull); } -- (BOOL)initInternetConfig -{ - OSStatus error; - error = ::ICStart(&mInternetConfig, 'CHIM'); - if (error != noErr) { - // XXX throw here? - NSLog(@"Error initializing IC"); - return NO; - } - return YES; -} - - (BOOL)initMozillaPrefs { nsresult rv; @@ -782,53 +763,6 @@ typedef enum EProxyConfig { (void)mPrefs->SetBoolPref(prefName, (PRBool)value); } - -//- (BOOL) getICBoolPref:(ConstStr255Param) prefKey; -//{ -// ICAttr dummy; -// OSStatus error; -// SInt32 size; -// Boolean buf; - -// error = ICGetPref (internetConfig, prefKey, &dummy, &buf, &size); -// if (error == noErr && buf) -// return YES; -// else -// return NO; -// } - -- (NSString *) getICStringPref:(ConstStr255Param) prefKey; -{ - NSString *string; - ICAttr dummy; - OSStatus error; - SInt32 size = 256; - char *buf; - - do { - if ((buf = (char*)malloc((unsigned int)size)) == NULL) { - return nil; - } - error = ICGetPref (mInternetConfig, prefKey, &dummy, buf, &size); - if (error != noErr && error != icTruncatedErr) { - free (buf); - NSLog (@"[IC error %d in [PreferenceManager getICStringPref]", (int) error); - return nil; - } - size *= 2; - } while (error == icTruncatedErr); - if (*buf == 0) { - NSLog (@"ICGetPref returned empty string"); - free (buf); - return nil; - } - CopyPascalStringToC ((ConstStr255Param) buf, buf); - string = [NSString stringWithCString:buf]; - free(buf); - return string; -} - - - (NSString *) homePage:(BOOL)checkStartupPagePref { if (!mPrefs) @@ -842,18 +776,10 @@ typedef enum EProxyConfig { // but we don't care about that. Default to 1 unless |checkStartupPagePref| // is true. nsresult rv = NS_OK; - if ( checkStartupPagePref ) + if (checkStartupPagePref) rv = mPrefs->GetIntPref("browser.startup.page", &mode); - if (NS_FAILED(rv) || mode == 1) { - // see which home page to use - PRBool boolPref; - if (NS_SUCCEEDED(mPrefs->GetBoolPref("chimera.use_system_home_page", &boolPref)) && boolPref) { - NSString* homePage = [self getICStringPref:kICWWWHomePage]; - if (!homePage) - homePage = @"about:blank"; - return homePage; - } + if (NS_FAILED(rv) || mode == 1) { nsCOMPtr prefBranch = do_QueryInterface(mPrefs); if (!prefBranch) return @"about:blank"; @@ -884,10 +810,6 @@ typedef enum EProxyConfig { if (!mPrefs) return resultString; - PRBool boolPref; - if (NS_SUCCEEDED(mPrefs->GetBoolPref("chimera.use_system_home_page", &boolPref)) && boolPref) - return [self getICStringPref:kICWebSearchPagePrefs]; - nsCOMPtr prefBranch = do_QueryInterface(mPrefs); if (!prefBranch) return resultString;