diff options
author | Luboš Doležel <lubos@dolezel.info> | 2015-12-31 09:48:00 +0100 |
---|---|---|
committer | Luboš Doležel <lubos@dolezel.info> | 2015-12-31 09:48:00 +0100 |
commit | 38280fdfcb4d63e9f9684ebf0a69e8ff4a9dbee6 (patch) | |
tree | f39096f0890e39b20c8c1a21419f5ef95fba38ff /src | |
parent | 4fe548615fc84c8e0cac0cd97b0946b5defe4492 (diff) | |
parent | 07991f06fe7404708a66537ad87a2f42a8f71565 (diff) | |
download | twinkle-38280fdfcb4d63e9f9684ebf0a69e8ff4a9dbee6.tar twinkle-38280fdfcb4d63e9f9684ebf0a69e8ff4a9dbee6.tar.gz twinkle-38280fdfcb4d63e9f9684ebf0a69e8ff4a9dbee6.tar.lz twinkle-38280fdfcb4d63e9f9684ebf0a69e8ff4a9dbee6.tar.xz twinkle-38280fdfcb4d63e9f9684ebf0a69e8ff4a9dbee6.zip |
Merge pull request #45 from petercolberg/historyform
historyform fixes
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); |