summaryrefslogtreecommitdiffstats
path: root/kdialogd3/kdialogd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kdialogd3/kdialogd.cpp')
-rw-r--r--kdialogd3/kdialogd.cpp116
1 files changed, 58 insertions, 58 deletions
diff --git a/kdialogd3/kdialogd.cpp b/kdialogd3/kdialogd.cpp
index 7e7adde..b7a84c7 100644
--- a/kdialogd3/kdialogd.cpp
+++ b/kdialogd3/kdialogd.cpp
@@ -4,7 +4,7 @@
#include <iostream>
#include <kdiroperator.h>
#include <kuniqueapplication.h>
-#include <qsocketnotifier.h>
+#include <tqsocketnotifier.h>
#include <kio/netaccess.h>
#include <kmessagebox.h>
#include <klocale.h>
@@ -22,7 +22,7 @@
#include <ksockaddr.h>
#include <kdebug.h>
#include <kdeversion.h>
-#include <qtimer.h>
+#include <tqtimer.h>
#ifdef KDIALOGD_APP
#include <kcmdlineargs.h>
#include <kaboutdata.h>
@@ -38,9 +38,9 @@ KConfig *KDialogD::theirConfig=NULL;
#define DEFAULT_TIMEOUT 30
#endif
-static QString groupName(const QString &app, bool fileDialog=true)
+static TQString groupName(const TQString &app, bool fileDialog=true)
{
- return QString(fileDialog ? "KFileDialog " : "KDirSelectDialog ")+app;
+ return TQString(fileDialog ? "KFileDialog " : "KDirSelectDialog ")+app;
}
// from kdebase/kdesu
@@ -121,7 +121,7 @@ static int createSocket()
return sockitsFd;
}
-static void urls2Local(KURL::List &urls, QStringList &items, QWidget *parent)
+static void urls2Local(KURL::List &urls, TQStringList &items, TQWidget *tqparent)
{
KURL::List::Iterator it(urls.begin()),
end(urls.end());
@@ -132,7 +132,7 @@ static void urls2Local(KURL::List &urls, QStringList &items, QWidget *parent)
else
{
#if KDE_IS_VERSION(3, 5, 0)
- KURL url(KIO::NetAccess::mostLocalURL(*it, parent));
+ KURL url(KIO::NetAccess::mostLocalURL(*it, tqparent));
if(url.isLocalFile())
items.append(url.path());
@@ -144,8 +144,8 @@ static void urls2Local(KURL::List &urls, QStringList &items, QWidget *parent)
}
}
-KDialogD::KDialogD(QObject *parent)
- : QObject(parent),
+KDialogD::KDialogD(TQObject *tqparent)
+ : TQObject(tqparent),
#ifdef KDIALOGD_APP
itsTimer(NULL),
itsTimeoutVal(DEFAULT_TIMEOUT),
@@ -172,8 +172,8 @@ KDialogD::KDialogD(QObject *parent)
if(!theirConfig)
theirConfig=new KConfig("kdialogdrc", false, false);
- connect(new QSocketNotifier(itsFd, QSocketNotifier::Read, this),
- SIGNAL(activated(int)), this, SLOT(newConnection()));
+ connect(new TQSocketNotifier(itsFd, TQSocketNotifier::Read, this),
+ TQT_SIGNAL(activated(int)), this, TQT_SLOT(newConnection()));
#ifdef KDIALOGD_APP
if(theirConfig->hasGroup(CFG_TIMEOUT_GROUP))
@@ -182,12 +182,12 @@ KDialogD::KDialogD(QObject *parent)
itsTimeoutVal=theirConfig->readNumEntry(CFG_TIMEOUT_KEY, DEFAULT_TIMEOUT);
if(itsTimeoutVal<0)
itsTimeoutVal=DEFAULT_TIMEOUT;
- theirConfig->setGroup(QString::null);
+ theirConfig->setGroup(TQString());
}
kdDebug() << "Timeout:" << itsTimeoutVal << endl;
if(itsTimeoutVal)
- connect(itsTimer=new QTimer(this), SIGNAL(timeout()), this, SLOT(timeout()));
+ connect(itsTimer=new TQTimer(this), TQT_SIGNAL(timeout()), this, TQT_SLOT(timeout()));
#endif
}
}
@@ -216,7 +216,7 @@ void KDialogD::newConnection()
if(readBlock(connectedFD, (char *)&appNameLen, 4))
{
bool ok=true;
- QCString appName;
+ TQCString appName;
if(0==appNameLen)
appName="Generic";
@@ -234,8 +234,8 @@ void KDialogD::newConnection()
itsTimer->stop();
#endif
connect(new KDialogDClient(connectedFD, appName, this),
- SIGNAL(error(KDialogDClient *)),
- this, SLOT(deleteConnection(KDialogDClient *)));
+ TQT_SIGNAL(error(KDialogDClient *)),
+ this, TQT_SLOT(deleteConnection(KDialogDClient *)));
}
}
}
@@ -272,16 +272,16 @@ void KDialogD::timeout()
#endif
}
-KDialogDClient::KDialogDClient(int sock, const QString &an, QObject *parent)
- : QObject(parent),
+KDialogDClient::KDialogDClient(int sock, const TQString &an, TQObject *tqparent)
+ : TQObject(tqparent),
itsFd(sock),
itsDlg(NULL),
itsAccepted(false),
itsAppName(an)
{
kdDebug() << "new client..." << itsAppName << " (" << itsFd << ")" << endl;
- connect(new QSocketNotifier(itsFd, QSocketNotifier::Read, this), SIGNAL(activated(int)), this, SLOT(read()));
- connect(new QSocketNotifier(itsFd, QSocketNotifier::Exception, this), SIGNAL(activated(int)), this, SLOT(close()));
+ connect(new TQSocketNotifier(itsFd, TQSocketNotifier::Read, this), TQT_SIGNAL(activated(int)), this, TQT_SLOT(read()));
+ connect(new TQSocketNotifier(itsFd, TQSocketNotifier::Exception, this), TQT_SIGNAL(activated(int)), this, TQT_SLOT(close()));
}
KDialogDClient::~KDialogDClient()
@@ -316,7 +316,7 @@ void KDialogDClient::read()
return;
char request;
- QString caption;
+ TQString caption;
unsigned int xid=0;
if(!itsDlg && readData(&request, 1) && request>=(char)OP_FILE_OPEN && request<=(char)OP_FOLDER &&
@@ -341,7 +341,7 @@ void KDialogDClient::read()
if(OP_FOLDER==(Operation)request)
{
- QString intialFolder;
+ TQString intialFolder;
if(readString(intialFolder))
{
@@ -352,7 +352,7 @@ void KDialogDClient::read()
}
else
{
- QString intialFolder,
+ TQString intialFolder,
filter;
char overW=0;
@@ -379,20 +379,20 @@ void KDialogDClient::finished()
//
// * finished is emitted when a dialog is ok'ed/cancel'ed/closed
// * if the user just closes the dialog - neither ok nor cancel are emitted
- // * the dir select dialog doesnt seem to set the QDialog result parameter
+ // * the dir select dialog doesnt seem to set the TQDialog result parameter
// when it is accepted - so for this reason if ok is clicked we store an
// 'accepted' value there, and check for that after the dialog is finished.
kdDebug() << "finished" << endl;
- if(itsDlg && !(itsAccepted || QDialog::Accepted==itsDlg->result()))
+ if(itsDlg && !(itsAccepted || TQDialog::Accepted==itsDlg->result()))
cancel();
}
-void KDialogDClient::ok(const QStringList &items)
+void KDialogDClient::ok(const TQStringList &items)
{
kdDebug() << "ok" << endl;
int num=items.count();
- QStringList::ConstIterator it(items.begin()),
+ TQStringList::ConstIterator it(items.begin()),
end(items.end());
bool error=!writeData((char *)&num, 4);
@@ -424,39 +424,39 @@ void KDialogDClient::cancel()
}
}
-bool KDialogDClient::readData(QCString &buffer, int size)
+bool KDialogDClient::readData(TQCString &buffer, int size)
{
buffer.resize(size);
return ::readBlock(itsFd, buffer.data(), size);
}
-bool KDialogDClient::readString(QString &str)
+bool KDialogDClient::readString(TQString &str)
{
int size;
if(!readData((char *)&size, 4))
return false;
- QCString buffer;
+ TQCString buffer;
buffer.resize(size);
if(!readData(buffer.data(), size))
return false;
- str=QString::fromUtf8(buffer.data());
+ str=TQString::fromUtf8(buffer.data());
return true;
}
-bool KDialogDClient::writeString(const QString &str)
+bool KDialogDClient::writeString(const TQString &str)
{
- QCString utf8(str.utf8());
+ TQCString utf8(str.utf8());
int size=utf8.length()+1;
return writeData((char *)&size, 4) && writeData(utf8.data(), size);
}
-void KDialogDClient::initDialog(const QString &caption, KDialogBase *d, unsigned int xid)
+void KDialogDClient::initDialog(const TQString &caption, KDialogBase *d, unsigned int xid)
{
itsAccepted=false;
itsDlg=d;
@@ -471,7 +471,7 @@ void KDialogDClient::initDialog(const QString &caption, KDialogBase *d, unsigned
KWin::setState(itsDlg->winId(), NET::Modal);
KWin::WindowInfo wi(KWin::windowInfo(xid, NET::WMGeometry, NET::WM2UserTime));
- QRect geom(wi.geometry());
+ TQRect geom(wi.tqgeometry());
int rx=geom.x(),
ry=geom.y();
@@ -505,14 +505,14 @@ void KDialogDClient::initDialog(const QString &caption, KDialogBase *d, unsigned
#endif
}
- connect(itsDlg, SIGNAL(ok(const QStringList &)), this, SLOT(ok(const QStringList &)));
- connect(itsDlg, SIGNAL(finished()), this, SLOT(finished()));
+ connect(itsDlg, TQT_SIGNAL(ok(const TQStringList &)), this, TQT_SLOT(ok(const TQStringList &)));
+ connect(itsDlg, TQT_SIGNAL(finished()), this, TQT_SLOT(finished()));
itsDlg->show();
}
-KDialogDFileDialog::KDialogDFileDialog(QString &an, Operation op, const QString &startDir,
- const QString &filter, bool confirmOw)
- : KFileDialog(startDir.isEmpty() || "~"==startDir ? QDir::homeDirPath() : startDir,
+KDialogDFileDialog::KDialogDFileDialog(TQString &an, Operation op, const TQString &startDir,
+ const TQString &filter, bool confirmOw)
+ : KFileDialog(startDir.isEmpty() || "~"==startDir ? TQDir::homeDirPath() : startDir,
filter, NULL, NULL, false),
itsConfirmOw(confirmOw),
itsAppName(an)
@@ -539,9 +539,9 @@ KDialogDFileDialog::KDialogDFileDialog(QString &an, Operation op, const QString
if(KDialogD::config())
{
- QString oldGrp(KDialogD::config()->group()),
+ TQString oldGrp(KDialogD::config()->group()),
grp(groupName(itsAppName));
- QSize defaultSize(600, 400);
+ TQSize defaultSize(600, 400);
readConfig(KDialogD::config(), grp);
KDialogD::config()->setGroup(grp);
@@ -559,12 +559,12 @@ void KDialogDFileDialog::accept()
void KDialogDFileDialog::slotOk()
{
- setResult(QDialog::Accepted);
+ setResult(TQDialog::Accepted);
KFileDialog::slotOk();
kdDebug() << "KDialogDFileDialog::slotOk" << endl;
KURL::List urls;
- QStringList items;
+ TQStringList items;
bool good=true;
if(mode()&KFile::Files)
@@ -586,14 +586,14 @@ void KDialogDFileDialog::slotOk()
good=!KIO::NetAccess::exists(urls.first(), false, this) ||
KMessageBox::Continue==KMessageBox::warningContinueCancel(this,
i18n("File %1 exists.\nDo you want to replace it?")
- .arg(urls.first().prettyURL()),
+ .tqarg(urls.first().prettyURL()),
i18n("File Exists"),
- KGuiItem(i18n("Replace"), "filesaveas"), QString::null,
+ KGuiItem(i18n("Replace"), "filesaveas"), TQString(),
KMessageBox::Notify|KMessageBox::PlainCaption);
if(good)
{
- QString filter(currentFilter());
+ TQString filter(currentFilter());
if(!filter.isEmpty())
items.append(filter);
@@ -603,7 +603,7 @@ void KDialogDFileDialog::slotOk()
KFileDialog::accept();
}
else
- setResult(QDialog::Rejected);
+ setResult(TQDialog::Rejected);
}
}
@@ -613,7 +613,7 @@ KDialogDFileDialog::~KDialogDFileDialog()
if(KDialogD::config())
{
- QString oldGrp(KDialogD::config()->group()),
+ TQString oldGrp(KDialogD::config()->group()),
grp(groupName(itsAppName));
writeConfig(KDialogD::config(), grp);
@@ -623,20 +623,20 @@ KDialogDFileDialog::~KDialogDFileDialog()
}
}
-KDialogDDirSelectDialog::KDialogDDirSelectDialog(QString &an, const QString &startDir, bool localOnly,
- QWidget *parent, const char *name, bool modal)
+KDialogDDirSelectDialog::KDialogDDirSelectDialog(TQString &an, const TQString &startDir, bool localOnly,
+ TQWidget *tqparent, const char *name, bool modal)
: KDirSelectDialog(startDir.isEmpty() || "~"==startDir
- ? QDir::homeDirPath() : startDir,
- localOnly, parent, name, modal),
+ ? TQDir::homeDirPath() : startDir,
+ localOnly, tqparent, name, modal),
itsAppName(an)
{
kdDebug() << "startDir:" << startDir << endl;
if(KDialogD::config())
{
- QString oldGrp(KDialogD::config()->group()),
+ TQString oldGrp(KDialogD::config()->group()),
grp(groupName(itsAppName, false));
- QSize defaultSize(600, 400);
+ TQSize defaultSize(600, 400);
//readConfig(KDialogD::config(), grp);
KDialogD::config()->setGroup(grp);
@@ -651,7 +651,7 @@ KDialogDDirSelectDialog::~KDialogDDirSelectDialog()
if(KDialogD::config())
{
- QString oldGrp(KDialogD::config()->group()),
+ TQString oldGrp(KDialogD::config()->group()),
grp(groupName(itsAppName, false));
//writeConfig(KDialogD::config(), grp);
@@ -666,7 +666,7 @@ void KDialogDDirSelectDialog::slotOk()
kdDebug() << "KDialogDDirSelectDialog::slotOk" << endl;
KURL::List urls;
- QStringList items;
+ TQStringList items;
urls.append(url());
urls2Local(urls, items, this);
@@ -704,13 +704,13 @@ int main(int argc, char **argv)
#else
extern "C"
{
- KDE_EXPORT KDEDModule *create_kdialogd(const QCString &obj)
+ KDE_EXPORT KDEDModule *create_kdialogd(const TQCString &obj)
{
return new KDialogDKDED(obj);
}
};
-KDialogDKDED::KDialogDKDED(const QCString &obj)
+KDialogDKDED::KDialogDKDED(const TQCString &obj)
: KDEDModule(obj)
{
new KDialogD(this);