summaryrefslogtreecommitdiffstats
path: root/src/appimpl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/appimpl.cpp')
-rw-r--r--src/appimpl.cpp74
1 files changed, 45 insertions, 29 deletions
diff --git a/src/appimpl.cpp b/src/appimpl.cpp
index f0efb32..cd3fe18 100644
--- a/src/appimpl.cpp
+++ b/src/appimpl.cpp
@@ -18,6 +18,7 @@
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
+#include "appinfo.h"
#include "appimpl.h"
#include <stdlib.h>
@@ -33,39 +34,54 @@
#include <tdeio/job.h>
-AppImpl::AppImpl() : TQObject()
+AppImpl::AppImpl(TDEIO_AppInfo *slave) : TQObject(), m_slave(slave)
{
}
-bool AppImpl::listRoot(TQValueList<TDEIO::UDSEntry> &list)
+void AppImpl::listRoot()
{
- kdDebug() << "AppImpl::listRoot" << endl;
-
- //TQStringList dirList = TQStringList::split(":", getenv("PATH"));
- TQStringList dirList;
- dirList << "/opt/trinity/bin/";
- dirList << "/usr/bin/";
- dirList << "/usr/local/bin/";
- kdDebug() << dirList << endl;
-
- for (const TQString &dirName : dirList)
- {
- TQDir dir(dirName);
- if (!dir.exists())
- {
- continue;
- }
-
- TQStringList filenames = dir.entryList(TQDir::Files | TQDir::Readable);
- TDEIO::UDSEntry entry;
- for (const TQString &filename : filenames)
- {
- createEntry(entry, filename);
- list.append(entry);
- }
- }
-
- return true;
+ kdDebug() << "AppImpl::listRoot" << endl;
+
+ // Top level entry
+ TDEIO::UDSEntry entry;
+ createTopLevelEntry(entry);
+ m_slave->listEntry(entry, false);
+
+ //TQStringList dirList = TQStringList::split(":", getenv("PATH"));
+ TQStringList dirList;
+ dirList << "/opt/trinity/bin/";
+ dirList << "/usr/bin/";
+ dirList << "/usr/local/bin/";
+ kdDebug() << dirList << endl;
+
+ TQValueList<TDEIO::UDSEntry> list;
+ for (const TQString &dirName : dirList)
+ {
+ TQDir dir(dirName);
+ if (!dir.exists())
+ {
+ continue;
+ }
+
+ TQStringList filenames = dir.entryList(TQDir::Files | TQDir::Readable);
+ TDEIO::UDSEntry entry;
+ for (const TQString &filename : filenames)
+ {
+ createEntry(entry, filename);
+ list.append(entry);
+ if (list.count() >= 50)
+ {
+ m_slave->listEntries(list);
+ list.clear();
+ }
+ }
+ }
+ if (list.count() > 0)
+ {
+ m_slave->listEntries(list);
+ list.clear();
+ }
+ m_slave->finished();
}
bool AppImpl::parseURL(const KURL &url, TQString &name, TQString &path) const