Skip to content

Commit 872e890

Browse files
author
Stanislas Chevallier
committed
Try to fix reading SRT files on a system that doesn't have any other app handling them, see #1
1 parent b429b4a commit 872e890

File tree

2 files changed

+25
-15
lines changed

2 files changed

+25
-15
lines changed

Subtitler.xcodeproj/project.pbxproj

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
9702708427032EA9001B5785 /* AppError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9702708327032EA9001B5785 /* AppError.swift */; };
1111
9702708727033502001B5785 /* DocumentController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9702708627033502001B5785 /* DocumentController.swift */; };
1212
97027089270339EC001B5785 /* PlayerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97027088270339EC001B5785 /* PlayerView.swift */; };
13-
970B47332B934E1A00A25FDC /* Difference in Frameworks */ = {isa = PBXBuildFile; productRef = 970B47322B934E1A00A25FDC /* Difference */; };
1413
970B47362B934E3500A25FDC /* SnapKit in Frameworks */ = {isa = PBXBuildFile; productRef = 970B47352B934E3500A25FDC /* SnapKit */; };
14+
9728DAD32BF38B7E00EB4FA2 /* Difference in Frameworks */ = {isa = PBXBuildFile; productRef = 9728DAD22BF38B7E00EB4FA2 /* Difference */; };
1515
972CAB7127032591005E9C3D /* NSTableView+SY.swift in Sources */ = {isa = PBXBuildFile; fileRef = 972CAB6A27032591005E9C3D /* NSTableView+SY.swift */; };
1616
972CAB7327032591005E9C3D /* TimingButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 972CAB6E27032591005E9C3D /* TimingButton.swift */; };
1717
972CAB7427032591005E9C3D /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 972CAB7027032591005E9C3D /* ViewController.swift */; };
@@ -72,14 +72,14 @@
7272
buildActionMask = 2147483647;
7373
files = (
7474
970B47362B934E3500A25FDC /* SnapKit in Frameworks */,
75-
970B47332B934E1A00A25FDC /* Difference in Frameworks */,
7675
);
7776
runOnlyForDeploymentPostprocessing = 0;
7877
};
7978
9792497C270351F900248C3D /* Frameworks */ = {
8079
isa = PBXFrameworksBuildPhase;
8180
buildActionMask = 2147483647;
8281
files = (
82+
9728DAD32BF38B7E00EB4FA2 /* Difference in Frameworks */,
8383
);
8484
runOnlyForDeploymentPostprocessing = 0;
8585
};
@@ -94,6 +94,13 @@
9494
path = Controllers;
9595
sourceTree = "<group>";
9696
};
97+
9728DAD12BF38B7E00EB4FA2 /* Frameworks */ = {
98+
isa = PBXGroup;
99+
children = (
100+
);
101+
name = Frameworks;
102+
sourceTree = "<group>";
103+
};
97104
972CAB6927032591005E9C3D /* Extensions */ = {
98105
isa = PBXGroup;
99106
children = (
@@ -141,6 +148,7 @@
141148
974FAA722703223B008B539B /* Subtitler */,
142149
97924980270351F900248C3D /* SubtitlerTests */,
143150
974FAA712703223B008B539B /* Products */,
151+
9728DAD12BF38B7E00EB4FA2 /* Frameworks */,
144152
);
145153
sourceTree = "<group>";
146154
};
@@ -197,7 +205,6 @@
197205
);
198206
name = Subtitler;
199207
packageProductDependencies = (
200-
970B47322B934E1A00A25FDC /* Difference */,
201208
970B47352B934E3500A25FDC /* SnapKit */,
202209
);
203210
productName = Subtitler;
@@ -218,6 +225,9 @@
218225
97924984270351FA00248C3D /* PBXTargetDependency */,
219226
);
220227
name = SubtitlerTests;
228+
packageProductDependencies = (
229+
9728DAD22BF38B7E00EB4FA2 /* Difference */,
230+
);
221231
productName = SubtitlerTests;
222232
productReference = 9792497F270351F900248C3D /* SubtitlerTests.xctest */;
223233
productType = "com.apple.product-type.bundle.unit-test";
@@ -230,7 +240,7 @@
230240
attributes = {
231241
BuildIndependentTargetsInParallel = 1;
232242
LastSwiftUpdateCheck = 1300;
233-
LastUpgradeCheck = 1520;
243+
LastUpgradeCheck = 1530;
234244
TargetAttributes = {
235245
974FAA6F2703223B008B539B = {
236246
CreatedOnToolsVersion = 13.0;
@@ -485,7 +495,7 @@
485495
CODE_SIGN_IDENTITY = "Apple Development";
486496
CODE_SIGN_STYLE = Automatic;
487497
COMBINE_HIDPI_IMAGES = YES;
488-
CURRENT_PROJECT_VERSION = 5;
498+
CURRENT_PROJECT_VERSION = 6;
489499
DEAD_CODE_STRIPPING = YES;
490500
DEVELOPMENT_TEAM = 79RY8264V4;
491501
ENABLE_HARDENED_RUNTIME = YES;
@@ -499,7 +509,7 @@
499509
"$(inherited)",
500510
"@executable_path/../Frameworks",
501511
);
502-
MARKETING_VERSION = 1.0.4;
512+
MARKETING_VERSION = 1.0.5;
503513
PRODUCT_BUNDLE_IDENTIFIER = me.syan.Subtitler;
504514
PRODUCT_NAME = "$(TARGET_NAME)";
505515
SWIFT_EMIT_LOC_STRINGS = YES;
@@ -516,7 +526,7 @@
516526
CODE_SIGN_IDENTITY = "Apple Development";
517527
CODE_SIGN_STYLE = Automatic;
518528
COMBINE_HIDPI_IMAGES = YES;
519-
CURRENT_PROJECT_VERSION = 5;
529+
CURRENT_PROJECT_VERSION = 6;
520530
DEAD_CODE_STRIPPING = YES;
521531
DEVELOPMENT_TEAM = 79RY8264V4;
522532
ENABLE_HARDENED_RUNTIME = YES;
@@ -530,7 +540,7 @@
530540
"$(inherited)",
531541
"@executable_path/../Frameworks",
532542
);
533-
MARKETING_VERSION = 1.0.4;
543+
MARKETING_VERSION = 1.0.5;
534544
PRODUCT_BUNDLE_IDENTIFIER = me.syan.Subtitler;
535545
PRODUCT_NAME = "$(TARGET_NAME)";
536546
SWIFT_EMIT_LOC_STRINGS = YES;
@@ -640,16 +650,16 @@
640650
/* End XCRemoteSwiftPackageReference section */
641651

642652
/* Begin XCSwiftPackageProductDependency section */
643-
970B47322B934E1A00A25FDC /* Difference */ = {
644-
isa = XCSwiftPackageProductDependency;
645-
package = 970B47312B934E1A00A25FDC /* XCRemoteSwiftPackageReference "Difference" */;
646-
productName = Difference;
647-
};
648653
970B47352B934E3500A25FDC /* SnapKit */ = {
649654
isa = XCSwiftPackageProductDependency;
650655
package = 970B47342B934E3500A25FDC /* XCRemoteSwiftPackageReference "SnapKit" */;
651656
productName = SnapKit;
652657
};
658+
9728DAD22BF38B7E00EB4FA2 /* Difference */ = {
659+
isa = XCSwiftPackageProductDependency;
660+
package = 970B47312B934E1A00A25FDC /* XCRemoteSwiftPackageReference "Difference" */;
661+
productName = Difference;
662+
};
653663
/* End XCSwiftPackageProductDependency section */
654664
};
655665
rootObject = 974FAA682703223B008B539B /* Project object */;

Subtitler/Models/Subtitle.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class Subtitle: NSDocument {
4242
fileURL = nil
4343
fileType = "public.srt"
4444

45-
case "public.srt":
45+
case "public.srt", "me.syan.subtitle":
4646
self.lines = try SubRipParser.parse(data: data)
4747
isTransient = false
4848

@@ -53,7 +53,7 @@ class Subtitle: NSDocument {
5353

5454
override func data(ofType typeName: String) throws -> Data {
5555
switch typeName {
56-
case "public.srt":
56+
case "public.srt", "me.syan.subtitle":
5757
return try SubRipParser.write(lines: lines)
5858

5959
default:

0 commit comments

Comments
 (0)