kfoomaticprinterimpl.cpp00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include "kfoomaticprinterimpl.h"
00021 #include "kprinter.h"
00022
00023 #include <kstandarddirs.h>
00024 #include <klocale.h>
00025
00026 KFoomaticPrinterImpl::KFoomaticPrinterImpl(QObject *parent, const char *name, const QStringList & )
00027 : KPrinterImpl(parent,name)
00028 {
00029 }
00030
00031 KFoomaticPrinterImpl::~KFoomaticPrinterImpl()
00032 {
00033 }
00034
00035
00036 QString KFoomaticPrinterImpl::executable()
00037 {
00038 QString exe = KStandardDirs::findExe("foomatic-printjob");
00039 return exe;
00040 }
00041
00042 bool KFoomaticPrinterImpl::setupCommand(QString& cmd, KPrinter *printer)
00043 {
00044 QString exe = executable();
00045 if (!exe.isEmpty())
00046 {
00047 cmd = exe + QString::fromLatin1(" -P %1 -# %2").arg(quote(printer->printerName())).arg(printer->numCopies());
00048 return true;
00049 }
00050 else
00051 printer->setErrorMessage(i18n("No valid print executable was found in your path. Check your installation."));
00052 return false;
00053 }
|