From 72e03bbb176e2b8fe5bce6c51e75a521d48797fa Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Wed, 21 Feb 2024 11:56:46 +1100 Subject: [PATCH] Fix mrview compilation through conflict resolution - Remove code within cmd/mrview.cpp that originates from 6417a526a1bd374bfc74d221655eab0c8f5a29e3 as part of #2689, which was erroneously added in 39240ad6d2ce619dc0b1febbc6e73c61858d7b5a. - Fix compilation of src/gui/mrview/file_open.cpp to coincide with changes in #2764; these were omitted from cherry-picks 39240ad6d2ce619dc0b1febbc6e73c61858d7b5a and 0afe37b402ba999f64a29d706626fc3d22492462 due to that file having already been removed during the course of #2689. --- cmd/mrview.cpp | 14 -------------- src/gui/mrview/file_open.cpp | 4 ++-- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/cmd/mrview.cpp b/cmd/mrview.cpp index 604ffa2b36..11c08afe82 100644 --- a/cmd/mrview.cpp +++ b/cmd/mrview.cpp @@ -80,20 +80,6 @@ void usage() { } void run() { - GUI::App::setEventHandler([](QEvent *event) { - if (event->type() == QEvent::FileOpen) { - QFileOpenEvent *openEvent = static_cast(event); - std::vector> list; - try { - list.push_back(std::make_unique(MR::Header::open(openEvent->file().toUtf8().data()))); - } catch (Exception &E) { - E.display(); - } - reinterpret_cast(MR::GUI::App::main_window)->add_images(list); - } - return false; - }); - Q_INIT_RESOURCE(icons); GUI::MRView::Window window; MR::GUI::MRView::Sync::SyncManager sync; // sync allows syncing between mrview windows in different processes window.show(); diff --git a/src/gui/mrview/file_open.cpp b/src/gui/mrview/file_open.cpp index a2afd7d300..20e805931f 100644 --- a/src/gui/mrview/file_open.cpp +++ b/src/gui/mrview/file_open.cpp @@ -23,9 +23,9 @@ namespace GUI { bool App::event(QEvent *event) { if (event->type() == QEvent::FileOpen) { QFileOpenEvent *openEvent = static_cast(event); - vector> list; + std::vector> list; try { - list.push_back(make_unique(MR::Header::open(openEvent->file().toUtf8().data()))); + list.push_back(std::make_unique(MR::Header::open(openEvent->file().toUtf8().data()))); } catch (Exception &E) { E.display(); }