From 6c9647c1866b49d61ea3ce7d9201450fa0497b52 Mon Sep 17 00:00:00 2001 From: Fritz Elfert Date: Thu, 1 Feb 2001 02:03:25 +0000 Subject: 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 form to the new recommended form. --- kde2/kioslave/kio_plp.cpp | 28 +++++++++++++--------------- kde2/kioslave/kio_plp.h | 2 +- 2 files changed, 14 insertions(+), 16 deletions(-) (limited to 'kde2') 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 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 res); bool isRomDrive(const QString& path); bool isDrive(const QString& path); -- cgit v1.2.3