void RollbackImport() { // Remove photos foreach (var id in imported_photos) { store.Remove(store.Get(id)); } foreach (var uri in photo_file_tracker.CopiedFiles) { var file = GLib.FileFactory.NewForUri(uri); file.Delete(null); } // Clean up directories while (created_directories.Count > 0) { var uri = created_directories.Pop(); var dir = GLib.FileFactory.NewForUri(uri); var enumerator = dir.EnumerateChildren("standard::name", GLib.FileQueryInfoFlags.None, null); if (!enumerator.HasPending) { dir.Delete(null); } } // Clean created tags metadata_importer.Cancel(); // Remove created roll rolls.Remove(CreatedRoll); }
public void UpdateThisUri(int index, string path, ref Photo photo) { if (photo == null) { photo = photo_store.Get((uint)photo_id_array[index]) as Photo; } PhotoVersion version = photo.GetVersion((uint)version_id_array[index]) as PhotoVersion; version.Uri = new System.Uri(path); photo.Changes.UriChanged = true; photo.Changes.ChangeVersion((uint)version_id_array[index]); }
public void UpdateThisUri(int index, string path, ref Photo photo) { if (photo == null) { photo = photo_store.Get(photo_id_array[index]); } PhotoVersion version = photo.GetVersion((uint)version_id_array[index]) as PhotoVersion; version.BaseUri = new SafeUri(path).GetBaseUri(); version.Filename = new SafeUri(path).GetFilename(); photo.Changes.UriChanged = true; photo.Changes.ChangeVersion((uint)version_id_array[index]); }