summaryrefslogtreecommitdiffstats
path: root/src/appimpl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/appimpl.cpp')
-rw-r--r--src/appimpl.cpp228
1 files changed, 114 insertions, 114 deletions
diff --git a/src/appimpl.cpp b/src/appimpl.cpp
index 6c29f75..2357815 100644
--- a/src/appimpl.cpp
+++ b/src/appimpl.cpp
@@ -48,48 +48,48 @@
#include <kservice.h>
#include <kservicegroup.h>
-#include <qapplication.h>
-#include <qeventloop.h>
-#include <qdir.h>
+#include <tqapplication.h>
+#include <tqeventloop.h>
+#include <tqdir.h>
#include <sys/stat.h>
-AppImpl::AppImpl() : QObject()
+AppImpl::AppImpl() : TQObject()
{
}
-bool AppImpl::listRoot(QValueList<KIO::UDSEntry> &list)
+bool AppImpl::listRoot(TQValueList<KIO::UDSEntry> &list)
{
kdDebug() << "AppImpl::listRoot" << endl;
- QStringList dirList = QStringList::split(":",getenv("PATH"));
+ TQStringList dirList = TQStringList::split(":",getenv("PATH"));
kdDebug() << dirList << endl;
- QStringList names_found;
-// QStringList dirList;
+ TQStringList names_found;
+// TQStringList dirList;
// dirList << "/usr/local/bin/";
// dirList << "/usr/bin/";
// dirList << "/usr/sbin/";
// dirList << "/bin/";
- QStringList::ConstIterator dirpath = dirList.begin();
- QStringList::ConstIterator end = dirList.end();
+ TQStringList::ConstIterator dirpath = dirList.begin();
+ TQStringList::ConstIterator end = dirList.end();
for(; dirpath!=end; ++dirpath)
{
- QDir dir = *dirpath;
+ TQDir dir = *dirpath;
if (!dir.exists()) continue;
- QStringList filenames
- = dir.entryList( QDir::Files | QDir::Readable );
+ TQStringList filenames
+ = dir.entryList( TQDir::Files | TQDir::Readable );
KIO::UDSEntry entry;
- QStringList::ConstIterator filename = filenames.begin();
- QStringList::ConstIterator endf = filenames.end();
+ TQStringList::ConstIterator filename = filenames.begin();
+ TQStringList::ConstIterator endf = filenames.end();
for(; filename!=endf; ++filename)
{
@@ -111,9 +111,9 @@ bool AppImpl::listRoot(QValueList<KIO::UDSEntry> &list)
return true;
}
-bool AppImpl::parseURL(const KURL &url, QString &name, QString &path) const
+bool AppImpl::parseURL(const KURL &url, TQString &name, TQString &path) const
{
- QString url_path = url.path();
+ TQString url_path = url.path();
int i = url_path.find('/', 1);
if (i > 0)
@@ -124,13 +124,13 @@ bool AppImpl::parseURL(const KURL &url, QString &name, QString &path) const
else
{
name = url_path.mid(1);
- path = QString::null;
+ path = TQString::null;
}
- return name != QString::null;
+ return name != TQString::null;
}
-bool AppImpl::realURL(const QString &name, const QString &path,
+bool AppImpl::realURL(const TQString &name, const TQString &path,
KURL &url) const
{
url = findBaseURL(name);
@@ -143,29 +143,29 @@ bool AppImpl::realURL(const QString &name, const QString &path,
return true;
}
-bool AppImpl::statByName(const QString &filename, KIO::UDSEntry& entry)
+bool AppImpl::statByName(const TQString &filename, KIO::UDSEntry& entry)
{
kdDebug() << "AppImpl::statByName" << endl;
- QStringList dirList;
+ TQStringList dirList;
dirList << "/usr/local/bin/";
dirList << "/usr/bin/";
- QStringList::ConstIterator dirpath = dirList.begin();
- QStringList::ConstIterator end = dirList.end();
+ TQStringList::ConstIterator dirpath = dirList.begin();
+ TQStringList::ConstIterator end = dirList.end();
for(; dirpath!=end; ++dirpath)
{
- QDir dir = *dirpath;
+ TQDir dir = *dirpath;
if (!dir.exists()) continue;
- QStringList filenames
- = dir.entryList( QDir::Files | QDir::Readable );
+ TQStringList filenames
+ = dir.entryList( TQDir::Files | TQDir::Readable );
- QStringList::ConstIterator name = filenames.begin();
- QStringList::ConstIterator endf = filenames.end();
+ TQStringList::ConstIterator name = filenames.begin();
+ TQStringList::ConstIterator endf = filenames.end();
for(; name!=endf; ++name)
{
@@ -180,27 +180,27 @@ bool AppImpl::statByName(const QString &filename, KIO::UDSEntry& entry)
return false;
}
-KURL AppImpl::findBaseURL(const QString &filename) const
+KURL AppImpl::findBaseURL(const TQString &filename) const
{
kdDebug() << "AppImpl::findBaseURL" << endl;
- QStringList dirList = KGlobal::dirs()->resourceDirs("system_entries");
+ TQStringList dirList = KGlobal::dirs()->resourceDirs("system_entries");
- QStringList::ConstIterator dirpath = dirList.begin();
- QStringList::ConstIterator end = dirList.end();
+ TQStringList::ConstIterator dirpath = dirList.begin();
+ TQStringList::ConstIterator end = dirList.end();
for(; dirpath!=end; ++dirpath)
{
- QDir dir = *dirpath;
+ TQDir dir = *dirpath;
if (!dir.exists()) continue;
- QStringList filenames
- = dir.entryList( QDir::Files | QDir::Readable );
+ TQStringList filenames
+ = dir.entryList( TQDir::Files | TQDir::Readable );
KIO::UDSEntry entry;
- QStringList::ConstIterator name = filenames.begin();
- QStringList::ConstIterator endf = filenames.end();
+ TQStringList::ConstIterator name = filenames.begin();
+ TQStringList::ConstIterator endf = filenames.end();
for(; name!=endf; ++name)
{
@@ -224,7 +224,7 @@ KURL AppImpl::findBaseURL(const QString &filename) const
static void addAtom(KIO::UDSEntry &entry, unsigned int ID, long l,
- const QString &s = QString::null)
+ const TQString &s = TQString::null)
{
KIO::UDSAtom atom;
atom.m_uds = ID;
@@ -245,15 +245,15 @@ void AppImpl::createTopLevelEntry(KIO::UDSEntry &entry) const
}
void AppImpl::createEntry(KIO::UDSEntry &entry,
-// const QString &directory,
- const QString &file)
+// const TQString &directory,
+ const TQString &file)
{
entry.clear();
addAtom(entry, KIO::UDS_NAME, 0, file);
- QString new_filename = file;
+ TQString new_filename = file;
new_filename.truncate(file.length()-8);
addAtom(entry, KIO::UDS_URL, 0, "app:/"+new_filename);
@@ -268,22 +268,22 @@ void AppImpl::createEntry(KIO::UDSEntry &entry,
}
-void AppImpl::createExeEntry(QValueList<KIO::UDSEntry> &list,KIO::UDSEntry &entry,
- const QString &shortname,
- const QStringList &fullname)
+void AppImpl::createExeEntry(TQValueList<KIO::UDSEntry> &list,KIO::UDSEntry &entry,
+ const TQString &shortname,
+ const TQStringList &fullname)
{
- for ( QStringList::ConstIterator it = fullname.begin(); it != fullname.end(); ++it )
+ for ( TQStringList::ConstIterator it = fullname.begin(); it != fullname.end(); ++it )
{
if ((*it).isEmpty())
continue;
entry.clear();
-/* QStringList dirList = KGlobal::instance()->dirs()->resourceDirs("apps");
+/* TQStringList dirList = KGlobal::instance()->dirs()->resourceDirs("apps");
kdDebug() << dirList << endl;
- QStringList desktop = getFullLocation(dirList,shortname+".desktop",
- QDir::FilterSpec(QDir::Files | QDir::Dirs | QDir::Readable),
+ TQStringList desktop = getFullLocation(dirList,shortname+".desktop",
+ TQDir::FilterSpec(TQDir::Files | TQDir::Dirs | TQDir::Readable),
false,true);
kdDebug() << desktop << endl;*/
KService::Ptr service = KService::serviceByDesktopName( shortname );
@@ -291,7 +291,7 @@ void AppImpl::createExeEntry(QValueList<KIO::UDSEntry> &list,KIO::UDSEntry &entr
// if (!desktop.isEmpty()){
if (service && service->isValid()) {
-// for ( QStringList::Iterator dit = desktop.begin(); dit != desktop.end(); ++dit )
+// for ( TQStringList::Iterator dit = desktop.begin(); dit != desktop.end(); ++dit )
// {
// if ((*dit).isEmpty())
// continue;
@@ -324,37 +324,37 @@ void AppImpl::createExeEntry(QValueList<KIO::UDSEntry> &list,KIO::UDSEntry &entr
}
void AppImpl::createManPageEntry(KIO::UDSEntry &entry,
- const QString &shortname)
+ const TQString &shortname)
{
entry.clear();
addAtom(entry, KIO::UDS_NAME, 0, i18n("Manual for %1").arg(shortname));
-/* QString new_filename = file;
+/* TQString new_filename = file;
new_filename.truncate(file.length()-8);*/
addAtom(entry, KIO::UDS_URL, 0, "man:/"+shortname);
addAtom(entry, KIO::UDS_FILE_TYPE, S_IFREG);
addAtom(entry, KIO::UDS_MIME_TYPE, 0, "application/x-desktop");
- QString icon = "man";
+ TQString icon = "man";
addAtom(entry, KIO::UDS_ICON_NAME, 0, icon);
}
-void AppImpl::createHomeDirEntry(QValueList<KIO::UDSEntry> &list,KIO::UDSEntry &entry,
- const QString &shortname)
+void AppImpl::createHomeDirEntry(TQValueList<KIO::UDSEntry> &list,KIO::UDSEntry &entry,
+ const TQString &shortname)
{
- QStringList homedir;
- homedir << QString("%1/").arg(getenv("HOME"));
+ TQStringList homedir;
+ homedir << TQString("%1/").arg(getenv("HOME"));
- QString dirname = "."+shortname;
- QStringList fullname = getFullLocation(homedir,dirname,
- QDir::FilterSpec(QDir::Hidden | QDir::Dirs | QDir::Readable),
+ TQString dirname = "."+shortname;
+ TQStringList fullname = getFullLocation(homedir,dirname,
+ TQDir::FilterSpec(TQDir::Hidden | TQDir::Dirs | TQDir::Readable),
true, false);
- for ( QStringList::Iterator it = fullname.begin(); it != fullname.end(); ++it )
+ for ( TQStringList::Iterator it = fullname.begin(); it != fullname.end(); ++it )
{
if ((*it).isEmpty())
continue;
@@ -366,26 +366,26 @@ void AppImpl::createHomeDirEntry(QValueList<KIO::UDSEntry> &list,KIO::UDSEntry &
addAtom(entry, KIO::UDS_FILE_TYPE, S_IFDIR);
addAtom(entry, KIO::UDS_MIME_TYPE, 0, "inode/directory");
- QString icon = "cachefolder";
+ TQString icon = "cachefolder";
addAtom(entry, KIO::UDS_ICON_NAME, 0, icon);
if ( !entry.isEmpty() )
list.append(entry);
}
}
-void AppImpl::createKDEDataDirEntry(QValueList<KIO::UDSEntry> &list,KIO::UDSEntry &entry,
- const QString &shortname)
+void AppImpl::createKDEDataDirEntry(TQValueList<KIO::UDSEntry> &list,KIO::UDSEntry &entry,
+ const TQString &shortname)
{
- QStringList dirList = KGlobal::instance()->dirs()->resourceDirs("data");
+ TQStringList dirList = KGlobal::instance()->dirs()->resourceDirs("data");
- QStringList KDEDataDir = getFullLocation(dirList,shortname,
- QDir::FilterSpec(QDir::Dirs | QDir::Readable), false, false);
+ TQStringList KDEDataDir = getFullLocation(dirList,shortname,
+ TQDir::FilterSpec(TQDir::Dirs | TQDir::Readable), false, false);
if (KDEDataDir.isEmpty())
return;
- for ( QStringList::Iterator it = KDEDataDir.begin(); it != KDEDataDir.end(); ++it )
+ for ( TQStringList::Iterator it = KDEDataDir.begin(); it != KDEDataDir.end(); ++it )
{
if ((*it).isEmpty())
continue;
@@ -397,7 +397,7 @@ void AppImpl::createKDEDataDirEntry(QValueList<KIO::UDSEntry> &list,KIO::UDSEntr
addAtom(entry, KIO::UDS_FILE_TYPE, S_IFDIR);
addAtom(entry, KIO::UDS_MIME_TYPE, 0, "inode/directory");
- QString icon = "binaryfolder";
+ TQString icon = "binaryfolder";
addAtom(entry, KIO::UDS_ICON_NAME, 0, icon);
if ( !entry.isEmpty() )
list.append(entry);
@@ -405,24 +405,24 @@ void AppImpl::createKDEDataDirEntry(QValueList<KIO::UDSEntry> &list,KIO::UDSEntr
}
-void AppImpl::createStandardDataDirEntry(QValueList<KIO::UDSEntry> &list, KIO::UDSEntry &entry,
- const QString &shortname)
+void AppImpl::createStandardDataDirEntry(TQValueList<KIO::UDSEntry> &list, KIO::UDSEntry &entry,
+ const TQString &shortname)
{
- QStringList dirList;
+ TQStringList dirList;
dirList << "/usr/share/";
dirList << "/usr/local/share/";
- QStringList StandardDataDir =
+ TQStringList StandardDataDir =
getFullLocation(dirList,shortname,
- QDir::FilterSpec(QDir::Files | QDir::Dirs | QDir::Readable),
+ TQDir::FilterSpec(TQDir::Files | TQDir::Dirs | TQDir::Readable),
true, false);
if (StandardDataDir.isEmpty())
return;
- for ( QStringList::Iterator it = StandardDataDir.begin(); it != StandardDataDir.end(); ++it )
+ for ( TQStringList::Iterator it = StandardDataDir.begin(); it != StandardDataDir.end(); ++it )
{
if ((*it).isEmpty())
continue;
@@ -434,7 +434,7 @@ void AppImpl::createStandardDataDirEntry(QValueList<KIO::UDSEntry> &list, KIO::U
addAtom(entry, KIO::UDS_FILE_TYPE, S_IFDIR);
addAtom(entry, KIO::UDS_MIME_TYPE, 0, "inode/directory");
- QString icon = "binaryfolder";
+ TQString icon = "binaryfolder";
addAtom(entry, KIO::UDS_ICON_NAME, 0, icon);
if ( !entry.isEmpty() )
list.append(entry);
@@ -443,12 +443,12 @@ void AppImpl::createStandardDataDirEntry(QValueList<KIO::UDSEntry> &list, KIO::U
void AppImpl::createKDEConfigEntry(KIO::UDSEntry &entry,
- const QString &shortname)
+ const TQString &shortname)
{
entry.clear();
- QString KDEDataDir = locate("config", shortname+"rc");
+ TQString KDEDataDir = locate("config", shortname+"rc");
kdDebug() << "KDEDataDir: " << KDEDataDir << endl;
if (KDEDataDir.isEmpty())
@@ -460,36 +460,36 @@ void AppImpl::createKDEConfigEntry(KIO::UDSEntry &entry,
addAtom(entry, KIO::UDS_FILE_TYPE, S_IFDIR);
addAtom(entry, KIO::UDS_MIME_TYPE, 0, "text/plain");
- QString icon = "configure";
+ TQString icon = "configure";
addAtom(entry, KIO::UDS_ICON_NAME, 0, icon);
}
-void AppImpl::createStandardConfigEntry(QValueList<KIO::UDSEntry> &list, KIO::UDSEntry &entry,
- const QString &shortname)
+void AppImpl::createStandardConfigEntry(TQValueList<KIO::UDSEntry> &list, KIO::UDSEntry &entry,
+ const TQString &shortname)
{
- QStringList dirList;
+ TQStringList dirList;
dirList << "/etc/";
dirList << "/usr/local/etc/";
dirList << "/usr/etc/";
- QStringList StandardConfigFile =
+ TQStringList StandardConfigFile =
getFullLocation(dirList,shortname,
- QDir::FilterSpec(QDir::Files | QDir::Dirs | QDir::Readable),
+ TQDir::FilterSpec(TQDir::Files | TQDir::Dirs | TQDir::Readable),
true, false);
if (StandardConfigFile.isEmpty())
return;
- for ( QStringList::Iterator it = StandardConfigFile.begin(); it != StandardConfigFile.end(); ++it )
+ for ( TQStringList::Iterator it = StandardConfigFile.begin(); it != StandardConfigFile.end(); ++it )
{
if ((*it).isEmpty())
continue;
entry.clear();
bool isFolder = false;
- QFileInfo fi(*it);
+ TQFileInfo fi(*it);
if (fi.isDir())
isFolder = true;
@@ -497,7 +497,7 @@ void AppImpl::createStandardConfigEntry(QValueList<KIO::UDSEntry> &list, KIO::UD
addAtom(entry, KIO::UDS_URL, 0, *it);
- QString icon;
+ TQString icon;
if (isFolder){
addAtom(entry, KIO::UDS_NAME, 0, i18n("Config Data(%1)").arg(*it));
addAtom(entry, KIO::UDS_FILE_TYPE, S_IFDIR);
@@ -515,30 +515,30 @@ void AppImpl::createStandardConfigEntry(QValueList<KIO::UDSEntry> &list, KIO::UD
}
}
-void AppImpl::createTmpDirEntry(QValueList<KIO::UDSEntry> &list, KIO::UDSEntry &entry,
- const QString &shortname)
+void AppImpl::createTmpDirEntry(TQValueList<KIO::UDSEntry> &list, KIO::UDSEntry &entry,
+ const TQString &shortname)
{
- QStringList dirList;
+ TQStringList dirList;
dirList << "/tmp/";
- QStringList TmpDir =
+ TQStringList TmpDir =
getFullLocation(dirList,shortname,
- QDir::FilterSpec(QDir::Files | QDir::Dirs | QDir::Readable),
+ TQDir::FilterSpec(TQDir::Files | TQDir::Dirs | TQDir::Readable),
true, true);
if (TmpDir.isEmpty())
return;
- for ( QStringList::Iterator it = TmpDir.begin(); it != TmpDir.end(); ++it )
+ for ( TQStringList::Iterator it = TmpDir.begin(); it != TmpDir.end(); ++it )
{
if ((*it).isEmpty())
continue;
entry.clear();
bool isFolder = false;
- QFileInfo fi(*it);
+ TQFileInfo fi(*it);
if (fi.isDir())
isFolder = true;
@@ -546,7 +546,7 @@ void AppImpl::createTmpDirEntry(QValueList<KIO::UDSEntry> &list, KIO::UDSEntry &
addAtom(entry, KIO::UDS_URL, 0, *it);
- QString icon;
+ TQString icon;
if (isFolder){
addAtom(entry, KIO::UDS_NAME, 0, i18n("Tmp Data (%1)").arg(*it));
addAtom(entry, KIO::UDS_FILE_TYPE, S_IFDIR);
@@ -570,16 +570,16 @@ void AppImpl::slotEntries(KIO::Job *job, const KIO::UDSEntryList &list)
{
job->kill(true);
m_lastListingEmpty = false;
- qApp->eventLoop()->exitLoop();
+ tqApp->eventLoop()->exitLoop();
}
}
void AppImpl::slotResult(KIO::Job *)
{
- qApp->eventLoop()->exitLoop();
+ tqApp->eventLoop()->exitLoop();
}
-bool AppImpl::listAppContents(const QString &name, QValueList<KIO::UDSEntry> &list)
+bool AppImpl::listAppContents(const TQString &name, TQValueList<KIO::UDSEntry> &list)
{
@@ -635,47 +635,47 @@ bool AppImpl::listAppContents(const QString &name, QValueList<KIO::UDSEntry> &li
return true;
}
-QStringList AppImpl::getAppAddress(const QString &name)
+TQStringList AppImpl::getAppAddress(const TQString &name)
{
- QStringList dirList;
+ TQStringList dirList;
dirList << "/usr/local/bin/";
dirList << "/usr/bin/";
- return getFullLocation(dirList,name, QDir::FilterSpec(QDir::Files | QDir::Readable),false, false);
+ return getFullLocation(dirList,name, TQDir::FilterSpec(TQDir::Files | TQDir::Readable),false, false);
}
-QStringList AppImpl::getFullLocation(const QStringList &dirList, const QString &name,
- const QDir::FilterSpec &filter, bool beginswith, bool recursive)
+TQStringList AppImpl::getFullLocation(const TQStringList &dirList, const TQString &name,
+ const TQDir::FilterSpec &filter, bool beginswith, bool recursive)
{
- QStringList finds;
- QStringList::ConstIterator dirpath = dirList.begin();
- QStringList::ConstIterator end = dirList.end();
+ TQStringList finds;
+ TQStringList::ConstIterator dirpath = dirList.begin();
+ TQStringList::ConstIterator end = dirList.end();
for(; dirpath!=end; ++dirpath)
{
- QDir dir = *dirpath;
+ TQDir dir = *dirpath;
if (!dir.exists()) continue;
- QStringList filenames
+ TQStringList filenames
= dir.entryList( filter );
- QStringList::ConstIterator filename = filenames.begin();
- QStringList::ConstIterator endf = filenames.end();
+ TQStringList::ConstIterator filename = filenames.begin();
+ TQStringList::ConstIterator endf = filenames.end();
for(; filename!=endf; ++filename)
{
if ((recursive) && ((*filename != "..")&&(*filename != "."))){
- QFileInfo fi(*dirpath+*filename);
+ TQFileInfo fi(*dirpath+*filename);
if (fi.isDir()){
- QStringList recurfinds;
- recurfinds = getFullLocation(QStringList(*dirpath+*filename+"/"),
+ TQStringList recurfinds;
+ recurfinds = getFullLocation(TQStringList(*dirpath+*filename+"/"),
name, filter, beginswith, recursive);
if (!recurfinds.isEmpty()){
- for ( QStringList::Iterator it = recurfinds.begin();
+ for ( TQStringList::Iterator it = recurfinds.begin();
it != recurfinds.end(); ++it )
{
if ((*it).isEmpty())