summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElvis Angelaccio <elvis.angelaccio@kde.org>2016-09-19 13:20:26 (GMT)
committerElvis Angelaccio <elvis.angelaccio@kde.org>2016-09-19 13:20:26 (GMT)
commit0be92fe6bb179e36a19fca11d7608f7a3db31d95 (patch)
tree89506c0352538bb522a6b2875226b79075131e14
parentcf26f62b95634d829d201cc286ad15a2eb6c39d2 (diff)
part: fix regression when adding files to a new archive
The m_archiveIsLoaded boolean is not really necessary and it was wrongly set to false when creating a new archive from Ark. Closes T3703
-rw-r--r--part/part.cpp7
-rw-r--r--part/part.h2
2 files changed, 2 insertions, 7 deletions
diff --git a/part/part.cpp b/part/part.cpp
index dfe0b46..c553c74 100644
--- a/part/part.cpp
+++ b/part/part.cpp
@@ -88,7 +88,6 @@ Part::Part(QWidget *parentWidget, QObject *parent, const QVariantList& args)
: KParts::ReadWritePart(parent),
m_splitter(Q_NULLPTR),
m_busy(false),
- m_archiveIsLoaded(false),
m_jobTracker(Q_NULLPTR)
{
Q_UNUSED(args)
@@ -833,7 +832,6 @@ void Part::slotLoadingFinished(KJob *job)
// The file failed to open, so reset the open archive, info panel and caption.
m_model->setArchive(Q_NULLPTR);
- m_archiveIsLoaded = false;
m_infoPanel->setPrettyFileName(QString());
m_infoPanel->updateWithDefaults();
@@ -841,9 +839,6 @@ void Part::slotLoadingFinished(KJob *job)
emit setWindowCaption(QString());
}
}
- else {
- m_archiveIsLoaded = true;
- }
m_view->sortByColumn(0, Qt::AscendingOrder);
@@ -1251,7 +1246,7 @@ void Part::adjustColumns()
void Part::slotAddFiles(const QStringList& filesToAdd, const Archive::Entry *destination, const QString &relPath)
{
- if (!m_archiveIsLoaded || filesToAdd.isEmpty()) {
+ if (!m_model->archive() || filesToAdd.isEmpty()) {
return;
}
diff --git a/part/part.h b/part/part.h
index f6a4b43..97334db 100644
--- a/part/part.h
+++ b/part/part.h
@@ -196,7 +196,7 @@ private:
QSplitter *m_splitter;
QList<QTemporaryDir*> m_tmpExtractDirList;
bool m_busy;
- bool m_archiveIsLoaded;
+
OpenFileMode m_openFileMode;
QUrl m_lastUsedAddPath;
QList<Kerfuffle::Archive::Entry*> m_jobTempEntries;