From ebde5f93fdd09ba23b4014df86f503516475e58f Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Thu, 25 Aug 2011 10:46:02 +0200 Subject: [PATCH] Bug 680696 - Remove nsPSPrinterList::Init; r=roc --- widget/src/gtk2/nsDeviceContextSpecG.cpp | 4 +--- widget/src/gtk2/nsPSPrinters.cpp | 10 +++------- widget/src/gtk2/nsPSPrinters.h | 7 +------ 3 files changed, 5 insertions(+), 16 deletions(-) diff --git a/widget/src/gtk2/nsDeviceContextSpecG.cpp b/widget/src/gtk2/nsDeviceContextSpecG.cpp index 4c6af3176dab..590f17731ed1 100644 --- a/widget/src/gtk2/nsDeviceContextSpecG.cpp +++ b/widget/src/gtk2/nsDeviceContextSpecG.cpp @@ -973,11 +973,9 @@ nsresult GlobalPrinters::InitializeGlobalPrinters () } mGlobalPrinterList = new nsTArray(); - 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 diff --git a/widget/src/gtk2/nsPSPrinters.cpp b/widget/src/gtk2/nsPSPrinters.cpp index 3052ba502dc7..397e43584594 100644 --- a/widget/src/gtk2/nsPSPrinters.cpp +++ b/widget/src/gtk2/nsPSPrinters.cpp @@ -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; } diff --git a/widget/src/gtk2/nsPSPrinters.h b/widget/src/gtk2/nsPSPrinters.h index 1bfb81501389..a330a03f088b 100644 --- a/widget/src/gtk2/nsPSPrinters.h +++ b/widget/src/gtk2/nsPSPrinters.h @@ -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?