diff --git a/Changelog b/Changelog index d3e0e2b78..908f1d25d 100644 --- a/Changelog +++ b/Changelog @@ -4,6 +4,7 @@ - BUGFIX: Fixed possible overflow in progress calculation in arborescence.h - BUGFIX: Save properties window size, position, columns width and restore them - BUGFIX: Set a minimum default width for NAME column in properties + - BUGFIX: Remember visual indexes of columns in transfer lists * Sun Jul 12 2009 - Christophe DUMEZ - v1.3.4 - BUGFIX: Fixed IP filter file parsing on 64bits diff --git a/src/FinishedTorrents.cpp b/src/FinishedTorrents.cpp index 74569a87f..8ee79ca58 100644 --- a/src/FinishedTorrents.cpp +++ b/src/FinishedTorrents.cpp @@ -176,6 +176,23 @@ bool FinishedTorrents::loadColWidthFinishedList(){ finishedList->header()->resizeSection(i, width_list.at(i).toInt()); } loadLastSortedColumn(); + QVariantList visualIndexes = settings.value(QString::fromUtf8("FinishedListVisualIndexes"), QVariantList()).toList(); + if(visualIndexes.size() != finishedListModel->columnCount()-1) { + qDebug("Corrupted values for download list columns sizes"); + return false; + } + bool change = false; + do { + change = false; + for(int i=0;iheader()->logicalIndex(i)).toInt(); + if(i != new_visual_index) { + qDebug("Moving column from %d to %d", finishedList->header()->logicalIndex(i), new_visual_index); + finishedList->header()->moveSection(i, new_visual_index); + change = true; + } + } + }while(change); qDebug("Finished list columns width loaded"); return true; } @@ -223,6 +240,11 @@ void FinishedTorrents::saveColWidthFinishedList() const{ } } settings.setValue("FinishedListColsWidth", new_width_list.join(" ")); + QVariantList visualIndexes; + for(int i=0; iheader()->visualIndex(i)); + } + settings.setValue(QString::fromUtf8("FinishedListVisualIndexes"), visualIndexes); qDebug("Finished list columns width saved"); } diff --git a/src/downloadingTorrents.cpp b/src/downloadingTorrents.cpp index 7bf41fda8..0c5cedde6 100644 --- a/src/downloadingTorrents.cpp +++ b/src/downloadingTorrents.cpp @@ -732,6 +732,11 @@ void DownloadingTorrents::saveColWidthDLList() const{ } } settings.setValue(QString::fromUtf8("DownloadListColsWidth"), new_width_list.join(QString::fromUtf8(" "))); + QVariantList visualIndexes; + for(int i=0; iheader()->visualIndex(i)); + } + settings.setValue(QString::fromUtf8("DownloadListVisualIndexes"), visualIndexes); qDebug("Download list columns width saved"); } @@ -752,6 +757,23 @@ bool DownloadingTorrents::loadColWidthDLList() { for(unsigned int i=0; iheader()->resizeSection(i, width_list.at(i).toInt()); } + QVariantList visualIndexes = settings.value(QString::fromUtf8("DownloadListVisualIndexes"), QVariantList()).toList(); + if(visualIndexes.size() != DLListModel->columnCount()-1) { + qDebug("Corrupted values for download list columns sizes"); + return false; + } + bool change = false; + do { + change = false; + for(int i=0;iheader()->logicalIndex(i)).toInt(); + if(i != new_visual_index) { + qDebug("Moving column from %d to %d", downloadList->header()->logicalIndex(i), new_visual_index); + downloadList->header()->moveSection(i, new_visual_index); + change = true; + } + } + }while(change); qDebug("Download list columns width loaded"); return true; }