summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElvis Angelaccio <elvis.angelaccio@kde.org>2016-11-08 18:45:54 (GMT)
committerElvis Angelaccio <elvis.angelaccio@kde.org>2016-11-08 18:49:52 (GMT)
commit47e970709e31b82939fc2fb5404884918a8e6d3c (patch)
tree111a96b54a40e05edb51e866bb0f0399f5088eba
parent57341779c0fd85e57972838802c27c8819f3d70a (diff)
Fix archiveview column resize
ArchiveModel now uses the `DoNotNotifyView` behavior when listing, which means the `columnsInserted` signal was never emitted and `Part::adjustColumns()` never called. This slot was not necessary in the first place, we can just move its code to the ArchiveView constructor. Differential Revision: D3281
-rw-r--r--part/archiveview.cpp4
-rw-r--r--part/part.cpp8
-rw-r--r--part/part.h1
3 files changed, 2 insertions, 11 deletions
diff --git a/part/archiveview.cpp b/part/archiveview.cpp
index c7706c1..a00ea06 100644
--- a/part/archiveview.cpp
+++ b/part/archiveview.cpp
@@ -23,8 +23,7 @@
#include "archiveview.h"
#include "ark_debug.h"
-#include <QDebug>
-
+#include <QHeaderView>
#include <QMimeData>
#include <QApplication>
#include <QDragEnterEvent>
@@ -46,6 +45,7 @@ ArchiveView::ArchiveView(QWidget *parent)
// #368807: drops must be initially disabled, otherwise they will override the MainWindow's ones.
// They will be enabled in Part::slotLoadingFinished().
setDropsEnabled(false);
+ header()->setSectionResizeMode(QHeaderView::ResizeToContents);
}
void ArchiveView::startDrag(Qt::DropActions supportedActions)
diff --git a/part/part.cpp b/part/part.cpp
index 80b9a1a..19b757a 100644
--- a/part/part.cpp
+++ b/part/part.cpp
@@ -293,9 +293,6 @@ void Part::setupView()
connect(m_view, &QTreeView::activated, this, &Part::slotActivated);
connect(m_view, &QWidget::customContextMenuRequested, this, &Part::slotShowContextMenu);
-
- connect(m_model, &QAbstractItemModel::columnsInserted,
- this, &Part::adjustColumns);
}
void Part::slotActivated(const QModelIndex &index)
@@ -1221,11 +1218,6 @@ void Part::slotExtractionDone(KJob* job)
}
}
-void Part::adjustColumns()
-{
- m_view->header()->setSectionResizeMode(0, QHeaderView::ResizeToContents);
-}
-
void Part::slotAddFiles(const QStringList& filesToAdd, const Archive::Entry *destination, const QString &relPath)
{
if (!m_model->archive() || filesToAdd.isEmpty()) {
diff --git a/part/part.h b/part/part.h
index 6b172e1..2e51d34 100644
--- a/part/part.h
+++ b/part/part.h
@@ -145,7 +145,6 @@ private slots:
void updateActions();
void updateQuickExtractMenu(QAction *extractAction);
void selectionChanged();
- void adjustColumns();
void setBusyGui();
void setReadyGui();
void setFileNameFromArchive();