From 5632d42a9736b114d8cf86d398a327e7b088846f Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sun, 27 Jan 2013 15:43:20 -0600 Subject: Minor update for kioslave rename --- kpackage/Makefile.am | 2 +- kpackage/kio.cpp | 124 ---------------------------------------------- kpackage/kio.h | 77 ---------------------------- kpackage/kpackage.cpp | 8 +-- kpackage/pkgInterface.cpp | 2 +- kpackage/tdeio.cpp | 124 ++++++++++++++++++++++++++++++++++++++++++++++ kpackage/tdeio.h | 77 ++++++++++++++++++++++++++++ 7 files changed, 207 insertions(+), 207 deletions(-) delete mode 100644 kpackage/kio.cpp delete mode 100644 kpackage/kio.h create mode 100644 kpackage/tdeio.cpp create mode 100644 kpackage/tdeio.h diff --git a/kpackage/Makefile.am b/kpackage/Makefile.am index 04939be..57d62d3 100644 --- a/kpackage/Makefile.am +++ b/kpackage/Makefile.am @@ -10,7 +10,7 @@ bin_PROGRAMS = kpackage kpackage_SOURCES = kpackage.cpp managementWidget.cpp packageDisplay.cpp \ packageProperties.cpp findf.cpp search.cpp \ options.cpp pkgOptions.cpp \ - packageInfo.cpp cache.cpp main.cpp utils.cpp kio.cpp \ + packageInfo.cpp cache.cpp main.cpp utils.cpp tdeio.cpp \ debInterface.cpp debDpkgInterface.cpp debAptInterface.cpp \ updateLoc.cpp procbuf.cpp kplview.cpp \ pkgInterface.cpp rpmInterface.cpp kissInterface.cpp \ diff --git a/kpackage/kio.cpp b/kpackage/kio.cpp deleted file mode 100644 index 89e2100..0000000 --- a/kpackage/kio.cpp +++ /dev/null @@ -1,124 +0,0 @@ -/* -** Copyright (C) 1999,2000 Toivo Pedaste -** -*/ - -/* -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation; either version 2 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program in a file called COPYING; if not, write to -** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, -** MA 02110-1301, USA. -*/ - -/* -** Bug reports and questions can be sent to kde-devel@kde.org -*/ - -#include -#include -#include "kio.h" - -Kio::Kio() -{ -} - -bool Kio::download(const KURL & from, const TQString & to) -{ - 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 TDEIO::NetAccess instead (David). - kapp->enter_loop(); - return worked; -} - -void Kio::slotIOJobFinished( TDEIO::Job * job) -{ - worked = (job->error() == 0); - kapp->exit_loop(); -} - -Kiod::Kiod() -{ - file=0L; - fileT = 0L; -} - -Kiod::~Kiod() -{ - delete file; - delete fileT; -} - -bool Kiod::listDir(const TQString &url, const TQString &fname, bool subdirs) -{ - delete file; - file = new TQFile(fname); - if (file->open(IO_WriteOnly)) { - delete fileT; - fileT = new TQTextStream(file); - TDEIO::ListJob *job; - if (!subdirs) - job = TDEIO::listDir( url ); - else - job = TDEIO::listRecursive( url, false); - - kdDebug() << "started " << job << " " << subdirs << endl; - - 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(); - - file->close(); - if (worked) - return TRUE; - else - return FALSE; - } else - return FALSE; -} - -void Kiod::slotListEntries( TDEIO::Job *, const TDEIO::UDSEntryList& entries ) -{ - long size = 0; - TQString text; - - TDEIO::UDSEntryList::ConstIterator entryIt = entries.begin(); - - for (; entryIt != entries.end(); ++entryIt) { - //kdDebug() << "listDir " << dynamic_cast(job)->url() << endl; - for (TDEIO::UDSEntry::ConstIterator it = (*entryIt).begin(); - it != (*entryIt).end(); it++ ) - { - if ( (*it).m_uds == TDEIO::UDS_SIZE ) - size = (*it).m_long; - else if ( (*it).m_uds == TDEIO::UDS_NAME ) - text = (*it).m_str; - } - *fileT << text << "\n" << size << "\n"; - kdDebug() << text << " " << size << "\n"; - } -} - -void Kiod::slotFinished( TDEIO::Job *job ) -{ - //kdDebug() << "finished" << " " << job << " " << dynamic_cast(job)->url() << endl; - worked = (job->error() == 0); - kapp->exit_loop(); -} - -#include "kio.moc" diff --git a/kpackage/kio.h b/kpackage/kio.h deleted file mode 100644 index 83e9794..0000000 --- a/kpackage/kio.h +++ /dev/null @@ -1,77 +0,0 @@ -/* -** Copyright (C) 1999,2000 Toivo Pedaste -** -*/ - -/* -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation; either version 2 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program in a file called COPYING; if not, write to -** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, -** MA 02110-1301, USA. -*/ - -/* -** Bug reports and questions can be sent to kde-devel@kde.org -*/ - - -#ifndef KP_KIO_H -#define KP_KIO_H - - -#include - -#include -#include -#include -#include "../config.h" -#include - -class Kio: public TQObject -{ - Q_OBJECT - - -public: - Kio(); - - bool download(const KURL & from, const TQString & to); - -private: - bool worked; - -private slots: - void slotIOJobFinished( TDEIO::Job *job ); -}; - -class Kiod: public TQObject -{ - Q_OBJECT - - -public: - Kiod(); - ~Kiod(); - - bool listDir(const TQString &url, const TQString &fname, bool subdirs); - -private: - TQFile *file; - TQTextStream *fileT; - bool worked; - -private slots: - void slotListEntries( TDEIO::Job *, const TDEIO::UDSEntryList& ); - void slotFinished( TDEIO::Job *); -}; -#endif diff --git a/kpackage/kpackage.cpp b/kpackage/kpackage.cpp index 7c24e17..310ae0e 100644 --- a/kpackage/kpackage.cpp +++ b/kpackage/kpackage.cpp @@ -55,7 +55,7 @@ #include "kpackage.h" #include "managementWidget.h" #include "pkgOptions.h" -#include "kio.h" +#include "tdeio.h" #include "findf.h" #include "search.h" #include "options.h" @@ -643,12 +643,12 @@ TQString KPACKAGE::fetchNetFile( const KURL & url ) } else { save_url = url; - setStatus(i18n("Starting KIO")); + setStatus(i18n("Starting TDEIO")); Kio kio; if (kio.download(url, cf)) { - setStatus(i18n("KIO finished")); + setStatus(i18n("TDEIO finished")); TQFileInfo fi(cf); if (!(fi.exists() && fi.size() > 0)) { unlink(TQFile::encodeName(cf)); @@ -660,7 +660,7 @@ TQString KPACKAGE::fetchNetFile( const KURL & url ) return cf; } } else { - setStatus(i18n("KIO failed")); + setStatus(i18n("TDEIO failed")); return ""; } } diff --git a/kpackage/pkgInterface.cpp b/kpackage/pkgInterface.cpp index c3f9a7e..984628d 100644 --- a/kpackage/pkgInterface.cpp +++ b/kpackage/pkgInterface.cpp @@ -34,7 +34,7 @@ #include "options.h" #include "cache.h" #include "updateLoc.h" -#include "kio.h" +#include "tdeio.h" extern Opts *opts; ////////////////////////////////////////////////////////////////////////////// diff --git a/kpackage/tdeio.cpp b/kpackage/tdeio.cpp new file mode 100644 index 0000000..111b803 --- /dev/null +++ b/kpackage/tdeio.cpp @@ -0,0 +1,124 @@ +/* +** Copyright (C) 1999,2000 Toivo Pedaste +** +*/ + +/* +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program in a file called COPYING; if not, write to +** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +** MA 02110-1301, USA. +*/ + +/* +** Bug reports and questions can be sent to kde-devel@kde.org +*/ + +#include +#include +#include "tdeio.h" + +Kio::Kio() +{ +} + +bool Kio::download(const KURL & from, const TQString & to) +{ + 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 TDEIO::NetAccess instead (David). + kapp->enter_loop(); + return worked; +} + +void Kio::slotIOJobFinished( TDEIO::Job * job) +{ + worked = (job->error() == 0); + kapp->exit_loop(); +} + +Kiod::Kiod() +{ + file=0L; + fileT = 0L; +} + +Kiod::~Kiod() +{ + delete file; + delete fileT; +} + +bool Kiod::listDir(const TQString &url, const TQString &fname, bool subdirs) +{ + delete file; + file = new TQFile(fname); + if (file->open(IO_WriteOnly)) { + delete fileT; + fileT = new TQTextStream(file); + TDEIO::ListJob *job; + if (!subdirs) + job = TDEIO::listDir( url ); + else + job = TDEIO::listRecursive( url, false); + + kdDebug() << "started " << job << " " << subdirs << endl; + + 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(); + + file->close(); + if (worked) + return TRUE; + else + return FALSE; + } else + return FALSE; +} + +void Kiod::slotListEntries( TDEIO::Job *, const TDEIO::UDSEntryList& entries ) +{ + long size = 0; + TQString text; + + TDEIO::UDSEntryList::ConstIterator entryIt = entries.begin(); + + for (; entryIt != entries.end(); ++entryIt) { + //kdDebug() << "listDir " << dynamic_cast(job)->url() << endl; + for (TDEIO::UDSEntry::ConstIterator it = (*entryIt).begin(); + it != (*entryIt).end(); it++ ) + { + if ( (*it).m_uds == TDEIO::UDS_SIZE ) + size = (*it).m_long; + else if ( (*it).m_uds == TDEIO::UDS_NAME ) + text = (*it).m_str; + } + *fileT << text << "\n" << size << "\n"; + kdDebug() << text << " " << size << "\n"; + } +} + +void Kiod::slotFinished( TDEIO::Job *job ) +{ + //kdDebug() << "finished" << " " << job << " " << dynamic_cast(job)->url() << endl; + worked = (job->error() == 0); + kapp->exit_loop(); +} + +#include "tdeio.moc" diff --git a/kpackage/tdeio.h b/kpackage/tdeio.h new file mode 100644 index 0000000..83e9794 --- /dev/null +++ b/kpackage/tdeio.h @@ -0,0 +1,77 @@ +/* +** Copyright (C) 1999,2000 Toivo Pedaste +** +*/ + +/* +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program in a file called COPYING; if not, write to +** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +** MA 02110-1301, USA. +*/ + +/* +** Bug reports and questions can be sent to kde-devel@kde.org +*/ + + +#ifndef KP_KIO_H +#define KP_KIO_H + + +#include + +#include +#include +#include +#include "../config.h" +#include + +class Kio: public TQObject +{ + Q_OBJECT + + +public: + Kio(); + + bool download(const KURL & from, const TQString & to); + +private: + bool worked; + +private slots: + void slotIOJobFinished( TDEIO::Job *job ); +}; + +class Kiod: public TQObject +{ + Q_OBJECT + + +public: + Kiod(); + ~Kiod(); + + bool listDir(const TQString &url, const TQString &fname, bool subdirs); + +private: + TQFile *file; + TQTextStream *fileT; + bool worked; + +private slots: + void slotListEntries( TDEIO::Job *, const TDEIO::UDSEntryList& ); + void slotFinished( TDEIO::Job *); +}; +#endif -- cgit v1.2.1