Changeset View
Changeset View
Standalone View
Standalone View
iso/iso.cpp
Show First 20 Lines • Show All 185 Lines • ▼ Show 20 Line(s) | |||||
186 | void kio_isoProtocol::createUDSEntry(const KArchiveEntry * isoEntry, UDSEntry & entry) | 186 | void kio_isoProtocol::createUDSEntry(const KArchiveEntry * isoEntry, UDSEntry & entry) | ||
187 | { | 187 | { | ||
188 | entry.clear(); | 188 | entry.clear(); | ||
189 | entry.UDS_ENTRY_INSERT(UDSEntry::UDS_NAME, isoEntry->name()); | 189 | entry.UDS_ENTRY_INSERT(UDSEntry::UDS_NAME, isoEntry->name()); | ||
190 | entry.UDS_ENTRY_INSERT(UDSEntry::UDS_FILE_TYPE, isoEntry->permissions() & S_IFMT); // keep file type only | 190 | entry.UDS_ENTRY_INSERT(UDSEntry::UDS_FILE_TYPE, isoEntry->permissions() & S_IFMT); // keep file type only | ||
191 | entry.UDS_ENTRY_INSERT(UDSEntry::UDS_ACCESS, isoEntry->permissions() & 07777); // keep permissions only | 191 | entry.UDS_ENTRY_INSERT(UDSEntry::UDS_ACCESS, isoEntry->permissions() & 07777); // keep permissions only | ||
192 | 192 | | |||
193 | if (isoEntry->isFile()) { | 193 | if (isoEntry->isFile()) { | ||
194 | long long si = ((KIsoFile *)isoEntry)->realsize(); | 194 | long long si = (dynamic_cast<const KIsoFile *>(isoEntry))->realsize(); | ||
195 | if (!si) si = ((KIsoFile *)isoEntry)->size(); | 195 | if (!si) si = (dynamic_cast<const KIsoFile *>(isoEntry))->size(); | ||
196 | entry.UDS_ENTRY_INSERT(UDSEntry::UDS_SIZE, si); | 196 | entry.UDS_ENTRY_INSERT(UDSEntry::UDS_SIZE, si); | ||
197 | } else { | 197 | } else { | ||
198 | entry.UDS_ENTRY_INSERT(UDSEntry::UDS_SIZE, 0L); | 198 | entry.UDS_ENTRY_INSERT(UDSEntry::UDS_SIZE, 0L); | ||
199 | } | 199 | } | ||
200 | 200 | | |||
201 | entry.UDS_ENTRY_INSERT(UDSEntry::UDS_USER, isoEntry->user()); | 201 | entry.UDS_ENTRY_INSERT(UDSEntry::UDS_USER, isoEntry->user()); | ||
202 | entry.UDS_ENTRY_INSERT(UDSEntry::UDS_GROUP, isoEntry->group()); | 202 | entry.UDS_ENTRY_INSERT(UDSEntry::UDS_GROUP, isoEntry->group()); | ||
203 | entry.UDS_ENTRY_INSERT((uint)UDSEntry::UDS_MODIFICATION_TIME, isoEntry->date().toTime_t()); | 203 | entry.UDS_ENTRY_INSERT((uint)UDSEntry::UDS_MODIFICATION_TIME, isoEntry->date().toTime_t()); | ||
204 | entry.UDS_ENTRY_INSERT(UDSEntry::UDS_ACCESS_TIME, | 204 | entry.UDS_ENTRY_INSERT(UDSEntry::UDS_ACCESS_TIME, | ||
205 | isoEntry->isFile() ? ((KIsoFile *)isoEntry)->adate() : | 205 | isoEntry->isFile() ? (dynamic_cast<const KIsoFile *>(isoEntry))->adate() : | ||
206 | ((KIsoDirectory *)isoEntry)->adate()); | 206 | (dynamic_cast<const KIsoDirectory *>(isoEntry))->adate()); | ||
207 | 207 | | |||
208 | entry.UDS_ENTRY_INSERT(UDSEntry::UDS_CREATION_TIME, | 208 | entry.UDS_ENTRY_INSERT(UDSEntry::UDS_CREATION_TIME, | ||
209 | isoEntry->isFile() ? ((KIsoFile *)isoEntry)->cdate() : | 209 | isoEntry->isFile() ? (dynamic_cast<const KIsoFile *>(isoEntry))->cdate() : | ||
210 | ((KIsoDirectory *)isoEntry)->cdate()); | 210 | (dynamic_cast<const KIsoDirectory *>(isoEntry))->cdate()); | ||
211 | 211 | | |||
212 | entry.UDS_ENTRY_INSERT(UDSEntry::UDS_LINK_DEST, isoEntry->symLinkTarget()); | 212 | entry.UDS_ENTRY_INSERT(UDSEntry::UDS_LINK_DEST, isoEntry->symLinkTarget()); | ||
213 | } | 213 | } | ||
214 | 214 | | |||
215 | void kio_isoProtocol::listDir(const QUrl &url) | 215 | void kio_isoProtocol::listDir(const QUrl &url) | ||
216 | { | 216 | { | ||
217 | //qDebug() << "kio_isoProtocol::listDir " << url.url() << endl; | 217 | //qDebug() << "kio_isoProtocol::listDir " << url.url() << endl; | ||
218 | 218 | | |||
▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Line(s) | 257 | if (!path.isEmpty() && path != DIR_SEPARATOR) { | |||
260 | if (!e) { | 260 | if (!e) { | ||
261 | error(KIO::ERR_DOES_NOT_EXIST, path); | 261 | error(KIO::ERR_DOES_NOT_EXIST, path); | ||
262 | return; | 262 | return; | ||
263 | } | 263 | } | ||
264 | if (! e->isDirectory()) { | 264 | if (! e->isDirectory()) { | ||
265 | error(KIO::ERR_IS_FILE, path); | 265 | error(KIO::ERR_IS_FILE, path); | ||
266 | return; | 266 | return; | ||
267 | } | 267 | } | ||
268 | dir = (KArchiveDirectory*)e; | 268 | dir = dynamic_cast<const KArchiveDirectory*>(e); | ||
269 | } else { | 269 | } else { | ||
270 | dir = root; | 270 | dir = root; | ||
271 | } | 271 | } | ||
272 | 272 | | |||
273 | QStringList l = dir->entries(); | 273 | QStringList l = dir->entries(); | ||
274 | totalSize(l.count()); | 274 | totalSize(l.count()); | ||
275 | 275 | | |||
276 | UDSEntry entry; | 276 | UDSEntry entry; | ||
▲ Show 20 Lines • Show All 251 Lines • Show Last 20 Lines |