mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-26 03:06:37 +03:00
Correctly restore 'name' column width when loading magnet links in the 'Add new torrent dialog'. Closes #1334.
This commit is contained in:
parent
202006bdd1
commit
c59793b33f
2 changed files with 4 additions and 3 deletions
|
@ -104,9 +104,7 @@ void AddNewTorrentDialog::loadState()
|
||||||
{
|
{
|
||||||
QIniSettings settings;
|
QIniSettings settings;
|
||||||
settings.beginGroup(QString::fromUtf8("AddNewTorrentDialog"));
|
settings.beginGroup(QString::fromUtf8("AddNewTorrentDialog"));
|
||||||
QByteArray state = settings.value("treeHeaderState").toByteArray();
|
m_headerState = settings.value("treeHeaderState").toByteArray();
|
||||||
if (!state.isEmpty())
|
|
||||||
ui->content_tree->header()->restoreState(state);
|
|
||||||
int width = settings.value("width", -1).toInt();
|
int width = settings.value("width", -1).toInt();
|
||||||
if (width >= 0) {
|
if (width >= 0) {
|
||||||
QRect geo = geometry();
|
QRect geo = geometry();
|
||||||
|
@ -659,6 +657,8 @@ void AddNewTorrentDialog::setupTreeview() {
|
||||||
|
|
||||||
// List files in torrent
|
// List files in torrent
|
||||||
m_contentModel->model()->setupModelData(*m_torrentInfo);
|
m_contentModel->model()->setupModelData(*m_torrentInfo);
|
||||||
|
if (!m_headerState.isEmpty())
|
||||||
|
ui->content_tree->header()->restoreState(m_headerState);
|
||||||
|
|
||||||
// Expand root folder
|
// Expand root folder
|
||||||
ui->content_tree->setExpanded(m_contentModel->index(0, 0), true);
|
ui->content_tree->setExpanded(m_contentModel->index(0, 0), true);
|
||||||
|
|
|
@ -99,6 +99,7 @@ private:
|
||||||
QStringList m_filesPath;
|
QStringList m_filesPath;
|
||||||
bool m_hasRenamedFile;
|
bool m_hasRenamedFile;
|
||||||
QShortcut *editHotkey;
|
QShortcut *editHotkey;
|
||||||
|
QByteArray m_headerState;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // ADDNEWTORRENTDIALOG_H
|
#endif // ADDNEWTORRENTDIALOG_H
|
||||||
|
|
Loading…
Reference in a new issue