summaryrefslogtreecommitdiffstats
path: root/kdeprint/lpr
diff options
context:
space:
mode:
Diffstat (limited to 'kdeprint/lpr')
-rw-r--r--kdeprint/lpr/apshandler.cpp84
-rw-r--r--kdeprint/lpr/apshandler.h16
-rw-r--r--kdeprint/lpr/editentrydialog.cpp66
-rw-r--r--kdeprint/lpr/editentrydialog.h6
-rw-r--r--kdeprint/lpr/klprprinterimpl.cpp12
-rw-r--r--kdeprint/lpr/klprprinterimpl.h6
-rw-r--r--kdeprint/lpr/kmconfiglpr.cpp16
-rw-r--r--kdeprint/lpr/kmconfiglpr.h2
-rw-r--r--kdeprint/lpr/kmlprjobmanager.cpp14
-rw-r--r--kdeprint/lpr/kmlprjobmanager.h6
-rw-r--r--kdeprint/lpr/kmlprmanager.cpp44
-rw-r--r--kdeprint/lpr/kmlprmanager.h24
-rw-r--r--kdeprint/lpr/kmlpruimanager.cpp2
-rw-r--r--kdeprint/lpr/kmlpruimanager.h2
-rw-r--r--kdeprint/lpr/lpchelper.cpp48
-rw-r--r--kdeprint/lpr/lpchelper.h32
-rw-r--r--kdeprint/lpr/lpqhelper.cpp12
-rw-r--r--kdeprint/lpr/lpqhelper.h12
-rw-r--r--kdeprint/lpr/lprhandler.cpp46
-rw-r--r--kdeprint/lpr/lprhandler.h28
-rw-r--r--kdeprint/lpr/lprngtoolhandler.cpp66
-rw-r--r--kdeprint/lpr/lprngtoolhandler.h24
-rw-r--r--kdeprint/lpr/lprsettings.cpp20
-rw-r--r--kdeprint/lpr/lprsettings.h14
-rw-r--r--kdeprint/lpr/matichandler.cpp54
-rw-r--r--kdeprint/lpr/matichandler.h12
-rw-r--r--kdeprint/lpr/matichelper.cpp2
-rw-r--r--kdeprint/lpr/matichelper.h4
-rw-r--r--kdeprint/lpr/printcapentry.cpp8
-rw-r--r--kdeprint/lpr/printcapentry.h20
-rw-r--r--kdeprint/lpr/printcapreader.cpp20
-rw-r--r--kdeprint/lpr/printcapreader.h14
32 files changed, 368 insertions, 368 deletions
diff --git a/kdeprint/lpr/apshandler.cpp b/kdeprint/lpr/apshandler.cpp
index 5b7bef943..fc6ade276 100644
--- a/kdeprint/lpr/apshandler.cpp
+++ b/kdeprint/lpr/apshandler.cpp
@@ -26,10 +26,10 @@
#include "util.h"
#include "kprinter.h"
-#include <qfile.h>
-#include <qdir.h>
-#include <qtextstream.h>
-#include <qvaluestack.h>
+#include <tqfile.h>
+#include <tqdir.h>
+#include <tqtextstream.h>
+#include <tqvaluestack.h>
#include <kstandarddirs.h>
#include <klocale.h>
#include <kdebug.h>
@@ -50,8 +50,8 @@ bool ApsHandler::validate(PrintcapEntry *entry)
KMPrinter* ApsHandler::createPrinter(PrintcapEntry *entry)
{
- entry->comment = QString::fromLatin1("# APS%1_BEGIN:printer%2").arg(m_counter).arg(m_counter);
- entry->postcomment = QString::fromLatin1("# APS%1_END - don't delete this").arg(m_counter);
+ entry->comment = TQString::fromLatin1("# APS%1_BEGIN:printer%2").arg(m_counter).arg(m_counter);
+ entry->postcomment = TQString::fromLatin1("# APS%1_END - don't delete this").arg(m_counter);
m_counter++;
return LprHandler::createPrinter(entry);
}
@@ -62,7 +62,7 @@ bool ApsHandler::completePrinter(KMPrinter *prt, PrintcapEntry *entry, bool shor
{
if (!shortmode)
{
- QMap<QString,QString> opts = loadResources(entry);
+ TQMap<TQString,TQString> opts = loadResources(entry);
if (opts.contains("PRINTER"))
{
prt->setDescription(i18n("APS Driver (%1)").arg(opts["PRINTER"]));
@@ -71,12 +71,12 @@ bool ApsHandler::completePrinter(KMPrinter *prt, PrintcapEntry *entry, bool shor
}
if (prt->device().isEmpty())
{
- QString prot;
+ TQString prot;
QString smbname(sysconfDir() + "/" + prt->printerName() + "/smbclient.conf");
QString ncpname(sysconfDir() + "/" + prt->printerName() + "/netware.conf");
- if (QFile::exists(smbname))
+ if (TQFile::exists(smbname))
{
- QMap<QString,QString> opts = loadVarFile(smbname);
+ TQMap<TQString,TQString> opts = loadVarFile(smbname);
if (opts.count() == 0)
prt->setDevice("smb://<unknown>/<unknown>");
else
@@ -90,15 +90,15 @@ bool ApsHandler::completePrinter(KMPrinter *prt, PrintcapEntry *entry, bool shor
}
prot = "smb";
}
- else if (QFile::exists(ncpname))
+ else if (TQFile::exists(ncpname))
{
- QMap<QString,QString> opts = loadVarFile(ncpname);
+ TQMap<TQString,TQString> opts = loadVarFile(ncpname);
if (opts.count() == 0)
prt->setDevice("ncp://<unknown>/<unknown>");
else
{
- QString uri = buildSmbURI(
- QString::null,
+ TQString uri = buildSmbURI(
+ TQString::null,
opts[ "NCP_SERVER" ],
opts[ "NCP_PRINTER" ],
opts[ "NCP_USER" ],
@@ -116,29 +116,29 @@ bool ApsHandler::completePrinter(KMPrinter *prt, PrintcapEntry *entry, bool shor
return false;
}
-QString ApsHandler::sysconfDir()
+TQString ApsHandler::sysconfDir()
{
- return QFile::encodeName("/etc/apsfilter");
+ return TQFile::encodeName("/etc/apsfilter");
}
-QString ApsHandler::shareDir()
+TQString ApsHandler::shareDir()
{
return driverDirectory();
}
-QString ApsHandler::driverDirInternal()
+TQString ApsHandler::driverDirInternal()
{
return locateDir("apsfilter/setup", "/usr/share:/usr/local/share:/opt/share");
}
-QMap<QString,QString> ApsHandler::loadResources(PrintcapEntry *entry)
+TQMap<TQString,TQString> ApsHandler::loadResources(PrintcapEntry *entry)
{
- return loadVarFile(sysconfDir() + "/" + (entry ? entry->name : QString::null) + "/apsfilterrc");
+ return loadVarFile(sysconfDir() + "/" + (entry ? entry->name : TQString::null) + "/apsfilterrc");
}
-QMap<QString,QString> ApsHandler::loadVarFile(const QString& filename)
+TQMap<TQString,TQString> ApsHandler::loadVarFile(const TQString& filename)
{
- QMap<QString,QString> opts;
+ TQMap<TQString,TQString> opts;
QFile f(filename);
if (f.open(IO_ReadOnly))
{
@@ -165,7 +165,7 @@ DrMain* ApsHandler::loadDriver(KMPrinter *prt, PrintcapEntry *entry, bool config
DrMain *driver = loadApsDriver(config);
if (driver /* && config */ ) // Load resources in all case, to get the correct page size
{
- QMap<QString,QString> opts = loadResources(entry);
+ TQMap<TQString,TQString> opts = loadResources(entry);
if ( !config && opts.contains( "PAPERSIZE" ) )
{
// this is needed to keep applications informed
@@ -185,7 +185,7 @@ DrMain* ApsHandler::loadDriver(KMPrinter *prt, PrintcapEntry *entry, bool config
return driver;
}
-DrMain* ApsHandler::loadDbDriver(const QString& s)
+DrMain* ApsHandler::loadDbDriver(const TQString& s)
{
int p = s.find('/');
DrMain *driver = loadApsDriver(true);
@@ -224,8 +224,8 @@ PrintcapEntry* ApsHandler::createEntry(KMPrinter *prt)
if (prot == "smb" || prot == "ncp")
{
// either "smb" or "ncp"
- QFile::remove(path + "/smbclient.conf");
- QFile::remove(path + "/netware.conf");
+ TQFile::remove(path + "/smbclient.conf");
+ TQFile::remove(path + "/netware.conf");
QFile f;
if (prot == "smb")
{
@@ -233,7 +233,7 @@ PrintcapEntry* ApsHandler::createEntry(KMPrinter *prt)
if (f.open(IO_WriteOnly))
{
QTextStream t(&f);
- QString work, server, printer, user, passwd;
+ TQString work, server, printer, user, passwd;
if ( splitSmbURI( prt->device(), work, server, printer, user, passwd ) )
{
if (work.isEmpty())
@@ -270,8 +270,8 @@ PrintcapEntry* ApsHandler::createEntry(KMPrinter *prt)
f.setName(path + "/netware.conf");
if (f.open(IO_WriteOnly))
{
- QString work, server, printer, user, passwd;
- QString uri = prt->device();
+ TQString work, server, printer, user, passwd;
+ TQString uri = prt->device();
uri.replace( 0, 3, "smb" );
if ( splitSmbURI( uri, work, server, printer, user, passwd ) )
{
@@ -297,7 +297,7 @@ PrintcapEntry* ApsHandler::createEntry(KMPrinter *prt)
}
}
// change file permissions
- ::chmod(QFile::encodeName(f.name()).data(), S_IRUSR|S_IWUSR);
+ ::chmod(TQFile::encodeName(f.name()).data(), S_IRUSR|S_IWUSR);
}
PrintcapEntry *entry = LprHandler::createEntry(prt);
if (!entry)
@@ -309,8 +309,8 @@ PrintcapEntry* ApsHandler::createEntry(KMPrinter *prt)
entry->addField("af", Field::String, sd + "/acct");
entry->addField("lf", Field::String, sd + "/log");
entry->addField("if", Field::String, sysconfDir() + "/basedir/bin/apsfilter");
- entry->comment = QString::fromLatin1("# APS%1_BEGIN:printer%2").arg(m_counter).arg(m_counter);
- entry->postcomment = QString::fromLatin1("# APS%1_END").arg(m_counter);
+ entry->comment = TQString::fromLatin1("# APS%1_BEGIN:printer%2").arg(m_counter).arg(m_counter);
+ entry->postcomment = TQString::fromLatin1("# APS%1_END").arg(m_counter);
m_counter++;
return entry;
}
@@ -328,15 +328,15 @@ bool ApsHandler::savePrinterDriver(KMPrinter *prt, PrintcapEntry *entry, DrMain
QTextStream t(&f);
t << "# File generated by KDEPrint" << endl;
t << "PRINTER='" << driver->get("gsdriver") << "'" << endl;
- QValueStack<DrGroup*> stack;
+ TQValueStack<DrGroup*> stack;
stack.push(driver);
while (stack.count() > 0)
{
DrGroup *grp = stack.pop();
- QPtrListIterator<DrGroup> git(grp->groups());
+ TQPtrListIterator<DrGroup> git(grp->groups());
for (; git.current(); ++git)
stack.push(git.current());
- QPtrListIterator<DrBase> oit(grp->options());
+ TQPtrListIterator<DrBase> oit(grp->options());
QString value;
for (; oit.current(); ++oit)
{
@@ -372,10 +372,10 @@ bool ApsHandler::savePrinterDriver(KMPrinter *prt, PrintcapEntry *entry, DrMain
bool ApsHandler::removePrinter(KMPrinter*, PrintcapEntry *entry)
{
QString path(sysconfDir() + "/" + entry->name);
- QFile::remove(path + "/smbclient.conf");
- QFile::remove(path + "/netware.conf");
- QFile::remove(path + "/apsfilterrc");
- if (!QDir(path).rmdir(path))
+ TQFile::remove(path + "/smbclient.conf");
+ TQFile::remove(path + "/netware.conf");
+ TQFile::remove(path + "/apsfilterrc");
+ if (!TQDir(path).rmdir(path))
{
manager()->setErrorMsg(i18n("Unable to remove directory %1.").arg(path));
return false;
@@ -383,11 +383,11 @@ bool ApsHandler::removePrinter(KMPrinter*, PrintcapEntry *entry)
return true;
}
-QString ApsHandler::printOptions(KPrinter *printer)
+TQString ApsHandler::printOptions(KPrinter *printer)
{
QString optstr;
- QMap<QString,QString> opts = printer->options();
- for (QMap<QString,QString>::ConstIterator it=opts.begin(); it!=opts.end(); ++it)
+ TQMap<TQString,TQString> opts = printer->options();
+ for (TQMap<TQString,TQString>::ConstIterator it=opts.begin(); it!=opts.end(); ++it)
{
if (it.key().startsWith("kde-") || it.key().startsWith("_kde-") || it.key().startsWith( "app-" ))
continue;
diff --git a/kdeprint/lpr/apshandler.h b/kdeprint/lpr/apshandler.h
index 58e6b8878..02ee79c92 100644
--- a/kdeprint/lpr/apshandler.h
+++ b/kdeprint/lpr/apshandler.h
@@ -22,7 +22,7 @@
#include "lprhandler.h"
-#include <qmap.h>
+#include <tqmap.h>
class ApsHandler : public LprHandler
{
@@ -33,21 +33,21 @@ public:
KMPrinter* createPrinter(PrintcapEntry*);
bool completePrinter(KMPrinter*, PrintcapEntry*, bool = true);
DrMain* loadDriver(KMPrinter*, PrintcapEntry*, bool = false);
- DrMain* loadDbDriver(const QString&);
+ DrMain* loadDbDriver(const TQString&);
void reset();
PrintcapEntry* createEntry(KMPrinter*);
bool savePrinterDriver(KMPrinter*, PrintcapEntry*, DrMain*, bool* = 0);
bool removePrinter(KMPrinter*, PrintcapEntry*);
- QString printOptions(KPrinter*);
+ TQString printOptions(KPrinter*);
protected:
- QString driverDirInternal();
+ TQString driverDirInternal();
private:
- QMap<QString,QString> loadResources(PrintcapEntry*);
- QMap<QString,QString> loadVarFile(const QString&);
- QString sysconfDir();
- QString shareDir();
+ TQMap<TQString,TQString> loadResources(PrintcapEntry*);
+ TQMap<TQString,TQString> loadVarFile(const TQString&);
+ TQString sysconfDir();
+ TQString shareDir();
DrMain* loadApsDriver(bool = false);
private:
diff --git a/kdeprint/lpr/editentrydialog.cpp b/kdeprint/lpr/editentrydialog.cpp
index 270b58235..6b0fb63f7 100644
--- a/kdeprint/lpr/editentrydialog.cpp
+++ b/kdeprint/lpr/editentrydialog.cpp
@@ -19,45 +19,45 @@
#include "editentrydialog.h"
-#include <qlineedit.h>
-#include <qcheckbox.h>
-#include <qspinbox.h>
-#include <qcombobox.h>
-#include <qlabel.h>
-#include <qheader.h>
+#include <tqlineedit.h>
+#include <tqcheckbox.h>
+#include <tqspinbox.h>
+#include <tqcombobox.h>
+#include <tqlabel.h>
+#include <tqheader.h>
#include <klistview.h>
-#include <qlayout.h>
-#include <qwidgetstack.h>
+#include <tqlayout.h>
+#include <tqwidgetstack.h>
#include <klocale.h>
#include <kiconloader.h>
-EditEntryDialog::EditEntryDialog(PrintcapEntry *entry, QWidget *parent, const char *name)
-: KDialogBase(parent, name, true, QString::null, Ok|Cancel)
+EditEntryDialog::EditEntryDialog(PrintcapEntry *entry, TQWidget *parent, const char *name)
+: KDialogBase(parent, name, true, TQString::null, Ok|Cancel)
{
- QWidget *w = new QWidget(this);
+ QWidget *w = new TQWidget(this);
setMainWidget(w);
- QLabel *lab0 = new QLabel(i18n("Aliases:"), w);
- m_aliases = new QLineEdit(w);
+ QLabel *lab0 = new TQLabel(i18n("Aliases:"), w);
+ m_aliases = new TQLineEdit(w);
m_view = new KListView(w);
m_view->addColumn("");
m_view->header()->hide();
- m_type = new QComboBox(w);
+ m_type = new TQComboBox(w);
m_type->insertItem(i18n("String"));
m_type->insertItem(i18n("Number"));
m_type->insertItem(i18n("Boolean"));
- m_stack = new QWidgetStack(w);
- m_boolean = new QCheckBox(i18n("Enabled"), m_stack);
- m_string = new QLineEdit(m_stack);
- m_number = new QSpinBox(0, 9999, 1, m_stack);
+ m_stack = new TQWidgetStack(w);
+ m_boolean = new TQCheckBox(i18n("Enabled"), m_stack);
+ m_string = new TQLineEdit(m_stack);
+ m_number = new TQSpinBox(0, 9999, 1, m_stack);
m_stack->addWidget(m_string, 0);
m_stack->addWidget(m_boolean, 2);
m_stack->addWidget(m_number, 1);
- m_name = new QLineEdit(w);
+ m_name = new TQLineEdit(w);
- QVBoxLayout *l0 = new QVBoxLayout(w, 0, 10);
- QHBoxLayout *l1 = new QHBoxLayout(0, 0, 10);
- QHBoxLayout *l2 = new QHBoxLayout(0, 0, 5);
+ QVBoxLayout *l0 = new TQVBoxLayout(w, 0, 10);
+ QHBoxLayout *l1 = new TQHBoxLayout(0, 0, 10);
+ QHBoxLayout *l2 = new TQHBoxLayout(0, 0, 5);
l0->addLayout(l1);
l1->addWidget(lab0);
l1->addWidget(m_aliases);
@@ -72,12 +72,12 @@ EditEntryDialog::EditEntryDialog(PrintcapEntry *entry, QWidget *parent, const ch
setCaption(i18n("Printcap Entry: %1").arg(entry->name));
m_fields = entry->fields;
m_aliases->setText(entry->aliases.join("|"));
- QListViewItem *root = new QListViewItem(m_view, entry->name), *item = 0;
+ QListViewItem *root = new TQListViewItem(m_view, entry->name), *item = 0;
root->setSelectable(false);
root->setOpen(true);
root->setPixmap(0, SmallIcon("fileprint"));
- for (QMap<QString,Field>::ConstIterator it=m_fields.begin(); it!=m_fields.end(); ++it)
- item = new QListViewItem(root, item, (*it).toString(), it.key());
+ for (TQMap<TQString,Field>::ConstIterator it=m_fields.begin(); it!=m_fields.end(); ++it)
+ item = new TQListViewItem(root, item, (*it).toString(), it.key());
}
m_block = true;
@@ -86,12 +86,12 @@ EditEntryDialog::EditEntryDialog(PrintcapEntry *entry, QWidget *parent, const ch
slotTypeChanged(0);
m_block = false;
- connect(m_view, SIGNAL(selectionChanged(QListViewItem*)), SLOT(slotItemSelected(QListViewItem*)));
- connect(m_string, SIGNAL(textChanged(const QString&)), SLOT(slotChanged()));
- connect(m_boolean, SIGNAL(toggled(bool)), SLOT(slotChanged()));
- connect(m_number, SIGNAL(valueChanged(int)), SLOT(slotChanged()));
- connect(m_type, SIGNAL(activated(int)), SLOT(slotTypeChanged(int)));
- connect(m_name, SIGNAL(textChanged(const QString&)), SLOT(slotChanged()));
+ connect(m_view, TQT_SIGNAL(selectionChanged(TQListViewItem*)), TQT_SLOT(slotItemSelected(TQListViewItem*)));
+ connect(m_string, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotChanged()));
+ connect(m_boolean, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotChanged()));
+ connect(m_number, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(slotChanged()));
+ connect(m_type, TQT_SIGNAL(activated(int)), TQT_SLOT(slotTypeChanged(int)));
+ connect(m_name, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotChanged()));
resize(500,400);
}
@@ -122,7 +122,7 @@ void EditEntryDialog::slotChanged()
}
}
-void EditEntryDialog::slotItemSelected(QListViewItem *item)
+void EditEntryDialog::slotItemSelected(TQListViewItem *item)
{
m_stack->setEnabled(item);
m_name->setEnabled(item);
@@ -144,7 +144,7 @@ void EditEntryDialog::slotItemSelected(QListViewItem *item)
void EditEntryDialog::fillEntry(PrintcapEntry *entry)
{
- entry->aliases = QStringList::split('|', m_aliases->text(), false);
+ entry->aliases = TQStringList::split('|', m_aliases->text(), false);
entry->fields = m_fields;
}
diff --git a/kdeprint/lpr/editentrydialog.h b/kdeprint/lpr/editentrydialog.h
index 906bc45db..eb861ccd7 100644
--- a/kdeprint/lpr/editentrydialog.h
+++ b/kdeprint/lpr/editentrydialog.h
@@ -35,12 +35,12 @@ class EditEntryDialog : public KDialogBase
{
Q_OBJECT
public:
- EditEntryDialog(PrintcapEntry *entry, QWidget *parent = 0, const char *name = 0);
+ EditEntryDialog(PrintcapEntry *entry, TQWidget *parent = 0, const char *name = 0);
void fillEntry(PrintcapEntry *entry);
protected slots:
- void slotItemSelected(QListViewItem*);
+ void slotItemSelected(TQListViewItem*);
void slotChanged();
void slotTypeChanged(int);
@@ -48,7 +48,7 @@ protected:
Field createField();
private:
- QMap<QString,Field> m_fields;
+ TQMap<TQString,Field> m_fields;
QLineEdit *m_name, *m_string, *m_aliases;
QCheckBox *m_boolean;
QComboBox *m_type;
diff --git a/kdeprint/lpr/klprprinterimpl.cpp b/kdeprint/lpr/klprprinterimpl.cpp
index f6f416376..1d77b166c 100644
--- a/kdeprint/lpr/klprprinterimpl.cpp
+++ b/kdeprint/lpr/klprprinterimpl.cpp
@@ -22,10 +22,10 @@
#include "kmlprmanager.h"
#include <kstandarddirs.h>
-#include <qfile.h>
+#include <tqfile.h>
#include <stdlib.h>
-KLprPrinterImpl::KLprPrinterImpl(QObject *parent, const char *name, const QStringList & /*args*/)
+KLprPrinterImpl::KLprPrinterImpl(TQObject *parent, const char *name, const TQStringList & /*args*/)
: KPrinterImpl(parent,name)
{
m_exepath = KStandardDirs::findExe("lpr");
@@ -35,25 +35,25 @@ KLprPrinterImpl::~KLprPrinterImpl()
{
}
-bool KLprPrinterImpl::setupCommand(QString& cmd, KPrinter *printer)
+bool KLprPrinterImpl::setupCommand(TQString& cmd, KPrinter *printer)
{
// check printer object
if (!printer || m_exepath.isEmpty())
return false;
- cmd = QString::fromLatin1("%1 -P %1 '-#%1'").arg(m_exepath).arg(quote(printer->printerName())).arg( printer->numCopies() );
+ cmd = TQString::fromLatin1("%1 -P %1 '-#%1'").arg(m_exepath).arg(quote(printer->printerName())).arg( printer->numCopies() );
QString opts = static_cast<KMLprManager*>(KMManager::self())->printOptions(printer);
if (!opts.isEmpty())
cmd += (" " + opts);
return true;
}
-void KLprPrinterImpl::broadcastOption(const QString& key, const QString& value)
+void KLprPrinterImpl::broadcastOption(const TQString& key, const TQString& value)
{
KPrinterImpl::broadcastOption(key,value);
if (key == "kde-pagesize")
{
- QString pagename = QString::fromLatin1(pageSizeToPageName((KPrinter::PageSize)value.toInt()));
+ QString pagename = TQString::fromLatin1(pageSizeToPageName((KPrinter::PageSize)value.toInt()));
KPrinterImpl::broadcastOption("PageSize",pagename);
}
}
diff --git a/kdeprint/lpr/klprprinterimpl.h b/kdeprint/lpr/klprprinterimpl.h
index e603e9396..ca346ab8a 100644
--- a/kdeprint/lpr/klprprinterimpl.h
+++ b/kdeprint/lpr/klprprinterimpl.h
@@ -25,11 +25,11 @@
class KLprPrinterImpl : public KPrinterImpl
{
public:
- KLprPrinterImpl(QObject *parent, const char *name, const QStringList & /*args*/);
+ KLprPrinterImpl(TQObject *parent, const char *name, const TQStringList & /*args*/);
~KLprPrinterImpl();
- bool setupCommand(QString&, KPrinter*);
- void broadcastOption(const QString& key, const QString& value);
+ bool setupCommand(TQString&, KPrinter*);
+ void broadcastOption(const TQString& key, const TQString& value);
private:
QString m_exepath;
diff --git a/kdeprint/lpr/kmconfiglpr.cpp b/kdeprint/lpr/kmconfiglpr.cpp
index ccf6a71a1..95a2e02d4 100644
--- a/kdeprint/lpr/kmconfiglpr.cpp
+++ b/kdeprint/lpr/kmconfiglpr.cpp
@@ -20,27 +20,27 @@
#include "kmconfiglpr.h"
#include "lprsettings.h"
-#include <qcombobox.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qgroupbox.h>
+#include <tqcombobox.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqgroupbox.h>
#include <klocale.h>
#include <kconfig.h>
-KMConfigLpr::KMConfigLpr(QWidget *parent, const char *name)
+KMConfigLpr::KMConfigLpr(TQWidget *parent, const char *name)
: KMConfigPage(parent, name)
{
setPageName(i18n("Spooler"));
setPageHeader(i18n("Spooler Settings"));
setPagePixmap("gear");
- QGroupBox *m_modebox = new QGroupBox(1, Qt::Vertical, i18n("Spooler"), this);
+ QGroupBox *m_modebox = new TQGroupBox(1, Qt::Vertical, i18n("Spooler"), this);
- m_mode = new QComboBox(m_modebox);
+ m_mode = new TQComboBox(m_modebox);
m_mode->insertItem("LPR (BSD compatible)");
m_mode->insertItem("LPRng");
- QVBoxLayout *l0 = new QVBoxLayout(this, 5, 10);
+ QVBoxLayout *l0 = new TQVBoxLayout(this, 5, 10);
l0->addWidget(m_modebox);
l0->addStretch(1);
}
diff --git a/kdeprint/lpr/kmconfiglpr.h b/kdeprint/lpr/kmconfiglpr.h
index 26538eb8f..13e52fb42 100644
--- a/kdeprint/lpr/kmconfiglpr.h
+++ b/kdeprint/lpr/kmconfiglpr.h
@@ -27,7 +27,7 @@ class QComboBox;
class KMConfigLpr : public KMConfigPage
{
public:
- KMConfigLpr(QWidget *parent = 0, const char *name = 0);
+ KMConfigLpr(TQWidget *parent = 0, const char *name = 0);
void loadConfig(KConfig*);
void saveConfig(KConfig*);
diff --git a/kdeprint/lpr/kmlprjobmanager.cpp b/kdeprint/lpr/kmlprjobmanager.cpp
index d60a41020..f002043d5 100644
--- a/kdeprint/lpr/kmlprjobmanager.cpp
+++ b/kdeprint/lpr/kmlprjobmanager.cpp
@@ -24,21 +24,21 @@
#include "kmjob.h"
#include "lprsettings.h"
-#include <qptrlist.h>
+#include <tqptrlist.h>
#include <klocale.h>
-KMLprJobManager::KMLprJobManager(QObject *parent, const char *name, const QStringList & /*args*/)
+KMLprJobManager::KMLprJobManager(TQObject *parent, const char *name, const TQStringList & /*args*/)
: KMJobManager(parent, name)
{
m_lpqhelper = new LpqHelper(this, "LpqHelper");
}
-bool KMLprJobManager::listJobs(const QString& prname, JobType, int limit)
+bool KMLprJobManager::listJobs(const TQString& prname, JobType, int limit)
{
- QPtrList<KMJob> jobList;
+ TQPtrList<KMJob> jobList;
jobList.setAutoDelete(false);
m_lpqhelper->listJobs(jobList, prname, limit);
- QPtrListIterator<KMJob> it(jobList);
+ TQPtrListIterator<KMJob> it(jobList);
for (; it.current(); ++it)
addJob(it.current());
return false;
@@ -58,10 +58,10 @@ int KMLprJobManager::actions()
return (KMJob::Remove | KMJob::Hold | KMJob::Resume);
}
-bool KMLprJobManager::sendCommandSystemJob(const QPtrList<KMJob>& jobs, int action, const QString& arg)
+bool KMLprJobManager::sendCommandSystemJob(const TQPtrList<KMJob>& jobs, int action, const TQString& arg)
{
QString msg;
- QPtrListIterator<KMJob> it(jobs);
+ TQPtrListIterator<KMJob> it(jobs);
bool status(true);
LpcHelper *helper = lpcHelper();
diff --git a/kdeprint/lpr/kmlprjobmanager.h b/kdeprint/lpr/kmlprjobmanager.h
index 555b5e75b..83d65a296 100644
--- a/kdeprint/lpr/kmlprjobmanager.h
+++ b/kdeprint/lpr/kmlprjobmanager.h
@@ -28,14 +28,14 @@ class LpcHelper;
class KMLprJobManager : public KMJobManager
{
public:
- KMLprJobManager(QObject *parent, const char *name, const QStringList & /*args*/);
+ KMLprJobManager(TQObject *parent, const char *name, const TQStringList & /*args*/);
int actions();
protected:
- bool listJobs(const QString&, JobType, int = 0);
+ bool listJobs(const TQString&, JobType, int = 0);
LpcHelper* lpcHelper();
- bool sendCommandSystemJob(const QPtrList<KMJob>&, int, const QString& = QString::null);
+ bool sendCommandSystemJob(const TQPtrList<KMJob>&, int, const TQString& = TQString::null);
private:
LpqHelper *m_lpqhelper;
diff --git a/kdeprint/lpr/kmlprmanager.cpp b/kdeprint/lpr/kmlprmanager.cpp
index e383bca2f..65b08eb67 100644
--- a/kdeprint/lpr/kmlprmanager.cpp
+++ b/kdeprint/lpr/kmlprmanager.cpp
@@ -28,8 +28,8 @@
#include "driver.h"
#include "editentrydialog.h"
-#include <qfileinfo.h>
-#include <qptrlist.h>
+#include <tqfileinfo.h>
+#include <tqptrlist.h>
#include <klocale.h>
#include <kstandarddirs.h>
#include <kdebug.h>
@@ -42,7 +42,7 @@
#include <stdlib.h>
#include <unistd.h>
-KMLprManager::KMLprManager(QObject *parent, const char *name, const QStringList & /*args*/)
+KMLprManager::KMLprManager(TQObject *parent, const char *name, const TQStringList & /*args*/)
: KMManager(parent,name)
{
m_handlers.setAutoDelete(true);
@@ -78,7 +78,7 @@ void KMLprManager::listPrinters()
// cleanup previous entries
m_entries.clear();
// notify handlers
- QPtrListIterator<LprHandler> hit(m_handlerlist);
+ TQPtrListIterator<LprHandler> hit(m_handlerlist);
for (; hit.current(); ++hit)
hit.current()->reset();
@@ -91,7 +91,7 @@ void KMLprManager::listPrinters()
reader.setPrintcapFile(&f);
while ((entry = reader.nextEntry()) != NULL)
{
- QPtrListIterator<LprHandler> it(m_handlerlist);
+ TQPtrListIterator<LprHandler> it(m_handlerlist);
for (; it.current(); ++it)
if (it.current()->validate(entry))
{
@@ -110,7 +110,7 @@ void KMLprManager::listPrinters()
}
else
{
- QPtrListIterator<KMPrinter> it(m_printers);
+ TQPtrListIterator<KMPrinter> it(m_printers);
for (; it.current(); ++it)
if (!it.current()->isSpecial())
{
@@ -138,9 +138,9 @@ void KMLprManager::initHandlers()
// now load external handlers
QStringList l = KGlobal::dirs()->findAllResources("data", "kdeprint/lpr/*.la");
- for (QStringList::ConstIterator it=l.begin(); it!=l.end(); ++it)
+ for (TQStringList::ConstIterator it=l.begin(); it!=l.end(); ++it)
{
- KLibrary *library = KLibLoader::self()->library(QFile::encodeName(*it));
+ KLibrary *library = KLibLoader::self()->library(TQFile::encodeName(*it));
if (library)
{
kdDebug() << "loading external handler from " << *it << endl;
@@ -228,10 +228,10 @@ DrMain* KMLprManager::loadPrinterDriver(KMPrinter *prt, bool config)
return NULL;
}
-DrMain* KMLprManager::loadFileDriver(const QString& filename)
+DrMain* KMLprManager::loadFileDriver(const TQString& filename)
{
int p = filename.find('/');
- QString handler_str = (p != -1 ? filename.left(p) : QString::fromLatin1("default"));
+ QString handler_str = (p != -1 ? filename.left(p) : TQString::fromLatin1("default"));
LprHandler *handler = m_handlers.find(handler_str);
if (handler)
{
@@ -293,7 +293,7 @@ bool KMLprManager::savePrintcapFile()
if (f.open(IO_WriteOnly))
{
QTextStream t(&f);
- QDictIterator<PrintcapEntry> it(m_entries);
+ TQDictIterator<PrintcapEntry> it(m_entries);
for (; it.current(); ++it)
{
it.current()->writeEntry(t);
@@ -361,7 +361,7 @@ bool KMLprManager::createPrinter(KMPrinter *prt)
entry->addField("mx", Field::Integer, "0");
entry->addField("sd", Field::String, sd);
if (!prt->option("kde-aliases").isEmpty())
- entry->aliases += QStringList::split("|", prt->option("kde-aliases"), false);
+ entry->aliases += TQStringList::split("|", prt->option("kde-aliases"), false);
// insert the new entry and save printcap file
m_entries.insert(prt->printerName(), entry);
@@ -405,7 +405,7 @@ bool KMLprManager::removePrinter(KMPrinter *prt)
{
// printcap file saved, entry can be deleted now
delete entry;
- status = (::system(QFile::encodeName("rm -rf " + KProcess::quote(sd))) == 0);
+ status = (::system(TQFile::encodeName("rm -rf " + KProcess::quote(sd))) == 0);
if (!status)
setErrorMsg(i18n("Unable to remove spool directory %1. "
"Check that you have write permissions "
@@ -420,14 +420,14 @@ bool KMLprManager::removePrinter(KMPrinter *prt)
return false;
}
-QString KMLprManager::driverDbCreationProgram()
+TQString KMLprManager::driverDbCreationProgram()
{
- return QString::fromLatin1("make_driver_db_lpr");
+ return TQString::fromLatin1("make_driver_db_lpr");
}
-QString KMLprManager::driverDirectory()
+TQString KMLprManager::driverDirectory()
{
- QPtrListIterator<LprHandler> it(m_handlerlist);
+ TQPtrListIterator<LprHandler> it(m_handlerlist);
QString dbDirs;
for (; it.current(); ++it)
{
@@ -440,7 +440,7 @@ QString KMLprManager::driverDirectory()
return dbDirs;
}
-QString KMLprManager::printOptions(KPrinter *prt)
+TQString KMLprManager::printOptions(KPrinter *prt)
{
KMPrinter *mprt = findPrinter(prt->printerName());
QString opts;
@@ -450,12 +450,12 @@ QString KMLprManager::printOptions(KPrinter *prt)
if (handler)
return handler->printOptions(prt);
}
- return QString::null;
+ return TQString::null;
}
void KMLprManager::createPluginActions(KActionCollection *coll)
{
- KAction *act = new KAction(i18n("&Edit printcap Entry..."), "kdeprint_report", 0, this, SLOT(slotEditPrintcap()), coll, "plugin_editprintcap");
+ KAction *act = new KAction(i18n("&Edit printcap Entry..."), "kdeprint_report", 0, this, TQT_SLOT(slotEditPrintcap()), coll, "plugin_editprintcap");
act->setGroup("plugin");
}
@@ -473,7 +473,7 @@ void KMLprManager::slotEditPrintcap()
i18n("Editing a printcap entry manually should only be "
"done by confirmed system administrator. This may "
"prevent your printer from working. Do you want to "
- "continue?"), QString::null, KStdGuiItem::cont(),
+ "continue?"), TQString::null, KStdGuiItem::cont(),
"editPrintcap") == KMessageBox::Cancel)
return;
@@ -484,7 +484,7 @@ void KMLprManager::slotEditPrintcap()
}
}
-QString KMLprManager::stateInformation()
+TQString KMLprManager::stateInformation()
{
return i18n("Spooler type: %1").arg(LprSettings::self()->mode() == LprSettings::LPR ? "LPR (BSD compatible)" : "LPRng");
}
diff --git a/kdeprint/lpr/kmlprmanager.h b/kdeprint/lpr/kmlprmanager.h
index 5a7612e38..516494f95 100644
--- a/kdeprint/lpr/kmlprmanager.h
+++ b/kdeprint/lpr/kmlprmanager.h
@@ -22,9 +22,9 @@
#include "kmmanager.h"
-#include <qdict.h>
-#include <qptrlist.h>
-#include <qdatetime.h>
+#include <tqdict.h>
+#include <tqptrlist.h>
+#include <tqdatetime.h>
#include <kurl.h>
class LprHandler;
@@ -36,7 +36,7 @@ class KMLprManager : public KMManager
{
Q_OBJECT
public:
- KMLprManager(QObject *parent, const char *name, const QStringList & /*args*/);
+ KMLprManager(TQObject *parent, const char *name, const TQStringList & /*args*/);
bool completePrinter(KMPrinter*);
bool completePrinterShort(KMPrinter*);
@@ -44,19 +44,19 @@ public:
bool startPrinter(KMPrinter*, bool);
bool savePrinterDriver(KMPrinter*, DrMain*);
DrMain* loadPrinterDriver(KMPrinter*, bool = false);
- DrMain* loadFileDriver(const QString&);
+ DrMain* loadFileDriver(const TQString&);
bool createPrinter(KMPrinter*);
bool removePrinter(KMPrinter*);
- QString driverDbCreationProgram();
- QString driverDirectory();
+ TQString driverDbCreationProgram();
+ TQString driverDirectory();
LpcHelper* lpcHelper() { return m_lpchelper; }
- QString printOptions(KPrinter*);
+ TQString printOptions(KPrinter*);
void createPluginActions(KActionCollection*);
void validatePluginActions(KActionCollection*, KMPrinter*);
- QString stateInformation();
+ TQString stateInformation();
protected slots:
void slotEditPrintcap();
@@ -71,9 +71,9 @@ protected:
bool savePrintcapFile();
private:
- QDict<LprHandler> m_handlers;
- QPtrList<LprHandler> m_handlerlist;
- QDict<PrintcapEntry> m_entries;
+ TQDict<LprHandler> m_handlers;
+ TQPtrList<LprHandler> m_handlerlist;
+ TQDict<PrintcapEntry> m_entries;
QDateTime m_updtime;
LpcHelper *m_lpchelper;
KMPrinter *m_currentprinter;
diff --git a/kdeprint/lpr/kmlpruimanager.cpp b/kdeprint/lpr/kmlpruimanager.cpp
index 7b621d66f..ea48c9bf9 100644
--- a/kdeprint/lpr/kmlpruimanager.cpp
+++ b/kdeprint/lpr/kmlpruimanager.cpp
@@ -31,7 +31,7 @@
#include <klocale.h>
-KMLprUiManager::KMLprUiManager(QObject *parent, const char *name, const QStringList & /*args*/)
+KMLprUiManager::KMLprUiManager(TQObject *parent, const char *name, const TQStringList & /*args*/)
: KMUiManager(parent,name)
{
}
diff --git a/kdeprint/lpr/kmlpruimanager.h b/kdeprint/lpr/kmlpruimanager.h
index 46eedb189..e7e015e2a 100644
--- a/kdeprint/lpr/kmlpruimanager.h
+++ b/kdeprint/lpr/kmlpruimanager.h
@@ -25,7 +25,7 @@
class KMLprUiManager : public KMUiManager
{
public:
- KMLprUiManager(QObject *parent, const char *name, const QStringList & /*args*/);
+ KMLprUiManager(TQObject *parent, const char *name, const TQStringList & /*args*/);
~KMLprUiManager();
void setupPropertyPages(KMPropertyPage*);
diff --git a/kdeprint/lpr/lpchelper.cpp b/kdeprint/lpr/lpchelper.cpp
index b4cd6f9e1..516e85af3 100644
--- a/kdeprint/lpr/lpchelper.cpp
+++ b/kdeprint/lpr/lpchelper.cpp
@@ -23,14 +23,14 @@
#include "lprsettings.h"
#include <kstandarddirs.h>
-#include <qtextstream.h>
-#include <qregexp.h>
+#include <tqtextstream.h>
+#include <tqregexp.h>
#include <kdebug.h>
#include <klocale.h>
#include <kprocess.h>
#include <stdlib.h>
-static QString execute(const QString& cmd)
+static TQString execute(const TQString& cmd)
{
KPipeProcess proc;
QString output;
@@ -44,8 +44,8 @@ static QString execute(const QString& cmd)
return output;
}
-LpcHelper::LpcHelper(QObject *parent, const char *name)
-: QObject(parent, name)
+LpcHelper::LpcHelper(TQObject *parent, const char *name)
+: TQObject(parent, name)
{
// look for the "lpc" executable. Use the PATH variable and
// add some specific dirs.
@@ -60,7 +60,7 @@ LpcHelper::~LpcHelper()
{
}
-KMPrinter::PrinterState LpcHelper::state(const QString& prname) const
+KMPrinter::PrinterState LpcHelper::state(const TQString& prname) const
{
if (m_state.contains(prname))
return m_state[prname];
@@ -72,7 +72,7 @@ KMPrinter::PrinterState LpcHelper::state(KMPrinter *prt) const
return state(prt->printerName());
}
-void LpcHelper::parseStatusLPR(QTextStream &t)
+void LpcHelper::parseStatusLPR(TQTextStream &t)
{
QString printer, line;
int p(-1);
@@ -107,7 +107,7 @@ void LpcHelper::parseStatusLPR(QTextStream &t)
}
}
-void LpcHelper::parseStatusLPRng(QTextStream& t)
+void LpcHelper::parseStatusLPRng(TQTextStream& t)
{
QStringList l;
int p(-1);
@@ -118,7 +118,7 @@ void LpcHelper::parseStatusLPRng(QTextStream& t)
break;
while (!t.atEnd())
{
- l = QStringList::split(QRegExp("\\s"), t.readLine(), false);
+ l = TQStringList::split(TQRegExp("\\s"), t.readLine(), false);
if (l.count() < 4)
continue;
p = l[0].find('@');
@@ -163,7 +163,7 @@ void LpcHelper::updateStates()
}
-bool LpcHelper::enable(KMPrinter *prt, bool state, QString& msg)
+bool LpcHelper::enable(KMPrinter *prt, bool state, TQString& msg)
{
int st = m_state[prt->printerName()] & KMPrinter::StateMask;
if (changeState(prt->printerName(), (state ? "enable" : "disable"), msg))
@@ -174,7 +174,7 @@ bool LpcHelper::enable(KMPrinter *prt, bool state, QString& msg)
return false;
}
-bool LpcHelper::start(KMPrinter *prt, bool state, QString& msg)
+bool LpcHelper::start(KMPrinter *prt, bool state, TQString& msg)
{
int rej = m_state[prt->printerName()] & ~KMPrinter::StateMask;
if (changeState(prt->printerName(), (state ? "start" : "stop"), msg))
@@ -190,7 +190,7 @@ bool LpcHelper::start(KMPrinter *prt, bool state, QString& msg)
// -1 : permission denied
// -2 : unknown printer
// 1 : unknown error
-int LpcHelper::parseStateChangeLPR(const QString& result, const QString& printer)
+int LpcHelper::parseStateChangeLPR(const TQString& result, const TQString& printer)
{
if (result.startsWith(printer + ":"))
return 0;
@@ -202,7 +202,7 @@ int LpcHelper::parseStateChangeLPR(const QString& result, const QString& printer
return 1;
}
-static QString lprngAnswer(const QString& result, const QString& printer)
+static TQString lprngAnswer(const TQString& result, const TQString& printer)
{
int p, q;
@@ -214,10 +214,10 @@ static QString lprngAnswer(const QString& result, const QString& printer)
QString answer = result.mid(q, p-q).stripWhiteSpace();
return answer;
}
- return QString::null;
+ return TQString::null;
}
-int LpcHelper::parseStateChangeLPRng(const QString& result, const QString& printer)
+int LpcHelper::parseStateChangeLPRng(const TQString& result, const TQString& printer)
{
QString answer = lprngAnswer(result, printer);
if (answer == "no")
@@ -228,7 +228,7 @@ int LpcHelper::parseStateChangeLPRng(const QString& result, const QString& print
return 1;
}
-bool LpcHelper::changeState(const QString& printer, const QString& op, QString& msg)
+bool LpcHelper::changeState(const TQString& printer, const TQString& op, TQString& msg)
{
if (m_exepath.isEmpty())
{
@@ -260,20 +260,20 @@ bool LpcHelper::changeState(const QString& printer, const QString& op, QString&
break;
default:
case 1:
- msg = i18n("Unknown error: %1").arg(result.replace(QRegExp("\\n"), " "));
+ msg = i18n("Unknown error: %1").arg(result.replace(TQRegExp("\\n"), " "));
break;
}
return (status == 0);
}
-bool LpcHelper::removeJob(KMJob *job, QString& msg)
+bool LpcHelper::removeJob(KMJob *job, TQString& msg)
{
if (m_lprmpath.isEmpty())
{
msg = i18n("The executable %1 couldn't be found in your PATH.").arg("lprm");
return false;
}
- QString result = execute(m_lprmpath + " -P " + KProcess::quote(job->printer()) + " " + QString::number(job->id()));
+ QString result = execute(m_lprmpath + " -P " + KProcess::quote(job->printer()) + " " + TQString::number(job->id()));
if (result.find("dequeued") != -1)
return true;
else if (result.find("Permission denied") != -1 || result.find("no permissions") != -1)
@@ -284,14 +284,14 @@ bool LpcHelper::removeJob(KMJob *job, QString& msg)
}
// LPRng only
-bool LpcHelper::changeJobState(KMJob *job, int state, QString& msg)
+bool LpcHelper::changeJobState(KMJob *job, int state, TQString& msg)
{
if (m_lprmpath.isEmpty())
{
msg = i18n("The executable %1 couldn't be found in your PATH.").arg("lpc");
return false;
}
- QString result = execute(m_exepath + (state == KMJob::Held ? " hold " : " release ") + KProcess::quote(job->printer()) + " " + QString::number(job->id()));
+ QString result = execute(m_exepath + (state == KMJob::Held ? " hold " : " release ") + KProcess::quote(job->printer()) + " " + TQString::number(job->id()));
QString answer = lprngAnswer(result, job->printer());
if (answer == "no")
{
@@ -302,7 +302,7 @@ bool LpcHelper::changeJobState(KMJob *job, int state, QString& msg)
return true;
}
-bool LpcHelper::restart(QString& msg)
+bool LpcHelper::restart(TQString& msg)
{
QString s;
if (m_exepath.isEmpty())
@@ -314,7 +314,7 @@ bool LpcHelper::restart(QString& msg)
msg = i18n("The executable %1 couldn't be found in your PATH.").arg(s);
return false;
}
- ::system(QFile::encodeName(m_exepath + " reread"));
- ::system(QFile::encodeName(m_checkpcpath + " -f"));
+ ::system(TQFile::encodeName(m_exepath + " reread"));
+ ::system(TQFile::encodeName(m_checkpcpath + " -f"));
return true;
}
diff --git a/kdeprint/lpr/lpchelper.h b/kdeprint/lpr/lpchelper.h
index a4474354d..d7e6c7897 100644
--- a/kdeprint/lpr/lpchelper.h
+++ b/kdeprint/lpr/lpchelper.h
@@ -20,9 +20,9 @@
#ifndef LPCHELPER_H
#define LPCHELPER_H
-#include <qobject.h>
-#include <qmap.h>
-#include <qtextstream.h>
+#include <tqobject.h>
+#include <tqmap.h>
+#include <tqtextstream.h>
#include "kmprinter.h"
class KMJob;
@@ -30,29 +30,29 @@ class KMJob;
class LpcHelper : public QObject
{
public:
- LpcHelper(QObject *parent = 0, const char *name = 0);
+ LpcHelper(TQObject *parent = 0, const char *name = 0);
~LpcHelper();
- KMPrinter::PrinterState state(const QString&) const;
+ KMPrinter::PrinterState state(const TQString&) const;
KMPrinter::PrinterState state(KMPrinter*) const;
void updateStates();
- bool enable(KMPrinter*, bool, QString&);
- bool start(KMPrinter*, bool, QString&);
- bool removeJob(KMJob*, QString&);
- bool changeJobState(KMJob*, int, QString&);
+ bool enable(KMPrinter*, bool, TQString&);
+ bool start(KMPrinter*, bool, TQString&);
+ bool removeJob(KMJob*, TQString&);
+ bool changeJobState(KMJob*, int, TQString&);
- bool restart(QString&);
+ bool restart(TQString&);
protected:
- bool changeState(const QString&, const QString&, QString&);
- void parseStatusLPR(QTextStream&);
- void parseStatusLPRng(QTextStream&);
- int parseStateChangeLPR(const QString&, const QString&);
- int parseStateChangeLPRng(const QString&, const QString&);
+ bool changeState(const TQString&, const TQString&, TQString&);
+ void parseStatusLPR(TQTextStream&);
+ void parseStatusLPRng(TQTextStream&);
+ int parseStateChangeLPR(const TQString&, const TQString&);
+ int parseStateChangeLPRng(const TQString&, const TQString&);
private:
- QMap<QString, KMPrinter::PrinterState> m_state;
+ TQMap<TQString, KMPrinter::PrinterState> m_state;
QString m_exepath, m_lprmpath, m_checkpcpath;
};
diff --git a/kdeprint/lpr/lpqhelper.cpp b/kdeprint/lpr/lpqhelper.cpp
index c9f26174b..2675c9d41 100644
--- a/kdeprint/lpr/lpqhelper.cpp
+++ b/kdeprint/lpr/lpqhelper.cpp
@@ -26,8 +26,8 @@
#include <kprocess.h>
#include <kdebug.h>
-LpqHelper::LpqHelper(QObject *parent, const char *name)
-: QObject(parent, name)
+LpqHelper::LpqHelper(TQObject *parent, const char *name)
+: TQObject(parent, name)
{
m_exepath = KStandardDirs::findExe("lpq");
}
@@ -36,7 +36,7 @@ LpqHelper::~LpqHelper()
{
}
-KMJob* LpqHelper::parseLineLpr(const QString& line)
+KMJob* LpqHelper::parseLineLpr(const TQString& line)
{
QString rank = line.left(7);
if (!rank[0].isDigit() && rank != "active")
@@ -54,7 +54,7 @@ KMJob* LpqHelper::parseLineLpr(const QString& line)
return job;
}
-KMJob* LpqHelper::parseLineLPRng(const QString& line)
+KMJob* LpqHelper::parseLineLPRng(const TQString& line)
{
QString rank = line.left(7).stripWhiteSpace();
if (!rank[0].isDigit() && rank != "active" && rank != "hold")
@@ -80,7 +80,7 @@ KMJob* LpqHelper::parseLineLPRng(const QString& line)
return job;
}
-void LpqHelper::listJobs(QPtrList<KMJob>& jobs, const QString& prname, int limit)
+void LpqHelper::listJobs(TQPtrList<KMJob>& jobs, const TQString& prname, int limit)
{
KPipeProcess proc;
if (!m_exepath.isEmpty() && proc.open(m_exepath + " -P " + KProcess::quote(prname)))
@@ -105,7 +105,7 @@ void LpqHelper::listJobs(QPtrList<KMJob>& jobs, const QString& prname, int limit
if (job)
{
job->setPrinter(prname);
- job->setUri("lpd://"+prname+"/"+QString::number(job->id()));
+ job->setUri("lpd://"+prname+"/"+TQString::number(job->id()));
jobs.append(job);
count++;
}
diff --git a/kdeprint/lpr/lpqhelper.h b/kdeprint/lpr/lpqhelper.h
index 1c9af35a6..b41521f66 100644
--- a/kdeprint/lpr/lpqhelper.h
+++ b/kdeprint/lpr/lpqhelper.h
@@ -20,22 +20,22 @@
#ifndef LPQHELPER_H
#define LPQHELPER_H
-#include <qobject.h>
-#include <qptrlist.h>
+#include <tqobject.h>
+#include <tqptrlist.h>
class KMJob;
class LpqHelper : public QObject
{
public:
- LpqHelper(QObject *parent = 0, const char *name = 0);
+ LpqHelper(TQObject *parent = 0, const char *name = 0);
~LpqHelper();
- void listJobs(QPtrList<KMJob>& jobs, const QString& prname, int limit = 0);
+ void listJobs(TQPtrList<KMJob>& jobs, const TQString& prname, int limit = 0);
protected:
- KMJob* parseLineLpr(const QString&);
- KMJob* parseLineLPRng(const QString&);
+ KMJob* parseLineLpr(const TQString&);
+ KMJob* parseLineLPRng(const TQString&);
private:
QString m_exepath;
diff --git a/kdeprint/lpr/lprhandler.cpp b/kdeprint/lpr/lprhandler.cpp
index 396562691..600df4796 100644
--- a/kdeprint/lpr/lprhandler.cpp
+++ b/kdeprint/lpr/lprhandler.cpp
@@ -24,14 +24,14 @@
#include "lprsettings.h"
#include "driver.h"
-#include <qfile.h>
-#include <qtextstream.h>
-#include <qvaluestack.h>
+#include <tqfile.h>
+#include <tqtextstream.h>
+#include <tqvaluestack.h>
#include <klocale.h>
#include <unistd.h>
-LprHandler::LprHandler(const QString& name, KMManager *mgr)
+LprHandler::LprHandler(const TQString& name, KMManager *mgr)
: m_name(name), m_manager(mgr)
{
}
@@ -57,7 +57,7 @@ KMPrinter* LprHandler::createPrinter(PrintcapEntry *entry)
bool LprHandler::completePrinter(KMPrinter *prt, PrintcapEntry *entry, bool)
{
prt->setDescription(i18n("Unknown (unrecognized entry)"));
- QString val = entry->field("lp");
+ TQString val = entry->field("lp");
KURL uri;
if (!val.isEmpty() && val != "/dev/null")
{
@@ -85,7 +85,7 @@ bool LprHandler::completePrinter(KMPrinter *prt, PrintcapEntry *entry, bool)
}
else if (!(val = entry->field("rp")).isEmpty())
{
- QString rm = entry->has("rm") ?
+ TQString rm = entry->has("rm") ?
entry->field("rm") :
LprSettings::self()->defaultRemoteHost();
prt->setLocation(i18n("Remote queue (%1) on %2").arg(val).arg(rm));
@@ -111,7 +111,7 @@ bool LprHandler::savePrinterDriver(KMPrinter*, PrintcapEntry*, DrMain*, bool*)
return false;
}
-DrMain* LprHandler::loadDbDriver(const QString&)
+DrMain* LprHandler::loadDbDriver(const TQString&)
{
manager()->setErrorMsg(i18n("Unrecognized entry."));
return NULL;
@@ -138,15 +138,15 @@ PrintcapEntry* LprHandler::createEntry(KMPrinter *prt)
entry->addField("rp", Field::String, rp);
// force this entry to null (otherwise it seems it's redirected
// to /dev/lp0 by default)
- entry->addField("lp", Field::String, QString::null);
+ entry->addField("lp", Field::String, TQString::null);
}
else if ( prot == "socket" )
{
- QString lp = uri.host();
+ TQString lp = uri.host();
if ( uri.port() == 0 )
lp.append( "%9100" );
else
- lp.append( "%" ).append( QString::number( uri.port() ) );
+ lp.append( "%" ).append( TQString::number( uri.port() ) );
entry->addField("lp", Field::String, lp);
}
else
@@ -161,22 +161,22 @@ bool LprHandler::removePrinter(KMPrinter*, PrintcapEntry*)
return true;
}
-QString LprHandler::printOptions(KPrinter*)
+TQString LprHandler::printOptions(KPrinter*)
{
- return QString::null;
+ return TQString::null;
}
void LprHandler::reset()
{
}
-DrMain* LprHandler::loadToolDriver(const QString& filename)
+DrMain* LprHandler::loadToolDriver(const TQString& filename)
{
QFile f(filename);
if (f.open(IO_ReadOnly))
{
DrMain *driver = new DrMain;
- QValueStack<DrGroup*> groups;
+ TQValueStack<DrGroup*> groups;
QTextStream t(&f);
QStringList l;
DrListOption *lopt(0);
@@ -186,7 +186,7 @@ DrMain* LprHandler::loadToolDriver(const QString& filename)
driver->set("text", "Tool Driver");
while (!t.atEnd())
{
- l = QStringList::split('|', t.readLine().stripWhiteSpace(), false);
+ l = TQStringList::split('|', t.readLine().stripWhiteSpace(), false);
if (l.count() == 0)
continue;
if (l[0] == "GROUP")
@@ -245,26 +245,26 @@ DrMain* LprHandler::loadToolDriver(const QString& filename)
return NULL;
}
-QString LprHandler::driverDirectory()
+TQString LprHandler::driverDirectory()
{
if (m_cacheddriverdir.isEmpty())
m_cacheddriverdir = driverDirInternal();
return m_cacheddriverdir;
}
-QString LprHandler::driverDirInternal()
+TQString LprHandler::driverDirInternal()
{
- return QString::null;
+ return TQString::null;
}
-QString LprHandler::locateDir(const QString& dirname, const QString& paths)
+TQString LprHandler::locateDir(const TQString& dirname, const TQString& paths)
{
- QStringList pathlist = QStringList::split(':', paths, false);
- for (QStringList::ConstIterator it=pathlist.begin(); it!=pathlist.end(); ++it)
+ QStringList pathlist = TQStringList::split(':', paths, false);
+ for (TQStringList::ConstIterator it=pathlist.begin(); it!=pathlist.end(); ++it)
{
QString testpath = *it + "/" + dirname;
- if (::access(QFile::encodeName(testpath), F_OK) == 0)
+ if (::access(TQFile::encodeName(testpath), F_OK) == 0)
return testpath;
}
- return QString::null;
+ return TQString::null;
}
diff --git a/kdeprint/lpr/lprhandler.h b/kdeprint/lpr/lprhandler.h
index 49b9c6236..98b9c3819 100644
--- a/kdeprint/lpr/lprhandler.h
+++ b/kdeprint/lpr/lprhandler.h
@@ -24,7 +24,7 @@
#warning internal header, do not use except if you are a KDEPrint developer
#endif
-#include <qstring.h>
+#include <tqstring.h>
class PrintcapEntry;
class KMPrinter;
@@ -42,30 +42,30 @@ class KPrinter;
class LprHandler
{
public:
- LprHandler(const QString& name, KMManager *mgr = 0);
+ LprHandler(const TQString& name, KMManager *mgr = 0);
virtual ~LprHandler();
virtual bool validate(PrintcapEntry*);
virtual KMPrinter* createPrinter(PrintcapEntry*);
virtual bool completePrinter(KMPrinter*, PrintcapEntry*, bool shortmode = true);
virtual DrMain* loadDriver(KMPrinter*, PrintcapEntry*, bool = false);
- virtual DrMain* loadDbDriver(const QString&);
+ virtual DrMain* loadDbDriver(const TQString&);
virtual bool savePrinterDriver(KMPrinter*, PrintcapEntry*, DrMain*, bool* = 0);
virtual PrintcapEntry* createEntry(KMPrinter*);
virtual bool removePrinter(KMPrinter*, PrintcapEntry*);
- virtual QString printOptions(KPrinter*);
+ virtual TQString printOptions(KPrinter*);
virtual void reset();
- QString name() const;
+ TQString name() const;
KMManager* manager() const;
- QString driverDirectory();
+ TQString driverDirectory();
protected:
- DrMain* loadToolDriver(const QString&);
- QString locateDir(const QString& dirname, const QString& paths);
- QString cachedDriverDir() const;
- void setCachedDriverDir(const QString&);
- virtual QString driverDirInternal();
+ DrMain* loadToolDriver(const TQString&);
+ TQString locateDir(const TQString& dirname, const TQString& paths);
+ TQString cachedDriverDir() const;
+ void setCachedDriverDir(const TQString&);
+ virtual TQString driverDirInternal();
protected:
QString m_name;
@@ -73,16 +73,16 @@ protected:
QString m_cacheddriverdir;
};
-inline QString LprHandler::name() const
+inline TQString LprHandler::name() const
{ return m_name; }
inline KMManager* LprHandler::manager() const
{ return m_manager; }
-inline QString LprHandler::cachedDriverDir() const
+inline TQString LprHandler::cachedDriverDir() const
{ return m_cacheddriverdir; }
-inline void LprHandler::setCachedDriverDir(const QString& s)
+inline void LprHandler::setCachedDriverDir(const TQString& s)
{ m_cacheddriverdir = s; }
#endif
diff --git a/kdeprint/lpr/lprngtoolhandler.cpp b/kdeprint/lpr/lprngtoolhandler.cpp
index 1b08d70b9..3710496a9 100644
--- a/kdeprint/lpr/lprngtoolhandler.cpp
+++ b/kdeprint/lpr/lprngtoolhandler.cpp
@@ -26,8 +26,8 @@
#include "kmmanager.h"
#include "kprinter.h"
-#include <qfile.h>
-#include <qtextstream.h>
+#include <tqfile.h>
+#include <tqtextstream.h>
#include <klocale.h>
#include <kdebug.h>
#include <kstandarddirs.h>
@@ -50,7 +50,7 @@ bool LPRngToolHandler::completePrinter(KMPrinter *prt, PrintcapEntry *entry, boo
QString str, lp;
// look for type in comment
- QStringList l = QStringList::split(' ', entry->comment, false);
+ QStringList l = TQStringList::split(' ', entry->comment, false);
lp = entry->field("lp");
if (l.count() < 1)
return false;
@@ -59,10 +59,10 @@ bool LPRngToolHandler::completePrinter(KMPrinter *prt, PrintcapEntry *entry, boo
LprHandler::completePrinter(prt, entry, shortmode);
else if (l[1] == "SMB")
{
- QMap<QString,QString> opts = parseXferOptions(entry->field("xfer_options"));
+ TQMap<TQString,TQString> opts = parseXferOptions(entry->field("xfer_options"));
QString user, pass;
loadAuthFile(LprSettings::self()->baseSpoolDir() + "/" + entry->name + "/" + opts["authfile"], user, pass);
- QString uri = buildSmbURI(
+ TQString uri = buildSmbURI(
opts[ "workgroup" ],
opts[ "host" ],
opts[ "printer" ],
@@ -103,15 +103,15 @@ bool LPRngToolHandler::completePrinter(KMPrinter *prt, PrintcapEntry *entry, boo
return true;
}
-QMap<QString,QString> LPRngToolHandler::parseXferOptions(const QString& str)
+TQMap<TQString,TQString> LPRngToolHandler::parseXferOptions(const TQString& str)
{
uint p(0), q;
- QMap<QString,QString> opts;
+ TQMap<TQString,TQString> opts;
QString key, val;
while (p < str.length())
{
- key = val = QString::null;
+ key = val = TQString::null;
// skip spaces
while (p < str.length() && str[p].isSpace())
p++;
@@ -130,7 +130,7 @@ QMap<QString,QString> LPRngToolHandler::parseXferOptions(const QString& str)
return opts;
}
-void LPRngToolHandler::loadAuthFile(const QString& filename, QString& user, QString& pass)
+void LPRngToolHandler::loadAuthFile(const TQString& filename, TQString& user, TQString& pass)
{
QFile f(filename);
if (f.open(IO_ReadOnly))
@@ -170,7 +170,7 @@ DrMain* LPRngToolHandler::loadDriver(KMPrinter *prt, PrintcapEntry *entry, bool
driver->set("text", i18n("LPRngTool Common Driver (%1)").arg((model.isEmpty() ? i18n("unknown") : model)));
if (!model.isEmpty())
driver->set("driverID", model);
- QMap<QString,QString> opts = parseZOptions(entry->field("prefix_z"));
+ TQMap<TQString,TQString> opts = parseZOptions(entry->field("prefix_z"));
opts["lpr"] = entry->field("lpr");
driver->setOptions(opts);
// if not configuring, don't show the "lpr" options
@@ -180,7 +180,7 @@ DrMain* LPRngToolHandler::loadDriver(KMPrinter *prt, PrintcapEntry *entry, bool
return driver;
}
-DrMain* LPRngToolHandler::loadDbDriver(const QString& s)
+DrMain* LPRngToolHandler::loadDbDriver(const TQString& s)
{
int p = s.find('/');
DrMain* driver = loadToolDriver(locate("data", "kdeprint/lprngtooldriver1"));
@@ -189,10 +189,10 @@ DrMain* LPRngToolHandler::loadDbDriver(const QString& s)
return driver;
}
-QValueList< QPair<QString,QStringList> > LPRngToolHandler::loadChoiceDict(const QString& filename)
+TQValueList< QPair<TQString,TQStringList> > LPRngToolHandler::loadChoiceDict(const TQString& filename)
{
QFile f(filename);
- QValueList< QPair<QString,QStringList> > dict;
+ TQValueList< QPair<TQString,TQStringList> > dict;
if (f.open(IO_ReadOnly))
{
QTextStream t(&f);
@@ -204,9 +204,9 @@ QValueList< QPair<QString,QStringList> > LPRngToolHandler::loadChoiceDict(const
if (line.startsWith("OPTION"))
{
if (l.count() > 0 && !key.isEmpty())
- dict << QPair<QString,QStringList>(key, l);
+ dict << QPair<TQString,TQStringList>(key, l);
l.clear();
- key = QString::null;
+ key = TQString::null;
if (line.contains('|') == 2 || line.right(7) == "BOOLEAN")
{
int p = line.find('|', 7);
@@ -223,10 +223,10 @@ QValueList< QPair<QString,QStringList> > LPRngToolHandler::loadChoiceDict(const
return dict;
}
-QMap<QString,QString> LPRngToolHandler::parseZOptions(const QString& optstr)
+TQMap<TQString,TQString> LPRngToolHandler::parseZOptions(const TQString& optstr)
{
- QMap<QString,QString> opts;
- QStringList l = QStringList::split(',', optstr, false);
+ TQMap<TQString,TQString> opts;
+ QStringList l = TQStringList::split(',', optstr, false);
if (l.count() == 0)
return opts;
@@ -234,10 +234,10 @@ QMap<QString,QString> LPRngToolHandler::parseZOptions(const QString& optstr)
m_dict = loadChoiceDict(locate("data", "kdeprint/lprngtooldriver1"));
QString unknown;
- for (QStringList::ConstIterator it=l.begin(); it!=l.end(); ++it)
+ for (TQStringList::ConstIterator it=l.begin(); it!=l.end(); ++it)
{
bool found(false);
- for (QValueList< QPair<QString,QStringList> >::ConstIterator p=m_dict.begin(); p!=m_dict.end() && !found; ++p)
+ for (TQValueList< QPair<TQString,TQStringList> >::ConstIterator p=m_dict.begin(); p!=m_dict.end() && !found; ++p)
{
if ((*p).second.find(*it) != (*p).second.end())
{
@@ -258,12 +258,12 @@ QMap<QString,QString> LPRngToolHandler::parseZOptions(const QString& optstr)
return opts;
}
-QString LPRngToolHandler::filterDir()
+TQString LPRngToolHandler::filterDir()
{
return driverDirectory();
}
-QString LPRngToolHandler::driverDirInternal()
+TQString LPRngToolHandler::driverDirInternal()
{
return locateDir("filters", "/usr/lib:/usr/local/lib:/opt/lib:/usr/libexec:/usr/local/libexec:/opt/libexec");
}
@@ -293,7 +293,7 @@ PrintcapEntry* LPRngToolHandler::createEntry(KMPrinter *prt)
if (url.port() == 0)
lp.append("%9100");
else
- lp.append("%").append(QString::number(url.port()));
+ lp.append("%").append(TQString::number(url.port()));
}
else if (prot == "lpd")
{
@@ -308,7 +308,7 @@ PrintcapEntry* LPRngToolHandler::createEntry(KMPrinter *prt)
QString work, server, printer, user, passwd;
if ( splitSmbURI( prt->device(), work, server, printer, user, passwd ) )
{
- entry->addField("xfer_options", Field::String, QString::fromLatin1("authfile=\"auth\" crlf=\"0\" hostip=\"\" host=\"%1\" printer=\"%2\" remote_mode=\"SMB\" share=\"//%3/%4\" workgroup=\"%5\"").arg(server).arg(printer).arg(server).arg(printer).arg(work));
+ entry->addField("xfer_options", Field::String, TQString::fromLatin1("authfile=\"auth\" crlf=\"0\" hostip=\"\" host=\"%1\" printer=\"%2\" remote_mode=\"SMB\" share=\"//%3/%4\" workgroup=\"%5\"").arg(server).arg(printer).arg(server).arg(printer).arg(work));
QFile authfile(LprSettings::self()->baseSpoolDir() + "/" + prt->printerName() + "/auth");
if (authfile.open(IO_WriteOnly))
{
@@ -331,12 +331,12 @@ PrintcapEntry* LPRngToolHandler::createEntry(KMPrinter *prt)
DrMain *driver = prt->driver();
comment.append("filtertype=IFHP ifhp_options=status@,sync@,pagecount@,waitend@ printerdb_entry=");
comment.append(driver->get("driverID"));
- entry->addField("ifhp", Field::String, QString::fromLatin1("model=%1,status@,sync@,pagecount@,waitend@").arg(driver->get("driverID")));
- entry->addField("lprngtooloptions", Field::String, QString::fromLatin1("FILTERTYPE=\"IFHP\" IFHP_OPTIONS=\"status@,sync@,pagecount@,waitend@\" PRINTERDB_ENTRY=\"%1\"").arg(driver->get("driverID")));
- QMap<QString,QString> opts;
+ entry->addField("ifhp", Field::String, TQString::fromLatin1("model=%1,status@,sync@,pagecount@,waitend@").arg(driver->get("driverID")));
+ entry->addField("lprngtooloptions", Field::String, TQString::fromLatin1("FILTERTYPE=\"IFHP\" IFHP_OPTIONS=\"status@,sync@,pagecount@,waitend@\" PRINTERDB_ENTRY=\"%1\"").arg(driver->get("driverID")));
+ TQMap<TQString,TQString> opts;
QString optstr;
driver->getOptions(opts, false);
- for (QMap<QString,QString>::ConstIterator it=opts.begin(); it!=opts.end(); ++it)
+ for (TQMap<TQString,TQString>::ConstIterator it=opts.begin(); it!=opts.end(); ++it)
if (it.key() != "lpr")
optstr.append(*it).append(",");
if (!optstr.isEmpty())
@@ -357,10 +357,10 @@ PrintcapEntry* LPRngToolHandler::createEntry(KMPrinter *prt)
bool LPRngToolHandler::savePrinterDriver(KMPrinter*, PrintcapEntry *entry, DrMain *driver, bool *mustSave)
{
// save options in the "prefix_z" field and tell the manager to save the printcap file
- QMap<QString,QString> opts;
+ TQMap<TQString,TQString> opts;
QString optstr;
driver->getOptions(opts, false);
- for (QMap<QString,QString>::ConstIterator it=opts.begin(); it!=opts.end(); ++it)
+ for (TQMap<TQString,TQString>::ConstIterator it=opts.begin(); it!=opts.end(); ++it)
if (it.key() != "lpr")
optstr.append(*it).append(",");
if (!optstr.isEmpty())
@@ -374,11 +374,11 @@ bool LPRngToolHandler::savePrinterDriver(KMPrinter*, PrintcapEntry *entry, DrMai
return true;
}
-QString LPRngToolHandler::printOptions(KPrinter *printer)
+TQString LPRngToolHandler::printOptions(KPrinter *printer)
{
QString optstr;
- QMap<QString,QString> opts = printer->options();
- for (QMap<QString,QString>::ConstIterator it=opts.begin(); it!=opts.end(); ++it)
+ TQMap<TQString,TQString> opts = printer->options();
+ for (TQMap<TQString,TQString>::ConstIterator it=opts.begin(); it!=opts.end(); ++it)
{
if (it.key().startsWith("kde-") || it.key().startsWith("_kde-") || it.key() == "lpr" || it.key().startsWith( "app-" ))
continue;
diff --git a/kdeprint/lpr/lprngtoolhandler.h b/kdeprint/lpr/lprngtoolhandler.h
index ceff82393..6d7ec299f 100644
--- a/kdeprint/lpr/lprngtoolhandler.h
+++ b/kdeprint/lpr/lprngtoolhandler.h
@@ -21,9 +21,9 @@
#define LPRNGTOOLHANDLER_H
#include "lprhandler.h"
-#include <qmap.h>
-#include <qstringlist.h>
-#include <qpair.h>
+#include <tqmap.h>
+#include <tqstringlist.h>
+#include <tqpair.h>
class LPRngToolHandler : public LprHandler
{
@@ -33,22 +33,22 @@ public:
bool validate(PrintcapEntry*);
bool completePrinter(KMPrinter*, PrintcapEntry*, bool = true);
DrMain* loadDriver(KMPrinter*, PrintcapEntry*, bool = false);
- DrMain* loadDbDriver(const QString&);
+ DrMain* loadDbDriver(const TQString&);
PrintcapEntry* createEntry(KMPrinter*);
bool savePrinterDriver(KMPrinter*, PrintcapEntry*, DrMain*, bool* = 0);
- QString printOptions(KPrinter*);
+ TQString printOptions(KPrinter*);
protected:
- QMap<QString,QString> parseXferOptions(const QString&);
- void loadAuthFile(const QString&, QString&, QString&);
- QValueList< QPair<QString,QStringList> > loadChoiceDict(const QString&);
- QMap<QString,QString> parseZOptions(const QString&);
- QString filterDir();
- QString driverDirInternal();
+ TQMap<TQString,TQString> parseXferOptions(const TQString&);
+ void loadAuthFile(const TQString&, TQString&, TQString&);
+ TQValueList< QPair<TQString,TQStringList> > loadChoiceDict(const TQString&);
+ TQMap<TQString,TQString> parseZOptions(const TQString&);
+ TQString filterDir();
+ TQString driverDirInternal();
private:
- QValueList< QPair<QString,QStringList> > m_dict;
+ TQValueList< QPair<TQString,TQStringList> > m_dict;
};
#endif
diff --git a/kdeprint/lpr/lprsettings.cpp b/kdeprint/lpr/lprsettings.cpp
index 90662a94c..15eef4126 100644
--- a/kdeprint/lpr/lprsettings.cpp
+++ b/kdeprint/lpr/lprsettings.cpp
@@ -22,16 +22,16 @@
#include "kmfactory.h"
#include <kconfig.h>
-#include <qfile.h>
-#include <qtextstream.h>
+#include <tqfile.h>
+#include <tqtextstream.h>
#define LPDCONF "/etc/lpd.conf"
#define PRINTCAP "/etc/printcap"
LprSettings* LprSettings::m_self = 0;
-LprSettings::LprSettings(QObject *parent, const char *name)
-: QObject(parent, name), KPReloadObject(true)
+LprSettings::LprSettings(TQObject *parent, const char *name)
+: TQObject(parent, name), KPReloadObject(true)
{
init();
}
@@ -63,21 +63,21 @@ void LprSettings::init()
else
{
// try to guess
- if (QFile::exists(LPDCONF))
+ if (TQFile::exists(LPDCONF))
m_mode = LPRng;
else
m_mode = LPR;
}
// Printcap file
- m_printcapfile = QString::null;
+ m_printcapfile = TQString::null;
m_local = true;
// Spool directory
m_spooldir = "/var/spool/lpd";
}
-QString LprSettings::printcapFile()
+TQString LprSettings::printcapFile()
{
if (m_printcapfile.isEmpty())
{
@@ -86,7 +86,7 @@ QString LprSettings::printcapFile()
if (m_mode == LPRng)
{
// look into /etc/lpd/conf file
- QFile cf(LPDCONF);
+ TQFile cf(LPDCONF);
if (cf.open(IO_ReadOnly))
{
QTextStream t(&cf);
@@ -112,12 +112,12 @@ QString LprSettings::printcapFile()
return m_printcapfile;
}
-QString LprSettings::defaultRemoteHost()
+TQString LprSettings::defaultRemoteHost()
{
if (m_defaultremotehost.isEmpty())
{
m_defaultremotehost = "localhost";
- QFile cf(LPDCONF);
+ TQFile cf(LPDCONF);
if (cf.open(IO_ReadOnly))
{
QTextStream t(&cf);
diff --git a/kdeprint/lpr/lprsettings.h b/kdeprint/lpr/lprsettings.h
index c6d6fe64f..419ec46d1 100644
--- a/kdeprint/lpr/lprsettings.h
+++ b/kdeprint/lpr/lprsettings.h
@@ -24,7 +24,7 @@
#warning internal header, do not use except if you are a KDEPrint developer
#endif
-#include <qobject.h>
+#include <tqobject.h>
#include <kdeprint/kpreloadobject.h>
/**
@@ -34,10 +34,10 @@
* if you're a KDEPrint developer. The API might change in the
* future and binary compatibility might be broken.
*/
-class LprSettings : public QObject, public KPReloadObject
+class LprSettings : public TQObject, public KPReloadObject
{
public:
- LprSettings(QObject *parent = 0, const char *name = 0);
+ LprSettings(TQObject *parent = 0, const char *name = 0);
~LprSettings();
static LprSettings* self();
@@ -45,10 +45,10 @@ public:
enum Mode { LPR, LPRng };
Mode mode() const { return m_mode; }
void setMode(Mode m) { m_mode = m; }
- QString printcapFile();
- QString defaultRemoteHost();
+ TQString printcapFile();
+ TQString defaultRemoteHost();
bool isLocalPrintcap() { return m_local; }
- QString baseSpoolDir() { return m_spooldir; }
+ TQString baseSpoolDir() { return m_spooldir; }
protected:
void init();
@@ -61,7 +61,7 @@ private:
QString m_printcapfile;
bool m_local;
QString m_spooldir;
- QString m_defaultremotehost;
+ TQString m_defaultremotehost;
};
#endif
diff --git a/kdeprint/lpr/matichandler.cpp b/kdeprint/lpr/matichandler.cpp
index a4b0d39a6..f3f0d4cdc 100644
--- a/kdeprint/lpr/matichandler.cpp
+++ b/kdeprint/lpr/matichandler.cpp
@@ -34,9 +34,9 @@
#include <kapplication.h>
#include <kdebug.h>
#include <kprocess.h>
-#include <qfile.h>
-#include <qtextstream.h>
-#include <qregexp.h>
+#include <tqfile.h>
+#include <tqtextstream.h>
+#include <tqregexp.h>
#include <stdlib.h>
#include <sys/wait.h>
@@ -104,18 +104,18 @@ bool MaticHandler::completePrinter(KMPrinter *prt, PrintcapEntry *entry, bool sh
KURL url ( parsePostpipe(postpipe) );
if (!url.isEmpty())
{
- QString ds = QString::fromLatin1("%1 (%2)").arg(prt->location()).arg(url.protocol());
+ QString ds = TQString::fromLatin1("%1 (%2)").arg(prt->location()).arg(url.protocol());
prt->setDevice(url.url());
prt->setLocation(ds);
}
}
- QMap<QString,QVariant> m = loader.data()[ "VAR" ].toMap();
+ TQMap<TQString,TQVariant> m = loader.data()[ "VAR" ].toMap();
if ( !m.isEmpty() )
{
prt->setManufacturer(m["make"].toString());
prt->setModel(m["model"].toString());
- prt->setDriverInfo(QString::fromLatin1("%1 %2 (%3)").arg(prt->manufacturer()).arg(prt->model()).arg(m["driver"].toString()));
+ prt->setDriverInfo(TQString::fromLatin1("%1 %2 (%3)").arg(prt->manufacturer()).arg(prt->model()).arg(m["driver"].toString()));
}
}
}
@@ -123,11 +123,11 @@ bool MaticHandler::completePrinter(KMPrinter *prt, PrintcapEntry *entry, bool sh
return true;
}
-QString MaticHandler::parsePostpipe(const QString& s)
+TQString MaticHandler::parsePostpipe(const TQString& s)
{
QString url;
int p = s.findRev('|');
- QStringList args = QStringList::split(" ", s.right(s.length()-p-1));
+ QStringList args = TQStringList::split(" ", s.right(s.length()-p-1));
if (args.count() != 0)
{
@@ -143,7 +143,7 @@ QString MaticHandler::parsePostpipe(const QString& s)
// smb printer
else if (args[0].right(10) == "/smbclient")
{
- QStringList host_components = QStringList::split(QRegExp("/|\\\\\""), args[1], false);
+ QStringList host_components = TQStringList::split(TQRegExp("/|\\\\\""), args[1], false);
QString workgrp, user, pass;
for (uint i=2; i<args.count(); i++)
{
@@ -181,7 +181,7 @@ QString MaticHandler::parsePostpipe(const QString& s)
return url;
}
-QString MaticHandler::createPostpipe(const QString& _url)
+TQString MaticHandler::createPostpipe(const TQString& _url)
{
KURL url( _url );
QString prot = url.protocol();
@@ -191,7 +191,7 @@ QString MaticHandler::createPostpipe(const QString& _url)
str += ("| " + m_ncpath);
str += (" " + url.host());
if (url.port() != 0)
- str += (" " + QString::number(url.port()));
+ str += (" " + TQString::number(url.port()));
}
else if (prot == "lpd")
{
@@ -201,7 +201,7 @@ QString MaticHandler::createPostpipe(const QString& _url)
}
else if (prot == "smb")
{
- QString work, server, printer, user, passwd;
+ TQString work, server, printer, user, passwd;
if ( splitSmbURI( _url, work, server, printer, user, passwd ) )
{
str += ("| (\\n echo \\\"print -\\\"\\n cat \\n) | " + m_smbpath);
@@ -225,7 +225,7 @@ DrMain* MaticHandler::loadDriver(KMPrinter*, PrintcapEntry *entry, bool)
// changing printer name), the template would be also removed
QString origfilename = maticFile(entry);
QString filename = locateLocal("tmp", "foomatic_" + kapp->randomString(8));
- ::system(QFile::encodeName("cp " + KProcess::quote(origfilename) + " " + KProcess::quote(filename)));
+ ::system(TQFile::encodeName("cp " + KProcess::quote(origfilename) + " " + KProcess::quote(filename)));
DrMain *driver = Foomatic2Loader::loadDriver(filename);
if (driver)
{
@@ -237,9 +237,9 @@ DrMain* MaticHandler::loadDriver(KMPrinter*, PrintcapEntry *entry, bool)
return NULL;
}
-DrMain* MaticHandler::loadDbDriver(const QString& path)
+DrMain* MaticHandler::loadDbDriver(const TQString& path)
{
- QStringList comps = QStringList::split('/', path, false);
+ QStringList comps = TQStringList::split('/', path, false);
if (comps.count() < 3 || comps[0] != "foomatic")
{
manager()->setErrorMsg(i18n("Internal error."));
@@ -247,7 +247,7 @@ DrMain* MaticHandler::loadDbDriver(const QString& path)
}
QString tmpFile = locateLocal("tmp", "foomatic_" + kapp->randomString(8));
- QString PATH = getenv("PATH") + QString::fromLatin1(":/usr/sbin:/usr/local/sbin:/opt/sbin:/opt/local/sbin");
+ QString PATH = getenv("PATH") + TQString::fromLatin1(":/usr/sbin:/usr/local/sbin:/opt/sbin:/opt/local/sbin");
QString exe = KStandardDirs::findExe("foomatic-datafile", PATH);
if (exe.isEmpty())
{
@@ -258,7 +258,7 @@ DrMain* MaticHandler::loadDbDriver(const QString& path)
KPipeProcess in;
QFile out(tmpFile);
- QString cmd = KProcess::quote(exe);
+ TQString cmd = KProcess::quote(exe);
cmd += " -t lpd -d ";
cmd += KProcess::quote(comps[2]);
cmd += " -p ";
@@ -330,28 +330,28 @@ bool MaticHandler::savePrinterDriver(KMPrinter *prt, PrintcapEntry *entry, DrMai
tmpFile.close();
QString cmd = "mv " + KProcess::quote(tmpFile.name()) + " " + KProcess::quote(outFile);
- int status = ::system(QFile::encodeName(cmd).data());
- QFile::remove(tmpFile.name());
+ int status = ::system(TQFile::encodeName(cmd).data());
+ TQFile::remove(tmpFile.name());
result = (status != -1 && WEXITSTATUS(status) == 0);
}
if (!result)
manager()->setErrorMsg(i18n("You probably don't have the required permissions "
"to perform that operation."));
- QFile::remove(tmpFile.name());
+ TQFile::remove(tmpFile.name());
if (!result || entry->field("ppdfile").isEmpty())
return result;
else
return savePpdFile(driver, entry->field("ppdfile"));
}
-bool MaticHandler::savePpdFile(DrMain *driver, const QString& filename)
+bool MaticHandler::savePpdFile(DrMain *driver, const TQString& filename)
{
QString mdriver(driver->get("matic_driver")), mprinter(driver->get("matic_printer"));
if (mdriver.isEmpty() || mprinter.isEmpty())
return true;
- QString PATH = getenv("PATH") + QString::fromLatin1(":/usr/sbin:/usr/local/sbin:/opt/sbin:/opt/local/sbin");
+ QString PATH = getenv("PATH") + TQString::fromLatin1(":/usr/sbin:/usr/local/sbin:/opt/sbin:/opt/local/sbin");
QString exe = KStandardDirs::findExe("foomatic-datafile", PATH);
if (exe.isEmpty())
{
@@ -452,7 +452,7 @@ bool MaticHandler::removePrinter(KMPrinter *prt, PrintcapEntry *entry)
QString af = entry->field("af");
if (af.isEmpty())
return true;
- if (!QFile::remove(af))
+ if (!TQFile::remove(af))
{
manager()->setErrorMsg(i18n("Unable to remove driver file %1.").arg(af));
return false;
@@ -460,11 +460,11 @@ bool MaticHandler::removePrinter(KMPrinter *prt, PrintcapEntry *entry)
return true;
}
-QString MaticHandler::printOptions(KPrinter *printer)
+TQString MaticHandler::printOptions(KPrinter *printer)
{
- QMap<QString,QString> opts = printer->options();
+ TQMap<TQString,TQString> opts = printer->options();
QString str;
- for (QMap<QString,QString>::Iterator it=opts.begin(); it!=opts.end(); ++it)
+ for (TQMap<TQString,TQString>::Iterator it=opts.begin(); it!=opts.end(); ++it)
{
if (it.key().startsWith("kde-") || it.key().startsWith("_kde-") || it.key().startsWith( "app-" ))
continue;
@@ -475,7 +475,7 @@ QString MaticHandler::printOptions(KPrinter *printer)
return str;
}
-QString MaticHandler::driverDirInternal()
+TQString MaticHandler::driverDirInternal()
{
return locateDir("foomatic/db/source", "/usr/share:/usr/local/share:/opt/share");
}
diff --git a/kdeprint/lpr/matichandler.h b/kdeprint/lpr/matichandler.h
index 1cbcc9941..a7111f5ff 100644
--- a/kdeprint/lpr/matichandler.h
+++ b/kdeprint/lpr/matichandler.h
@@ -35,19 +35,19 @@ public:
KMPrinter* createPrinter(PrintcapEntry*);
bool completePrinter(KMPrinter*, PrintcapEntry*, bool = true);
DrMain* loadDriver(KMPrinter*, PrintcapEntry*, bool = false);
- DrMain* loadDbDriver(const QString&);
+ DrMain* loadDbDriver(const TQString&);
bool savePrinterDriver(KMPrinter*, PrintcapEntry*, DrMain*, bool* = 0);
PrintcapEntry* createEntry(KMPrinter*);
bool removePrinter(KMPrinter*, PrintcapEntry*);
- QString printOptions(KPrinter*);
+ TQString printOptions(KPrinter*);
protected:
- QString driverDirInternal();
+ TQString driverDirInternal();
private:
- QString parsePostpipe(const QString&);
- QString createPostpipe(const QString&);
- bool savePpdFile(DrMain*, const QString&);
+ TQString parsePostpipe(const TQString&);
+ TQString createPostpipe(const TQString&);
+ bool savePpdFile(DrMain*, const TQString&);
private:
QString m_exematicpath;
diff --git a/kdeprint/lpr/matichelper.cpp b/kdeprint/lpr/matichelper.cpp
index 230bcd55b..544db8c71 100644
--- a/kdeprint/lpr/matichelper.cpp
+++ b/kdeprint/lpr/matichelper.cpp
@@ -21,7 +21,7 @@
#include "printcapentry.h"
#include "driver.h"
-QString maticFile(PrintcapEntry *entry)
+TQString maticFile(PrintcapEntry *entry)
{
QString s(entry->field("af"));
if (s.isEmpty())
diff --git a/kdeprint/lpr/matichelper.h b/kdeprint/lpr/matichelper.h
index 8d78d57e7..622dd06aa 100644
--- a/kdeprint/lpr/matichelper.h
+++ b/kdeprint/lpr/matichelper.h
@@ -20,10 +20,10 @@
#ifndef MATICHELPER_H
#define MATICHELPER_H
-#include <qstring.h>
+#include <tqstring.h>
class PrintcapEntry;
-QString maticFile(PrintcapEntry*);
+TQString maticFile(PrintcapEntry*);
#endif
diff --git a/kdeprint/lpr/printcapentry.cpp b/kdeprint/lpr/printcapentry.cpp
index 0a8d79ce4..419a532a9 100644
--- a/kdeprint/lpr/printcapentry.cpp
+++ b/kdeprint/lpr/printcapentry.cpp
@@ -19,7 +19,7 @@
#include "printcapentry.h"
-QString Field::toString() const
+TQString Field::toString() const
{
QString s = name;
switch (type)
@@ -38,14 +38,14 @@ QString Field::toString() const
return s;
}
-bool PrintcapEntry::writeEntry(QTextStream& t)
+bool PrintcapEntry::writeEntry(TQTextStream& t)
{
t << comment << endl;
t << name;
if (aliases.count() > 0)
t << '|' << aliases.join("|");
t << ':';
- for (QMap<QString,Field>::ConstIterator it=fields.begin(); it!=fields.end(); ++it)
+ for (TQMap<TQString,Field>::ConstIterator it=fields.begin(); it!=fields.end(); ++it)
{
t << '\\' << endl << " :";
t << (*it).name;
@@ -72,7 +72,7 @@ bool PrintcapEntry::writeEntry(QTextStream& t)
return true;
}
-void PrintcapEntry::addField(const QString& name, Field::Type type, const QString& value)
+void PrintcapEntry::addField(const TQString& name, Field::Type type, const TQString& value)
{
Field f;
f.name = name;
diff --git a/kdeprint/lpr/printcapentry.h b/kdeprint/lpr/printcapentry.h
index 17dbb9275..15adafddd 100644
--- a/kdeprint/lpr/printcapentry.h
+++ b/kdeprint/lpr/printcapentry.h
@@ -24,10 +24,10 @@
#warning internal header, do not use except if you are a KDEPrint developer
#endif
-#include <qstring.h>
-#include <qmap.h>
-#include <qstringlist.h>
-#include <qtextstream.h>
+#include <tqstring.h>
+#include <tqmap.h>
+#include <tqstringlist.h>
+#include <tqtextstream.h>
/**
* @internal
@@ -49,7 +49,7 @@ public:
value = f.value;
return (*this);
}
- QString toString() const;
+ TQString toString() const;
Type type;
QString name;
@@ -69,13 +69,13 @@ public:
QString name;
QStringList aliases;
QString comment;
- QMap<QString,Field> fields;
+ TQMap<TQString,Field> fields;
QString postcomment;
- bool has(const QString& f) const { return fields.contains(f); }
- QString field(const QString& f) const { return fields[f].value; }
- bool writeEntry(QTextStream&);
- void addField(const QString& name, Field::Type type = Field::Boolean, const QString& value = QString::null);
+ bool has(const TQString& f) const { return fields.contains(f); }
+ TQString field(const TQString& f) const { return fields[f].value; }
+ bool writeEntry(TQTextStream&);
+ void addField(const TQString& name, Field::Type type = Field::Boolean, const TQString& value = TQString::null);
};
#endif
diff --git a/kdeprint/lpr/printcapreader.cpp b/kdeprint/lpr/printcapreader.cpp
index b57d33ba0..a3ab30e8f 100644
--- a/kdeprint/lpr/printcapreader.cpp
+++ b/kdeprint/lpr/printcapreader.cpp
@@ -20,26 +20,26 @@
#include "printcapreader.h"
#include "printcapentry.h"
-#include <qfile.h>
+#include <tqfile.h>
#include <kdebug.h>
-void PrintcapReader::setPrintcapFile(QFile *f)
+void PrintcapReader::setPrintcapFile(TQFile *f)
{
if (f->isOpen())
{
m_stream.setDevice(f);
- m_buffer = QString::null;
+ m_buffer = TQString::null;
}
}
-bool PrintcapReader::nextLine(QString& line)
+bool PrintcapReader::nextLine(TQString& line)
{
if (m_stream.atEnd() && m_buffer.isEmpty())
return false;
else if (!m_buffer.isEmpty())
{
line = m_buffer;
- m_buffer = QString::null;
+ m_buffer = TQString::null;
}
else
line = m_stream.readLine().stripWhiteSpace();
@@ -49,7 +49,7 @@ bool PrintcapReader::nextLine(QString& line)
return true;
}
-void PrintcapReader::unputLine(const QString& s)
+void PrintcapReader::unputLine(const TQString& s)
{
m_buffer = s;
}
@@ -59,7 +59,7 @@ PrintcapEntry* PrintcapReader::nextEntry()
if (!m_stream.device())
return NULL;
- QString line, comment, name, fields, buf;
+ TQString line, comment, name, fields, buf;
// skip comments, keep last one
while (1)
{
@@ -114,7 +114,7 @@ PrintcapEntry* PrintcapReader::nextEntry()
if (!name.isEmpty())
{
PrintcapEntry *entry = new PrintcapEntry;
- QStringList l = QStringList::split('|', name, false);
+ TQStringList l = TQStringList::split('|', name, false);
entry->name = l[0];
entry->comment = comment;
// kdDebug() << "Printer: " << entry->name << endl;
@@ -128,8 +128,8 @@ PrintcapEntry* PrintcapReader::nextEntry()
{
// kdDebug() << "Fields:" << endl;
// kdDebug() << "(" << fields << ")" << endl;
- l = QStringList::split(':', fields, false);
- for (QStringList::ConstIterator it=l.begin(); it!=l.end(); ++it)
+ l = TQStringList::split(':', fields, false);
+ for (TQStringList::ConstIterator it=l.begin(); it!=l.end(); ++it)
{
Field f;
int p = (*it).find('=');
diff --git a/kdeprint/lpr/printcapreader.h b/kdeprint/lpr/printcapreader.h
index 4741f2520..117b34f8c 100644
--- a/kdeprint/lpr/printcapreader.h
+++ b/kdeprint/lpr/printcapreader.h
@@ -20,8 +20,8 @@
#ifndef PRINTCAPREADER_H
#define PRINTCAPREADER_H
-#include <qstring.h>
-#include <qtextstream.h>
+#include <tqstring.h>
+#include <tqtextstream.h>
class QFile;
class PrintcapEntry;
@@ -29,15 +29,15 @@ class PrintcapEntry;
class PrintcapReader
{
public:
- void setPrintcapFile(QFile*);
+ void setPrintcapFile(TQFile*);
PrintcapEntry* nextEntry();
private:
- QString m_buffer;
- QTextStream m_stream;
+ TQString m_buffer;
+ TQTextStream m_stream;
- bool nextLine(QString&);
- void unputLine(const QString&);
+ bool nextLine(TQString&);
+ void unputLine(const TQString&);
};
#endif