Many little changes to get rid of compile-time warnings.
There now should be no warnings when compiling on LINUX. YMMV elsewhere.
This commit is contained in:
+3
-3
@@ -46,7 +46,7 @@ bool DBCSignalHandler::addSignal(DBC_SIGNAL &sig)
|
||||
|
||||
bool DBCSignalHandler::removeSignal(DBC_SIGNAL *sig)
|
||||
{
|
||||
Q_UNUSED(sig);
|
||||
Q_UNUSED(sig)
|
||||
//if (sigs.removeAll(*sig) > 0) return true;
|
||||
return false;
|
||||
}
|
||||
@@ -1698,7 +1698,7 @@ void DBCHandler::swapFiles(int pos1, int pos2)
|
||||
if (pos2 < 0) return;
|
||||
if (pos2 >= loadedFiles.count()) return;
|
||||
|
||||
loadedFiles.swap(pos1, pos2);
|
||||
loadedFiles.swapItemsAt(pos1, pos2);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1711,7 +1711,7 @@ DBC_MESSAGE* DBCHandler::findMessage(const CANFrame &frame)
|
||||
{
|
||||
for(int i = 0; i < loadedFiles.count(); i++)
|
||||
{
|
||||
if (loadedFiles[i].getAssocBus() == -1 || frame.bus == (unsigned int)loadedFiles[i].getAssocBus())
|
||||
if (loadedFiles[i].getAssocBus() == -1 || frame.bus == loadedFiles[i].getAssocBus())
|
||||
{
|
||||
DBC_MESSAGE* msg = loadedFiles[i].messageHandler->findMsgByID(frame.frameId());
|
||||
if (msg != nullptr) return msg;
|
||||
|
||||
@@ -270,6 +270,8 @@ void DBCLoadSaveWindow::editFile()
|
||||
|
||||
void DBCLoadSaveWindow::matchingCriteriaChanged(int index)
|
||||
{
|
||||
Q_UNUSED(index)
|
||||
|
||||
if (inhibitCellProcessing) return;
|
||||
// We don't know which combobox changed, so we just update all of them
|
||||
for (int row=0; row<ui->tableFiles->rowCount(); row++)
|
||||
@@ -312,7 +314,7 @@ void DBCLoadSaveWindow::cellChanged(int row, int col)
|
||||
{
|
||||
DBCFile *file = dbcHandler->getFileByIdx(row);
|
||||
int bus = ui->tableFiles->item(row, col)->text().toInt();
|
||||
int numBuses = CANConManager::getInstance()->getNumBuses();
|
||||
//int numBuses = CANConManager::getInstance()->getNumBuses();
|
||||
if (bus > -2)
|
||||
{
|
||||
file->setAssocBus(bus);
|
||||
|
||||
+16
-16
@@ -102,7 +102,7 @@ void DBCMainEditor::setFileIdx(int idx)
|
||||
|
||||
void DBCMainEditor::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
Q_UNUSED(event)
|
||||
writeSettings();
|
||||
sigEditor->close();
|
||||
}
|
||||
@@ -197,7 +197,7 @@ void DBCMainEditor::onCellChangedNode(int row,int col)
|
||||
if (dbcFile->findNodeByName(newName) != nullptr) //duplicates an existing node!
|
||||
{
|
||||
QMessageBox msg;
|
||||
msg.setParent(0);
|
||||
msg.setParent(nullptr);
|
||||
msg.setText("An existing node with that name already exists! Aborting!");
|
||||
msg.exec();
|
||||
return;
|
||||
@@ -275,7 +275,7 @@ void DBCMainEditor::onCellChangedMessage(int row,int col)
|
||||
if (msg != nullptr)
|
||||
{
|
||||
QMessageBox msg;
|
||||
msg.setParent(0);
|
||||
msg.setParent(nullptr);
|
||||
msg.setText("An existing msg with that ID already exists! Aborting!");
|
||||
msg.exec();
|
||||
|
||||
@@ -296,7 +296,7 @@ void DBCMainEditor::onCellChangedMessage(int row,int col)
|
||||
{
|
||||
if ((uint) referenceFrames->at(i).frameId() == msgID)
|
||||
{
|
||||
newMsg.len = referenceFrames->at(i).payload().length();
|
||||
newMsg.len = static_cast<unsigned int>(referenceFrames->at(i).payload().length());
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -395,14 +395,14 @@ void DBCMainEditor::onCellClickedMessage(int row, int col)
|
||||
QTableWidgetItem* firstCol = ui->MessagesTable->item(row, 0);
|
||||
bool ret = false;
|
||||
DBC_MESSAGE *msg;
|
||||
int msgID;
|
||||
uint32_t msgID;
|
||||
|
||||
if (col == 3) //3 is the signals field. If clicked we go to the signals dialog
|
||||
{
|
||||
QTableWidgetItem* msg = ui->MessagesTable->item(row, 0);
|
||||
if(msg) {
|
||||
QString idString = msg->text();
|
||||
DBC_MESSAGE *message = dbcFile->messageHandler->findMsgByID(Utility::ParseStringToNum(idString));
|
||||
DBC_MESSAGE *message = dbcFile->messageHandler->findMsgByID(static_cast<uint32_t>(Utility::ParseStringToNum(idString)));
|
||||
sigEditor->setMessageRef(message);
|
||||
sigEditor->setFileIdx(fileIdx);
|
||||
sigEditor->setWindowModality(Qt::WindowModal);
|
||||
@@ -416,8 +416,8 @@ void DBCMainEditor::onCellClickedMessage(int row, int col)
|
||||
}
|
||||
if (col == 4)
|
||||
{
|
||||
QColor newColor = QColorDialog::getColor(thisItem->backgroundColor());
|
||||
thisItem->setBackgroundColor(newColor);
|
||||
QColor newColor = QColorDialog::getColor(thisItem->background().color());
|
||||
thisItem->setBackground(newColor);
|
||||
|
||||
if(!firstCol) return;
|
||||
|
||||
@@ -443,8 +443,8 @@ void DBCMainEditor::onCellClickedMessage(int row, int col)
|
||||
}
|
||||
if (col == 5)
|
||||
{
|
||||
QColor newColor = QColorDialog::getColor(thisItem->backgroundColor());
|
||||
thisItem->setBackgroundColor(newColor);
|
||||
QColor newColor = QColorDialog::getColor(thisItem->background().color());
|
||||
thisItem->setBackground(newColor);
|
||||
|
||||
if(!firstCol) return;
|
||||
|
||||
@@ -523,11 +523,11 @@ void DBCMainEditor::refreshMessagesTable(const DBC_NODE *node)
|
||||
QTableWidgetItem *msgLen = new QTableWidgetItem(QString::number(msg->len));
|
||||
QTableWidgetItem *msgSignals = new QTableWidgetItem(QString::number(msg->sigHandler->getCount()));
|
||||
QTableWidgetItem *fgColor = new QTableWidgetItem("");
|
||||
if (msg->fgColor.isValid()) fgColor->setBackgroundColor(msg->fgColor);
|
||||
else fgColor->setBackgroundColor(QColor(dbcFile->findAttributeByName("GenMsgForegroundColor")->defaultValue.toString()));
|
||||
if (msg->fgColor.isValid()) fgColor->setBackground(msg->fgColor);
|
||||
else fgColor->setBackground(QColor(dbcFile->findAttributeByName("GenMsgForegroundColor")->defaultValue.toString()));
|
||||
QTableWidgetItem *bgColor = new QTableWidgetItem("");
|
||||
if (msg->bgColor.isValid()) bgColor->setBackgroundColor(msg->bgColor);
|
||||
else bgColor->setBackgroundColor(QColor(dbcFile->findAttributeByName("GenMsgBackgroundColor")->defaultValue.toString()));
|
||||
if (msg->bgColor.isValid()) bgColor->setBackground(msg->bgColor);
|
||||
else bgColor->setBackground(QColor(dbcFile->findAttributeByName("GenMsgBackgroundColor")->defaultValue.toString()));
|
||||
|
||||
QTableWidgetItem *msgComment = new QTableWidgetItem(msg->comment);
|
||||
|
||||
@@ -558,8 +558,8 @@ void DBCMainEditor::insertBlankRow()
|
||||
for(int i=1 ; i < ui->MessagesTable->columnCount(); i++)
|
||||
{
|
||||
QTableWidgetItem *item = new QTableWidgetItem("");
|
||||
if (i == 4) item->setBackgroundColor(QApplication::palette().color(QPalette::WindowText)); //foreground color
|
||||
if (i == 5) item->setBackgroundColor(QApplication::palette().color(QPalette::Base));
|
||||
if (i == 4) item->setBackground(QApplication::palette().color(QPalette::WindowText)); //foreground color
|
||||
if (i == 5) item->setBackground(QApplication::palette().color(QPalette::Base));
|
||||
item->setFlags(item->flags() & ~Qt::ItemIsEditable);
|
||||
ui->MessagesTable->setItem(rowIdx, i, item);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user