add_to_history_internal (_history, p);
}
+/** Remove non-existant items from the history */
+void
+Config::clean_history ()
+{
+ clean_history_internal (_history);
+}
+
void
Config::add_to_player_history (boost::filesystem::path p)
{
add_to_history_internal (_player_history, p);
}
+/** Remove non-existant items from the player history */
+void
+Config::clean_player_history ()
+{
+ clean_history_internal (_player_history);
+}
+
void
Config::add_to_history_internal (vector<boost::filesystem::path>& h, boost::filesystem::path p)
{
changed (HISTORY);
}
+void
+Config::clean_history_internal (vector<boost::filesystem::path>& h)
+{
+ vector<boost::filesystem::path> old = h;
+ h.clear ();
+ BOOST_FOREACH (boost::filesystem::path i, old) {
+ if (boost::filesystem::is_directory(i)) {
+ h.push_back (i);
+ }
+ }
+}
+
bool
Config::have_existing (string file)
{
}
void add_to_history (boost::filesystem::path p);
+ void clean_history ();
void add_to_player_history (boost::filesystem::path p);
+ void clean_player_history ();
void set_jump_to_selected (bool j) {
maybe_set (_jump_to_selected, j);
boost::shared_ptr<dcp::CertificateChain> create_certificate_chain ();
boost::filesystem::path directory_or (boost::optional<boost::filesystem::path> dir, boost::filesystem::path a) const;
void add_to_history_internal (std::vector<boost::filesystem::path>& h, boost::filesystem::path p);
+ void clean_history_internal (std::vector<boost::filesystem::path>& h);
void backup ();
template <class T>
int pos = _history_position;
+ /* Clear out non-existant history items before we re-build the menu */
+ Config::instance()->clean_history ();
vector<boost::filesystem::path> history = Config::instance()->history ();
if (!history.empty ()) {
int pos = _history_position;
+ /* Clear out non-existant history items before we re-build the menu */
+ Config::instance()->clean_player_history ();
vector<boost::filesystem::path> history = Config::instance()->player_history ();
if (!history.empty ()) {