]> git.sesse.net Git - nageru/blobdiff - futatabi/mainwindow.cpp
Fix a dangling reference (found by GCC 14).
[nageru] / futatabi / mainwindow.cpp
index 0ebb75ca35ba22f737c0a7a772d062fa332ffc18..29eeb756655f5ea85d0099b2b068ee116861c8eb 100644 (file)
@@ -7,6 +7,7 @@
 #include "player.h"
 #include "futatabi_midi_mapping.pb.h"
 #include "midi_mapping_dialog.h"
+#include "pbo_pool.h"
 #include "shared/aboutdialog.h"
 #include "shared/disk_space_estimator.h"
 #include "shared/post_to_main_thread.h"
@@ -324,7 +325,11 @@ void MainWindow::change_num_cameras()
                display->setAutoFillBackground(true);
                layout->addWidget(display);
 
-               display->set_overlay(to_string(i + 1));
+               if (global_flags.source_labels.count(i + 1)) {
+                       display->set_overlay(global_flags.source_labels[i + 1]);
+               } else {
+                       display->set_overlay(to_string(i + 1));
+               }
 
                QPushButton *preview_btn = new QPushButton(this);
                preview_btn->setMaximumSize(20, 17);
@@ -923,7 +928,7 @@ bool MainWindow::eventFilter(QObject *watched, QEvent *event)
                } else if (watched == ui->playlist->viewport()) {
                        destination = ui->playlist;
                        jog_destination = JOG_PLAYLIST;
-                       if (destination->columnAt(wheel->x()) != int(PlayList::Column::CAMERA)) {
+                       if (destination->columnAt(wheel->position().x()) != int(PlayList::Column::CAMERA)) {
                                last_mousewheel_camera_row = -1;
                        }
                } else {
@@ -931,8 +936,8 @@ bool MainWindow::eventFilter(QObject *watched, QEvent *event)
                        return false;
                }
 
-               int column = destination->columnAt(wheel->x());
-               int row = destination->rowAt(wheel->y());
+               int column = destination->columnAt(wheel->position().x());
+               int row = destination->rowAt(wheel->position().y());
                if (column == -1 || row == -1)
                        return false;