Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix: build error on GTKMM-4 (#6393)
  • Loading branch information
Coeur committed Dec 17, 2023
1 parent 4d0f5c7 commit e116672
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion gtk/OptionsDialog.cc
Expand Up @@ -338,7 +338,16 @@ void TorrentFileChooserDialog::onOpenDialogResponse(int response, Glib::RefPtr<S
bool const do_prompt = get_choice(std::string(ShowOptionsDialogChoice)) == "true";
bool const do_notify = false;

auto const files = IF_GTKMM4(get_files2, get_files)();
#if GTKMM_CHECK_VERSION(4, 0, 0)
auto files = std::vector<Glib::RefPtr<Gio::File>>();
auto files_model = get_files();
for (auto i = guint{ 0 }; i < files_model->get_n_items(); ++i)
{
files.push_back(gtr_ptr_dynamic_cast<Gio::File>(files_model->get_object(i)));
}
#else
auto const files = get_files();
#endif
g_assert(!files.empty());

/* remember this folder the next time we use this dialog */
Expand Down

0 comments on commit e116672

Please sign in to comment.