Bug 680696 - Remove nsPSPrinterList::Init; r=roc

This commit is contained in:
Ms2ger 2011-08-25 10:46:02 +02:00
parent 40a50219ea
commit ebde5f93fd
3 changed files with 5 additions and 16 deletions

View File

@ -973,11 +973,9 @@ nsresult GlobalPrinters::InitializeGlobalPrinters ()
}
mGlobalPrinterList = new nsTArray<nsString>();
if (!mGlobalPrinterList)
return NS_ERROR_OUT_OF_MEMORY;
nsPSPrinterList psMgr;
if (NS_SUCCEEDED(psMgr.Init()) && psMgr.Enabled()) {
if (psMgr.Enabled()) {
/* Get the list of PostScript-module printers */
// XXX: this function is the only user of GetPrinterList
// So it may be interesting to convert the nsCStrings

View File

@ -58,17 +58,13 @@ using namespace mozilla;
nsCUPSShim gCupsShim;
/* Initialize the printer manager object */
nsresult
nsPSPrinterList::Init()
nsPSPrinterList::nsPSPrinterList()
{
// Should we try cups?
PRBool useCups =
Preferences::GetBool("print.postscript.cups.enabled", PR_TRUE);
if (useCups && !gCupsShim.IsInitialized()) {
if (Preferences::GetBool("print.postscript.cups.enabled", PR_TRUE) &&
!gCupsShim.IsInitialized()) {
gCupsShim.Init();
}
return NS_OK;
}

View File

@ -47,12 +47,7 @@ class nsCUPSShim;
class nsPSPrinterList {
public:
/**
* Initialize a printer manager object.
* @return NS_ERROR_NOT_INITIALIZED if unable to access prefs
* NS_OK for successful initialization.
*/
nsresult Init();
nsPSPrinterList();
/**
* Is the PostScript module enabled or disabled?