Changeset View
Changeset View
Standalone View
Standalone View
iso/kiso.cpp
Show First 20 Lines • Show All 96 Lines • ▼ Show 20 Line(s) | |||||
97 | #endif | 97 | #endif | ||
98 | 98 | | |||
99 | return ret; | 99 | return ret; | ||
100 | } | 100 | } | ||
101 | 101 | | |||
102 | class KIso::KIsoPrivate | 102 | class KIso::KIsoPrivate | ||
103 | { | 103 | { | ||
104 | public: | 104 | public: | ||
105 | KIsoPrivate() {} | 105 | KIsoPrivate() = default; | ||
106 | QStringList dirList; | 106 | QStringList dirList; | ||
107 | }; | 107 | }; | ||
108 | 108 | | |||
109 | KIso::KIso(const QString& filename, const QString & _mimetype) | 109 | KIso::KIso(const QString& filename, const QString & _mimetype) | ||
110 | : KArchive(0L) | 110 | : KArchive(nullptr) | ||
111 | { | 111 | { | ||
112 | KRFUNC; | 112 | KRFUNC; | ||
113 | KRDEBUG("Starting KIso: " << filename << " - type: " << _mimetype); | 113 | KRDEBUG("Starting KIso: " << filename << " - type: " << _mimetype); | ||
114 | 114 | | |||
115 | m_startsec = -1; | 115 | m_startsec = -1; | ||
116 | m_filename = filename; | 116 | m_filename = filename; | ||
117 | d = new KIsoPrivate; | 117 | d = new KIsoPrivate; | ||
118 | QString mimetype(_mimetype); | 118 | QString mimetype(_mimetype); | ||
▲ Show 20 Lines • Show All 105 Lines • ▼ Show 20 Line(s) | 210 | { | |||
224 | return -1; | 224 | return -1; | ||
225 | } | 225 | } | ||
226 | 226 | | |||
227 | /* callback function for libisofs */ | 227 | /* callback function for libisofs */ | ||
228 | static int mycallb(struct iso_directory_record *idr, void *udata) | 228 | static int mycallb(struct iso_directory_record *idr, void *udata) | ||
229 | { | 229 | { | ||
230 | KRFUNC; | 230 | KRFUNC; | ||
231 | 231 | | |||
232 | KIso *iso = static_cast<KIso*>(udata); | 232 | auto *iso = static_cast<KIso*>(udata); | ||
233 | QString path, user, group, symlink; | 233 | QString path, user, group, symlink; | ||
234 | int i; | 234 | int i; | ||
235 | int access; | 235 | int access; | ||
236 | int time, cdate, adate; | 236 | int time, cdate, adate; | ||
237 | rr_entry rr; | 237 | rr_entry rr; | ||
238 | bool special = false; | 238 | bool special = false; | ||
239 | KArchiveEntry *entry = NULL, *oldentry = NULL; | 239 | KArchiveEntry *entry = nullptr, *oldentry = nullptr; | ||
240 | char z_algo[2], z_params[2]; | 240 | char z_algo[2], z_params[2]; | ||
241 | long long z_size = 0; | 241 | long long z_size = 0; | ||
242 | 242 | | |||
243 | if ((idr->flags[0] & 1) && !iso->showhidden) return 0; | 243 | if ((idr->flags[0] & 1) && !iso->showhidden) return 0; | ||
244 | if (iso->level) { | 244 | if (iso->level) { | ||
245 | if (isonum_711(idr->name_len) == 1) { | 245 | if (isonum_711(idr->name_len) == 1) { | ||
246 | switch (idr->name[0]) { | 246 | switch (idr->name[0]) { | ||
247 | case 0: | 247 | case 0: | ||
▲ Show 20 Lines • Show All 43 Lines • ▼ Show 20 Line(s) | |||||
291 | } | 291 | } | ||
292 | if (iso->showrr) FreeRR(&rr); | 292 | if (iso->showrr) FreeRR(&rr); | ||
293 | if (idr->flags[0] & 2) { | 293 | if (idr->flags[0] & 2) { | ||
294 | entry = new KIsoDirectory(iso, path, access | S_IFDIR, time, adate, cdate, | 294 | entry = new KIsoDirectory(iso, path, access | S_IFDIR, time, adate, cdate, | ||
295 | user, group, symlink); | 295 | user, group, symlink); | ||
296 | } else { | 296 | } else { | ||
297 | entry = new KIsoFile(iso, path, access, time, adate, cdate, | 297 | entry = new KIsoFile(iso, path, access, time, adate, cdate, | ||
298 | user, group, symlink, (long long)(isonum_733(idr->extent)) << (long long)11, isonum_733(idr->size)); | 298 | user, group, symlink, (long long)(isonum_733(idr->extent)) << (long long)11, isonum_733(idr->size)); | ||
299 | if (z_size)(static_cast <KIsoFile*>(entry))->setZF(z_algo, z_params, z_size); | 299 | if (z_size)(dynamic_cast <KIsoFile*>(entry))->setZF(z_algo, z_params, z_size); | ||
300 | 300 | | |||
301 | } | 301 | } | ||
302 | iso->dirent->addEntry(entry); | 302 | iso->dirent->addEntry(entry); | ||
303 | } | 303 | } | ||
304 | if ((idr->flags[0] & 2) && (iso->level == 0 || !special)) { | 304 | if ((idr->flags[0] & 2) && (iso->level == 0 || !special)) { | ||
305 | if (iso->level) { | 305 | if (iso->level) { | ||
306 | oldentry = iso->dirent; | 306 | oldentry = iso->dirent; | ||
307 | iso->dirent = static_cast<KIsoDirectory*>(entry); | 307 | iso->dirent = dynamic_cast<KIsoDirectory*>(entry); | ||
308 | } | 308 | } | ||
309 | iso->level++; | 309 | iso->level++; | ||
310 | ProcessDir(&readf, isonum_733(idr->extent), isonum_733(idr->size), &mycallb, udata); | 310 | ProcessDir(&readf, isonum_733(idr->extent), isonum_733(idr->size), &mycallb, udata); | ||
311 | iso->level--; | 311 | iso->level--; | ||
312 | if (iso->level) iso->dirent = static_cast<KIsoDirectory*>(oldentry); | 312 | if (iso->level) iso->dirent = dynamic_cast<KIsoDirectory*>(oldentry); | ||
313 | } | 313 | } | ||
314 | return 0; | 314 | return 0; | ||
315 | } | 315 | } | ||
316 | 316 | | |||
317 | void KIso::addBoot(struct el_torito_boot_descriptor* bootdesc) | 317 | void KIso::addBoot(struct el_torito_boot_descriptor* bootdesc) | ||
318 | { | 318 | { | ||
319 | KRFUNC; | 319 | KRFUNC; | ||
320 | 320 | | |||
▲ Show 20 Lines • Show All 201 Lines • Show Last 20 Lines |