|
|
|
@ -34,16 +34,16 @@ Kio::Kio()
|
|
|
|
|
|
|
|
|
|
bool Kio::download(const KURL & from, const TQString & to)
|
|
|
|
|
{
|
|
|
|
|
KIO::Job *iojob = KIO::file_copy(from, to);
|
|
|
|
|
connect( iojob, TQT_SIGNAL( result(KIO::Job*) ),
|
|
|
|
|
TQT_SLOT( slotIOJobFinished( KIO::Job* )));
|
|
|
|
|
TDEIO::Job *iojob = TDEIO::file_copy(from, to);
|
|
|
|
|
connect( iojob, TQT_SIGNAL( result(TDEIO::Job*) ),
|
|
|
|
|
TQT_SLOT( slotIOJobFinished( TDEIO::Job* )));
|
|
|
|
|
// missing modal widget hack here.
|
|
|
|
|
// I'd recommend using KIO::NetAccess instead (David).
|
|
|
|
|
// I'd recommend using TDEIO::NetAccess instead (David).
|
|
|
|
|
kapp->enter_loop();
|
|
|
|
|
return worked;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Kio::slotIOJobFinished( KIO::Job * job)
|
|
|
|
|
void Kio::slotIOJobFinished( TDEIO::Job * job)
|
|
|
|
|
{
|
|
|
|
|
worked = (job->error() == 0);
|
|
|
|
|
kapp->exit_loop();
|
|
|
|
@ -68,18 +68,18 @@ bool Kiod::listDir(const TQString &url, const TQString &fname, bool subdirs)
|
|
|
|
|
if (file->open(IO_WriteOnly)) {
|
|
|
|
|
delete fileT;
|
|
|
|
|
fileT = new TQTextStream(file);
|
|
|
|
|
KIO::ListJob *job;
|
|
|
|
|
TDEIO::ListJob *job;
|
|
|
|
|
if (!subdirs)
|
|
|
|
|
job = KIO::listDir( url );
|
|
|
|
|
job = TDEIO::listDir( url );
|
|
|
|
|
else
|
|
|
|
|
job = KIO::listRecursive( url, false);
|
|
|
|
|
job = TDEIO::listRecursive( url, false);
|
|
|
|
|
|
|
|
|
|
kdDebug() << "started " << job << " " << subdirs << endl;
|
|
|
|
|
|
|
|
|
|
TQObject::connect( job, TQT_SIGNAL( entries( KIO::Job*, const KIO::UDSEntryList& ) ),
|
|
|
|
|
TQT_SLOT( slotListEntries( KIO::Job*, const KIO::UDSEntryList& ) ) );
|
|
|
|
|
TQObject::connect( job, TQT_SIGNAL( result( KIO::Job * ) ),
|
|
|
|
|
TQT_SLOT( slotFinished( KIO::Job* ) ) );
|
|
|
|
|
TQObject::connect( job, TQT_SIGNAL( entries( TDEIO::Job*, const TDEIO::UDSEntryList& ) ),
|
|
|
|
|
TQT_SLOT( slotListEntries( TDEIO::Job*, const TDEIO::UDSEntryList& ) ) );
|
|
|
|
|
TQObject::connect( job, TQT_SIGNAL( result( TDEIO::Job * ) ),
|
|
|
|
|
TQT_SLOT( slotFinished( TDEIO::Job* ) ) );
|
|
|
|
|
|
|
|
|
|
kapp->enter_loop();
|
|
|
|
|
|
|
|
|
@ -92,21 +92,21 @@ bool Kiod::listDir(const TQString &url, const TQString &fname, bool subdirs)
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Kiod::slotListEntries( KIO::Job *, const KIO::UDSEntryList& entries )
|
|
|
|
|
void Kiod::slotListEntries( TDEIO::Job *, const TDEIO::UDSEntryList& entries )
|
|
|
|
|
{
|
|
|
|
|
long size = 0;
|
|
|
|
|
TQString text;
|
|
|
|
|
|
|
|
|
|
KIO::UDSEntryList::ConstIterator entryIt = entries.begin();
|
|
|
|
|
TDEIO::UDSEntryList::ConstIterator entryIt = entries.begin();
|
|
|
|
|
|
|
|
|
|
for (; entryIt != entries.end(); ++entryIt) {
|
|
|
|
|
//kdDebug() << "listDir " << dynamic_cast<KIO::ListJob*>(job)->url() << endl;
|
|
|
|
|
for (KIO::UDSEntry::ConstIterator it = (*entryIt).begin();
|
|
|
|
|
//kdDebug() << "listDir " << dynamic_cast<TDEIO::ListJob*>(job)->url() << endl;
|
|
|
|
|
for (TDEIO::UDSEntry::ConstIterator it = (*entryIt).begin();
|
|
|
|
|
it != (*entryIt).end(); it++ )
|
|
|
|
|
{
|
|
|
|
|
if ( (*it).m_uds == KIO::UDS_SIZE )
|
|
|
|
|
if ( (*it).m_uds == TDEIO::UDS_SIZE )
|
|
|
|
|
size = (*it).m_long;
|
|
|
|
|
else if ( (*it).m_uds == KIO::UDS_NAME )
|
|
|
|
|
else if ( (*it).m_uds == TDEIO::UDS_NAME )
|
|
|
|
|
text = (*it).m_str;
|
|
|
|
|
}
|
|
|
|
|
*fileT << text << "\n" << size << "\n";
|
|
|
|
@ -114,9 +114,9 @@ void Kiod::slotListEntries( KIO::Job *, const KIO::UDSEntryList& entries )
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Kiod::slotFinished( KIO::Job *job )
|
|
|
|
|
void Kiod::slotFinished( TDEIO::Job *job )
|
|
|
|
|
{
|
|
|
|
|
//kdDebug() << "finished" << " " << job << " " << dynamic_cast<KIO::ListJob*>(job)->url() << endl;
|
|
|
|
|
//kdDebug() << "finished" << " " << job << " " << dynamic_cast<TDEIO::ListJob*>(job)->url() << endl;
|
|
|
|
|
worked = (job->error() == 0);
|
|
|
|
|
kapp->exit_loop();
|
|
|
|
|
}
|
|
|
|
|