aboutsummaryrefslogtreecommitdiffstats
path: root/kde2
diff options
context:
space:
mode:
authorFritz Elfert <felfert@to.com>2001-02-01 02:03:25 +0000
committerFritz Elfert <felfert@to.com>2001-02-01 02:03:25 +0000
commit6c9647c1866b49d61ea3ce7d9201450fa0497b52 (patch)
treed240f512fb1a5d72f5b0fe3ad4b60c937cfd8274 /kde2
parent320ed6edbbde5936ac07247896fbc2f51505a469 (diff)
downloadplptools-6c9647c1866b49d61ea3ce7d9201450fa0497b52.tar.gz
plptools-6c9647c1866b49d61ea3ce7d9201450fa0497b52.tar.bz2
plptools-6c9647c1866b49d61ea3ce7d9201450fa0497b52.zip
More cleanup:
- Removed bool.h and references to it everywhere. This is checked now in ./configure and the stuff went into acconfig.h - Replaced ugly bufferStore-based method of returning directory entries from rfsv::readdir() by a cleaner way. (A new, separate class PlpDirent is returned now.) With the old implementation, the caller has to know about the layout of the entries. Also, the old implementation was not 64bit aware. - Similar replacement done for rfsv::dir(). This now returns the entries in a standard STL container (deque) instead of a bufferArray. - Started renaming #include statements for standard library headers from the old <xxx.h> form to the new recommended <xxx> form.
Diffstat (limited to 'kde2')
-rw-r--r--kde2/kioslave/kio_plp.cpp28
-rw-r--r--kde2/kioslave/kio_plp.h2
2 files changed, 14 insertions, 16 deletions
diff --git a/kde2/kioslave/kio_plp.cpp b/kde2/kioslave/kio_plp.cpp
index 8cf76c7..587ef98 100644
--- a/kde2/kioslave/kio_plp.cpp
+++ b/kde2/kioslave/kio_plp.cpp
@@ -260,27 +260,25 @@ listDir(const KURL& _url) {
convertName(path);
path += "\\";
- bufferArray files;
+ PlpDir files;
Enum<rfsv::errs> res = plpRfsv->dir(path, files);
if (checkForError(res))
return;
- totalSize(files.length());
+ totalSize(files.size());
UDSEntry entry;
- while (!files.empty()) {
+ for (int i = 0; i < files.size(); i++) {
UDSAtom atom;
- bufferStore s = files.pop();
- PsiTime *date = (PsiTime *)s.getDWord(0);
- long size = s.getDWord(4);
- long attr = s.getDWord(8);
- entry.clear();
+ PlpDirent e = files[i];
+ long attr = e.getAttr();
+ entry.clear();
atom.m_uds = KIO::UDS_NAME;
- atom.m_str = s.getString(12);
+ atom.m_str = e.getName();
entry.append(atom);
if (rom)
attr |= rfsv::PSI_A_RDONLY;
- completeUDSEntry(entry, attr, size, date);
+ completeUDSEntry(entry, attr, e.getSize(), e.getPsiTime().getTime());
listEntry(entry, false);
}
listEntry(entry, true); // ready
@@ -364,14 +362,14 @@ stat( const KURL & url) {
atom.m_uds = KIO::UDS_NAME;
atom.m_str = fileName;
entry.append(atom);
- completeUDSEntry(entry, attr, size, &time);
+ completeUDSEntry(entry, attr, size, time.getTime());
statEntry(entry);
finished();
}
void PLPProtocol::
-completeUDSEntry(UDSEntry& entry, const long attr, const long size, PsiTime *date) {
+completeUDSEntry(UDSEntry& entry, const long attr, const long size, const time_t date) {
UDSAtom atom;
atom.m_uds = KIO::UDS_SIZE;
@@ -379,7 +377,7 @@ completeUDSEntry(UDSEntry& entry, const long attr, const long size, PsiTime *dat
entry.append(atom);
atom.m_uds = KIO::UDS_MODIFICATION_TIME;
- atom.m_long = date->getTime();
+ atom.m_long = date;
entry.append(atom);
atom.m_uds = KIO::UDS_ACCESS;
@@ -661,8 +659,8 @@ put( const KURL& url, int _mode, bool _overwrite, bool /*_resume*/ ) {
void PLPProtocol::
rename(const KURL &src, const KURL &dest, bool _overwrite) {
- QString from( QFile::encodeName(src.path()));
- QString to( QFile::encodeName(dest.path()));
+ QString from(QFile::encodeName(src.path()));
+ QString to(QFile::encodeName(dest.path()));
if (checkConnection())
return;
diff --git a/kde2/kioslave/kio_plp.h b/kde2/kioslave/kio_plp.h
index 4f1bc23..0112801 100644
--- a/kde2/kioslave/kio_plp.h
+++ b/kde2/kioslave/kio_plp.h
@@ -56,7 +56,7 @@ class PLPProtocol : public KIO::SlaveBase
char driveChar(const QString& path);
void createVirtualDirEntry(KIO::UDSEntry & entry, bool rdonly);
- void completeUDSEntry(KIO::UDSEntry& entry, const long attr, const long size, PsiTime *date);
+ void completeUDSEntry(KIO::UDSEntry& entry, const long attr, const long size, const time_t date);
bool checkForError(Enum<rfsv::errs> res);
bool isRomDrive(const QString& path);
bool isDrive(const QString& path);