From 2d88671034cf31dd8069335e4e4d545f6589a389 Mon Sep 17 00:00:00 2001 From: Jordan Sherer Date: Thu, 19 Sep 2019 11:39:46 -0400 Subject: [PATCH] Fixed #209: bug where message window reply button did not reply to the correct callsign --- messagewindow.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/messagewindow.cpp b/messagewindow.cpp index ca7e0e7..cd19df1 100644 --- a/messagewindow.cpp +++ b/messagewindow.cpp @@ -157,6 +157,8 @@ QString MessageWindow::prepareReplyMessage(QString path, QString text){ void MessageWindow::on_messageTableWidget_selectionChanged(const QItemSelection &/*selected*/, const QItemSelection &/*deselected*/){ auto row = ui->messageTableWidget->currentRow(); + + // message column auto item = ui->messageTableWidget->item(row, ui->messageTableWidget->columnCount()-1); if(!item){ return; @@ -168,13 +170,15 @@ void MessageWindow::on_messageTableWidget_selectionChanged(const QItemSelection void MessageWindow::on_replyPushButton_clicked(){ auto row = ui->messageTableWidget->currentRow(); - auto item = ui->messageTableWidget->item(row, ui->messageTableWidget->columnCount()-2); + + // from column + auto item = ui->messageTableWidget->item(row, ui->messageTableWidget->columnCount()-3); if(!item){ return; } auto path = item->data(Qt::UserRole).toString(); - auto text = "[MESSAGE]"; // ui->replytextEdit->toPlainText(); + auto text = "[MESSAGE]"; auto message = prepareReplyMessage(path, text); emit replyMessage(message);