• Raphael Kubo da Costa's avatar
    Use a QScopedPointer to keep only one Archive instance alive at a time. · 8a3e5d96
    Raphael Kubo da Costa authored
    Even though having more than one Archive instance around is harmless, it
    wastes resources with no purpose.
    We thus guard the Archive pointer in Part::openFile() with a
    QScopedPointer so that if one is trying to create an archive whose type
    is read-only for Ark (ie. .gz files) and then chooses another mimetype,
    the first created instance is deleted right away, and not when
    ArchiveModel is destroyed.
    ArchiveModel::m_archive is now also a QScopedPointer, so that we do not
    need to manually delete the current archive when
    ArchiveModel::setArchive() is called.
part.cpp 29.3 KB