diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/historyform.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/gui/historyform.cpp b/src/gui/historyform.cpp index e8e88ae..15b882a 100644 --- a/src/gui/historyform.cpp +++ b/src/gui/historyform.cpp @@ -77,10 +77,13 @@ void HistoryForm::init() m_model->setColumnCount(5); m_model->setHorizontalHeaderLabels(QStringList() << tr("Time") << tr("In/Out") << tr("From/To") << tr("Subject") << tr("Status")); - historyListView->sortByColumn(HISTCOL_TIMESTAMP, Qt::DescendingOrder); + historyListView->horizontalHeader()->setSortIndicator(HISTCOL_TIMESTAMP, Qt::DescendingOrder); - historyListView->setColumnWidth(HISTCOL_FROMTO, 200); - historyListView->setColumnWidth(HISTCOL_SUBJECT, 200); +#if QT_VERSION >= 0x050000 + historyListView->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents); +#else + historyListView->horizontalHeader()->setResizeMode(QHeaderView::ResizeToContents); +#endif inCheckBox->setChecked(true); outCheckBox->setChecked(true); @@ -122,6 +125,8 @@ void HistoryForm::loadHistory() unsigned long totalCallDuration = 0; unsigned long totalConversationDuration = 0; + m_model->setRowCount(0); + std::list<t_call_record> history; call_history->get_history(history); @@ -228,6 +233,8 @@ void HistoryForm::loadHistory() durationText += ")"; totalDurationValueTextLabel->setText(durationText); + // Sort entries using currently selected sort column and order. + historyListView->sortByColumn(historyListView->horizontalHeader()->sortIndicatorSection(), historyListView->horizontalHeader()->sortIndicatorOrder()); // Make the first entry the selected entry. historyListView->selectRow(0); |