Rename KCModule, KConfig, KIO, KServer, and KSocket to avoid conflicts with KDE4

pull/1/head
Timothy Pearson 12 years ago
parent 604bf3f969
commit d46a1fe346

@ -18,7 +18,7 @@ Changes in 2.2.6 :
- Added patch from carucciio to load torrents silently from the command line
- Set output_path of torrent as default location when the users selects set download location in the viewmenu (157486)
- Torrents with no file selected are now always shown as download
- Ditch KIO::NetAccess when moving data files (157462)
- Ditch TDEIO::NetAccess when moving data files (157462)
- Fix stop all and start all from system tray menu (it used to apply to the current view, now it applies to all torrents) (157991)
- Make sure that set download location and add to group are disabled when no torrent is selected
- Fix ktshell when there are multiple dcop sessions (158115)

@ -42,7 +42,7 @@ For more details, consult :
http://devel-home.kde.org/~larrosa/tutorial/p9.html
http://developer.kde.org/documentation/tutorials/xmlui/preface.html
* Use KConfig XT to create your configuration dialogs and make
* Use TDEConfig XT to create your configuration dialogs and make
them more maintainable.
For more details, consult :

@ -76,14 +76,14 @@ FilterBar::~FilterBar()
{
}
void FilterBar::saveSettings(KConfig* cfg)
void FilterBar::saveSettings(TDEConfig* cfg)
{
cfg->writeEntry("filter_bar_hidden",isHidden());
cfg->writeEntry("filter_bar_text",m_name_filter);
cfg->writeEntry("filter_bar_case_sensitive",m_case_sensitive->isChecked());
}
void FilterBar::loadSettings(KConfig* cfg)
void FilterBar::loadSettings(TDEConfig* cfg)
{
setHidden(cfg->readBoolEntry("filter_bar_hidden",true));
m_case_sensitive->setChecked(cfg->readBoolEntry("filter_bar_case_sensitive",true));

@ -24,7 +24,7 @@
class TQLabel;
class TQCheckBox;
class KConfig;
class TDEConfig;
class KLineEdit;
class KPushButton;
class KToolBarButton;
@ -49,8 +49,8 @@ public:
virtual ~FilterBar();
bool matchesFilter(kt::TorrentInterface* tc);
void saveSettings(KConfig* cfg);
void loadSettings(KConfig* cfg);
void saveSettings(TDEConfig* cfg);
void loadSettings(TDEConfig* cfg);
private slots:
void slotChangeFilter(const TQString& nameFilter);

@ -763,11 +763,11 @@ void KTorrent::changeCaption(const TQString& text)
setCaption(text);
}
void KTorrent::saveProperties(KConfig* )
void KTorrent::saveProperties(TDEConfig* )
{
}
void KTorrent::readProperties(KConfig*)
void KTorrent::readProperties(TDEConfig*)
{
}

@ -141,14 +141,14 @@ protected:
* This function is called when it is time for the app to save its
* properties for session management purposes.
*/
void saveProperties(KConfig *);
void saveProperties(TDEConfig *);
/**
* This function is called when this app is restored. The KConfig
* This function is called when this app is restored. The TDEConfig
* object points to the session management config file that was saved
* with @ref saveProperties
*/
void readProperties(KConfig *);
void readProperties(TDEConfig *);
private slots:

@ -282,11 +282,11 @@ bool KTorrentCore::load(const TQString & target,const TQString & dir,bool silent
}
}
void KTorrentCore::downloadFinished(KIO::Job *job)
void KTorrentCore::downloadFinished(TDEIO::Job *job)
{
KIO::StoredTransferJob* j = (KIO::StoredTransferJob*)job;
TDEIO::StoredTransferJob* j = (TDEIO::StoredTransferJob*)job;
int err = j->error();
if (err == KIO::ERR_USER_CANCELED)
if (err == TDEIO::ERR_USER_CANCELED)
{
loadingFinished(j->url(),false,true);
return;
@ -327,16 +327,16 @@ void KTorrentCore::load(const KURL& url)
}
else
{
KIO::Job* j = KIO::storedGet(url,false,true);
connect(j,TQT_SIGNAL(result(KIO::Job*)),this,TQT_SLOT(downloadFinished( KIO::Job* )));
TDEIO::Job* j = TDEIO::storedGet(url,false,true);
connect(j,TQT_SIGNAL(result(TDEIO::Job*)),this,TQT_SLOT(downloadFinished( TDEIO::Job* )));
}
}
void KTorrentCore::downloadFinishedSilently(KIO::Job *job)
void KTorrentCore::downloadFinishedSilently(TDEIO::Job *job)
{
KIO::StoredTransferJob* j = (KIO::StoredTransferJob*)job;
TDEIO::StoredTransferJob* j = (TDEIO::StoredTransferJob*)job;
int err = j->error();
if (err == KIO::ERR_USER_CANCELED)
if (err == TDEIO::ERR_USER_CANCELED)
{
loadingFinished(j->url(),false,true);
}
@ -394,8 +394,8 @@ void KTorrentCore::loadSilently(const KURL& url)
else
{
// download to a random file in tmp
KIO::Job* j = KIO::storedGet(url,false,true);
connect(j,TQT_SIGNAL(result(KIO::Job*)),this,TQT_SLOT(downloadFinishedSilently( KIO::Job* )));
TDEIO::Job* j = TDEIO::storedGet(url,false,true);
connect(j,TQT_SIGNAL(result(TDEIO::Job*)),this,TQT_SLOT(downloadFinishedSilently( TDEIO::Job* )));
}
}
@ -425,9 +425,9 @@ void KTorrentCore::loadSilentlyDir(const KURL& url, const KURL& savedir)
else
{
// download to a random file in tmp
KIO::Job* j = KIO::storedGet(url,false,true);
TDEIO::Job* j = TDEIO::storedGet(url,false,true);
custom_save_locations.insert(j,savedir); // keep track of save location
connect(j,TQT_SIGNAL(result(KIO::Job*)),this,TQT_SLOT(downloadFinishedSilently( KIO::Job* )));
connect(j,TQT_SIGNAL(result(TDEIO::Job*)),this,TQT_SLOT(downloadFinishedSilently( TDEIO::Job* )));
}
}

@ -35,7 +35,7 @@ namespace bt
class TorrentControl;
}
namespace KIO
namespace TDEIO
{
class Job;
}
@ -339,8 +339,8 @@ private slots:
void torrentFinished(kt::TorrentInterface* tc);
void slotStoppedByError(kt::TorrentInterface* tc, TQString msg);
void torrentSeedAutoStopped(kt::TorrentInterface* tc,kt::AutoStopReason reason);
void downloadFinished(KIO::Job *job);
void downloadFinishedSilently(KIO::Job *job);
void downloadFinished(TDEIO::Job *job);
void downloadFinishedSilently(TDEIO::Job *job);
void emitCorruptedData(kt::TorrentInterface* tc);
private:
@ -352,7 +352,7 @@ private:
kt::PluginManager* pman;
bt::QueueManager* qman;
kt::GroupManager* gman;
TQMap<KIO::Job*,KURL> custom_save_locations; // map to store save locations
TQMap<TDEIO::Job*,KURL> custom_save_locations; // map to store save locations
};
#endif

@ -206,7 +206,7 @@ void KTorrentView::setCurrentGroup(Group* group)
onExecuted(view->currentItem());
}
void KTorrentView::saveSettings(KConfig* cfg,int idx)
void KTorrentView::saveSettings(TDEConfig* cfg,int idx)
{
TQString group = TQString("KTorrentView-%1").arg(idx);
view->saveLayout(cfg,group);
@ -215,7 +215,7 @@ void KTorrentView::saveSettings(KConfig* cfg,int idx)
}
void KTorrentView::loadSettings(KConfig* cfg,int idx)
void KTorrentView::loadSettings(TDEConfig* cfg,int idx)
{
TQString group = TQString("KTorrentView-%1").arg(idx);
view->restoreLayout(cfg,group);

@ -101,10 +101,10 @@ public:
kt::TorrentInterface* getCurrentTC();
/// Save the views settings
void saveSettings(KConfig* cfg,int idx);
void saveSettings(TDEConfig* cfg,int idx);
/// Load the views settings
void loadSettings(KConfig* cfg,int idx);
void loadSettings(TDEConfig* cfg,int idx);
/**
* Put the current selection in a list.

@ -60,7 +60,7 @@ Button::Button(ButtonBar *parent, const TQString text, const TQIconSet &icon,
m_clearAccelAction = new KAction(i18n("Clear Accelerator"), 0,
TQT_TQOBJECT(this), TQT_SLOT(clearAccel()), TQT_TQOBJECT(this));
KConfig *config = kapp->config();
TDEConfig *config = kapp->config();
config->setGroup("UI");
TQString accel = config->readEntry(TQString("button_%1").arg(text), "");
if (!accel.isEmpty())
@ -70,7 +70,7 @@ Button::Button(ButtonBar *parent, const TQString text, const TQIconSet &icon,
Button::~Button()
{
// m_buttonBar->removeButton(this);
KConfig *config = kapp->config();
TDEConfig *config = kapp->config();
config->setGroup("UI");
TQRegExp r("^&([0-9])\\s.*");

@ -68,7 +68,7 @@ DDockWindow::DDockWindow(DMainWindow *parent, Position position)
break;
}
KConfig *config = kapp->config();
TDEConfig *config = kapp->config();
config->setGroup("UI");
int mode = config->readNumEntry("MDIStyle", 3);
Ideal::ButtonMode buttonMode = Ideal::Text;
@ -103,7 +103,7 @@ DDockWindow::~DDockWindow()
void DDockWindow::setVisible(bool v)
{
//write dock width to the config file
KConfig *config = kapp->config();
TDEConfig *config = kapp->config();
TQString group = TQString("%1").arg(m_name);
config->setGroup(group);
@ -147,7 +147,7 @@ void DDockWindow::loadSettings()
void DDockWindow::saveSettings()
{
KConfig *config = kapp->config();
TDEConfig *config = kapp->config();
TQString group = TQString("%1").arg(m_name);
int invisibleWidth = 0;
config->setGroup(group);
@ -199,7 +199,7 @@ void DDockWindow::addWidget(const TQString &title, TQWidget *widget, bool skipAc
{
//if the widget was selected last time the dock is deleted
//we need to show it
KConfig *config = kapp->config();
TDEConfig *config = kapp->config();
TQString group = TQString("%1").arg(m_name);
config->setGroup(group);
if (config->readEntry("ViewLastWidget") == title)

@ -42,7 +42,7 @@ DMainWindow::DMainWindow(TQWidget *parent, const char *name)
void DMainWindow::loadSettings()
{
KConfig *config = kapp->config();
TDEConfig *config = kapp->config();
config->setGroup("UI");
m_openTabAfterCurrent = config->readBoolEntry("OpenNewTabAfterCurrent", true);
m_showIconsOnTabs = config->readBoolEntry("ShowTabIcons", false);

@ -56,7 +56,7 @@ DTabWidget::DTabWidget(TQWidget *parent, const char *name)
void DTabWidget::loadSettings()
{
/*
KConfig *config = kapp->config();
TDEConfig *config = kapp->config();
config->setGroup("UI");
// m_tabBarShown = config->readBoolEntry("TabBarShown", true);
m_tabBarShown = ! config->readNumEntry("TabWidgetVisibility", 0);

@ -43,7 +43,7 @@ KTorrentView* ViewManager::newView()
return v;
}
void ViewManager::saveViewState(KConfig* cfg)
void ViewManager::saveViewState(TDEConfig* cfg)
{
TQStringList cv;
int idx = 0;
@ -56,7 +56,7 @@ void ViewManager::saveViewState(KConfig* cfg)
cfg->writeEntry("current_views",cv);
}
void ViewManager::restoreViewState(KConfig* cfg,KTorrent* ktor)
void ViewManager::restoreViewState(TDEConfig* cfg,KTorrent* ktor)
{
TQStringList def;
def.append(i18n("Downloads"));

@ -24,7 +24,7 @@
#include <tqvaluelist.h>
#include <interfaces/guiinterface.h>
class KConfig;
class TDEConfig;
class KTabWidget;
class KTorrentView;
class KTorrent;
@ -44,10 +44,10 @@ public:
KTorrentView* newView();
/// Save all views
void saveViewState(KConfig* cfg);
void saveViewState(TDEConfig* cfg);
/// Restore all views from configuration
void restoreViewState(KConfig* cfg,KTorrent* ktor);
void restoreViewState(TDEConfig* cfg,KTorrent* ktor);
/// Start all selected downloads in the current view
void startDownloads();

@ -29,16 +29,16 @@ namespace kt
ExitOperation::~ExitOperation()
{}
ExitJobOperation::ExitJobOperation(KIO::Job* j)
ExitJobOperation::ExitJobOperation(TDEIO::Job* j)
{
connect(j,TQT_SIGNAL(result(KIO::Job*)),this,TQT_SLOT(onResult( KIO::Job* )));
connect(j,TQT_SIGNAL(result(TDEIO::Job*)),this,TQT_SLOT(onResult( TDEIO::Job* )));
}
ExitJobOperation::~ExitJobOperation()
{
}
void ExitJobOperation::onResult(KIO::Job* )
void ExitJobOperation::onResult(TDEIO::Job* )
{
operationFinished(this);
}

@ -50,19 +50,19 @@ namespace kt
};
/**
* Exit operation which waits for a KIO::Job
* Exit operation which waits for a TDEIO::Job
*/
class ExitJobOperation : public ExitOperation
{
Q_OBJECT
public:
ExitJobOperation(KIO::Job* j);
ExitJobOperation(TDEIO::Job* j);
virtual ~ExitJobOperation();
virtual bool deleteAllowed() const {return false;}
private slots:
virtual void onResult(KIO::Job* j);
virtual void onResult(TDEIO::Job* j);
};
}

@ -86,13 +86,13 @@ namespace dht
virtual void encode(TQByteArray & arr) = 0;
/// Set the origin (i.e. where the message came from)
void setOrigin(const KNetwork::KSocketAddress & o) {origin = o;}
void setOrigin(const KNetwork::TDESocketAddress & o) {origin = o;}
/// Get the origin
const KNetwork::KInetSocketAddress & getOrigin() const {return origin;}
/// Set the origin (i.e. where the message came from)
void setDestination(const KNetwork::KSocketAddress & o) {origin = o;}
void setDestination(const KNetwork::TDESocketAddress & o) {origin = o;}
/// Get the origin
const KNetwork::KInetSocketAddress & getDestination() const {return origin;}

@ -157,7 +157,7 @@ namespace dht
}
void RPCServer::send(const KNetwork::KSocketAddress & addr,const TQByteArray & msg)
void RPCServer::send(const KNetwork::TDESocketAddress & addr,const TQByteArray & msg)
{
sock->send(KNetwork::KDatagramPacket(msg,addr));
}
@ -230,7 +230,7 @@ namespace dht
return calls.find(mtid);
}
void RPCServer::ping(const dht::Key & our_id,const KNetwork::KSocketAddress & addr)
void RPCServer::ping(const dht::Key & our_id,const KNetwork::TDESocketAddress & addr)
{
Out(SYS_DHT|LOG_NOTICE) << "DHT: pinging " << addr.nodeName() << endl;
PingReq* pr = new PingReq(our_id);

@ -91,7 +91,7 @@ namespace dht
* Ping a node, we don't care about the MTID.
* @param addr The address
*/
void ping(const dht::Key & our_id,const KNetwork::KSocketAddress & addr);
void ping(const dht::Key & our_id,const KNetwork::TDESocketAddress & addr);
/**
* Find a RPC call, based on the mtid
@ -106,7 +106,7 @@ namespace dht
void readPacket();
private:
void send(const KNetwork::KSocketAddress & addr,const TQByteArray & msg);
void send(const KNetwork::TDESocketAddress & addr,const TQByteArray & msg);
void doQueuedCalls();
private:

@ -70,15 +70,15 @@ namespace bt
/**
* Move the data files to a new directory.
* @param ndir The directory
* @return The KIO::Job doing the move
* @return The TDEIO::Job doing the move
*/
virtual KIO::Job* moveDataFiles(const TQString & ndir) = 0;
virtual TDEIO::Job* moveDataFiles(const TQString & ndir) = 0;
/**
* The move data files job is done.
* @param job The job that did it
*/
virtual void moveDataFilesCompleted(KIO::Job* job) = 0;
virtual void moveDataFilesCompleted(TDEIO::Job* job) = 0;
/**
* Changes output path. All data files should already been moved.

@ -148,12 +148,12 @@ namespace bt
file_priority_file = data_dir + "file_priority";
}
KIO::Job* ChunkManager::moveDataFiles(const TQString & ndir)
TDEIO::Job* ChunkManager::moveDataFiles(const TQString & ndir)
{
return cache->moveDataFiles(ndir);
}
void ChunkManager::moveDataFilesCompleted(KIO::Job* job)
void ChunkManager::moveDataFilesCompleted(TDEIO::Job* job)
{
cache->moveDataFilesCompleted(job);
}

@ -30,7 +30,7 @@
class TQStringList;
namespace KIO
namespace TDEIO
{
class Job;
}
@ -109,13 +109,13 @@ namespace bt
* @param ndir The new directory
* @return The job doing the move
*/
KIO::Job* moveDataFiles(const TQString & ndir);
TDEIO::Job* moveDataFiles(const TQString & ndir);
/**
* The move data files job has finished
* @param job The move job
*/
void moveDataFilesCompleted(KIO::Job* job);
void moveDataFilesCompleted(TDEIO::Job* job);
/**
* Loads the index file.

@ -116,18 +116,18 @@ namespace bt
scrape_url.setEncodedPathAndQuery(epq);
Out(SYS_TRK|LOG_NOTICE) << "Doing scrape request to url : " << scrape_url.prettyURL() << endl;
KIO::MetaData md;
TDEIO::MetaData md;
setupMetaData(md);
KIO::StoredTransferJob* j = KIO::storedGet(scrape_url,false,false);
TDEIO::StoredTransferJob* j = TDEIO::storedGet(scrape_url,false,false);
// set the meta data
j->setMetaData(md);
KIO::Scheduler::scheduleJob(j);
TDEIO::Scheduler::scheduleJob(j);
connect(j,TQT_SIGNAL(result(KIO::Job* )),this,TQT_SLOT(onScrapeResult( KIO::Job* )));
connect(j,TQT_SIGNAL(result(TDEIO::Job* )),this,TQT_SLOT(onScrapeResult( TDEIO::Job* )));
}
void HTTPTracker::onScrapeResult(KIO::Job* j)
void HTTPTracker::onScrapeResult(TDEIO::Job* j)
{
if (j->error())
{
@ -135,7 +135,7 @@ namespace bt
return;
}
KIO::StoredTransferJob* st = (KIO::StoredTransferJob*)j;
TDEIO::StoredTransferJob* st = (TDEIO::StoredTransferJob*)j;
BDecoder dec(st->data(),false,0);
BNode* n = 0;
@ -355,11 +355,11 @@ namespace bt
}
void HTTPTracker::onAnnounceResult(KIO::Job* j)
void HTTPTracker::onAnnounceResult(TDEIO::Job* j)
{
if (j->error())
{
KIO::StoredTransferJob* st = (KIO::StoredTransferJob*)j;
TDEIO::StoredTransferJob* st = (TDEIO::StoredTransferJob*)j;
KURL u = st->url();
active_job = 0;
@ -376,7 +376,7 @@ namespace bt
}
else
{
KIO::StoredTransferJob* st = (KIO::StoredTransferJob*)j;
TDEIO::StoredTransferJob* st = (TDEIO::StoredTransferJob*)j;
KURL u = st->url();
active_job = 0;
@ -415,7 +415,7 @@ namespace bt
requestFailed(i18n("Invalid tracker URL"));
}
void HTTPTracker::setupMetaData(KIO::MetaData & md)
void HTTPTracker::setupMetaData(TDEIO::MetaData & md)
{
md["UserAgent"] = "ktorrent/" VERSION;
md["SendLanguageSettings"] = "false";
@ -446,14 +446,14 @@ namespace bt
void HTTPTracker::doAnnounce(const KURL & u)
{
Out(SYS_TRK|LOG_NOTICE) << "Doing tracker request to url : " << u.prettyURL() << endl;
KIO::MetaData md;
TDEIO::MetaData md;
setupMetaData(md);
KIO::StoredTransferJob* j = KIO::storedGet(u,false,false);
TDEIO::StoredTransferJob* j = TDEIO::storedGet(u,false,false);
// set the meta data
j->setMetaData(md);
KIO::Scheduler::scheduleJob(j);
TDEIO::Scheduler::scheduleJob(j);
connect(j,TQT_SIGNAL(result(KIO::Job* )),this,TQT_SLOT(onAnnounceResult( KIO::Job* )));
connect(j,TQT_SIGNAL(result(TDEIO::Job* )),this,TQT_SLOT(onAnnounceResult( TDEIO::Job* )));
active_job = j;
requestPending();

@ -23,7 +23,7 @@
#include <tqtimer.h>
#include "tracker.h"
namespace KIO
namespace TDEIO
{
class Job;
class MetaData;
@ -55,19 +55,19 @@ namespace bt
virtual void scrape();
private slots:
void onAnnounceResult(KIO::Job* j);
void onScrapeResult(KIO::Job* j);
void onAnnounceResult(TDEIO::Job* j);
void onScrapeResult(TDEIO::Job* j);
void emitInvalidURLFailure();
private:
void doRequest(WaitJob* wjob = 0);
bool updateData(const TQByteArray & data);
void setupMetaData(KIO::MetaData & md);
void setupMetaData(TDEIO::MetaData & md);
void doAnnounceQueue();
void doAnnounce(const KURL & u);
private:
KIO::Job* active_job;
TDEIO::Job* active_job;
KURL::List announce_queue;
TQString event;
Uint32 failures;

@ -23,7 +23,7 @@
namespace bt
{
MoveDataFilesJob::MoveDataFilesJob() : KIO::Job(false),err(false),active_job(0)
MoveDataFilesJob::MoveDataFilesJob() : TDEIO::Job(false),err(false),active_job(0)
{}
@ -35,12 +35,12 @@ namespace bt
todo.insert(src,dst);
}
void MoveDataFilesJob::onJobDone(KIO::Job* j)
void MoveDataFilesJob::onJobDone(TDEIO::Job* j)
{
if (j->error() || err)
{
if (!err)
m_error = KIO::ERR_INTERNAL;
m_error = TDEIO::ERR_INTERNAL;
active_job = 0;
if (j->error())
@ -59,9 +59,9 @@ namespace bt
}
}
void MoveDataFilesJob::onCanceled(KIO::Job* j)
void MoveDataFilesJob::onCanceled(TDEIO::Job* j)
{
m_error = KIO::ERR_USER_CANCELED;
m_error = TDEIO::ERR_USER_CANCELED;
active_job = 0;
err = true;
recover();
@ -77,12 +77,12 @@ namespace bt
}
TQMap<TQString,TQString>::iterator i = todo.begin();
active_job = KIO::move(KURL::fromPathOrURL(i.key()),KURL::fromPathOrURL(i.data()),false);
active_job = TDEIO::move(KURL::fromPathOrURL(i.key()),KURL::fromPathOrURL(i.data()),false);
active_src = i.key();
active_dst = i.data();
Out(SYS_GEN|LOG_DEBUG) << "Moving " << active_src << " -> " << active_dst << endl;
connect(active_job,TQT_SIGNAL(result(KIO::Job*)),this,TQT_SLOT(onJobDone(KIO::Job*)));
connect(active_job,TQT_SIGNAL(canceled(KIO::Job*)),this,TQT_SLOT(onCanceled(KIO::Job*)));
connect(active_job,TQT_SIGNAL(result(TDEIO::Job*)),this,TQT_SLOT(onJobDone(TDEIO::Job*)));
connect(active_job,TQT_SIGNAL(canceled(TDEIO::Job*)),this,TQT_SLOT(onCanceled(TDEIO::Job*)));
todo.erase(i);
}
@ -94,9 +94,9 @@ namespace bt
return;
}
TQMap<TQString,TQString>::iterator i = success.begin();
active_job = KIO::move(KURL::fromPathOrURL(i.data()),KURL::fromPathOrURL(i.key()),false);
connect(active_job,TQT_SIGNAL(result(KIO::Job*)),this,TQT_SLOT(onJobDone(KIO::Job*)));
connect(active_job,TQT_SIGNAL(canceled(KIO::Job*)),this,TQT_SLOT(onCanceled(KIO::Job*)));
active_job = TDEIO::move(KURL::fromPathOrURL(i.data()),KURL::fromPathOrURL(i.key()),false);
connect(active_job,TQT_SIGNAL(result(TDEIO::Job*)),this,TQT_SLOT(onJobDone(TDEIO::Job*)));
connect(active_job,TQT_SIGNAL(canceled(TDEIO::Job*)),this,TQT_SLOT(onCanceled(TDEIO::Job*)));
success.erase(i);
}
}

@ -27,9 +27,9 @@ namespace bt
/**
* @author Joris Guisson <joris.guisson@gmail.com>
* KIO::Job to move all the files of a torrent.
* TDEIO::Job to move all the files of a torrent.
*/
class MoveDataFilesJob : public KIO::Job
class MoveDataFilesJob : public TDEIO::Job
{
Q_OBJECT
@ -50,15 +50,15 @@ namespace bt
void startMoving();
private slots:
void onJobDone(KIO::Job* j);
void onCanceled(KIO::Job* j);
void onJobDone(TDEIO::Job* j);
void onCanceled(TDEIO::Job* j);
private:
void recover();
private:
bool err;
KIO::Job* active_job;
TDEIO::Job* active_job;
TQString active_src,active_dst;
TQMap<TQString,TQString> todo;
TQMap<TQString,TQString> success;

@ -195,7 +195,7 @@ namespace bt
}
}
KIO::Job* MultiFileCache::moveDataFiles(const TQString & ndir)
TDEIO::Job* MultiFileCache::moveDataFiles(const TQString & ndir)
{
if (!bt::Exists(ndir))
bt::MakeDir(ndir);
@ -239,7 +239,7 @@ namespace bt
return 0;
}
void MultiFileCache::moveDataFilesCompleted(KIO::Job* job)
void MultiFileCache::moveDataFilesCompleted(TDEIO::Job* job)
{
if (!job->error())
{

@ -55,8 +55,8 @@ namespace bt
virtual void open();
virtual TQString getOutputPath() const;
virtual void changeOutputPath(const TQString & outputpath);
virtual KIO::Job* moveDataFiles(const TQString & ndir);
virtual void moveDataFilesCompleted(KIO::Job* job);
virtual TDEIO::Job* moveDataFiles(const TQString & ndir);
virtual void moveDataFilesCompleted(TDEIO::Job* job);
virtual void preallocateDiskSpace(PreallocationThread* prealloc);
virtual bool hasMissingFiles(TQStringList & sl);
virtual void deleteDataFiles();

@ -52,12 +52,12 @@ namespace bt
cache_file = tmpdir + "cache";
}
KIO::Job* SingleFileCache::moveDataFiles(const TQString & ndir)
TDEIO::Job* SingleFileCache::moveDataFiles(const TQString & ndir)
{
return KIO::move(KURL::fromPathOrURL(output_file),KURL::fromPathOrURL(ndir));
return TDEIO::move(KURL::fromPathOrURL(output_file),KURL::fromPathOrURL(ndir));
}
void SingleFileCache::moveDataFilesCompleted(KIO::Job* /*job*/)
void SingleFileCache::moveDataFilesCompleted(TDEIO::Job* /*job*/)
{
}

@ -49,8 +49,8 @@ namespace bt
virtual void close();
virtual void open();
virtual void changeTmpDir(const TQString & ndir);
virtual KIO::Job* moveDataFiles(const TQString & ndir);
virtual void moveDataFilesCompleted(KIO::Job* job);
virtual TDEIO::Job* moveDataFiles(const TQString & ndir);
virtual void moveDataFilesCompleted(TDEIO::Job* job);
virtual void changeOutputPath(const TQString& outputpath);
virtual TQString getOutputPath() const {return output_file;}
virtual void preallocateDiskSpace(PreallocationThread* prealloc);

@ -843,7 +843,7 @@ namespace bt
if (stats.output_path != nd)
{
KIO::Job* j = 0;
TDEIO::Job* j = 0;
if(moveFiles)
{
if (stats.multi_file_torrent)
@ -855,7 +855,7 @@ namespace bt
move_data_files_destination_path = nd;
if (j)
{
connect(j,TQT_SIGNAL(result(KIO::Job*)),this,TQT_SLOT(moveDataFilesJobDone(KIO::Job*)));
connect(j,TQT_SIGNAL(result(TDEIO::Job*)),this,TQT_SLOT(moveDataFilesJobDone(TDEIO::Job*)));
return true;
}
else
@ -884,7 +884,7 @@ namespace bt
return true;
}
void TorrentControl::moveDataFilesJobDone(KIO::Job* job)
void TorrentControl::moveDataFilesJobDone(TDEIO::Job* job)
{
if (job)
cman->moveDataFilesCompleted(job);

@ -34,7 +34,7 @@
class TQStringList;
class TQString;
namespace KIO
namespace TDEIO
{
class Job;
}
@ -308,7 +308,7 @@ namespace bt
/// Update the stats of the torrent.
void updateStats();
void corrupted(Uint32 chunk);
void moveDataFilesJobDone(KIO::Job* job);
void moveDataFilesJobDone(TDEIO::Job* job);
private:
void updateTracker(const TQString & ev,bool last_succes = true);

@ -87,7 +87,7 @@ namespace bt
bool doRequest();
private:
KNetwork::KSocketAddress address;
KNetwork::TDESocketAddress address;
Int32 transaction_id;
Int64 connection_id;

@ -75,7 +75,7 @@ namespace bt
delete sock;
}
void UDPTrackerSocket::sendConnect(Int32 tid,const KNetwork::KSocketAddress & addr)
void UDPTrackerSocket::sendConnect(Int32 tid,const KNetwork::TDESocketAddress & addr)
{
Int64 cid = 0x41727101980LL;
Uint8 buf[16];
@ -88,7 +88,7 @@ namespace bt
transactions.insert(tid,CONNECT);
}
void UDPTrackerSocket::sendAnnounce(Int32 tid,const Uint8* data,const KNetwork::KSocketAddress & addr)
void UDPTrackerSocket::sendAnnounce(Int32 tid,const Uint8* data,const KNetwork::TDESocketAddress & addr)
{
transactions.insert(tid,ANNOUNCE);
sock->send(KDatagramPacket((char*)data,98,addr));

@ -29,7 +29,7 @@
namespace KNetwork
{
class KDatagramSocket;
class KSocketAddress;
class TDESocketAddress;
}
namespace bt
@ -66,7 +66,7 @@ namespace bt
* @param tid The transaction_id
* @param addr The address to send to
*/
void sendConnect(Int32 tid,const KNetwork::KSocketAddress & addr);
void sendConnect(Int32 tid,const KNetwork::TDESocketAddress & addr);
/**
* Send an announce message. As a response to this, the announceRecieved
@ -76,7 +76,7 @@ namespace bt
* @param data The data to send (connect input structure, in UDP Tracker specifaction)
* @param addr The address to send to
*/
void sendAnnounce(Int32 tid,const Uint8* data,const KNetwork::KSocketAddress & addr);
void sendAnnounce(Int32 tid,const Uint8* data,const KNetwork::TDESocketAddress & addr);
/**
* If a transaction times out, this should be used to cancel it.

@ -27,7 +27,7 @@ namespace bt
{
AutoRotateLogJob::AutoRotateLogJob(const TQString & file,Log* lg)
: KIO::Job(false),file(file),cnt(10),lg(lg)
: TDEIO::Job(false),file(file),cnt(10),lg(lg)
{
update();
}
@ -50,8 +50,8 @@ namespace bt
TQString curr = TQString("%1-%2.gz").arg(file).arg(cnt);
if (bt::Exists(prev)) // if file exists start the move job
{
KIO::Job* sj = KIO::file_move(KURL::fromPathOrURL(prev),KURL::fromPathOrURL(curr),-1,true,false,false);
connect(sj,TQT_SIGNAL(result(KIO::Job*)),this,TQT_SLOT(moveJobDone(KIO::Job* )));
TDEIO::Job* sj = TDEIO::file_move(KURL::fromPathOrURL(prev),KURL::fromPathOrURL(curr),-1,true,false,false);
connect(sj,TQT_SIGNAL(result(TDEIO::Job*)),this,TQT_SLOT(moveJobDone(TDEIO::Job* )));
return;
}
else
@ -64,8 +64,8 @@ namespace bt
{
// move current log to 1 and zip it
bt::Move(file,file + "-1",true);
KIO::Job* sj = KIO::file_move(KURL::fromPathOrURL(file),KURL::fromPathOrURL(file + "-1"),-1,true,false,false);
connect(sj,TQT_SIGNAL(result(KIO::Job*)),this,TQT_SLOT(moveJobDone(KIO::Job* )));
TDEIO::Job* sj = TDEIO::file_move(KURL::fromPathOrURL(file),KURL::fromPathOrURL(file + "-1"),-1,true,false,false);
connect(sj,TQT_SIGNAL(result(TDEIO::Job*)),this,TQT_SLOT(moveJobDone(TDEIO::Job* )));
}
else
{
@ -78,7 +78,7 @@ namespace bt
}
void AutoRotateLogJob::moveJobDone(KIO::Job*)
void AutoRotateLogJob::moveJobDone(TDEIO::Job*)
{
cnt--; // decrease counter so the newt file will be moved in update
update(); // don't care about result of job

@ -33,7 +33,7 @@ namespace bt
Job which handles the rotation of the log file.
This Job must do several move jobs which must be done sequentially.
*/
class AutoRotateLogJob : public KIO::Job
class AutoRotateLogJob : public TDEIO::Job
{
Q_OBJECT
@ -44,7 +44,7 @@ namespace bt
virtual void kill(bool quietly=true);
private slots:
void moveJobDone(KIO::Job*);
void moveJobDone(TDEIO::Job*);
private:
void update();

@ -102,48 +102,48 @@ namespace bt
void Move(const TQString & src,const TQString & dst,bool nothrow)
{
// Out() << "Moving " << src << " -> " << dst << endl;
if (!KIO::NetAccess::move(KURL::fromPathOrURL(src),KURL::fromPathOrURL(dst),0))
if (!TDEIO::NetAccess::move(KURL::fromPathOrURL(src),KURL::fromPathOrURL(dst),0))
{
if (!nothrow)
throw Error(i18n("Cannot move %1 to %2: %3")
.arg(src).arg(dst)
.arg(KIO::NetAccess::lastErrorString()));
.arg(TDEIO::NetAccess::lastErrorString()));
else
Out() << TQString("Error : Cannot move %1 to %2: %3")
.arg(src).arg(dst)
.arg(KIO::NetAccess::lastErrorString()) << endl;
.arg(TDEIO::NetAccess::lastErrorString()) << endl;
}
}
void CopyFile(const TQString & src,const TQString & dst,bool nothrow)
{
if (!KIO::NetAccess::file_copy(KURL::fromPathOrURL(src),KURL::fromPathOrURL(dst)))
if (!TDEIO::NetAccess::file_copy(KURL::fromPathOrURL(src),KURL::fromPathOrURL(dst)))
{
if (!nothrow)
throw Error(i18n("Cannot copy %1 to %2: %3")
.arg(src).arg(dst)
.arg(KIO::NetAccess::lastErrorString()));
.arg(TDEIO::NetAccess::lastErrorString()));
else
Out() << TQString("Error : Cannot copy %1 to %2: %3")
.arg(src).arg(dst)
.arg(KIO::NetAccess::lastErrorString()) << endl;
.arg(TDEIO::NetAccess::lastErrorString()) << endl;
}
}
void CopyDir(const TQString & src,const TQString & dst,bool nothrow)
{
if (!KIO::NetAccess::dircopy(KURL::fromPathOrURL(src),KURL::fromPathOrURL(dst),0))
if (!TDEIO::NetAccess::dircopy(KURL::fromPathOrURL(src),KURL::fromPathOrURL(dst),0))
{
if (!nothrow)
throw Error(i18n("Cannot copy %1 to %2: %3")
.arg(src).arg(dst)
.arg(KIO::NetAccess::lastErrorString()));
.arg(TDEIO::NetAccess::lastErrorString()));
else
Out() << TQString("Error : Cannot copy %1 to %2: %3")
.arg(src).arg(dst)
.arg(KIO::NetAccess::lastErrorString()) << endl;
.arg(TDEIO::NetAccess::lastErrorString()) << endl;
}
}

@ -32,7 +32,7 @@ namespace bt
/**
* Creates a directory. Convenience function around
* KIO::NetAccess::mkdir .
* TDEIO::NetAccess::mkdir .
* @param dir The url of the dir
* @param nothrow wether or not we shouldn't throw an Error upon failure
* @throw Error upon error

@ -103,7 +103,7 @@ namespace bt
void HTTPRequest::onError(int)
{
Out() << "HTTPRequest error : " << sock->KSocketBase::errorString() << endl;
Out() << "HTTPRequest error : " << sock->TDESocketBase::errorString() << endl;
error(this,false);
sock->close();
operationFinished(this);

@ -25,7 +25,7 @@
namespace bt
{
WaitJob::WaitJob(Uint32 millis) : KIO::Job(false)
WaitJob::WaitJob(Uint32 millis) : TDEIO::Job(false)
{
connect(&timer,TQT_SIGNAL(timeout()),this,TQT_SLOT(timerDone()));
timer.start(millis,true);
@ -70,14 +70,14 @@ namespace bt
void WaitJob::execute(WaitJob* job)
{
KIO::NetAccess::synchronousRun(job,0);
TDEIO::NetAccess::synchronousRun(job,0);
}
void SynchronousWait(Uint32 millis)
{
Out() << "SynchronousWait" << endl;
WaitJob* j = new WaitJob(millis);
KIO::NetAccess::synchronousRun(j,0);
TDEIO::NetAccess::synchronousRun(j,0);
}
}

@ -35,7 +35,7 @@ namespace bt
* Job to wait for a certain amount of time or until one or more ExitOperation's have
* finished.
*/
class WaitJob : public KIO::Job
class WaitJob : public TDEIO::Job
{
Q_OBJECT

@ -143,12 +143,12 @@ namespace kt
m_size_chunks->setText(TQString::number(s.chunk_size / 1024 / 1024) + "." + TQString::number(((s.chunk_size / 1024) % 1024) / 100) + " MB");
}
void ChunkDownloadView::saveLayout(KConfig* cfg,const TQString & group_name)
void ChunkDownloadView::saveLayout(TDEConfig* cfg,const TQString & group_name)
{
m_list_view->saveLayout(cfg,group_name);
}
void ChunkDownloadView::restoreLayout(KConfig* cfg,const TQString & group_name)
void ChunkDownloadView::restoreLayout(TDEConfig* cfg,const TQString & group_name)
{
m_list_view->restoreLayout(cfg,group_name);
}

@ -54,8 +54,8 @@ namespace kt
ChunkDownloadView(TQWidget *parent = 0, const char *name = 0);
virtual ~ChunkDownloadView();
void saveLayout(KConfig* cfg,const TQString & group_name);
void restoreLayout(KConfig* cfg,const TQString & group_name);
void saveLayout(TDEConfig* cfg,const TQString & group_name);
void restoreLayout(TDEConfig* cfg,const TQString & group_name);
void clear();
void update();
void changeTC(kt::TorrentInterface* tc);

@ -94,7 +94,7 @@ namespace kt
if(target.exists())
{
//make backup
KIO::NetAccess::file_copy(TDEGlobal::dirs() ->saveLocation( "data", "ktorrent" ) + "level1.dat", TDEGlobal::dirs() ->saveLocation( "data", "ktorrent" ) + "level1.dat.tmp", -1, true);
TDEIO::NetAccess::file_copy(TDEGlobal::dirs() ->saveLocation( "data", "ktorrent" ) + "level1.dat", TDEGlobal::dirs() ->saveLocation( "data", "ktorrent" ) + "level1.dat.tmp", -1, true);
}
/* READ INPUT FILE */
@ -245,7 +245,7 @@ namespace kt
TQFile temp( TDEGlobal::dirs() ->saveLocation( "data", "ktorrent" ) + "level1.dat.tmp");
if(temp.exists())
{
KIO::NetAccess::file_copy(TDEGlobal::dirs() ->saveLocation( "data", "ktorrent" ) + "level1.dat.tmp", TDEGlobal::dirs() ->saveLocation( "data", "ktorrent" ) + "level1.dat", -1, true);
TDEIO::NetAccess::file_copy(TDEGlobal::dirs() ->saveLocation( "data", "ktorrent" ) + "level1.dat.tmp", TDEGlobal::dirs() ->saveLocation( "data", "ktorrent" ) + "level1.dat", -1, true);
temp.remove();
}

@ -107,8 +107,8 @@ namespace kt
KURL url(m_url->url());
KURL dest(target);
KURL temp(TDEGlobal::dirs()->saveLocation("data","ktorrent") + "level1.tmp");
if(KIO::NetAccess::exists(temp,false, this))
KIO::NetAccess::del(temp,this);
if(TDEIO::NetAccess::exists(temp,false, this))
TDEIO::NetAccess::del(temp,this);
bool download = true;
@ -117,26 +117,26 @@ namespace kt
if((KMessageBox::questionYesNo(this, i18n("Selected file already exists, do you want to download it again?"),i18n("File Exists")) == 4))
download = false;
else
KIO::NetAccess::move(target, temp);
TDEIO::NetAccess::move(target, temp);
}
if(download)
{
if(!url.isLocalFile())
{
if (KIO::NetAccess::download(url,target,NULL))
if (TDEIO::NetAccess::download(url,target,NULL))
{
//Level1 list successfully downloaded, remove temporary file
KIO::NetAccess::removeTempFile(target);
KIO::NetAccess::del(temp, this);
TDEIO::NetAccess::removeTempFile(target);
TDEIO::NetAccess::del(temp, this);
}
else
{
TQString err = KIO::NetAccess::lastErrorString();
TQString err = TDEIO::NetAccess::lastErrorString();
if(err != TQString())
KMessageBox::error(0,KIO::NetAccess::lastErrorString(),i18n("Error"));
KMessageBox::error(0,TDEIO::NetAccess::lastErrorString(),i18n("Error"));
else
KIO::NetAccess::move(temp, target);
TDEIO::NetAccess::move(temp, target);
//we don't want to convert since download failed
@ -145,9 +145,9 @@ namespace kt
}
else
{
if (!KIO::NetAccess::file_copy(url,dest, -1, true))
if (!TDEIO::NetAccess::file_copy(url,dest, -1, true))
{
KMessageBox::error(0,KIO::NetAccess::lastErrorString(),i18n("Error"));
KMessageBox::error(0,TDEIO::NetAccess::lastErrorString(),i18n("Error"));
return;
}
}
@ -158,13 +158,13 @@ namespace kt
{
KURL zipfile("zip:" + target + "/splist.txt");
KURL destinationfile(target + ".txt");
KIO::NetAccess::file_copy(zipfile,destinationfile, -1, true);
TDEIO::NetAccess::file_copy(zipfile,destinationfile, -1, true);
}
else
{
KURL zipfile(target);
KURL destinationfile(target + ".txt");
KIO::NetAccess::file_copy(zipfile,destinationfile, -1, true);
TDEIO::NetAccess::file_copy(zipfile,destinationfile, -1, true);
}
}
@ -194,7 +194,7 @@ namespace kt
if((KMessageBox::questionYesNo(this,i18n("Filter file (level1.dat) already exists, do you want to convert it again?"),i18n("File Exists")) == 4))
return;
// else
// KIO::NetAccess::del(TDEGlobal::dirs()->saveLocation("data","ktorrent") + "level1.dat", NULL);
// TDEIO::NetAccess::del(TDEGlobal::dirs()->saveLocation("data","ktorrent") + "level1.dat", NULL);
}
ConvertDialog dlg(m_plugin);
dlg.exec();

@ -185,7 +185,7 @@ namespace kt
accept();
}
void ImportDialog::onTorrentGetReult(KIO::Job* j)
void ImportDialog::onTorrentGetReult(TDEIO::Job* j)
{
if (j->error())
{
@ -194,7 +194,7 @@ namespace kt
}
else
{
KIO::StoredTransferJob* stj = (KIO::StoredTransferJob*)j;
TDEIO::StoredTransferJob* stj = (TDEIO::StoredTransferJob*)j;
Torrent tor;
// try to load the torrent
@ -225,8 +225,8 @@ namespace kt
if (!tor_url.isLocalFile())
{
// download the torrent file
KIO::StoredTransferJob* j = KIO::storedGet(tor_url);
connect(j,TQT_SIGNAL(result(KIO::Job* )),this,TQT_SLOT(onTorrentGetReult(KIO::Job*)));
TDEIO::StoredTransferJob* j = TDEIO::storedGet(tor_url);
connect(j,TQT_SIGNAL(result(TDEIO::Job* )),this,TQT_SLOT(onTorrentGetReult(TDEIO::Job*)));
}
else
{

@ -33,7 +33,7 @@ namespace bt
class Torrent;
}
namespace KIO
namespace TDEIO
{
class Job;
}
@ -54,7 +54,7 @@ namespace kt
public slots:
void onImport();
void onTorrentGetReult(KIO::Job* j);
void onTorrentGetReult(TDEIO::Job* j);
private:
void writeIndex(const TQString & file,const bt::BitSet & chunks);

@ -32,7 +32,7 @@ struct Image::Private : public Shared
unsigned int height;
unsigned int width;
TQBuffer *pixmapBuffer;
KIO::Job *job;
TDEIO::Job *job;
};
Image::Image() : TQObject(), d(new Private)
@ -111,18 +111,18 @@ void Image::getPixmap()
d->pixmapBuffer = new TQBuffer;
d->pixmapBuffer->open(IO_WriteOnly);
d->job = KIO::get(d->url, false, false);
connect(d->job, TQT_SIGNAL(data(KIO::Job *, const TQByteArray &)),
this, TQT_SLOT(slotData(KIO::Job *, const TQByteArray &)));
connect(d->job, TQT_SIGNAL(result(KIO::Job *)), this, TQT_SLOT(slotResult(KIO::Job *)));
d->job = TDEIO::get(d->url, false, false);
connect(d->job, TQT_SIGNAL(data(TDEIO::Job *, const TQByteArray &)),
this, TQT_SLOT(slotData(TDEIO::Job *, const TQByteArray &)));
connect(d->job, TQT_SIGNAL(result(TDEIO::Job *)), this, TQT_SLOT(slotResult(TDEIO::Job *)));
}
void Image::slotData(KIO::Job *, const TQByteArray &data)
void Image::slotData(TDEIO::Job *, const TQByteArray &data)
{
d->pixmapBuffer->writeBlock(data.data(), data.size());
}
void Image::slotResult(KIO::Job *job)
void Image::slotResult(TDEIO::Job *job)
{
TQPixmap pixmap;
if (!job->error())

@ -17,7 +17,7 @@
class TQDomNode;
namespace KIO
namespace TDEIO
{
class Job;
}
@ -161,8 +161,8 @@ namespace RSS
void gotPixmap(const TQPixmap &pixmap);
private slots:
void slotData(KIO::Job *job, const TQByteArray &data);
void slotResult(KIO::Job *job);
void slotData(TDEIO::Job *job, const TQByteArray &data);
void slotResult(TDEIO::Job *job);
private:
struct Private;

@ -47,7 +47,7 @@ struct FileRetriever::Private
TQBuffer *buffer;
int lastError;
KIO::Job *job;
TDEIO::Job *job;
};
FileRetriever::FileRetriever()
@ -80,16 +80,16 @@ void FileRetriever::retrieveData(const KURL &url)
if (u.protocol()=="feed")
u.setProtocol("http");
d->job = KIO::get(u, !m_useCache, false);
d->job = TDEIO::get(u, !m_useCache, false);
TQTimer::singleShot(1000*90, this, TQT_SLOT(slotTimeout()));
connect(d->job, TQT_SIGNAL(data(KIO::Job *, const TQByteArray &)),
TQT_SLOT(slotData(KIO::Job *, const TQByteArray &)));
connect(d->job, TQT_SIGNAL(result(KIO::Job *)), TQT_SLOT(slotResult(KIO::Job *)));
connect(d->job, TQT_SIGNAL(permanentRedirection(KIO::Job *, const KURL &, const KURL &)),
TQT_SLOT(slotPermanentRedirection(KIO::Job *, const KURL &, const KURL &)));
connect(d->job, TQT_SIGNAL(data(TDEIO::Job *, const TQByteArray &)),
TQT_SLOT(slotData(TDEIO::Job *, const TQByteArray &)));
connect(d->job, TQT_SIGNAL(result(TDEIO::Job *)), TQT_SLOT(slotResult(TDEIO::Job *)));
connect(d->job, TQT_SIGNAL(permanentRedirection(TDEIO::Job *, const KURL &, const KURL &)),
TQT_SLOT(slotPermanentRedirection(TDEIO::Job *, const KURL &, const KURL &)));
}
void FileRetriever::slotTimeout()
@ -99,7 +99,7 @@ void FileRetriever::slotTimeout()
delete d->buffer;
d->buffer = NULL;
d->lastError = KIO::ERR_SERVER_TIMEOUT;
d->lastError = TDEIO::ERR_SERVER_TIMEOUT;
emit dataRetrieved(TQByteArray(), false);
}
@ -109,12 +109,12 @@ int FileRetriever::errorCode() const
return d->lastError;
}
void FileRetriever::slotData(KIO::Job *, const TQByteArray &data)
void FileRetriever::slotData(TDEIO::Job *, const TQByteArray &data)
{
d->buffer->writeBlock(data.data(), data.size());
}
void FileRetriever::slotResult(KIO::Job *job)
void FileRetriever::slotResult(TDEIO::Job *job)
{
TQByteArray data = d->buffer->buffer();
data.detach();
@ -126,7 +126,7 @@ void FileRetriever::slotResult(KIO::Job *job)
emit dataRetrieved(data, d->lastError == 0);
}
void FileRetriever::slotPermanentRedirection(KIO::Job *, const KURL &, const KURL &newUrl)
void FileRetriever::slotPermanentRedirection(TDEIO::Job *, const KURL &, const KURL &newUrl)
{
emit permanentRedirection(newUrl);
}

@ -17,7 +17,7 @@ class KURL;
#include <tqobject.h>
namespace KIO
namespace TDEIO
{
class Job;
}
@ -137,9 +137,9 @@ namespace RSS
void slotTimeout();
private slots:
void slotData(KIO::Job *job, const TQByteArray &data);
void slotResult(KIO::Job *job);
void slotPermanentRedirection(KIO::Job *job, const KURL &fromUrl,
void slotData(TDEIO::Job *job, const TQByteArray &data);
void slotResult(TDEIO::Job *job);
void slotPermanentRedirection(TDEIO::Job *job, const KURL &fromUrl,
const KURL &toUrl);
private:

@ -49,8 +49,8 @@ namespace kt
{
//first let's download the link so we can process it to check for the actual torrent
curLink = curSubLink = link;
curFile = KIO::storedGet(link,false,false);
connect(curFile, TQT_SIGNAL(result(KIO::Job*)),this,TQT_SLOT(processLink( KIO::Job* )));
curFile = TDEIO::storedGet(link,false,false);
connect(curFile, TQT_SIGNAL(result(TDEIO::Job*)),this,TQT_SLOT(processLink( TDEIO::Job* )));
}
}
@ -59,7 +59,7 @@ namespace kt
}
void RssLinkDownloader::processLink(KIO::Job* jobStatus)
void RssLinkDownloader::processLink(TDEIO::Job* jobStatus)
{
if (!jobStatus->error())
@ -188,8 +188,8 @@ namespace kt
{
curSubLink = subLinks.first();
subLinks.pop_front();
curFile = KIO::storedGet(curSubLink,false,false);
connect(curFile, TQT_SIGNAL(result(KIO::Job*)),this,TQT_SLOT(processLink( KIO::Job* )));
curFile = TDEIO::storedGet(curSubLink,false,false);
connect(curFile, TQT_SIGNAL(result(TDEIO::Job*)),this,TQT_SLOT(processLink( TDEIO::Job* )));
}
}

@ -59,14 +59,14 @@ namespace kt
public slots:
void processLink(KIO::Job* jobStatus);
void processLink(TDEIO::Job* jobStatus);
void suicide();
signals:
void linkDownloaded( TQString link, int downloaded );
private:
KIO::StoredTransferJob * curFile;
TDEIO::StoredTransferJob * curFile;
TQString curLink, curSubLink;
TQStringList subLinks;
RssFilter * curFilter;

@ -164,7 +164,7 @@ namespace kt
TQFile::remove(dirname + "/." + name);
// NetAccess considered harmfull !!!
KIO::file_move(url, destination);
TDEIO::file_move(url, destination);
break;
case defaultAction:
TQFile f(dirname + "/." + name);

@ -74,12 +74,12 @@ namespace kt
active_job = 0;
}
KIO::TransferJob* j = KIO::get(u,false,false);
connect(j,TQT_SIGNAL(data(KIO::Job*,const TQByteArray &)),
this,TQT_SLOT(dataRecieved(KIO::Job*, const TQByteArray& )));
connect(j,TQT_SIGNAL(result(KIO::Job*)),this,TQT_SLOT(jobDone(KIO::Job* )));
connect(j,TQT_SIGNAL(mimetype(KIO::Job*, const TQString &)),
this,TQT_SLOT(mimetype(KIO::Job*, const TQString& )));
TDEIO::TransferJob* j = TDEIO::get(u,false,false);
connect(j,TQT_SIGNAL(data(TDEIO::Job*,const TQByteArray &)),
this,TQT_SLOT(dataRecieved(TDEIO::Job*, const TQByteArray& )));
connect(j,TQT_SIGNAL(result(TDEIO::Job*)),this,TQT_SLOT(jobDone(TDEIO::Job* )));
connect(j,TQT_SIGNAL(mimetype(TDEIO::Job*, const TQString &)),
this,TQT_SLOT(mimetype(TDEIO::Job*, const TQString& )));
active_job = j;
curr_data.resize(0);
@ -115,7 +115,7 @@ namespace kt
openURL(url());
}
void HTMLPart::dataRecieved(KIO::Job* job,const TQByteArray & data)
void HTMLPart::dataRecieved(TDEIO::Job* job,const TQByteArray & data)
{
if (job != active_job)
{
@ -134,7 +134,7 @@ namespace kt
}
}
void HTMLPart::mimetype(KIO::Job* job,const TQString & mt)
void HTMLPart::mimetype(TDEIO::Job* job,const TQString & mt)
{
if (job != active_job)
{
@ -145,7 +145,7 @@ namespace kt
mime_type = mt;
}
void HTMLPart::jobDone(KIO::Job* job)
void HTMLPart::jobDone(TDEIO::Job* job)
{
if (job != active_job)
{
@ -185,7 +185,7 @@ namespace kt
else
{
begin(curr_url);
write(KIO::buildErrorString(job->error(),job->errorText()));/*,&curr_url));**/
write(TDEIO::buildErrorString(job->error(),job->errorText()));/*,&curr_url));**/
end();
}
active_job = 0;

@ -22,7 +22,7 @@
#include <khtml_part.h>
namespace KIO
namespace TDEIO
{
class Job;
}
@ -50,9 +50,9 @@ namespace kt
private slots:
void addToHistory(const KURL & url);
void dataRecieved(KIO::Job* job,const TQByteArray & data);
void mimetype(KIO::Job* job,const TQString & mt);
void jobDone(KIO::Job* job);
void dataRecieved(TDEIO::Job* job,const TQByteArray & data);
void mimetype(TDEIO::Job* job,const TQString & mt);
void jobDone(TDEIO::Job* job);
signals:
@ -63,7 +63,7 @@ namespace kt
private:
KURL::List history;
KIO::Job* active_job;
TDEIO::Job* active_job;
TQByteArray curr_data;
TQString mime_type;
KURL curr_url;

@ -188,12 +188,12 @@ namespace kt
TQString fn = TDEGlobal::dirs()->saveLocation("data","ktorrent") + "search_engines.tmp";
KURL source("http://www.ktorrent.org/downloads/search_engines");
if (KIO::NetAccess::download(source,fn,NULL))
if (TDEIO::NetAccess::download(source,fn,NULL))
{
//list successfully downloaded, remove temporary file
updateList(fn);
saveSearchEngines();
KIO::NetAccess::removeTempFile(fn);
TDEIO::NetAccess::removeTempFile(fn);
}
}

@ -213,7 +213,7 @@ namespace kt
{
KURL save_url = fdlg.selectedURL();
// start a copy job
KIO::Job* j = KIO::file_copy(url,save_url,-1,true);
TDEIO::Job* j = TDEIO::file_copy(url,save_url,-1,true);
// let it deal with the errors
j->setAutoErrorHandlingEnabled(true,0);
}

@ -222,7 +222,7 @@ namespace kt
void UPnPMCastSocket::onError(int)
{
Out(SYS_PNP|LOG_IMPORTANT) << "UPnPMCastSocket Error : " << KSocketBase::errorString() << endl;
Out(SYS_PNP|LOG_IMPORTANT) << "UPnPMCastSocket Error : " << TDESocketBase::errorString() << endl;
}
void UPnPMCastSocket::saveRouters(const TQString & file)

@ -140,7 +140,7 @@ namespace kt
services.append(s);
}
void UPnPRouter::downloadFinished(KIO::Job* j)
void UPnPRouter::downloadFinished(TDEIO::Job* j)
{
if (j->error())
{
@ -156,7 +156,7 @@ namespace kt
{
Out(SYS_PNP|LOG_IMPORTANT) << "Error parsing router description !" << endl;
TQString dest = TDEGlobal::dirs()->saveLocation("data","ktorrent") + "upnp_failure";
KIO::file_copy(target,dest,-1,true,false,false);
TDEIO::file_copy(target,dest,-1,true,false,false);
}
else
{
@ -170,8 +170,8 @@ namespace kt
void UPnPRouter::downloadXMLFile()
{
// downlaod XML description into a temporary file in /tmp
KIO::Job* job = KIO::file_copy(location,tmp_file,-1,true,false,false);
connect(job,TQT_SIGNAL(result(KIO::Job *)),this,TQT_SLOT(downloadFinished( KIO::Job* )));
TDEIO::Job* job = TDEIO::file_copy(location,tmp_file,-1,true,false,false);
connect(job,TQT_SIGNAL(result(TDEIO::Job *)),this,TQT_SLOT(downloadFinished( TDEIO::Job* )));
}
void UPnPRouter::debugPrintData()

@ -33,7 +33,7 @@ namespace bt
class WaitJob;
}
namespace KIO
namespace TDEIO
{
class Job;
}
@ -191,7 +191,7 @@ namespace kt
void onReplyOK(bt::HTTPRequest* r,const TQString &);
void onReplyError(bt::HTTPRequest* r,const TQString &);
void onError(bt::HTTPRequest* r,bool);
void downloadFinished(KIO::Job* j);
void downloadFinished(TDEIO::Job* j);

@ -140,7 +140,7 @@ namespace kt
TorrentFileInterface & file = (*i)->getTorrentFile(j);
out << TQString("\"%1\" => array(\n").arg(j);
out << TQString("\"name\" => \"%1\",\n").arg(file.getPath());
out << TQString("\"size\" => \"%1\",\n").arg(KIO::convertSize(file.getSize()));
out << TQString("\"size\" => \"%1\",\n").arg(TDEIO::convertSize(file.getSize()));
out << TQString("\"perc_done\" => \"%1\",\n").arg(file.getDownloadPercentage());
out << TQString("\"status\" => \"%1\"\n").arg(file.getPriority());
out << TQString(")\n");

Loading…
Cancel
Save