Skip to content
Browse files

Removed unused code

  • Loading branch information...
1 parent bbb5716 commit 3c414503dabc21b9bf0fd8c9670a62204b4c848a @bmcdorman bmcdorman committed Aug 22, 2013
Showing with 22 additions and 23 deletions.
  1. +0 −2 src/compile_worker.cpp
  2. +0 −1 src/main_window.cpp
  3. +0 −1 src/qhsv_picker.cpp
  4. +22 −19 src/vision_dialog.cpp
View
2 src/compile_worker.cpp
@@ -117,7 +117,5 @@ QString CompileWorker::tempPath()
void CompileWorker::cleanup()
{
-
- // QMessageBox::information(0, "", m_tempDir);
Cleaner c(m_tempDir);
}
View
1 src/main_window.cpp
@@ -261,7 +261,6 @@ void MainWindow::updateSettings()
QPalette pal = ui->console->palette();
pal.setColor(QPalette::Base, consoleColor);
- // ui->console->setPalette(pal);
QString contents = ui->console->toPlainText();
ui->console->clear();
View
1 src/qhsv_picker.cpp
@@ -59,7 +59,6 @@ void QHsvPicker::paintEvent(QPaintEvent *)
QPainter painter(this);
const float widthRatio = width() / 360.0f;
- //unused: const float heightRatio = height() / 255.0f;
const bool enabled = isEnabled();
View
41 src/vision_dialog.cpp
@@ -223,25 +223,28 @@ void VisionDialog::on_down_clicked()
void VisionDialog::updateOptions(const QItemSelection &current, const QItemSelection &prev)
{
- if(prev.indexes().size()) {
- QModelIndex p = prev.indexes()[0];
- Config c = m_configModel->config();
- c.beginGroup(CAMERA_GROUP);
- c.beginGroup(CAMERA_CHANNEL_GROUP_PREFIX + QString::number(p.row()).toStdString());
- c.addValues(m_hsvConfig);
- m_configModel->setConfig(c);
- ui->channels->selectionModel()->select(current, QItemSelectionModel::Select);
- }
-
- const QModelIndexList &indexes = current.indexes();
- const bool enable = ui->channels->isEnabled();
- const bool sel = indexes.size() == 1 && enable;
- ui->addChannel->setEnabled(enable);
- ui->removeChannel->setEnabled(sel);
- ui->up->setEnabled(sel && indexes[0].row() > 0);
- ui->down->setEnabled(sel && indexes[0].row() + 1 < m_configModel->rowCount());
- ui->hsv->setEnabled(sel);
-
+ if(prev.indexes().size()) {
+ QModelIndex p = prev.indexes()[0];
+ Config c = m_configModel->config();
+ c.beginGroup(CAMERA_GROUP);
+ c.beginGroup(CAMERA_CHANNEL_GROUP_PREFIX + QString::number(p.row()).toStdString());
+ c.addValues(m_hsvConfig);
+ const int row = current.indexes().size() == 1 ? current.indexes()[0].row() : -1;
+ m_configModel->setConfig(c);
+ if(row >= 0) {
+ ui->channels->selectionModel()->select(m_configModel->index(row, 0), QItemSelectionModel::Select);
+ }
+ }
+
+ const QModelIndexList &indexes = current.indexes();
+ const bool enable = ui->channels->isEnabled();
+ const bool sel = indexes.size() == 1 && enable;
+ ui->addChannel->setEnabled(enable);
+ ui->removeChannel->setEnabled(sel);
+ ui->up->setEnabled(sel && indexes[0].row() > 0);
+ ui->down->setEnabled(sel && indexes[0].row() + 1 < m_configModel->rowCount());
+ ui->hsv->setEnabled(sel);
+
if(indexes.size()) {
Config c = m_configModel->config();
c.beginGroup(CAMERA_GROUP);

0 comments on commit 3c41450

Please sign in to comment.
Something went wrong with that request. Please try again.