summaryrefslogtreecommitdiffstats
path: root/kpackage/debAptInterface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kpackage/debAptInterface.cpp')
-rw-r--r--kpackage/debAptInterface.cpp140
1 files changed, 70 insertions, 70 deletions
diff --git a/kpackage/debAptInterface.cpp b/kpackage/debAptInterface.cpp
index 9dffb39..9139adf 100644
--- a/kpackage/debAptInterface.cpp
+++ b/kpackage/debAptInterface.cpp
@@ -60,8 +60,8 @@ DEBAPT::DEBAPT():DEB()
locatedialog->dLocations(1, 8, this, i18n("Folders", "F"),
"Deb", "*.deb",
i18n("Location of Folders Containing Debian Packages"));
- connect(locatedialog,SIGNAL(returnVal(LcacheObj *)),
- this,SLOT(setAvail(LcacheObj *)));
+ connect(locatedialog,TQT_SIGNAL(returnVal(LcacheObj *)),
+ this,TQT_SLOT(setAvail(LcacheObj *)));
locatedialog->apply_slot();
paramsInst.append(new param(i18n("Download only"),FALSE,FALSE,"-d"));
@@ -93,28 +93,28 @@ DEBAPT::~DEBAPT()
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
-bool DEBAPT::isType(char *, const QString &)
+bool DEBAPT::isType(char *, const TQString &)
{
return false;
}
void DEBAPT::makeMenu(KActionCollection* act)
{
- updateM = new KAction( i18n("&Update"), QString::null,
+ updateM = new KAction( i18n("&Update"), TQString::null,
0, this,
- SLOT(updateS()), act, "debapt_update");
+ TQT_SLOT(updateS()), act, "debapt_update");
- upgradeM = new KAction( i18n("U&pgrade"), QString::null,
+ upgradeM = new KAction( i18n("U&pgrade"), TQString::null,
0, this,
- SLOT(upgradeS()), act, "debapt_upgrade");
+ TQT_SLOT(upgradeS()), act, "debapt_upgrade");
- fixupM = new KAction( i18n("&Fixup"), QString::null,
+ fixupM = new KAction( i18n("&Fixup"), TQString::null,
0, this,
- SLOT(fixupS()), act, "debapt_fixup");
+ TQT_SLOT(fixupS()), act, "debapt_fixup");
- fileM = new KAction( i18n("&Apt-File Update"), QString::null,
+ fileM = new KAction( i18n("&Apt-File Update"), TQString::null,
0, this,
- SLOT(fileS()), act, "debapt_file");
+ TQT_SLOT(fileS()), act, "debapt_file");
}
void DEBAPT::setMenu(KActionCollection*, bool enable)
@@ -160,7 +160,7 @@ void DEBAPT::fileS()
}
}
-void DEBAPT::listPackages(QPtrList<packageInfo> *pki)
+void DEBAPT::listPackages(TQPtrList<packageInfo> *pki)
{
if (hostName.isEmpty()) {
listInstalledPackages(pki);
@@ -173,24 +173,24 @@ void DEBAPT::listPackages(QPtrList<packageInfo> *pki)
}
}
-void DEBAPT::listRemotePackages(QPtrList<packageInfo> *pki)
+void DEBAPT::listRemotePackages(TQPtrList<packageInfo> *pki)
{
listRPack(pki);
}
-void DEBAPT::listRPack(QPtrList<packageInfo> *pki)
+void DEBAPT::listRPack(TQPtrList<packageInfo> *pki)
{
int NLINES = 70000;
packageInfo *p;
- QStringList plist;
+ TQStringList plist;
kpackage->setStatus(i18n("Querying DEB APT remote package list: %1").arg(hostName));
kpackage->setPercent(0);
- QString cmd = "cat " STATUS;
+ TQString cmd = "cat " STATUS;
- QStringList list = kpty->run(cmd);
+ TQStringList list = kpty->run(cmd);
kpackage->setStatus(i18n("Processing DEB APT remote package list: %1").arg(hostName));
// kdDebug() << "P=" << list.count() <<"\n";
kpackage->setPercent(50);
@@ -198,12 +198,12 @@ void DEBAPT::listRPack(QPtrList<packageInfo> *pki)
if (list.count() > 0) {
- QString s;
+ TQString s;
kpackage->setPercent(50 );
int cnt = 0;
- for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) {
+ for ( TQStringList::Iterator it = list.begin(); it != list.end(); ++it ) {
cnt++;
if (cnt % (NLINES/20) == 0) {
kpackage->setPercent(((cnt * 100)/ NLINES ) + 50);
@@ -232,12 +232,12 @@ void DEBAPT::listRPack(QPtrList<packageInfo> *pki)
kpackage->setPercent(100);
}
-void DEBAPT::listAvail(QPtrList<packageInfo> *pki)
+void DEBAPT::listAvail(TQPtrList<packageInfo> *pki)
{
int NLINES = 150000;
packageInfo *p;
- QStringList plist;
+ TQStringList plist;
// kdDebug() << "H=" << hostName << "\n";
if (hostName.isEmpty())
@@ -246,7 +246,7 @@ void DEBAPT::listAvail(QPtrList<packageInfo> *pki)
kpackage->setStatus(i18n("Querying DEB APT available list: %1").arg(hostName));
kpackage->setPercent(0);
- QStringList list = kpty->run("apt-cache dumpavail");
+ TQStringList list = kpty->run("apt-cache dumpavail");
if (hostName.isEmpty())
kpackage->setStatus(i18n("Processing DEB APT available list"));
else
@@ -257,12 +257,12 @@ void DEBAPT::listAvail(QPtrList<packageInfo> *pki)
if (list.count() > 0) {
- QString s;
+ TQString s;
kpackage->setPercent(50 );
int cnt = 0;
- for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) {
+ for ( TQStringList::Iterator it = list.begin(); it != list.end(); ++it ) {
cnt++;
if (cnt % (NLINES/20) == 0) {
kpackage->setPercent(((cnt * 100)/ NLINES ) + 50);
@@ -288,12 +288,12 @@ void DEBAPT::listAvail(QPtrList<packageInfo> *pki)
kpackage->setPercent(100);
}
-QStringList DEBAPT::listInstalls(const QStringList &packs, bool install, bool &cancel)
+TQStringList DEBAPT::listInstalls(const TQStringList &packs, bool install, bool &cancel)
{
bool extras=FALSE, found=FALSE;
- QString match;
- QString s = "apt-get -s ";
+ TQString match;
+ TQString s = "apt-get -s ";
if (install) {
s += "install ";
match = " extra packages ";
@@ -302,12 +302,12 @@ QStringList DEBAPT::listInstalls(const QStringList &packs, bool install, bool &
s += "remove ";
}
- for ( QStringList::ConstIterator it = packs.begin(); it != packs.end(); ++it ) {
+ for ( TQStringList::ConstIterator it = packs.begin(); it != packs.end(); ++it ) {
s += *it;
s += " ";
}
- QStringList list = kpty->run(s, TRUE, TRUE);
+ TQStringList list = kpty->run(s, TRUE, TRUE);
if (!kpty->inSession) {
cancel = TRUE; // Root login did not work
} else {
@@ -315,8 +315,8 @@ QStringList DEBAPT::listInstalls(const QStringList &packs, bool install, bool &
}
// kdDebug() << "LS=" << list.count() << "\n";
- QString packAll;
- for ( QStringList::ConstIterator it = list.begin(); it != list.end(); ++it ) {
+ TQString packAll;
+ for ( TQStringList::ConstIterator it = list.begin(); it != list.end(); ++it ) {
// kdDebug() << "M=" << *it << "\n";
if ((*it).find(match) >= 0 || extras) {
if (extras) {
@@ -332,32 +332,32 @@ QStringList DEBAPT::listInstalls(const QStringList &packs, bool install, bool &
}
if (!found) {
- QStringList nill;
+ TQStringList nill;
return nill;
} else {
- QStringList plist = QStringList::split(' ',packAll);
+ TQStringList plist = TQStringList::split(' ',packAll);
return plist;
}
}
//////////////////////////////////////////////////////////////////////////////
-QStringList DEBAPT::FindFile(const QString &name, bool searchAll)
+TQStringList DEBAPT::FindFile(const TQString &name, bool searchAll)
{
if (searchAll) {
if (ifExe("apt-file") || !hostName.isEmpty()) {
- QString s = "apt-file search ";
+ TQString s = "apt-file search ";
s += name;
- QStringList filelist = kpty->run(s);
+ TQStringList filelist = kpty->run(s);
- for ( QStringList::Iterator it = filelist.begin(); it != filelist.end(); ++it ) {
+ for ( TQStringList::Iterator it = filelist.begin(); it != filelist.end(); ++it ) {
int p = (*it).find(": ");
if( p !=-1 )
(*it).replace(p, 2, "\t");
}
if (filelist.count() == 1) {
- QStringList::Iterator it = filelist.begin();
+ TQStringList::Iterator it = filelist.begin();
if ((*it).find("not found") >= 0) {
filelist.remove(it);
}
@@ -366,7 +366,7 @@ QStringList DEBAPT::FindFile(const QString &name, bool searchAll)
return filelist;
} else {
KpMsg("Error",i18n("The %1 program needs to be installed").arg("apt-file"), TRUE);
- QStringList nill;
+ TQStringList nill;
return nill;
}
} else {
@@ -375,9 +375,9 @@ QStringList DEBAPT::FindFile(const QString &name, bool searchAll)
}
-QStringList DEBAPT::getFileList(packageInfo *p)
+TQStringList DEBAPT::getFileList(packageInfo *p)
{
- QString fn( p->getFilename());
+ TQString fn( p->getFilename());
if(!fn.isEmpty())
return getUFileList(fn);
else {
@@ -392,10 +392,10 @@ QStringList DEBAPT::getFileList(packageInfo *p)
}
}
- QStringList DEBAPT::getRFileList(packageInfo *p)
+ TQStringList DEBAPT::getRFileList(packageInfo *p)
{
- QString from;
- QString name = p->getProperty("name");
+ TQString from;
+ TQString name = p->getProperty("name");
from = "cat " INFODIR;
from += name;
@@ -405,9 +405,9 @@ QStringList DEBAPT::getFileList(packageInfo *p)
}
//////////////////////////////////////////////////////////////////////////////
-QString DEBAPT::doUninstall(int uninstallFlags, const QString &packs, bool &test)
+TQString DEBAPT::doUninstall(int uninstallFlags, const TQString &packs, bool &test)
{
- QString s = env + "apt-get remove ";
+ TQString s = env + "apt-get remove ";
s += setOptions(uninstallFlags, paramsUninst);
s += packs;
@@ -420,16 +420,16 @@ QString DEBAPT::doUninstall(int uninstallFlags, const QString &packs, bool &test
}
//////////////////////////////////////////////////////////////////////////////
-QString DEBAPT::install(int installFlags, QPtrList<packageInfo> *p,
+TQString DEBAPT::install(int installFlags, TQPtrList<packageInfo> *p,
bool &test)
{
- QString packs = "";
- QString files = "";
+ TQString packs = "";
+ TQString files = "";
packageInfo *i;
for (i = p->first(); i!= 0; i = p->next()) {
- QString file = i->getFilename();
- QString fname = i->fetchFilename();
+ TQString file = i->getFilename();
+ TQString fname = i->fetchFilename();
if (!file.isEmpty()) {
files += KProcess::quote(file);
@@ -447,9 +447,9 @@ QString DEBAPT::install(int installFlags, QPtrList<packageInfo> *p,
}
}
-QString DEBAPT::doInstall(int installFlags, const QString &packs, bool &test)
+TQString DEBAPT::doInstall(int installFlags, const TQString &packs, bool &test)
{
- QString s = env + "apt-get install ";
+ TQString s = env + "apt-get install ";
s += setOptions(installFlags, paramsInst);
s += packs;
@@ -464,7 +464,7 @@ QString DEBAPT::doInstall(int installFlags, const QString &packs, bool &test)
//////////////////////////////////////////////////////////////////////////////
-QStringList DEBAPT::readApt()
+TQStringList DEBAPT::readApt()
{
if (hostName.isEmpty()) {
return readAptF();
@@ -473,14 +473,14 @@ QStringList DEBAPT::readApt()
}
}
-QStringList DEBAPT::readAptS()
+TQStringList DEBAPT::readAptS()
{
- QString cmd = "cat -E " APT_SOURCE;
+ TQString cmd = "cat -E " APT_SOURCE;
- QStringList list = kpty->run(cmd);
+ TQStringList list = kpty->run(cmd);
if (!kpty->Result) {
- QString s;
- for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) {
+ TQString s;
+ for ( TQStringList::Iterator it = list.begin(); it != list.end(); ++it ) {
(*it).truncate((*it).length() - 1);
(*it) = (*it).stripWhiteSpace();
}
@@ -490,13 +490,13 @@ QStringList DEBAPT::readAptS()
}
}
-QStringList DEBAPT::readAptF()
+TQStringList DEBAPT::readAptF()
{
- QStringList lines;
- QFile file( "/etc/apt/sources.list" );
+ TQStringList lines;
+ TQFile file( "/etc/apt/sources.list" );
if ( file.open( IO_ReadOnly ) ) {
- QTextStream stream( &file );
- QString line;
+ TQTextStream stream( &file );
+ TQString line;
while ( !stream.atEnd() ) {
line = stream.readLine(); // line of text excluding '\n'
line = line.stripWhiteSpace();
@@ -509,11 +509,11 @@ QStringList DEBAPT::readAptF()
}
}
-void DEBAPT::writeApt(const QStringList &list) {
+void DEBAPT::writeApt(const TQStringList &list) {
kdDebug() << "writeApt\n";
- QString cmd = "sh -c \"/bin/echo -e '";
- for ( QStringList::ConstIterator it = list.begin(); it != list.end(); ++it ) {
- QString s = *it;
+ TQString cmd = "sh -c \"/bin/echo -e '";
+ for ( TQStringList::ConstIterator it = list.begin(); it != list.end(); ++it ) {
+ TQString s = *it;
s.replace("\""," ");
s.replace("'"," ");
s.replace("!"," ");
@@ -525,8 +525,8 @@ void DEBAPT::writeApt(const QStringList &list) {
cmd += "mv /etc/apt/sources.list /etc/apt/sources.list.b; mv /etc/apt/sources.list.n /etc/apt/sources.list; fi\" ";
- QStringList rlist = kpty->run(cmd,TRUE,TRUE);
- //for ( QStringList::Iterator it = rlist.begin(); it != rlist.end(); ++it ) {
+ TQStringList rlist = kpty->run(cmd,TRUE,TRUE);
+ //for ( TQStringList::Iterator it = rlist.begin(); it != rlist.end(); ++it ) {
// kdDebug() << "SL=" << *it << "\n";
//}
}