diff --git a/src/transferlistwidget.cpp b/src/transferlistwidget.cpp index b0f2d7767..9437e2d4d 100644 --- a/src/transferlistwidget.cpp +++ b/src/transferlistwidget.cpp @@ -127,6 +127,17 @@ TransferListWidget::TransferListWidget(QWidget *parent, MainWindow *main_window, setColumnHidden(TorrentModelItem::TR_SAVE_PATH, true); } + //Ensure that at least one column is visible at all times + bool atLeastOne = false; + for (unsigned int i=0; isetChecked(!isColumnHidden(i)); actions.append(myAct); } + int visibleCols = 0; + for (unsigned int i=0; i 1) + break; + } + // Call menu QAction *act = hideshowColumn.exec(QCursor::pos()); if (act) { int col = actions.indexOf(act); Q_ASSERT(col >= 0); + Q_ASSERT(visibleCols > 0); + if (!isColumnHidden(col) && visibleCols == 1) + return; qDebug("Toggling column %d visibility", col); setColumnHidden(col, !isColumnHidden(col)); if (!isColumnHidden(col) && columnWidth(col) <= 5)