diff -r 3b887a914979 -r 12fe57ebc7a1 mozilla-kde.patch --- a/mozilla-kde.patch Fri Oct 08 09:57:26 2010 +0200 +++ b/mozilla-kde.patch Sat Oct 09 16:50:12 2010 +0200 @@ -39,7 +39,57 @@ #include "prefapi.h" #include "prefread.h" #include "prefapi_private_data.h" -@@ -837,28 +838,40 @@ static nsresult pref_InitDefaults() +@@ -783,30 +784,48 @@ pref_LoadPrefsInDir(nsIFile* aDir, char + } + + static nsresult pref_LoadPrefsInDirList(const char *listId) + { + nsresult rv; + nsCOMPtr dirSvc(do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv)); + if (NS_FAILED(rv)) return rv; + ++ // make sure we load these special files after all the others ++ static const char* specialFiles[] = { ++#if defined(XP_UNIX) ++ "" ++#endif ++ }; ++ ++ if (nsKDEUtils::kdeSession()) { ++ for(int i = 0; ++ i < NS_ARRAY_LENGTH(specialFiles); ++ ++i ) { ++ if (*specialFiles[ i ] == '\0') { ++ specialFiles[ i ] = "kde.js"; ++ break; ++ } ++ } ++ } ++ + nsCOMPtr dirList; + dirSvc->Get(listId, + NS_GET_IID(nsISimpleEnumerator), + getter_AddRefs(dirList)); + if (dirList) { + PRBool hasMore; + while (NS_SUCCEEDED(dirList->HasMoreElements(&hasMore)) && hasMore) { + nsCOMPtr elem; + dirList->GetNext(getter_AddRefs(elem)); + if (elem) { + nsCOMPtr dir = do_QueryInterface(elem); + if (dir) { + // Do we care if a file provided by this process fails to load? +- pref_LoadPrefsInDir(dir, nsnull, 0); ++ pref_LoadPrefsInDir(dir, specialFiles, NS_ARRAY_LENGTH(specialFiles)); + } + } + } + } + return NS_OK; + } + + //---------------------------------------------------------------------------------------- +@@ -837,28 +856,40 @@ static nsresult pref_InitDefaults() /* these pref file names should not be used: we process them after all other application pref files for backwards compatibility */ static const char* specialFiles[] = { #if defined(XP_MAC) || defined(XP_MACOSX)