Created
July 23, 2014 05:30
-
-
Save chebert/2fd3fa55209652d65dbd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| struct FileChooserDialog { | |
| private: | |
| struct FileCompare { | |
| bool operator() (const Glib::RefPtr<Gio::File>& a, const Glib::RefPtr<Gio::File>& b) const { | |
| std::clog << (a->equal(b) ? "equal" : "not equal") << std::endl; | |
| return a->equal(b); | |
| } | |
| }; | |
| public: | |
| std::set<Glib::RefPtr<Gio::File>, FileCompare> chosen_files; | |
| }; | |
| void add_files_button_clicked_handler() { | |
| auto& dialog = app_data.file_chooser_dialog; | |
| for (auto file : dialog.dialog->get_files()) { | |
| auto& chosen_files = dialog.chosen_files; | |
| if (chosen_files.count(file) == 0) { | |
| chosen_files.insert(file); | |
| } | |
| } | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment