• R/O
  • HTTP
  • SSH
  • HTTPS

KCD: コミット

main code repository.


コミットメタ情報

リビジョン9ad76a5f6aebe19c5b3d6b60158ecbf0b9cbb08b (tree)
日時2018-04-16 21:49:43
作者masakih <masakih@user...>
コミッターmasakih

ログメッセージ

ApplicationDirecroriesの中のアプリケーションに依存する部分を分離した

変更サマリ

差分

--- a/KCD.xcodeproj/project.pbxproj
+++ b/KCD.xcodeproj/project.pbxproj
@@ -126,6 +126,7 @@
126126 F455DDC31FA4A9E400CDE64D /* LoggerExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = F455DDC21FA4A9E400CDE64D /* LoggerExtension.swift */; };
127127 F45771231E1BCC7C008A9215 /* PeriodicNotifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = F45771221E1BCC7C008A9215 /* PeriodicNotifier.swift */; };
128128 F458531A207A53CA007B251A /* Doutaku.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F4D9F7F8206A84890044B4C7 /* Doutaku.framework */; };
129+ F45854102084D2E3007B251A /* ApplicationDirecroriesExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = F458540F2084D2E3007B251A /* ApplicationDirecroriesExtension.swift */; };
129130 F45F3BE11E067A870009434E /* HistoryItemCleaner.swift in Sources */ = {isa = PBXBuildFile; fileRef = F45F3BE01E067A870009434E /* HistoryItemCleaner.swift */; };
130131 F45F3BE31E06A60A0009434E /* UpgradableShipsWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F45F3BE21E06A60A0009434E /* UpgradableShipsWindowController.swift */; };
131132 F45FBB6F1E0FDB33000E72B9 /* StrengthenListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F45FBB6E1E0FDB33000E72B9 /* StrengthenListViewController.swift */; };
@@ -506,6 +507,7 @@
506507 F455DDC01FA4A6CD00CDE64D /* Logger.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Logger.swift; sourceTree = "<group>"; };
507508 F455DDC21FA4A9E400CDE64D /* LoggerExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoggerExtension.swift; sourceTree = "<group>"; };
508509 F45771221E1BCC7C008A9215 /* PeriodicNotifier.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PeriodicNotifier.swift; sourceTree = "<group>"; };
510+ F458540F2084D2E3007B251A /* ApplicationDirecroriesExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ApplicationDirecroriesExtension.swift; sourceTree = "<group>"; };
509511 F45F3BDD1E0679D80009434E /* KCD-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "KCD-Bridging-Header.h"; sourceTree = "<group>"; };
510512 F45F3BE01E067A870009434E /* HistoryItemCleaner.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HistoryItemCleaner.swift; sourceTree = "<group>"; };
511513 F45F3BE21E06A60A0009434E /* UpgradableShipsWindowController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UpgradableShipsWindowController.swift; sourceTree = "<group>"; };
@@ -800,6 +802,7 @@
800802 F45771221E1BCC7C008A9215 /* PeriodicNotifier.swift */,
801803 F47215A11E1F38280083D3BC /* Queue.swift */,
802804 F491A4BB1E4B523C00D1E067 /* ApplicationDirecrories.swift */,
805+ F458540F2084D2E3007B251A /* ApplicationDirecroriesExtension.swift */,
803806 F455DDC01FA4A6CD00CDE64D /* Logger.swift */,
804807 F455DDC21FA4A9E400CDE64D /* LoggerExtension.swift */,
805808 F40F976E1E67092600AE81BB /* ArrayExtensions.swift */,
@@ -1873,6 +1876,7 @@
18731876 F47C3EA61E5F050D00D97449 /* MasterSlotItemMapper.swift in Sources */,
18741877 F47215AA1E1F96B60083D3BC /* ResourceHistoryDataStore.swift in Sources */,
18751878 F47C3EA41E5F017500D97449 /* MasterFurnitureMapper.swift in Sources */,
1879+ F45854102084D2E3007B251A /* ApplicationDirecroriesExtension.swift in Sources */,
18761880 F45FBB6F1E0FDB33000E72B9 /* StrengthenListViewController.swift in Sources */,
18771881 F47C3EAA1E5F085B00D97449 /* MasterMissionMapper.swift in Sources */,
18781882 F44BC6CB1E223208004644E3 /* IgnoreCommand.swift in Sources */,
--- a/KCD/ApplicationDirecrories.swift
+++ b/KCD/ApplicationDirecrories.swift
@@ -46,39 +46,6 @@ struct ApplicationDirecrories {
4646 }
4747 }
4848
49-extension ApplicationDirecrories {
50-
51- static let screenshotSaveDirectoryURL: URL = {
52-
53- let parentURL = URL(fileURLWithPath: AppDelegate.shared.screenShotSaveDirectory)
54- let url = parentURL.appendingPathComponent(localizedAppName())
55- let fm = FileManager.default
56- var isDir: ObjCBool = false
57-
58- do {
59-
60- if !fm.fileExists(atPath: url.path, isDirectory: &isDir) {
61-
62- try fm.createDirectory(at: url, withIntermediateDirectories: false)
63-
64- } else if !isDir.boolValue {
65-
66- print("\(url) is regular file, not direcory.")
67-
68- return parentURL
69- }
70-
71- } catch {
72-
73- print("Can not create screenshot save directory.")
74-
75- return parentURL
76- }
77-
78- return url
79- }()
80-}
81-
8249
8350 func createDirectory(_ url: URL) -> Bool {
8451
--- /dev/null
+++ b/KCD/ApplicationDirecroriesExtension.swift
@@ -0,0 +1,40 @@
1+//
2+// ApplicationDirecroriesExtension.swift
3+// KCD
4+//
5+// Created by Hori,Masaki on 2018/04/16.
6+// Copyright © 2018年 Hori,Masaki. All rights reserved.
7+//
8+
9+extension ApplicationDirecrories {
10+
11+ static let screenshotSaveDirectoryURL: URL = {
12+
13+ let parentURL = URL(fileURLWithPath: AppDelegate.shared.screenShotSaveDirectory)
14+ let url = parentURL.appendingPathComponent(localizedAppName())
15+ let fm = FileManager.default
16+ var isDir: ObjCBool = false
17+
18+ do {
19+
20+ if !fm.fileExists(atPath: url.path, isDirectory: &isDir) {
21+
22+ try fm.createDirectory(at: url, withIntermediateDirectories: false)
23+
24+ } else if !isDir.boolValue {
25+
26+ print("\(url) is regular file, not direcory.")
27+
28+ return parentURL
29+ }
30+
31+ } catch {
32+
33+ print("Can not create screenshot save directory.")
34+
35+ return parentURL
36+ }
37+
38+ return url
39+ }()
40+}
旧リポジトリブラウザで表示