Skip to content

Commit

Permalink
Fix mrview compilation through conflict resolution
Browse files Browse the repository at this point in the history
- Remove code within cmd/mrview.cpp that originates from 6417a52 as part of #2689, which was erroneously added in 39240ad.
- Fix compilation of src/gui/mrview/file_open.cpp to coincide with changes in #2764; these were omitted from cherry-picks 39240ad and 0afe37b due to that file having already been removed during the course of #2689.
  • Loading branch information
Lestropie committed Feb 21, 2024
1 parent 4f3836b commit 72e03bb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
14 changes: 0 additions & 14 deletions cmd/mrview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,20 +80,6 @@ void usage() {
}

void run() {
GUI::App::setEventHandler([](QEvent *event) {
if (event->type() == QEvent::FileOpen) {
QFileOpenEvent *openEvent = static_cast<QFileOpenEvent *>(event);
std::vector<std::unique_ptr<MR::Header>> list;
try {
list.push_back(std::make_unique<MR::Header>(MR::Header::open(openEvent->file().toUtf8().data())));
} catch (Exception &E) {
E.display();
}
reinterpret_cast<MR::GUI::MRView::Window *>(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();
Expand Down
4 changes: 2 additions & 2 deletions src/gui/mrview/file_open.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ namespace GUI {
bool App::event(QEvent *event) {
if (event->type() == QEvent::FileOpen) {
QFileOpenEvent *openEvent = static_cast<QFileOpenEvent *>(event);
vector<std::unique_ptr<MR::Header>> list;
std::vector<std::unique_ptr<MR::Header>> list;
try {
list.push_back(make_unique<MR::Header>(MR::Header::open(openEvent->file().toUtf8().data())));
list.push_back(std::make_unique<MR::Header>(MR::Header::open(openEvent->file().toUtf8().data())));
} catch (Exception &E) {
E.display();
}
Expand Down

0 comments on commit 72e03bb

Please sign in to comment.