Skip to content

Commit 2aab617

Browse files
committed
handle default print column
fixes #66 bug introduced in 3d1a0c4
1 parent b375297 commit 2aab617

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

Qarma.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -560,11 +560,14 @@ void Qarma::dialogFinished(int status)
560560
QStringList result;
561561
if (tw) {
562562
QVariant v = sender()->property("qarma_print_column");
563-
int column = v.toString() == "ALL" ? -1 : v.toInt();
564-
if (column > tw->columnCount())
565-
column = -1;
566-
else if (column > 0)
567-
--column;
563+
int column = 1;
564+
if (v.isValid()) {
565+
column = v.toString() == "ALL" ? -1 : v.toInt();
566+
if (column > tw->columnCount())
567+
column = -1;
568+
else if (column > 0)
569+
--column;
570+
}
568571
bool done(false);
569572
auto text = [=](const QTreeWidgetItem *twi, int col, int offset) {
570573
if (col > -1)

0 commit comments

Comments
 (0)