+ bool no_errors = true;
+ string const path = OnlyPath(from);
+ string const base = OnlyFilename(ChangeExtension(from, ""));
+ string const to_base = ChangeExtension(to, "");
+ string const to_extension = GetExtension(to);
+
+ vector<string> files = DirList(OnlyPath(from), GetExtension(from));
+ for (vector<string>::const_iterator it = files.begin();
+ it != files.end(); ++it)
+ if (prefixIs(*it, base)) {
+ string from2 = path + *it;
+ string to2 = to_base + it->substr(base.length());
+ to2 = ChangeExtension(to2, to_extension);
+ lyxerr[Debug::FILES] << "moving " << from2
+ << " to " << to2 << endl;
+ bool moved = (copy)
+ ? lyx::copy(from2, to2)
+ : lyx::rename(from2, to2);
+ if (!moved && no_errors) {
+ Alert::alert(_("Error while trying to move file:"),
+ from2, _("to ") + to2);
+ no_errors = false;
+ }
+ }
+ return no_errors;