diff options
Diffstat (limited to 'embed/mozilla/MozillaPrivate.cpp')
-rw-r--r-- | embed/mozilla/MozillaPrivate.cpp | 45 |
1 files changed, 1 insertions, 44 deletions
diff --git a/embed/mozilla/MozillaPrivate.cpp b/embed/mozilla/MozillaPrivate.cpp index 23e8a391b..a3dc3483f 100644 --- a/embed/mozilla/MozillaPrivate.cpp +++ b/embed/mozilla/MozillaPrivate.cpp @@ -24,11 +24,8 @@ #include "MozillaPrivate.h" -#include <nsIPrintSettingsService.h> -#include <nsIPrintOptions.h> #include <nsIServiceManager.h> -#include <nsISimpleEnumerator.h> -#include <nsISupportsPrimitives.h> +#include <nsString.h> #include <nsPromiseFlatString.h> #include "ephy-debug.h" @@ -37,43 +34,3 @@ * example) in this file. Note that you cannot use embed strings here, * the header inclusions will conflict. */ - -GList * -MozillaPrivate::GetPrinterList () -{ - GList *printers = NULL; - nsresult rv = NS_OK; - - nsCOMPtr<nsIPrintSettingsService> pss = - do_GetService("@mozilla.org/gfx/printsettings-service;1", &rv); - NS_ENSURE_SUCCESS(rv, nsnull); - - nsCOMPtr<nsIPrintOptions> po = do_QueryInterface(pss, &rv); - NS_ENSURE_SUCCESS(rv, nsnull); - - nsCOMPtr<nsISimpleEnumerator> avPrinters; - rv = po->AvailablePrinters(getter_AddRefs(avPrinters)); - NS_ENSURE_SUCCESS(rv, nsnull); - - PRBool more = PR_FALSE; - - for (avPrinters->HasMoreElements(&more); - more == PR_TRUE; - avPrinters->HasMoreElements(&more)) - { - nsCOMPtr<nsISupports> i; - rv = avPrinters->GetNext(getter_AddRefs(i)); - NS_ENSURE_SUCCESS(rv, nsnull); - - nsCOMPtr<nsISupportsString> printer = do_QueryInterface(i, &rv); - NS_ENSURE_SUCCESS(rv, nsnull); - - nsAutoString data; - rv = printer->GetData(data); - NS_ENSURE_SUCCESS(rv, nsnull); - - printers = g_list_prepend (printers, g_strdup (NS_ConvertUCS2toUTF8 (data).get())); - } - - return g_list_reverse (printers); -} |