fix: build error on GTKMM-4 (#6393)

This commit is contained in:
Cœur
2023-12-17 16:37:35 +01:00
committed by GitHub
parent 4d0f5c7b6c
commit e116672b27

View File

@@ -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 */