fix for bug #2343 - Preferences are not initialized in the apprunner...

This commit is contained in:
rpotts%netscape.com 1999-03-16 07:25:43 +00:00
Родитель d100dc959e
Коммит 8d15a665eb
2 изменённых файлов: 22 добавлений и 1 удалений

Просмотреть файл

@ -44,6 +44,7 @@ LINCS=-I$(PUBLIC)\raptor \
-I$(PUBLIC)\base \
-I$(PUBLIC)\dom \
-I$(PUBLIC)\js \
-I$(PUBLIC)\pref \
-I$(PUBLIC)\appcores \
-I$(PUBLIC)\netlib

Просмотреть файл

@ -23,6 +23,7 @@
#include "nsIComponentManager.h"
#include "nsIServiceManager.h"
#include "nsIURL.h"
#include "nsIPref.h"
#include "nsGUIEvent.h"
#include "nsWidgetsCID.h"
@ -73,6 +74,9 @@ static NS_DEFINE_IID(kMenuBarCID, NS_MENUBAR_CID);
static NS_DEFINE_IID(kMenuCID, NS_MENU_CID);
static NS_DEFINE_IID(kMenuItemCID, NS_MENUITEM_CID);
static NS_DEFINE_CID(kPrefCID, NS_PREF_CID);
/* Define Interface IDs */
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
static NS_DEFINE_IID(kIWebShellWindowIID, NS_IWEBSHELL_WINDOW_IID);
@ -233,7 +237,23 @@ nsresult nsWebShellWindow::Initialize(nsIWidget* aParent,
if (nsnull != docLoader) {
docLoader->AddObserver((nsIDocumentLoaderObserver *)this);
}
/// webShell->SetPrefs(aPrefs);
/*
* XXX: How should preferences be supplied to the nsWebShellWindow?
* Should there be the notion of a global preferences service?
* Or should there be many preferences components based on
* the user profile...
*/
// Initialize the webshell with the preferences service
nsIPref *prefs;
rv = nsServiceManager::GetService(kPrefCID,
nsIPref::GetIID(),
(nsISupports **)&prefs);
if (NS_SUCCEEDED(rv)) {
mWebShell->SetPrefs(prefs);
nsServiceManager::ReleaseService(kPrefCID, prefs);
}
NS_IF_RELEASE(mCallbacks);
mCallbacks = aCallbacks;