• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-cqtcocoa誰得pythonphprubygameguibathyscaphec翻訳計画中(planning stage)omegatframeworktwittertestdomvb.netdirectxbtronarduinopreviewerゲームエンジン

macOSのスクリーンショットの保存場所を変更するメニュバーエクストラ


Commit MetaInfo

Revisionc201e5c4014bdaa3ead4cdab28932685e3bf314e (tree)
Time2018-03-10 17:55:30
Authormasakih <masakih@user...>
Commitermasakih

Log Message

処理を簡素化

Change Summary

Incremental Difference

--- a/GoInto/StatusBar.swift
+++ b/GoInto/StatusBar.swift
@@ -68,13 +68,14 @@ final class StatusBar: NSObject {
6868 extension StatusBar: NSMenuDelegate {
6969 func menuWillOpen(_ menu: NSMenu) {
7070 let url = Screenshot.shared.location
71- items
72- .flatMap { $0 as? FolderItem }
73- .forEach { $0.update(url) }
7471 recentItems.forEach { $0.update(url) }
75- items
76- .flatMap { $0 as? ImageTypeItem }
77- .forEach { $0.update() }
72+ items.forEach { item in
73+ switch item {
74+ case let f as FolderItem: f.update(url)
75+ case let i as ImageTypeItem: i.update()
76+ default: ()
77+ }
78+ }
7879 }
7980 }
8081