From d6b56273639ec7f4a9ae9a2708724c34f23aa20e Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Mon, 25 Apr 2011 14:00:46 +0000 Subject: [PATCH] Fix initial column sizes in torrent addition dialog --- src/torrentadditiondlg.cpp | 18 ++++-------------- src/torrentadditiondlg.h | 2 -- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/src/torrentadditiondlg.cpp b/src/torrentadditiondlg.cpp index 6761dfb76..df9532902 100644 --- a/src/torrentadditiondlg.cpp +++ b/src/torrentadditiondlg.cpp @@ -63,7 +63,6 @@ torrentAdditionDialog::torrentAdditionDialog(QWidget *parent) : const Preferences pref; setupUi(this); setAttribute(Qt::WA_DeleteOnClose); - loadFilesListState(); // Icons CancelButton->setIcon(IconProvider::instance()->getIcon("dialog-cancel")); OkButton->setIcon(IconProvider::instance()->getIcon("list-add")); @@ -128,7 +127,6 @@ torrentAdditionDialog::~torrentAdditionDialog() { void torrentAdditionDialog::closeEvent(QCloseEvent *event) { qDebug() << Q_FUNC_INFO; - saveFilesListState(); saveSettings(); QDialog::closeEvent(event); } @@ -136,24 +134,16 @@ void torrentAdditionDialog::closeEvent(QCloseEvent *event) void torrentAdditionDialog::readSettings() { QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); restoreGeometry(settings.value("TorrentAdditionDlg/dimensions").toByteArray()); - -} - -void torrentAdditionDialog::saveSettings() { - QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); - settings.setValue("TorrentAdditionDlg/dimensions", saveGeometry()); -} - -void torrentAdditionDialog::loadFilesListState() { - QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); if(!torrentContentList->header()->restoreState(settings.value("TorrentAdditionDlg/ContentHeaderState").toByteArray())) { - torrentContentList->header()->resizeSection(0, 200); //Default + qDebug() << Q_FUNC_INFO << "First executation, resize first section to 200px..."; + torrentContentList->header()->resizeSection(0, 400); //Default } } -void torrentAdditionDialog::saveFilesListState() { +void torrentAdditionDialog::saveSettings() { QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); settings.setValue("TorrentAdditionDlg/ContentHeaderState", torrentContentList->header()->saveState()); + settings.setValue("TorrentAdditionDlg/dimensions", saveGeometry()); } void torrentAdditionDialog::limitDialogWidth() { diff --git a/src/torrentadditiondlg.h b/src/torrentadditiondlg.h index e5e77f3ce..219cd8aa7 100644 --- a/src/torrentadditiondlg.h +++ b/src/torrentadditiondlg.h @@ -74,8 +74,6 @@ protected: private: void readSettings(); void saveSettings(); - void loadFilesListState(); - void saveFilesListState(); private: QString fileName;