[kde-doc-english] [trojita] src/Gui: GUI: also save & restore the sizes and state of the header fields in the message list
Jan Kundrát
jkt at flaska.net
Sun May 26 23:39:49 UTC 2013
Git commit 3234e18452f6360b410b9b9ed12dafd4abbd1422 by Jan Kundrát.
Committed on 27/05/2013 at 00:13.
Pushed by jkt into branch 'master'.
GUI: also save & restore the sizes and state of the header fields in the message list
M +0 -1 src/Gui/MsgListView.cpp
M +6 -0 src/Gui/Window.cpp
http://commits.kde.org/trojita/3234e18452f6360b410b9b9ed12dafd4abbd1422
diff --git a/src/Gui/MsgListView.cpp b/src/Gui/MsgListView.cpp
index 2295fd3..0060aa8 100644
--- a/src/Gui/MsgListView.cpp
+++ b/src/Gui/MsgListView.cpp
@@ -232,7 +232,6 @@ void MsgListView::slotFixSize()
resizeMode = QHeaderView::Fixed;
break;
}
- setColumnWidth(i, sizeHintForColumn(i));
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
header()->setSectionResizeMode(i, resizeMode);
#else
diff --git a/src/Gui/Window.cpp b/src/Gui/Window.cpp
index 2dbd02b..1c2b4f9 100644
--- a/src/Gui/Window.cpp
+++ b/src/Gui/Window.cpp
@@ -2102,6 +2102,7 @@ void MainWindow::saveSizesAndState(const LayoutMode oldMode)
items << saveState();
items << (m_mainVSplitter ? m_mainVSplitter->saveState() : QByteArray());
items << (m_mainHSplitter ? m_mainHSplitter->saveState() : QByteArray());
+ items << msgListWidget->tree->header()->saveState();
QByteArray buf;
QDataStream stream(&buf, QIODevice::WriteOnly);
stream << items.size();
@@ -2153,6 +2154,11 @@ void MainWindow::applySizesAndState()
m_mainHSplitter->restoreState(item);
}
}
+
+ if (size-- && !stream.atEnd()) {
+ stream >> item;
+ msgListWidget->tree->header()->restoreState(item);
+ }
}
void MainWindow::resizeEvent(QResizeEvent *)
More information about the kde-doc-english
mailing list