forked from teamnwah/openmw-tes3coop
improved ScriptErrorTable handling of script errors that don't have line/column associated with them (also avoiding a segfault)
This commit is contained in:
parent
80d1bb571c
commit
61e6b0d03c
1 changed files with 8 additions and 1 deletions
|
@ -52,6 +52,13 @@ void CSVWorld::ScriptErrorTable::addMessage (const std::string& message,
|
||||||
columnItem->setFlags (columnItem->flags() ^ Qt::ItemIsEditable);
|
columnItem->setFlags (columnItem->flags() ^ Qt::ItemIsEditable);
|
||||||
setItem (row, 3, columnItem);
|
setItem (row, 3, columnItem);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
QTableWidgetItem *lineItem = new QTableWidgetItem;
|
||||||
|
lineItem->setData (Qt::DisplayRole, "-");
|
||||||
|
lineItem->setFlags (lineItem->flags() ^ Qt::ItemIsEditable);
|
||||||
|
setItem (row, 1, lineItem);
|
||||||
|
}
|
||||||
|
|
||||||
QTableWidgetItem *messageItem = new QTableWidgetItem (QString::fromUtf8 (message.c_str()));
|
QTableWidgetItem *messageItem = new QTableWidgetItem (QString::fromUtf8 (message.c_str()));
|
||||||
messageItem->setFlags (messageItem->flags() ^ Qt::ItemIsEditable);
|
messageItem->setFlags (messageItem->flags() ^ Qt::ItemIsEditable);
|
||||||
|
@ -141,7 +148,7 @@ void CSVWorld::ScriptErrorTable::settingChanged (const CSMPrefs::Setting *settin
|
||||||
|
|
||||||
void CSVWorld::ScriptErrorTable::cellClicked (int row, int column)
|
void CSVWorld::ScriptErrorTable::cellClicked (int row, int column)
|
||||||
{
|
{
|
||||||
if (item (row, 1))
|
if (item (row, 3))
|
||||||
{
|
{
|
||||||
int scriptLine = item (row, 1)->data (Qt::DisplayRole).toInt();
|
int scriptLine = item (row, 1)->data (Qt::DisplayRole).toInt();
|
||||||
int scriptColumn = item (row, 3)->data (Qt::DisplayRole).toInt();
|
int scriptColumn = item (row, 3)->data (Qt::DisplayRole).toInt();
|
||||||
|
|
Loading…
Reference in a new issue