summaryrefslogtreecommitdiffstats
path: root/src/ftpsession.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-07-24 11:53:10 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-07-24 11:53:10 -0500
commitdacae0242e905268e9df9aed83f84e91b13a1749 (patch)
tree26c8dc7f37d040f54265a3471834309a1e248538 /src/ftpsession.cpp
parent0d218fd2db1810aafd86f7fc8761c75128f3fcb8 (diff)
downloadkasablanca-dacae0242e905268e9df9aed83f84e91b13a1749.tar.gz
kasablanca-dacae0242e905268e9df9aed83f84e91b13a1749.zip
Convert to TDE R14 API
Diffstat (limited to 'src/ftpsession.cpp')
-rw-r--r--src/ftpsession.cpp244
1 files changed, 122 insertions, 122 deletions
diff --git a/src/ftpsession.cpp b/src/ftpsession.cpp
index 2287d7e..f77320d 100644
--- a/src/ftpsession.cpp
+++ b/src/ftpsession.cpp
@@ -15,27 +15,27 @@
#define _LARGEFILE_SOURCE
#define _LARGEFILE64_SOURCE
-#include <klocale.h>
-#include <kglobal.h>
+#include <tdelocale.h>
+#include <tdeglobal.h>
#include <kmessagebox.h>
#include <kprocess.h>
#include <kiconloader.h>
#include <kinputdialog.h>
#include <klineedit.h>
-#include <qtextedit.h>
-#include <qtoolbutton.h>
-#include <qpopupmenu.h>
-#include <qwidget.h>
-#include <qlistview.h>
-#include <qlabel.h>
-#include <qpixmap.h>
-#include <qheader.h>
-#include <qstringlist.h>
-#include <qevent.h>
-#include <qfile.h>
-#include <qtextstream.h>
-#include <qpushbutton.h>
+#include <ntqtextedit.h>
+#include <ntqtoolbutton.h>
+#include <ntqpopupmenu.h>
+#include <ntqwidget.h>
+#include <ntqlistview.h>
+#include <ntqlabel.h>
+#include <ntqpixmap.h>
+#include <ntqheader.h>
+#include <ntqstringlist.h>
+#include <ntqevent.h>
+#include <ntqfile.h>
+#include <ntqtextstream.h>
+#include <ntqpushbutton.h>
#include "fileexistsdialog.h"
#include "customconnectdialog.h"
@@ -51,8 +51,8 @@
#include "kbconfig.h"
#include "ftplib.h"
-FtpSession::FtpSession(QObject *parent, const char *name)
- : QObject(parent, name)
+FtpSession::FtpSession(TQObject *parent, const char *name)
+ : TQObject(parent, name)
{
installEventFilter(this);
@@ -75,10 +75,10 @@ FtpSession::FtpSession(QObject *parent, const char *name)
mp_eventhandler->SetFtpThread(mp_ftpthread);
mp_ftpthread->SetEventReceiver(mp_eventhandler);
- m_iconencrypted = KGlobal::iconLoader()->loadIconSet("encrypted",KIcon::Small).pixmap(QIconSet::Small,QIconSet::Normal);
- m_iconunencrypted = KGlobal::iconLoader()->loadIconSet("encrypted",KIcon::Small).pixmap(QIconSet::Small,QIconSet::Disabled);
+ m_iconencrypted = TDEGlobal::iconLoader()->loadIconSet("encrypted",TDEIcon::Small).pixmap(TQIconSet::Small,TQIconSet::Normal);
+ m_iconunencrypted = TDEGlobal::iconLoader()->loadIconSet("encrypted",TDEIcon::Small).pixmap(TQIconSet::Small,TQIconSet::Disabled);
- connect(mp_eventhandler, SIGNAL(ftp_log(QString, bool)), SLOT(SLOT_Log(QString, bool)));
+ connect(mp_eventhandler, SIGNAL(ftp_log(TQString, bool)), SLOT(SLOT_Log(TQString, bool)));
connect(mp_eventhandler, SIGNAL(ftp_connect(bool)), SLOT(SLOT_Connect(bool)));
connect(mp_eventhandler, SIGNAL(ftp_login(bool)), SLOT(SLOT_Login(bool)));
connect(mp_eventhandler, SIGNAL(ftp_xfered(off64_t, bool)), SLOT(SLOT_Xfered(off64_t, bool)));
@@ -93,7 +93,7 @@ FtpSession::FtpSession(QObject *parent, const char *name)
connect(mp_eventhandler, SIGNAL(ftp_misc(bool)), SLOT(SLOT_Misc(bool)));
connect(mp_eventhandler, SIGNAL(ftp_mkdir(bool)), SLOT(SLOT_Misc(bool)));
connect(mp_eventhandler, SIGNAL(ftp_rename(bool)), SLOT(SLOT_Misc(bool)));
- connect(mp_eventhandler, SIGNAL(ftp_pwd(bool, QString)), SLOT(SLOT_Pwd(bool, QString)));
+ connect(mp_eventhandler, SIGNAL(ftp_pwd(bool, TQString)), SLOT(SLOT_Pwd(bool, TQString)));
connect(mp_eventhandler, SIGNAL(ftp_dir(bool, list<KbFileInfo*>, list<KbFileInfo*>)),
SLOT(SLOT_Dir(bool, list<KbFileInfo*>, list<KbFileInfo*>)));
connect(mp_eventhandler, SIGNAL(ftp_encryptdata(bool)), SLOT(SLOT_EncryptData(bool)));
@@ -110,20 +110,20 @@ FtpSession::~FtpSession()
void FtpSession::SetCmdLine(KLineEdit* cmdline)
{
KCompletion *comp = cmdline->completionObject();
- connect(cmdline, SIGNAL(returnPressed(const QString&)), comp, SLOT(addItem(const QString&)));
- cmdline->setCompletionMode(KGlobalSettings::CompletionAuto);
+ connect(cmdline, SIGNAL(returnPressed(const TQString&)), comp, SLOT(addItem(const TQString&)));
+ cmdline->setCompletionMode(TDEGlobalSettings::CompletionAuto);
mp_cmdline = cmdline;
}
void FtpSession::SetCwdLine(KLineEdit* cwdline)
{
KCompletion *comp = cwdline->completionObject();
- connect(cwdline, SIGNAL(returnPressed(const QString&)), comp, SLOT(addItem(const QString&)));
- cwdline->setCompletionMode(KGlobalSettings::CompletionAuto);
+ connect(cwdline, SIGNAL(returnPressed(const TQString&)), comp, SLOT(addItem(const TQString&)));
+ cwdline->setCompletionMode(TDEGlobalSettings::CompletionAuto);
mp_cwdline = cwdline;
}
-void FtpSession::SLOT_Log(QString log, bool out)
+void FtpSession::SLOT_Log(TQString log, bool out)
{
if (out) m_loglist.push_back(make_pair(log, true));
else m_loglist.push_back(make_pair(log, false));
@@ -152,13 +152,13 @@ void FtpSession::SLOT_ActionMenu(int i)
{
if (Occupied())
{
- qWarning("ERROR: triggered action while occupied");
+ tqWarning("ERROR: triggered action while occupied");
return;
}
if (i == Kasablanca::Mkdir)
{
bool b;
- QString name = KInputDialog::getText(i18n("Enter directory name"), i18n("Enter directory name:"), "", &b);
+ TQString name = KInputDialog::getText(i18n("Enter directory name"), i18n("Enter directory name:"), "", &b);
if (!b) return;
if (Connected())
{
@@ -178,7 +178,7 @@ void FtpSession::SLOT_ActionMenu(int i)
if (Connected())
{
Occupy();
- QListViewItemIterator it(mp_browser);
+ TQListViewItemIterator it(mp_browser);
while (it.current())
{
if (it.current()->isSelected())
@@ -198,7 +198,7 @@ void FtpSession::SLOT_ActionMenu(int i)
}
else
{
- QListViewItemIterator it(mp_browser);
+ TQListViewItemIterator it(mp_browser);
while (it.current())
{
if (it.current()->isSelected())
@@ -209,14 +209,14 @@ void FtpSession::SLOT_ActionMenu(int i)
{
if (KbConfig::deleteMovesIntoTrashIsEnabled())
{
- system(QString("mv " + m_localworkingdir.absPath() + "/" + item->File() +
- + " " + KGlobalSettings::trashPath()).latin1());
+ system(TQString("mv " + m_localworkingdir.absPath() + "/" + item->File() +
+ + " " + TDEGlobalSettings::trashPath()).latin1());
}
else
{
if (item->rtti() == KbItem::dir)
{
- QString dir = "rm -rf " + m_localworkingdir.absFilePath(item->File());
+ TQString dir = "rm -rf " + m_localworkingdir.absFilePath(item->File());
system(dir.latin1());
}
//RmdirLocal(item->File());
@@ -233,14 +233,14 @@ void FtpSession::SLOT_ActionMenu(int i)
{
if (Connected())
{
- QListViewItemIterator it(mp_browser);
+ TQListViewItemIterator it(mp_browser);
while (it.current())
{
if (it.current()->isSelected())
{
bool b;
KbItem* item = static_cast<KbItem*>(it.current());
- QString name = KInputDialog::getText(i18n("Enter new name"), i18n("Enter new name:"), item->File(), &b);
+ TQString name = KInputDialog::getText(i18n("Enter new name"), i18n("Enter new name:"), item->File(), &b);
if (b)
{
Occupy();
@@ -255,14 +255,14 @@ void FtpSession::SLOT_ActionMenu(int i)
}
else
{
- QListViewItemIterator it(mp_browser);
+ TQListViewItemIterator it(mp_browser);
while (it.current())
{
if (it.current()->isSelected())
{
bool b;
KbItem* item = static_cast<KbItem*>(it.current());
- QString name = KInputDialog::getText(i18n("Enter new name"), i18n("Enter new name:"), item->File(), &b);
+ TQString name = KInputDialog::getText(i18n("Enter new name"), i18n("Enter new name:"), item->File(), &b);
if (b) m_localworkingdir.rename(item->text(0), name);
else return;
}
@@ -285,7 +285,7 @@ void FtpSession::SLOT_ActionMenu(int i)
{
KbSiteInfo newsite = *mp_siteinfo;
bool b;
- QString name = KInputDialog::getText(i18n("Enter bookmark name"), i18n("Enter bookmark name:"), "", &b);
+ TQString name = KInputDialog::getText(i18n("Enter bookmark name"), i18n("Enter bookmark name:"), "", &b);
if (!b) return;
if (name == "") name = "New site";
newsite.SetName(name);
@@ -303,7 +303,7 @@ void FtpSession::SLOT_ConnectMenu(int i)
CustomConnectDialog dlg;
mp_siteinfo->Clear();
dlg.mp_site = mp_siteinfo;
- if (dlg.exec() == QDialog::Rejected) return;
+ if (dlg.exec() == TQDialog::Rejected) return;
else if (!mp_siteinfo->IsLegit())
{
KMessageBox::error(0,i18n("That site information is not legit."));
@@ -315,7 +315,7 @@ void FtpSession::SLOT_ConnectMenu(int i)
list<KbSiteInfo>::iterator it = static_cast<Kasablanca*>(parent())->m_bookmarks.begin();
for (int x = 0; x < i - 1; x++) it++;
mp_siteinfo = &(*it);
- qWarning("INFO: connecting to bookmark entry named: %s", mp_siteinfo->GetName().latin1());
+ tqWarning("INFO: connecting to bookmark entry named: %s", mp_siteinfo->GetName().latin1());
}
Connect();
Occupy();
@@ -327,24 +327,24 @@ void FtpSession::SLOT_ConnectMenu(int i)
if (mp_siteinfo->GetCorrectPasv()) mp_ftpthread->Ftp()->SetCorrectPasv(true);
else mp_ftpthread->Ftp()->SetCorrectPasv(false);
mp_ftpthread->Login(mp_siteinfo->GetUser(), mp_siteinfo->GetPass());
- if (QString(mp_siteinfo->GetDefaultDirectory()) != "") mp_ftpthread->Chdir(mp_siteinfo->GetDefaultDirectory());
+ if (TQString(mp_siteinfo->GetDefaultDirectory()) != "") mp_ftpthread->Chdir(mp_siteinfo->GetDefaultDirectory());
RefreshBrowser();
mp_ftpthread->start();
}
void FtpSession::SLOT_Finish()
{
- while (!mp_ftpthread->wait(KB_THREAD_TIMEOUT)) qWarning("WARNING: thread timeout, should *not* happen.");
+ while (!mp_ftpthread->wait(KB_THREAD_TIMEOUT)) tqWarning("WARNING: thread timeout, should *not* happen.");
if (mp_currenttransfer) Transfer(mp_currenttransfer);
else Free();
}
-void FtpSession::SLOT_ItemClicked(QListViewItem * item)
+void FtpSession::SLOT_ItemClicked(TQListViewItem * item)
{
if (Occupied())
{
- qWarning("ERROR: item clicked while occupied");
+ tqWarning("ERROR: item clicked while occupied");
return;
}
if (item->rtti() == KbItem::file) return;
@@ -361,7 +361,7 @@ void FtpSession::SLOT_ItemClicked(QListViewItem * item)
else UpdateLocal(item->text(0));
}
-void FtpSession::SLOT_ItemRClicked(QListViewItem *, const QPoint & point, int)
+void FtpSession::SLOT_ItemRClicked(TQListViewItem *, const TQPoint & point, int)
{
mp_rclickmenu->exec(point);
}
@@ -370,7 +370,7 @@ void FtpSession::SLOT_CmdLine()
{
if (Occupied())
{
- qWarning("ERROR: entered command while occupied");
+ tqWarning("ERROR: entered command while occupied");
return;
}
else if (Connected())
@@ -382,10 +382,10 @@ void FtpSession::SLOT_CmdLine()
}
else
{
- KProcess* p = new KProcess();
+ TDEProcess* p = new TDEProcess();
p->setWorkingDirectory(m_localworkingdir.absPath());
- *p << QStringList::split(" ", mp_cmdline->text());
- connect(p, SIGNAL(processExited(KProcess*)), SLOT(SLOT_LocalProcessExited(KProcess*)));
+ *p << TQStringList::split(" ", mp_cmdline->text());
+ connect(p, SIGNAL(processExited(TDEProcess*)), SLOT(SLOT_LocalProcessExited(TDEProcess*)));
if (p->start() == TRUE) mp_cmdline->setText("");
}
}
@@ -425,10 +425,10 @@ void FtpSession::SLOT_ConnectButton()
/* when disconnected show connect menu */
- else if (!Connected()) mp_bookmarksmenu->exec(mp_connectbutton->mapToGlobal(QPoint(0,0)));
+ else if (!Connected()) mp_bookmarksmenu->exec(mp_connectbutton->mapToGlobal(TQPoint(0,0)));
}
-void FtpSession::SetColors(QColor local, QColor success, QColor failure, QColor background)
+void FtpSession::SetColors(TQColor local, TQColor success, TQColor failure, TQColor background)
{
m_colorlocal = local;
m_colorsuccess = success;
@@ -436,7 +436,7 @@ void FtpSession::SetColors(QColor local, QColor success, QColor failure, QColor
mp_logwindow->setPaletteBackgroundColor(background);
}
-void FtpSession::SetFont(QFont font)
+void FtpSession::SetFont(TQFont font)
{
mp_logwindow->setFont(font);
}
@@ -455,7 +455,7 @@ void FtpSession::SLOT_CwdLine()
{
if (Occupied())
{
- qWarning("ERROR: entered cwd while occupied");
+ tqWarning("ERROR: entered cwd while occupied");
return;
}
if (Connected())
@@ -474,7 +474,7 @@ void FtpSession::SLOT_RefreshButton()
{
if (Occupied())
{
- qWarning("ERROR: refresh button pressed while occupied");
+ tqWarning("ERROR: refresh button pressed while occupied");
return;
}
if (Connected())
@@ -490,10 +490,10 @@ void FtpSession::QueueItems()
{
KbDirInfo *dir = new KbDirInfo(WorkingDir());
- QListViewItemIterator iit(mp_browser->lastItem());//, QListViewItemIterator::Selected);
+ TQListViewItemIterator iit(mp_browser->lastItem());//, TQListViewItemIterator::Selected);
while (iit.current())
{
- QListViewItem *item = iit.current();
+ TQListViewItem *item = iit.current();
if (item->isSelected())
{
if (item->rtti() == KbItem::dir) dir->AddDirectory( KbFileInfo(static_cast<KbFile*>(item), "/"));
@@ -532,7 +532,7 @@ void FtpSession::SLOT_TransferButton()
{
if (Occupied())
{
- qWarning("ERROR: transfer button pressed while occupied");
+ tqWarning("ERROR: transfer button pressed while occupied");
return;
}
m_startqueue = true;
@@ -553,7 +553,7 @@ void FtpSession::SLOT_Scandir(bool success, KbDirInfo* dir)
emit gui_queueitems(dir, this, dst, m_startqueue);
}
- else qWarning("INFO: scandir error");
+ else tqWarning("INFO: scandir error");
}
void FtpSession::SLOT_Connect(bool success)
@@ -603,9 +603,9 @@ void FtpSession::SLOT_Dir(bool success, list<KbFileInfo*> dirlist, list<KbFileIn
PrintLog(success);
if (success)
{
- while (QListViewItem* tmpviewitem = mp_browser->firstChild()) delete tmpviewitem;
- QListViewItem* dirup = new QListViewItem(mp_browser, "..");
- dirup->setPixmap(0, KGlobal::iconLoader()->loadIcon("folder",KIcon::Small));
+ while (TQListViewItem* tmpviewitem = mp_browser->firstChild()) delete tmpviewitem;
+ TQListViewItem* dirup = new TQListViewItem(mp_browser, "..");
+ dirup->setPixmap(0, TDEGlobal::iconLoader()->loadIcon("folder",TDEIcon::Small));
dirup->setSelectable(false);
list<KbFileInfo*>::iterator end_dir = dirlist.end();
@@ -626,7 +626,7 @@ void FtpSession::SLOT_Dir(bool success, list<KbFileInfo*> dirlist, list<KbFileIn
}
}
-void FtpSession::SLOT_Pwd(bool success, QString pwd)
+void FtpSession::SLOT_Pwd(bool success, TQString pwd)
{
PrintLog(success);
if (success)
@@ -637,7 +637,7 @@ void FtpSession::SLOT_Pwd(bool success, QString pwd)
if(pwd.endsWith("/") && pwd.length() > 1)
{
- qWarning("INFO: stripping trailing /");
+ tqWarning("INFO: stripping trailing /");
m_remoteworkingdir.truncate(pwd.length() - 1);
}
mp_cwdline->setText(pwd);
@@ -647,7 +647,7 @@ void FtpSession::SLOT_Pwd(bool success, QString pwd)
void FtpSession::SortItems()
{
- QListViewItem* x = mp_browser->firstChild();
+ TQListViewItem* x = mp_browser->firstChild();
mp_browser->takeItem(x);
mp_browser->setSorting(m_sortpref, m_sortascending);
@@ -662,7 +662,7 @@ void FtpSession::PrintLog(bool)
list<logentries>::iterator i;
for (i = m_loglist.begin(); i != m_loglist.end(); i++)
{
- QString line = (*i).first;
+ TQString line = (*i).first;
if ((*i).second == true)
{
@@ -684,7 +684,7 @@ void FtpSession::Connect()
{
mp_rclickmenu->setItemEnabled(Kasablanca::Bookmark, true);
mp_bookmarksmenu->setEnabled(false);
- mp_connectbutton->setIconSet(KGlobal::iconLoader()->loadIconSet("connect_established",KIcon::Toolbar));
+ mp_connectbutton->setIconSet(TDEGlobal::iconLoader()->loadIconSet("connect_established",TDEIcon::Toolbar));
mp_statusline->setText(i18n("Occupied"));
m_connected = true;
emit gui_clearqueue(this);
@@ -695,7 +695,7 @@ void FtpSession::Disconnect()
UpdateLocal();
mp_rclickmenu->setItemEnabled(Kasablanca::Bookmark, false);
mp_bookmarksmenu->setEnabled(true);
- mp_connectbutton->setIconSet(KGlobal::iconLoader()->loadIconSet("connect_no",KIcon::Toolbar));
+ mp_connectbutton->setIconSet(TDEGlobal::iconLoader()->loadIconSet("connect_no",TDEIcon::Toolbar));
mp_statusline->setText(i18n("Disconnected"));
m_connected = false;
emit gui_clearqueue(this);
@@ -703,7 +703,7 @@ void FtpSession::Disconnect()
void FtpSession::Occupy()
{
- qWarning("INFO: %s gui blocked", name());
+ tqWarning("INFO: %s gui blocked", name());
mp_rclickmenu->setEnabled(false);
mp_browser->setEnabled(false);
@@ -718,7 +718,7 @@ void FtpSession::Occupy()
void FtpSession::Free()
{
- qWarning("INFO: %s gui freed", name());
+ tqWarning("INFO: %s gui freed", name());
mp_rclickmenu->setEnabled(true);
mp_browser->setEnabled(true);
@@ -740,26 +740,26 @@ void FtpSession::RefreshBrowser()
mp_ftpthread->Dir(true);
}
-void FtpSession::UpdateLocal(QString cwd)
+void FtpSession::UpdateLocal(TQString cwd)
{
- QFileInfoList filelist, dirlist;
+ TQFileInfoList filelist, dirlist;
if (cwd != "") if (!m_localworkingdir.cd(cwd)) return;
if (!m_localworkingdir.exists()) return;
mp_browser->sortColumn();
- m_localworkingdir.setSorting(QDir::Name);
+ m_localworkingdir.setSorting(TQDir::Name);
- while (QListViewItem* tmpviewitem = mp_browser->firstChild()) delete tmpviewitem;
+ while (TQListViewItem* tmpviewitem = mp_browser->firstChild()) delete tmpviewitem;
- QListViewItem* dirup = new QListViewItem(mp_browser, "..");
- dirup->setPixmap(0, KGlobal::iconLoader()->loadIcon("folder",KIcon::Small));
+ TQListViewItem* dirup = new TQListViewItem(mp_browser, "..");
+ dirup->setPixmap(0, TDEGlobal::iconLoader()->loadIcon("folder",TDEIcon::Small));
dirup->setSelectable(false);
- m_localworkingdir.setFilter(QDir::Dirs | QDir::Hidden);
+ m_localworkingdir.setFilter(TQDir::Dirs | TQDir::Hidden);
dirlist = *m_localworkingdir.entryInfoList();
- QFileInfoListIterator dit(dirlist);
+ TQFileInfoListIterator dit(dirlist);
dit.atFirst();
while (dit.current())
{
@@ -767,10 +767,10 @@ void FtpSession::UpdateLocal(QString cwd)
++dit;
}
- m_localworkingdir.setFilter(QDir::Files | QDir::Hidden);
+ m_localworkingdir.setFilter(TQDir::Files | TQDir::Hidden);
filelist = *m_localworkingdir.entryInfoList();
- QFileInfoListIterator fit(filelist);
+ TQFileInfoListIterator fit(filelist);
fit.atFirst();
while (fit.current())
{
@@ -784,22 +784,22 @@ void FtpSession::UpdateLocal(QString cwd)
if (KbConfig::hideHiddenFilesIsEnabled()) FilterHiddenFiles(true);
}
-/*bool FtpSession::RmdirLocal(QString dir)
+/*bool FtpSession::RmdirLocal(TQString dir)
{
- QStringList filelist, dirlist;
- QString olddir;
+ TQStringList filelist, dirlist;
+ TQString olddir;
olddir = m_localworkingdir.path();
if (!m_localworkingdir.cd(dir)) return false;
- filelist = m_localworkingdir.entryList("*", QDir::Files | QDir::Hidden);
- for (QStringList::Iterator it = filelist.begin(); it != filelist.end(); ++it)
+ filelist = m_localworkingdir.entryList("*", TQDir::Files | TQDir::Hidden);
+ for (TQStringList::Iterator it = filelist.begin(); it != filelist.end(); ++it)
{
if (!m_localworkingdir.remove(*it)) return false;
}
- dirlist = m_localworkingdir.entryList("*", QDir::Dirs | QDir::Hidden);
- for (QStringList::Iterator it = dirlist.begin(); it != dirlist.end(); ++it)
+ dirlist = m_localworkingdir.entryList("*", TQDir::Dirs | TQDir::Hidden);
+ for (TQStringList::Iterator it = dirlist.begin(); it != dirlist.end(); ++it)
{
if ((*it != ".") && (*it != ".."))
{
@@ -813,40 +813,40 @@ void FtpSession::UpdateLocal(QString cwd)
return true;
}*/
-bool FtpSession::ScandirLocal(KbDirInfo *dir, QString path)
+bool FtpSession::ScandirLocal(KbDirInfo *dir, TQString path)
{
- QFileInfoList filelist, dirlist;
- QString olddir;
+ TQFileInfoList filelist, dirlist;
+ TQString olddir;
- qWarning("dir: path: %s file: %s", dir->dirPath(true).latin1(), dir->fileName().latin1());
+ tqWarning("dir: path: %s file: %s", dir->dirPath(true).latin1(), dir->fileName().latin1());
olddir = WorkingDir();
if (!m_localworkingdir.cd(dir->fileName())) return false;
- m_localworkingdir.setFilter(QDir::Files | QDir::Hidden);
+ m_localworkingdir.setFilter(TQDir::Files | TQDir::Hidden);
filelist = *m_localworkingdir.entryInfoList();
- QFileInfoListIterator fit(filelist);
+ TQFileInfoListIterator fit(filelist);
fit.atFirst();
while (fit.current())
{
KbFileInfo *kfi = new KbFileInfo(*fit.current());
kfi->SetDirPath(path);
dir->AddFile(kfi);
- qWarning("file: path: %s file: %s", kfi->dirPath(true).latin1(), kfi->fileName().latin1());
+ tqWarning("file: path: %s file: %s", kfi->dirPath(true).latin1(), kfi->fileName().latin1());
++fit;
}
- m_localworkingdir.setFilter(QDir::Dirs | QDir::Hidden);
+ m_localworkingdir.setFilter(TQDir::Dirs | TQDir::Hidden);
dirlist = *m_localworkingdir.entryInfoList();
list<KbFileInfo> kfilist;
- QFileInfoListIterator dit(dirlist);
+ TQFileInfoListIterator dit(dirlist);
dit.atFirst();
while (dit.current())
{
- QFileInfo qfi = *dit.current();
+ TQFileInfo qfi = *dit.current();
KbFileInfo kfi(qfi);
kfi.SetDirPath(path);
kfilist.push_back(kfi);
@@ -866,17 +866,17 @@ bool FtpSession::ScandirLocal(KbDirInfo *dir, QString path)
return true;
}
-QString FtpSession::WorkingDir()
+TQString FtpSession::WorkingDir()
{
if (Connected()) return m_remoteworkingdir;
else return m_localworkingdir.absPath();
}
-bool FtpSession::CheckLocalDirectory(QString path)
+bool FtpSession::CheckLocalDirectory(TQString path)
{
if (Connected())
{
- qWarning("ERROR: CheckLocalDirectory on connected session called");
+ tqWarning("ERROR: CheckLocalDirectory on connected session called");
return false;
}
@@ -890,11 +890,11 @@ bool FtpSession::CheckLocalDirectory(QString path)
}
}
-bool FtpSession::MakeLocalDirectory(QString path)
+bool FtpSession::MakeLocalDirectory(TQString path)
{
if (Connected())
{
- qWarning("ERROR: MakeLocalDirectory on connected session called");
+ tqWarning("ERROR: MakeLocalDirectory on connected session called");
return false;
}
@@ -904,28 +904,28 @@ bool FtpSession::MakeLocalDirectory(QString path)
return result;
}
-void FtpSession::MakeDirectory(QString dir)
+void FtpSession::MakeDirectory(TQString dir)
{
bool result = mp_ftpthread->Transfer_Mkdir(dir);
if (result) mp_ftpthread->start();
- else qWarning("ERROR: thread error, thread was still busy.");
+ else tqWarning("ERROR: thread error, thread was still busy.");
}
bool FtpSession::CopyLocalFile(KbTransferItem* item)
{
- QTextStream srcstream;
- QTextStream dststream;
- QFile srcfile(item->SrcFileInfo()->filePath());
- QFile dstfile(item->DstFileInfo()->filePath());
+ TQTextStream srcstream;
+ TQTextStream dststream;
+ TQFile srcfile(item->SrcFileInfo()->filePath());
+ TQFile dstfile(item->DstFileInfo()->filePath());
if (!dstfile.open(IO_WriteOnly))
{
- qWarning("ERROR: writing to local destination file not allowed");
+ tqWarning("ERROR: writing to local destination file not allowed");
return false;
}
dststream.setDevice(&dstfile);
if (!srcfile.open(IO_ReadOnly))
{
- qWarning("ERROR: reading from local source file not allowed");
+ tqWarning("ERROR: reading from local source file not allowed");
return false;
}
srcstream.setDevice(&srcfile);
@@ -936,11 +936,11 @@ bool FtpSession::CopyLocalFile(KbTransferItem* item)
return true;
}
-void FtpSession::ChangeDirectory(QString path)
+void FtpSession::ChangeDirectory(TQString path)
{
bool result = mp_ftpthread->Transfer_Changedir(path, (mp_siteinfo->GetTls() > 1));
if (result) mp_ftpthread->start();
- else qWarning("ERROR: thread error, thread was still busy.");
+ else tqWarning("ERROR: thread error, thread was still busy.");
}
void FtpSession::SLOT_Transfer(bool success)
@@ -952,7 +952,7 @@ void FtpSession::SLOT_Transfer(bool success)
int FtpSession::CheckFile(KbTransferItem *item)
{
item->DstFileInfo()->SetSize(0);
- QListViewItemIterator it(mp_browser);
+ TQListViewItemIterator it(mp_browser);
while (it.current())
{
@@ -960,7 +960,7 @@ int FtpSession::CheckFile(KbTransferItem *item)
{
FileExistsDialog dlg;
KbItem* kbi;
- QString newname;
+ TQString newname;
bool b;
int result;
@@ -1070,7 +1070,7 @@ void FtpSession::Transfer(KbTransferItem *item)
if (result == skip)
{
- qWarning("INFO: skipped transfer");
+ tqWarning("INFO: skipped transfer");
item->IncrementStatus();
}
else if (item->SrcSession()->Connected())
@@ -1108,7 +1108,7 @@ void FtpSession::FxpFile(KbTransferItem *item, filecheck fc)
{
bool result;
int srctls, dsttls, alternativefxp;
- QString localfile, remotefile;
+ TQString localfile, remotefile;
off64_t offset;
remotefile = item->SrcFileInfo()->fileName();
@@ -1124,14 +1124,14 @@ void FtpSession::FxpFile(KbTransferItem *item, filecheck fc)
else result = mp_ftpthread->Transfer_Fxp(remotefile, localfile, dstftp, srctls, dsttls, 0, alternativefxp);
if (result) mp_ftpthread->start();
- else qWarning("ERROR: thread error, thread was still busy.");
+ else tqWarning("ERROR: thread error, thread was still busy.");
}
void FtpSession::GetFile(KbTransferItem *item, filecheck fc)
{
bool result;
int tls;
- QString localfile, remotefile;
+ TQString localfile, remotefile;
remotefile = item->SrcFileInfo()->fileName();
localfile = mp_currenttransfer->DstSession()->WorkingDir() + '/' + item->DstFileInfo()->fileName();
@@ -1141,14 +1141,14 @@ void FtpSession::GetFile(KbTransferItem *item, filecheck fc)
else result = mp_ftpthread->Transfer_Get(remotefile, localfile, tls);
if (result) mp_ftpthread->start();
- else qWarning("ERROR: thread error, thread was still busy.");
+ else tqWarning("ERROR: thread error, thread was still busy.");
}
void FtpSession::PutFile(KbTransferItem *item, filecheck fc)
{
bool result;
int tls;
- QString localfile, remotefile;
+ TQString localfile, remotefile;
remotefile = item->SrcFileInfo()->fileName();
localfile = mp_currenttransfer->SrcSession()->WorkingDir() + '/' + item->DstFileInfo()->fileName();
@@ -1158,10 +1158,10 @@ void FtpSession::PutFile(KbTransferItem *item, filecheck fc)
else result = mp_ftpthread->Transfer_Put(localfile, remotefile, tls);
if (result) mp_ftpthread->start();
- else qWarning("ERROR: thread error, thread was still busy.");
+ else tqWarning("ERROR: thread error, thread was still busy.");
}
-void FtpSession::timerEvent(QTimerEvent*)
+void FtpSession::timerEvent(TQTimerEvent*)
{
if (mp_currenttransfer) mp_currenttransfer->ShowProgress(static_cast<Kasablanca*>(parent())->statusTip());
}
@@ -1174,7 +1174,7 @@ void FtpSession::EnableCmdLine(bool b)
void FtpSession::FilterHiddenFiles(bool b)
{
- QListViewItemIterator it(mp_browser);
+ TQListViewItemIterator it(mp_browser);
while (it.current())
{
if ((it.current() != mp_browser->firstChild()) && (static_cast<KbItem*>(it.current())->File().startsWith(".")))