192{
193 static std::map<boost::filesystem::path, PresentationInterface::WeakPtr> loadedPresentations;
194
195 const std::map<OpenPresentationInterface::Ptr, std::string>& openPresentationInterfaces =
197
198#ifdef HAVE_BOOST_FILESYSTEM_CANONICAL
199 boost::filesystem::path key(canonical(boost::filesystem::path(info.filename)));
200#else
201 boost::filesystem::path const key(absolute(boost::filesystem::path(info.filename)));
202#endif
203
205
206 if(!presentation)
207 {
208 for(auto const& cur: openPresentationInterfaces)
209 {
210 std::list<GtkFileFilter*> const filters = cur.first->getFilters();
212 {
213 presentation = cur.first->open(info.filename);
214
215 if(presentation)
216 {
217 loadedPresentations[key] = presentation;
219 break;
220 }
221 }
222 }
223 }
224
225 if(presentation)
226 {
227 return presentation;
228 }
229
230 throw std::invalid_argument("Don't know how to load presentation " + std::string(info.filename));
231}