Commit 1f1392a6 authored by Vishesh Yadav's avatar Vishesh Yadav

hg: Fix crash when deselecting a file to commit

CCBUG: 317018
parent eb349bd5
......@@ -200,7 +200,6 @@ void HgCommitDialog::slotItemSelectionChanged(const char status,
arguments << fileName;
hgWrapper->executeCommand(QLatin1String("diff"), arguments, diffOut);
kDebug() << diffOut;
m_fileDiffDoc->setText(diffOut);
m_fileDiffDoc->setHighlightingMode("diff");
}
......
......@@ -44,6 +44,7 @@ HgStatusList::HgStatusList(QWidget *parent):
m_statusTable->verticalHeader()->hide();
m_statusTable->setEditTriggers(QAbstractItemView::NoEditTriggers);
m_statusTable->setSelectionBehavior(QAbstractItemView::SelectRows);
m_statusTable->setSelectionMode(QAbstractItemView::SingleSelection);
//mainLayout->addWidget(m_filter);
mainLayout->addWidget(m_statusTable);
......@@ -53,11 +54,12 @@ HgStatusList::HgStatusList(QWidget *parent):
reloadStatusTable();
connect(m_statusTable, SIGNAL(itemSelectionChanged()),
this, SLOT(itemSelectionChangedSlot()));
connect(m_statusTable,
SIGNAL(currentItemChanged(QTableWidgetItem*, QTableWidgetItem*)),
this, SLOT(currentItemChangedSlot()));
}
void HgStatusList::itemSelectionChangedSlot()
void HgStatusList::currentItemChangedSlot()
{
emit itemSelectionChanged(
m_statusTable->item(m_statusTable->currentRow(), 1)->text()[0].toLatin1(),
......
......@@ -53,7 +53,7 @@ private slots:
void reloadStatusTable();
private slots:
void itemSelectionChangedSlot();
void currentItemChangedSlot();
signals:
void itemSelectionChanged(const char status, const QString &fileName);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment