diff --git a/kerfuffle/archive_kerfuffle.h b/kerfuffle/archive_kerfuffle.h --- a/kerfuffle/archive_kerfuffle.h +++ b/kerfuffle/archive_kerfuffle.h @@ -190,6 +190,8 @@ void setCompressionOptions(const CompressionOptions &opts); CompressionOptions compressionOptions() const; QString multiVolumeName() const; + // FIXME: this is only a temporary workaround. See T3300 for a proper fix. + bool hasBeenListed() const; static Archive *create(const QString &fileName, QObject *parent = 0); static Archive *create(const QString &fileName, const QString &fixedMimeType, QObject *parent = 0); @@ -244,6 +246,9 @@ */ void encrypt(const QString &password, bool encryptHeader); +signals: + void loadingFinished(); + private slots: void onListFinished(KJob*); void onAddFinished(KJob*); diff --git a/kerfuffle/archive_kerfuffle.cpp b/kerfuffle/archive_kerfuffle.cpp --- a/kerfuffle/archive_kerfuffle.cpp +++ b/kerfuffle/archive_kerfuffle.cpp @@ -466,6 +466,7 @@ } m_hasBeenListed = true; + emit loadingFinished(); } void Archive::listIfNotListed() @@ -506,4 +507,9 @@ return m_iface->multiVolumeName(); } +bool Archive::hasBeenListed() const +{ + return m_hasBeenListed; +} + } // namespace Kerfuffle diff --git a/part/part.cpp b/part/part.cpp --- a/part/part.cpp +++ b/part/part.cpp @@ -419,6 +419,7 @@ // archives). If we added files they would not get encrypted resulting in an // archive with a mixture of encrypted and unencrypted files. const bool isEncryptedButUnknownPassword = m_model->archive() && + m_model->archive()->hasBeenListed() && m_model->archive()->encryptionType() != Archive::Unencrypted && m_model->archive()->password().isEmpty(); @@ -671,6 +672,7 @@ // Plugin loaded successfully. KJob *job = m_model->setArchive(archive.take()); if (job) { + connect(archive.data(), &Archive::loadingFinished, this, &Part::updateActions); registerJob(job); job->start(); } else {