Skip to content

Commit 27881c0

Browse files
committed
Remove FileMaker hacks
This stops the aggressive icon building for files that are not CSV and should not be processed by this plugin. However it might break FileMaker TSV icon generation (I can no longer test this), if it does please use version 1.2.
1 parent 56caffc commit 27881c0

File tree

9 files changed

+100
-39
lines changed

9 files changed

+100
-39
lines changed

.gitignore

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Xcode
2+
.DS_Store
3+
*/build/*
4+
*.pbxuser
5+
!default.pbxuser
6+
*.mode1v3
7+
!default.mode1v3
8+
*.mode2v3
9+
!default.mode2v3
10+
*.perspectivev3
11+
!default.perspectivev3
12+
xcuserdata
13+
profile
14+
*.moved-aside
15+
DerivedData
16+
.idea/
17+
*.hmap
18+

CSVDocument.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ - (NSUInteger) numRowsFromCSVString:(NSString *)string maxRows:(NSUInteger)maxRo
114114
isNewColumn = NO;
115115
}
116116
else {
117-
colKey = [NSString stringWithFormat:@"col_%lu", colIndex];
117+
colKey = [NSString stringWithFormat:@"col_%lu", (unsigned long)colIndex];
118118
isNewColumn = YES;
119119
}
120120

GeneratePreviewForURL.m

+2-2
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ OSStatus GeneratePreviewForURL(void *thisInterface, QLPreviewRequestRef preview,
8383
([@";" isEqualToString:csvDoc.separator] ? @"Semicolon" : csvDoc.separator)));
8484
NSString *numRows = (numRowsParsed > MAX_ROWS) ?
8585
[NSString stringWithFormat:@"%i+", MAX_ROWS] :
86-
[NSString stringWithFormat:@"%lu", numRowsParsed];
86+
[NSString stringWithFormat:@"%lu", (unsigned long)numRowsParsed];
8787
[html appendFormat:@"</style></head><body><div class=\"file_info\"><b>%lu</b> %@, <b>%@</b> %@</div>",
88-
[csvDoc.columnKeys count],
88+
(unsigned long)[csvDoc.columnKeys count],
8989
(1 == [csvDoc.columnKeys count]) ? NSLocalizedString(@"column", nil) : NSLocalizedString(@"columns", nil),
9090
numRows,
9191
(1 == numRowsParsed) ? NSLocalizedString(@"row", nil) : NSLocalizedString(@"rows", nil)

INSTALL.rtf

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{\rtf1\ansi\ansicpg1252\cocoartf1187\cocoasubrtf340
2-
\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fnil\fcharset0 Monaco;}
2+
{\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fnil\fcharset0 Monaco;}
33
{\colortbl;\red255\green255\blue255;\red36\green70\blue183;}
44
\vieww14400\viewh14000\viewkind0
55
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural
@@ -12,16 +12,18 @@
1212
\cf0 Place the file
1313
\b QuickLookCSV.qlgenerator
1414
\b0 into:\
15+
\pard\tx566\tx6423\sl336\slmult1\pardirnatural
1516

16-
\f1\fs26 \cf2 ~/Library/QuickLook/
17+
\f1\fs26 \cf0 \cf2 ~/Library/QuickLook/
1718
\f0\fs28 \cf0 to install it for yourself only\
1819

1920
\f1\fs26 \cf2 (Macintosh HD)/Library/QuickLook/
2021
\f0\fs28 \cf0 to install it for all users of your Mac\
2122
If the QuickLook-folder does not exist, simply create it manually.\
2223
\
2324
This is version
24-
\b 1.2
25+
\b 1.3
2526
\b0 of the plugin.\
2627
{\field{\*\fldinst{HYPERLINK "http://code.google.com/p/quicklook-csv/"}}{\fldrslt http://code.google.com/p/quicklook-csv/}}\
28+
{\field{\*\fldinst{HYPERLINK "https://github.com/p2/quicklook-csv"}}{\fldrslt https://github.com/p2/quicklook-csv}} (issue reports and pull requests)\
2729
}

Info.plist

+56-25
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,17 @@
1212
<string>tsv</string>
1313
<string>tab</string>
1414
</array>
15+
<key>CFBundleTypeMIMETypes</key>
16+
<array>
17+
<string>text/tab-separated-values</string>
18+
</array>
1519
<key>CFBundleTypeName</key>
1620
<string>Tab</string>
1721
<key>CFBundleTypeRole</key>
1822
<string>QLGenerator</string>
1923
<key>LSItemContentTypes</key>
2024
<array>
2125
<string>public.tab-separated-values-text</string>
22-
<string>dyn.ah62d4rv4ge81k2pc</string>
2326
</array>
2427
<key>LSTypeIsPackage</key>
2528
<false/>
@@ -31,36 +34,18 @@
3134
<array>
3235
<string>csv</string>
3336
</array>
34-
<key>CFBundleTypeName</key>
35-
<string>CSV</string>
36-
<key>CFBundleTypeRole</key>
37-
<string>QLGenerator</string>
38-
<key>LSItemContentTypes</key>
37+
<key>CFBundleTypeMIMETypes</key>
3938
<array>
40-
<string>public.comma-separated-values-text</string>
41-
<string>dyn.age80g650</string>
42-
<string>dyn.ah62d4rv4ge80g650</string>
43-
<string>dyn.ah62d4um4ge80g650</string>
44-
</array>
45-
<key>NSPersistentStoreTypeKey</key>
46-
<string>XML</string>
47-
</dict>
48-
<dict>
49-
<key>CFBundleTypeExtensions</key>
50-
<array>
51-
<string>tsv</string>
52-
<string>tab</string>
39+
<string>text/csv</string>
5340
</array>
5441
<key>CFBundleTypeName</key>
55-
<string>FileMaker</string>
42+
<string>CSV</string>
5643
<key>CFBundleTypeRole</key>
5744
<string>QLGenerator</string>
5845
<key>LSItemContentTypes</key>
5946
<array>
60-
<string>com.apple.traditional-mac-plain-text</string>
47+
<string>public.comma-separated-values-text</string>
6148
</array>
62-
<key>LSTypeIsPackage</key>
63-
<false/>
6449
<key>NSPersistentStoreTypeKey</key>
6550
<string>XML</string>
6651
</dict>
@@ -76,9 +61,9 @@
7661
<key>CFBundleName</key>
7762
<string>${PRODUCT_NAME}</string>
7863
<key>CFBundleShortVersionString</key>
79-
<string>1.2</string>
64+
<string>1.3</string>
8065
<key>CFBundleVersion</key>
81-
<string>1.2</string>
66+
<string>1.3</string>
8267
<key>CFPlugInDynamicRegisterFunction</key>
8368
<string></string>
8469
<key>CFPlugInDynamicRegistration</key>
@@ -107,5 +92,51 @@
10792
<true/>
10893
<key>QLThumbnailMinimumSize</key>
10994
<real>17</real>
95+
<key>UTImportedTypeDeclarations</key>
96+
<array>
97+
<dict>
98+
<key>UTTypeConformsTo</key>
99+
<array>
100+
<string>public.text</string>
101+
</array>
102+
<key>UTTypeDescription</key>
103+
<string>Comma Separated Values</string>
104+
<key>UTTypeIdentifier</key>
105+
<string>public.comma-separated-values-text</string>
106+
<key>UTTypeReferenceURL</key>
107+
<string>http://tools.ietf.org/html/rfc4180</string>
108+
<key>UTTypeTagSpecification</key>
109+
<dict>
110+
<key>public.filename-extension</key>
111+
<array>
112+
<string>csv</string>
113+
</array>
114+
<key>public.mime-type</key>
115+
<string>text/csv</string>
116+
</dict>
117+
</dict>
118+
<dict>
119+
<key>UTTypeConformsTo</key>
120+
<array>
121+
<string>public.text</string>
122+
</array>
123+
<key>UTTypeDescription</key>
124+
<string>Tab Separated Values</string>
125+
<key>UTTypeIdentifier</key>
126+
<string>public.tab-separated-values-text</string>
127+
<key>UTTypeReferenceURL</key>
128+
<string>http://www.iana.org/assignments/media-types/text/tab-separated-values</string>
129+
<key>UTTypeTagSpecification</key>
130+
<dict>
131+
<key>public.filename-extension</key>
132+
<array>
133+
<string>tsv</string>
134+
<string>tab</string>
135+
</array>
136+
<key>public.mime-type</key>
137+
<string>text/tab-separated-values</string>
138+
</dict>
139+
</dict>
140+
</array>
110141
</dict>
111142
</plist>

QuickLookCSV.xcodeproj/project.pbxproj

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
8D5B49A804867FD3000E48DA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8D5B49A704867FD3000E48DA /* InfoPlist.strings */; };
1515
C86B05270671AA6E00DD9006 /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C86B05260671AA6E00DD9006 /* CoreServices.framework */; };
1616
EE77BE9C0FFEB3EA008B09DE /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = EE77BE9B0FFEB3EA008B09DE /* Localizable.strings */; };
17-
EE883107100141B9005590AE /* INSTALL.rtf in Resources */ = {isa = PBXBuildFile; fileRef = EE883106100141B9005590AE /* INSTALL.rtf */; };
1817
EEB3ED1C0FFE217E00B7462F /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EEB3ED1B0FFE217E00B7462F /* Cocoa.framework */; };
1918
EEB3EDCF0FFE38D800B7462F /* CSVDocument.h in Headers */ = {isa = PBXBuildFile; fileRef = EEB3EDCD0FFE38D800B7462F /* CSVDocument.h */; };
2019
EEB3EDD00FFE38D800B7462F /* CSVDocument.m in Sources */ = {isa = PBXBuildFile; fileRef = EEB3EDCE0FFE38D800B7462F /* CSVDocument.m */; };
@@ -42,6 +41,7 @@
4241
EE801DFD1637611700090402 /* testBig.csv */ = {isa = PBXFileReference; lastKnownFileType = text; name = testBig.csv; path = ../../../Desktop/CSV/testBig.csv; sourceTree = "<group>"; };
4342
EE801DFE163763E200090402 /* testMini.csv */ = {isa = PBXFileReference; lastKnownFileType = text; name = testMini.csv; path = Test/testMini.csv; sourceTree = "<group>"; };
4443
EE883106100141B9005590AE /* INSTALL.rtf */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; path = INSTALL.rtf; sourceTree = "<group>"; };
44+
EE89E06C16BDC64900B7E61A /* README.md */ = {isa = PBXFileReference; lastKnownFileType = text; path = README.md; sourceTree = "<group>"; };
4545
EEB3ED1B0FFE217E00B7462F /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
4646
EEB3EDCD0FFE38D800B7462F /* CSVDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSVDocument.h; sourceTree = "<group>"; };
4747
EEB3EDCE0FFE38D800B7462F /* CSVDocument.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CSVDocument.m; sourceTree = "<group>"; };
@@ -71,6 +71,8 @@
7171
089C166AFE841209C02AAC07 /* QuickLookCSV */ = {
7272
isa = PBXGroup;
7373
children = (
74+
EE89E06C16BDC64900B7E61A /* README.md */,
75+
EE883106100141B9005590AE /* INSTALL.rtf */,
7476
08FB77AFFE84173DC02AAC07 /* Source */,
7577
089C167CFE841241C02AAC07 /* Resources */,
7678
089C1671FE841209C02AAC07 /* External Frameworks and Libraries */,
@@ -94,7 +96,6 @@
9496
089C167CFE841241C02AAC07 /* Resources */ = {
9597
isa = PBXGroup;
9698
children = (
97-
EE883106100141B9005590AE /* INSTALL.rtf */,
9899
EE77BE9B0FFEB3EA008B09DE /* Localizable.strings */,
99100
EEB3EE850FFE513200B7462F /* Style.css */,
100101
8D576317048677EA00EA77CD /* Info.plist */,
@@ -197,7 +198,6 @@
197198
8D5B49A804867FD3000E48DA /* InfoPlist.strings in Resources */,
198199
EEB3EE860FFE513200B7462F /* Style.css in Resources */,
199200
EE77BE9C0FFEB3EA008B09DE /* Localizable.strings in Resources */,
200-
EE883107100141B9005590AE /* INSTALL.rtf in Resources */,
201201
);
202202
runOnlyForDeploymentPostprocessing = 0;
203203
};
@@ -215,7 +215,7 @@
215215
);
216216
runOnlyForDeploymentPostprocessing = 0;
217217
shellPath = /bin/sh;
218-
shellScript = "if [ 'Release' == $CONFIGURATION ]; then\n cd ~/Desktop\n mkdir \"QuickLook CSV\"\n\n cd \"QuickLook CSV\"\n ln -s ~/Library/QuickLook \"Plugins (User)\"\n ln -s /Library/QuickLook \"Plugins (System Wide)\"\n\n cp ${SRCROOT}/INSTALL.rtf ./\n \n mkdir \"Test Files\"\n cp ${SRCROOT}/Test/* \"Test Files\"\nfi";
218+
shellScript = "if [ 'Release' == $CONFIGURATION ]; then\n cd ~/Desktop\n if [ ! -e \"QuickLook CSV\" ]; then\n mkdir \"QuickLook CSV\"\n fi\n\n cd \"QuickLook CSV\"\n ln -s ~/Library/QuickLook \"Plugins (User)\"\n ln -s /Library/QuickLook \"Plugins (System Wide)\"\n\n cp ${SRCROOT}/INSTALL.rtf ./\n \n mkdir \"Test Files\"\n cp ${SRCROOT}/Test/* \"Test Files\"\nfi";
219219
};
220220
/* End PBXShellScriptBuildPhase section */
221221

QuickLookCSV.xcodeproj/project.xcworkspace/contents.xcworkspacedata

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

+7
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ Source & Issues
1818
The **source** is hosted on [Google Code][google] and [GitHub][], if you want to contribute please use GitHub and send me a pull request. For **issues** please use [GitHub][issues] as well.
1919

2020

21+
File Maker TSV Files
22+
--------------------
23+
24+
Some hacks were made in earlier versions to support FileMaker tab-separated-value files. Those hacks have been removed in Version 1.3. If this means your files no longer preview correctly, [download version 1.2][1.2] again, but please [let me know][issues].
25+
26+
2127
Screenshots
2228
-----------
2329

@@ -28,3 +34,4 @@ Screenshots
2834
[google]:http://code.google.com/p/quicklook-csv/
2935
[github]: https://github.com/p2/quicklook-csv
3036
[issues]: https://github.com/p2/quicklook-csv/issues
37+
[1.2]: http://code.google.com/p/quicklook-csv/downloads/detail?name=QuickLookCSV%201.2.dmg

svn-commit.tmp

-4
This file was deleted.

0 commit comments

Comments
 (0)