remove a bunch of dead code
- ID
573249e- date
2023-06-10 22:44:33+00:00- author
Alex Chan <alex@alexwlchan.net>- parent
fedef80- message
remove a bunch of dead code- changed files
1 file, 99 deletions
Changed files
BlinkReviewer/BlinkReviewer/Views/PhotoReviewer.swift (11686) → BlinkReviewer/BlinkReviewer/Views/PhotoReviewer.swift (7665)
diff --git a/BlinkReviewer/BlinkReviewer/Views/PhotoReviewer.swift b/BlinkReviewer/BlinkReviewer/Views/PhotoReviewer.swift
index 1b2a292..04e9412 100644
--- a/BlinkReviewer/BlinkReviewer/Views/PhotoReviewer.swift
+++ b/BlinkReviewer/BlinkReviewer/Views/PhotoReviewer.swift
@@ -188,103 +188,4 @@ struct PhotoReviewer: View {
break
}
}
-//
-// private func handleKeyEvent(_ event: NSEvent) {
-// let asset = photosLibrary.assets2.object(at: photosLibrary.assets2.count - 1 - selectedAssetIndex)
-//
-// switch event.keyCode {
-// case 123: // Left arrow key
-// if selectedAssetIndex > 0 {
-// selectedAssetIndex -= 1
-// }
-//
-// case 124: // Right arrow key
-// if selectedAssetIndex < photosLibrary.assets2.count - 1 {
-// selectedAssetIndex += 1
-// }
-//
-// case 18, 19, 20: // "1", "2", "3"
-// let state = photosLibrary.state(for: asset)
-//
-// let approved = getAlbum(withName: "Approved")
-// let rejected = getAlbum(withName: "Rejected")
-// let needsAction = getAlbum(withName: "Needs Action")
-//
-// try! PHPhotoLibrary.shared().performChangesAndWait {
-// // Strictly speaking, the first condition is a combination of two:
-// //
-// // 1. The action is `toggle-approved` and the photo is approved,
-// // in which case toggling means un-approving it.
-// // 2. The action is anything else and the photo is approved, in
-// // which case setting the new status means removing approved.
-// //
-// // Similar logic applies for all three conditions.
-// if state == .Approved {
-// print("removing asset \(asset.localIdentifier) from approved")
-// asset.remove(fromAlbum: approved)
-// } else if event.keyCode == 18 {
-// print("adding asset \(asset.localIdentifier) to approved")
-// asset.add(toAlbum: approved)
-// }
-//
-// if state == .Rejected {
-// asset.remove(fromAlbum: rejected)
-// } else if event.keyCode == 19 {
-// asset.add(toAlbum: rejected)
-// }
-//
-// if state == .NeedsAction {
-// asset.remove(fromAlbum: needsAction)
-// } else if event.keyCode == 20 {
-// asset.add(toAlbum: needsAction)
-// }
-// }
-//
-// photosLibrary.updateAsset(atIndex: selectedAssetIndex)
-//
-// if selectedAssetIndex > 0 {
-// selectedAssetIndex -= 1
-// }
-//
-// case 3: // "f"
-// try! PHPhotoLibrary.shared().performChangesAndWait {
-// PHAssetChangeRequest(for: asset).isFavorite = !asset.isFavorite
-// }
-//
-// photosLibrary.updateAsset(atIndex: selectedAssetIndex)
-//
-// case 8: // "c"
-// let crossStitch = getAlbum(withName: "Cross stitch")
-//
-// try! PHPhotoLibrary.shared().performChangesAndWait {
-// asset.toggle(inAlbum: crossStitch)
-// }
-//
-// photosLibrary.updateAsset(atIndex: selectedAssetIndex)
-//
-// case 32: // "u"
-// print("not implemented yet!")
-//// if photosLibrary.state(for: asset) != nil {
-//// let lastUnreviewed = photosLibrary.assets2
-////
-//// [0..<selectedAssetIndex].lastIndex(where: { asset in
-//// photosLibrary.state(for: asset) == nil
-//// })
-////
-//// if let theIndex = lastUnreviewed {
-//// selectedAssetIndex = theIndex
-//// }
-//// }
-//
-// case 1: // "s"
-// showStatistics.toggle()
-//
-// case 2: // "d"
-// showDebug.toggle()
-//
-// default:
-// print(event)
-// break
-// }
-// }
}