summaryrefslogtreecommitdiffstats
path: root/kdeprint/kmvirtualmanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kdeprint/kmvirtualmanager.cpp')
-rw-r--r--kdeprint/kmvirtualmanager.cpp74
1 files changed, 37 insertions, 37 deletions
diff --git a/kdeprint/kmvirtualmanager.cpp b/kdeprint/kmvirtualmanager.cpp
index 51a50292a..a6e263faf 100644
--- a/kdeprint/kmvirtualmanager.cpp
+++ b/kdeprint/kmvirtualmanager.cpp
@@ -24,10 +24,10 @@
#include "kprinter.h"
#include <stdlib.h>
-#include <qfile.h>
-#include <qtextstream.h>
-#include <qdir.h>
-#include <qfileinfo.h>
+#include <tqfile.h>
+#include <tqtextstream.h>
+#include <tqdir.h>
+#include <tqfileinfo.h>
#include <klocale.h>
#include <kstandarddirs.h>
#include <kurl.h>
@@ -36,7 +36,7 @@
#include <unistd.h>
-static QString instanceName(const QString& prname, const QString& instname)
+static TQString instanceName(const TQString& prname, const TQString& instname)
{
QString str(prname);
if (!instname.isEmpty())
@@ -45,7 +45,7 @@ static QString instanceName(const QString& prname, const QString& instname)
}
KMVirtualManager::KMVirtualManager(KMManager *parent, const char *name)
-: QObject(parent,name), m_manager(parent)
+: TQObject(parent,name), m_manager(parent)
{
}
@@ -53,12 +53,12 @@ KMVirtualManager::~KMVirtualManager()
{
}
-KMPrinter* KMVirtualManager::findPrinter(const QString& name)
+KMPrinter* KMVirtualManager::findPrinter(const TQString& name)
{
return m_manager->findPrinter(name);
}
-KMPrinter* KMVirtualManager::findInstance(KMPrinter *p, const QString& name)
+KMPrinter* KMVirtualManager::findInstance(KMPrinter *p, const TQString& name)
{
QString instname(instanceName(p->printerName(),name));
return findPrinter(instname);
@@ -90,11 +90,11 @@ void KMVirtualManager::addPrinter(KMPrinter *p)
void KMVirtualManager::setDefault(KMPrinter *p, bool saveflag)
{
m_manager->setSoftDefault(p);
- m_defaultprinter = (p ? p->printerName() : QString::null);
+ m_defaultprinter = (p ? p->printerName() : TQString::null);
if (saveflag) triggerSave();
}
-bool KMVirtualManager::isDefault(KMPrinter *p, const QString& name)
+bool KMVirtualManager::isDefault(KMPrinter *p, const TQString& name)
{
QString instname(instanceName(p->printerName(),name));
KMPrinter *printer = findPrinter(instname);
@@ -104,7 +104,7 @@ bool KMVirtualManager::isDefault(KMPrinter *p, const QString& name)
return false;
}
-void KMVirtualManager::create(KMPrinter *p, const QString& name)
+void KMVirtualManager::create(KMPrinter *p, const TQString& name)
{
QString instname = instanceName(p->printerName(),name);
if (findPrinter(instname) != NULL) return;
@@ -121,7 +121,7 @@ void KMVirtualManager::create(KMPrinter *p, const QString& name)
triggerSave();
}
-void KMVirtualManager::copy(KMPrinter *p, const QString& src, const QString& name)
+void KMVirtualManager::copy(KMPrinter *p, const TQString& src, const TQString& name)
{
QString instsrc(instanceName(p->printerName(),src)), instname(instanceName(p->printerName(),name));
KMPrinter *prsrc = findPrinter(instsrc);
@@ -135,15 +135,15 @@ void KMVirtualManager::copy(KMPrinter *p, const QString& src, const QString& nam
triggerSave();
}
-void KMVirtualManager::remove(KMPrinter *p, const QString& name)
+void KMVirtualManager::remove(KMPrinter *p, const TQString& name)
{
QString instname = instanceName(p->printerName(),name);
KMPrinter *printer = findPrinter(instname);
if (!printer) return;
if (name.isEmpty())
{ // remove default instance => only remove options, keep the KMPrinter object
- printer->setDefaultOptions(QMap<QString,QString>());
- printer->setEditedOptions(QMap<QString,QString>());
+ printer->setDefaultOptions(TQMap<TQString,TQString>());
+ printer->setEditedOptions(TQMap<TQString,TQString>());
printer->setEdited(false);
}
else
@@ -151,7 +151,7 @@ void KMVirtualManager::remove(KMPrinter *p, const QString& name)
triggerSave();
}
-void KMVirtualManager::setAsDefault(KMPrinter *p, const QString& name, QWidget *parent)
+void KMVirtualManager::setAsDefault(KMPrinter *p, const TQString& name, TQWidget *parent)
{
QString instname(instanceName(p->printerName(),name));
@@ -163,7 +163,7 @@ void KMVirtualManager::setAsDefault(KMPrinter *p, const QString& name, QWidget *
"applications. Note that this will only make your personal default printer "
"as undefined for non-KDE applications and should not prevent you from "
"printing normally. Do you really want to set <b>%1</b> as your personal default?</qt>" ).arg( instname ),
- QString::null, i18n("Set as Default"), "setSpecialAsDefault" ) == KMessageBox::No )
+ TQString::null, i18n("Set as Default"), "setSpecialAsDefault" ) == KMessageBox::No )
return;
}
@@ -179,8 +179,8 @@ void KMVirtualManager::setAsDefault(KMPrinter *p, const QString& name, QWidget *
void KMVirtualManager::refresh()
{
- QFileInfo fi(QDir::homeDirPath() + QFile::decodeName("/.lpoptions"));
- QFileInfo fi2(QFile::decodeName("/etc/cups/lpoptions"));
+ QFileInfo fi(TQDir::homeDirPath() + TQFile::decodeName("/.lpoptions"));
+ QFileInfo fi2(TQFile::decodeName("/etc/cups/lpoptions"));
// if root, then only use global file: trick -> use twice the same file
if (getuid() == 0)
@@ -188,7 +188,7 @@ void KMVirtualManager::refresh()
if (!m_checktime.isValid() || m_checktime < QMAX(fi.lastModified(),fi2.lastModified()))
{
- m_defaultprinter = QString::null;
+ m_defaultprinter = TQString::null;
if (fi2.exists())
loadFile(fi2.absFilePath());
if (fi.exists() && fi.absFilePath() != fi2.absFilePath())
@@ -198,7 +198,7 @@ void KMVirtualManager::refresh()
else
{ // parse printers looking for instances -> undiscarded them, real printers
// are undiscarded by the manager itself. Also update printer status.
- QPtrListIterator<KMPrinter> it(m_manager->m_printers);
+ TQPtrListIterator<KMPrinter> it(m_manager->m_printers);
for (;it.current();++it)
if (!it.current()->instanceName().isEmpty())
{
@@ -224,12 +224,12 @@ void KMVirtualManager::checkPrinter(KMPrinter *p)
}
}
-QString KMVirtualManager::defaultPrinterName()
+TQString KMVirtualManager::defaultPrinterName()
{
return m_defaultprinter;
}
-void KMVirtualManager::virtualList(QPtrList<KMPrinter>& list, const QString& prname)
+void KMVirtualManager::virtualList(TQPtrList<KMPrinter>& list, const TQString& prname)
{
// load printers if necessary
refresh();
@@ -238,13 +238,13 @@ void KMVirtualManager::virtualList(QPtrList<KMPrinter>& list, const QString& prn
list.setAutoDelete(false);
list.clear();
kdDebug(500) << "KMVirtualManager::virtualList() prname=" << prname << endl;
- QPtrListIterator<KMPrinter> it(m_manager->m_printers);
+ TQPtrListIterator<KMPrinter> it(m_manager->m_printers);
for (;it.current();++it)
if (it.current()->printerName() == prname)
list.append(it.current());
}
-void KMVirtualManager::loadFile(const QString& filename)
+void KMVirtualManager::loadFile(const TQString& filename)
{
QFile f(filename);
if (f.exists() && f.open(IO_ReadOnly))
@@ -260,9 +260,9 @@ void KMVirtualManager::loadFile(const QString& filename)
{
line = t.readLine().stripWhiteSpace();
if (line.isEmpty()) continue;
- words = QStringList::split(' ',line,false);
+ words = TQStringList::split(' ',line,false);
if (words.count() < 2) continue;
- pair = QStringList::split('/',words[1],false);
+ pair = TQStringList::split('/',words[1],false);
realprinter = m_manager->findPrinter(KURL::decode_string(pair[0]));
if (realprinter && !realprinter->isDiscarded())
{ // keep only instances corresponding to an existing and
@@ -279,8 +279,8 @@ void KMVirtualManager::loadFile(const QString& filename)
// parse options
for (uint i=2; i<words.count(); i++)
{
- pair = QStringList::split('=',words[i],false);
- printer->setDefaultOption(pair[0],(pair.count() > 1 ? pair[1] : QString::null));
+ pair = TQStringList::split('=',words[i],false);
+ printer->setDefaultOption(pair[0],(pair.count() > 1 ? pair[1] : TQString::null));
}
// add printer to the manager
addPrinter(printer); // don't use "printer" after this point !!!
@@ -297,25 +297,25 @@ void KMVirtualManager::triggerSave()
QString filename;
if (getuid() == 0)
{
- if (KStandardDirs::makeDir(QFile::decodeName("/etc/cups")))
- filename = QFile::decodeName("/etc/cups/lpoptions");
+ if (KStandardDirs::makeDir(TQFile::decodeName("/etc/cups")))
+ filename = TQFile::decodeName("/etc/cups/lpoptions");
}
else
- filename = QDir::homeDirPath() + QFile::decodeName("/.lpoptions");
+ filename = TQDir::homeDirPath() + TQFile::decodeName("/.lpoptions");
if (!filename.isEmpty())
{
saveFile(filename);
- m_checktime = QFileInfo(filename).lastModified();
+ m_checktime = TQFileInfo(filename).lastModified();
}
}
-void KMVirtualManager::saveFile(const QString& filename)
+void KMVirtualManager::saveFile(const TQString& filename)
{
QFile f(filename);
if (f.open(IO_WriteOnly))
{
QTextStream t(&f);
- QPtrListIterator<KMPrinter> it(m_manager->m_printers);
+ TQPtrListIterator<KMPrinter> it(m_manager->m_printers);
for (;it.current();++it)
{
if (it.current()->isSpecial())
@@ -327,8 +327,8 @@ void KMVirtualManager::saveFile(const QString& filename)
}
else
t << (it.current()->isSoftDefault() ? "Default " : "Dest ") << it.current()->name();
- QMap<QString,QString> opts = it.current()->defaultOptions();
- for (QMap<QString,QString>::ConstIterator oit=opts.begin(); oit!=opts.end(); ++oit)
+ TQMap<TQString,TQString> opts = it.current()->defaultOptions();
+ for (TQMap<TQString,TQString>::ConstIterator oit=opts.begin(); oit!=opts.end(); ++oit)
{
t << ' ' << oit.key();
if (!oit.data().isEmpty())