325 return NULL; |
327 return NULL; |
326 } |
328 } |
327 |
329 |
328 void FileEngineHandler::mount(const QString &path) |
330 void FileEngineHandler::mount(const QString &path) |
329 { |
331 { |
330 qDebug(QString("[PHYSFS] Mounting '%1' to '/'").arg(path).toLocal8Bit().data()); |
|
331 PHYSFS_mount(path.toUtf8().constData(), NULL, 0); |
332 PHYSFS_mount(path.toUtf8().constData(), NULL, 0); |
|
333 qDebug(QString("[PHYSFS] Mounting '%1' to '/': %2").arg(path).arg(errorStr()).toLocal8Bit().constData()); |
332 } |
334 } |
333 |
335 |
334 void FileEngineHandler::mount(const QString & path, const QString & mountPoint) |
336 void FileEngineHandler::mount(const QString & path, const QString & mountPoint) |
335 { |
337 { |
336 qDebug(QString("[PHYSFS] Mounting '%1' to '%2'").arg(path).arg(mountPoint).toLocal8Bit().data()); |
|
337 PHYSFS_mount(path.toUtf8().constData(), mountPoint.toUtf8().constData(), 0); |
338 PHYSFS_mount(path.toUtf8().constData(), mountPoint.toUtf8().constData(), 0); |
|
339 qDebug(QString("[PHYSFS] Mounting '%1' to '%2': %3").arg(path).arg(mountPoint).arg(errorStr()).toLocal8Bit().data()); |
338 } |
340 } |
339 |
341 |
340 void FileEngineHandler::setWriteDir(const QString &path) |
342 void FileEngineHandler::setWriteDir(const QString &path) |
341 { |
343 { |
342 qDebug(QString("[PHYSFS] Setting write dir to '%1'").arg(path).toLocal8Bit().data()); |
|
343 PHYSFS_setWriteDir(path.toUtf8().constData()); |
344 PHYSFS_setWriteDir(path.toUtf8().constData()); |
|
345 qDebug(QString("[PHYSFS] Setting write dir to '%1': %2").arg(path).arg(errorStr()).toLocal8Bit().data()); |
344 } |
346 } |
345 |
347 |
346 void FileEngineHandler::mountPacks() |
348 void FileEngineHandler::mountPacks() |
347 { |
349 { |
348 hedgewarsMountPackages(); |
350 hedgewarsMountPackages(); |
|
351 } |
|
352 |
|
353 QString FileEngineHandler::errorStr() |
|
354 { |
|
355 QString s = QString::fromUtf8(PHYSFS_getLastError()); |
|
356 return s.isEmpty() ? "ok" : s; |
349 } |
357 } |
350 |
358 |
351 |
359 |
352 FileEngineIterator::FileEngineIterator(QDir::Filters filters, const QStringList &nameFilters, const QStringList &entries) |
360 FileEngineIterator::FileEngineIterator(QDir::Filters filters, const QStringList &nameFilters, const QStringList &entries) |
353 : QAbstractFileEngineIterator(filters, nameFilters) |
361 : QAbstractFileEngineIterator(filters, nameFilters) |