Closed Bug 256410 Opened 21 years ago Closed 3 years ago

'complexValue' getter and setter rely on PersistentDescriptor of nsILocalFile

Categories

(Core :: Preferences: Backend, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: jshin1987, Unassigned)

Details

(Keywords: intl)

At least in one implementation, 'complexValue' setter sends a path in 'UTF-8' to setter of PersistentProperties of nsILocalFile. However, in most implementations of nsILocalFile, SetPersistentProperties is a vanilar wrapper over InitWithNativePath. On platforms where UTF-8 is the native encoding, it works well (Mac OS X and recent Linux distributions. Actually, Mac OS X doesn't use InitWithNativePath in SetPersistentProperties), but elsewhere it doesn't. I'm not sure which to 'fix' / modify, nsIPref* implementations or nsILocalFile*.
http://lxr.mozilla.org/seamonkey/source/modules/libpref/src/nsPrefBranch.cpp#278 278 if (aType.Equals(NS_GET_IID(nsILocalFile))) { 279 nsCOMPtr<nsILocalFile> file(do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv)); 280 281 if (NS_SUCCEEDED(rv)) { 282 rv = file->SetPersistentDescriptor(utf8String); 283 if (NS_SUCCEEDED(rv)) { 284 nsILocalFile *temp = file;
Status: NEW → ASSIGNED
Summary: 'complexValue' setter sends a path in 'UTF-8' to setter of PersistentProperties of nsILocalFile → 'complexValue' getter sends a path in 'UTF-8' to setter of PersistentDescriptor of nsILocalFile
Implementations of setter are also broken. Depending on how it's looked at, what's problematic is that getter and setter are inconsistent in interpreting what's stored as pref. value and what's stored as persistentDescriptor. http://lxr.mozilla.org/seamonkey/source/modules/libpref/src/nsPrefBranch.cpp#381 381 rv = file->GetPersistentDescriptor(descriptorString); 382 if (NS_SUCCEEDED(rv)) { 383 rv = SetCharPref(aPrefName, descriptorString.get()); 384 } 385 return rv; 386 } http://lxr.mozilla.org/seamonkey/source/xpcom/io/nsLocalFileWin.cpp#2130 http://lxr.mozilla.org/seamonkey/source/xpcom/io/nsLocalFileWin.cpp#2136 http://lxr.mozilla.org/seamonkey/source/xpcom/io/nsLocalFileOSX.cpp#1271 http://lxr.mozilla.org/seamonkey/source/xpcom/io/nsLocalFileOSX.cpp#1276 http://lxr.mozilla.org/seamonkey/source/embedding/components/ui/helperAppDlg/nsHelperAppDlg.js#176
Summary: 'complexValue' getter sends a path in 'UTF-8' to setter of PersistentDescriptor of nsILocalFile → 'complexValue' getter and setter rely on PersistentDescriptor of nsILocalFile
QA Contact: preferences-backend

The bug assignee didn't login in Bugzilla in the last 7 months.
:KrisWright, could you have a look please?
For more information, please visit auto_nag documentation.

Assignee: jshin1987 → nobody
Status: ASSIGNED → NEW
Flags: needinfo?(kwright)

We aren't using nsILocalFile in this spot anymore, as we've changed how we get complex value prefs.

Status: NEW → RESOLVED
Closed: 3 years ago
Flags: needinfo?(kwright)
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.