Skip to content

Commit cfb69fa

Browse files
committed
ongoing GNUstep port
1 parent eff3f90 commit cfb69fa

12 files changed

+82
-39
lines changed

ChangeLog

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
2011-02-06 Marcus Mueller <[email protected]>
2+
3+
* GNUmakefile*, *.[hm]: ported to GNUstep
4+
5+
* Info.plist: it's 2011 by now
6+
7+
* iTunesFileSystem.m: fixed an uninitialized variable access
8+
19
2011-01-29 Marcus Mueller <[email protected]>
210

311
* iTunesFSController.[hm]: removed. Added a new FUSEOFSAppController

GNUmakefile

+13-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ endif
1010

1111
include $(GNUSTEP_MAKEFILES)/common.make
1212

13+
14+
ifneq ($(FOUNDATION_LIB),apple)
15+
ADDITIONAL_CPPFLAGS += -DNO_OSX_ADDITIONS
16+
endif
17+
18+
1319
GNUSTEP_INSTALLATION_DOMAIN = LOCAL
1420

1521
APP_NAME = iTunesFS
@@ -18,7 +24,7 @@ iTunesFS_PRINCIPAL_CLASS = NSApplication
1824
iTunesFS_APPLICATION_ICON = iTunesFS.tiff
1925
iTunesFS_MAIN_MODEL_FILE = MainMenu.gorm
2026
iTunesFS_LANGUAGES = English German French Italian Spanish Japanese
21-
iTunesFS_SUBPROJECTS = FUSEOFS FUSEObjC-GNUstep
27+
iTunesFS_SUBPROJECTS = FUSEOFS
2228

2329
iTunesFS_OBJC_PRECOMPILED_HEADERS = common.h
2430

@@ -27,18 +33,24 @@ iTunesFS_OBJC_FILES += \
2733
\
2834
iTunesLibrary.m \
2935
iPodLibrary.m \
36+
JBiPodLibrary.m \
3037
iTunesPlaylist.m \
3138
iTunesTrack.m \
39+
iTunesFormatFile.m \
3240
iTunesFSFormatter.m \
3341
\
3442
Watchdog.m \
3543
\
44+
StreamReader.m \
3645
NSString+Extensions.m \
3746
NSURL+Extensions.m \
47+
NSData+ZlibDecompression.m \
3848

3949
iTunesFS_LOCALIZED_RESOURCE_FILES += \
4050
MainMenu.gorm \
4151
Localizable.strings \
52+
AlbumsTrackFormat.txt \
53+
PlaylistsTrackFormat.txt \
4254

4355
iTunesFS_RESOURCE_FILES += \
4456
iTunesFS.tiff \

GNUmakefile.preamble

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@
22

33
ADDITIONAL_GUI_LIBS += -lfuse
44

5-
ADDITIONAL_INCLUDE_DIRS += -IFUSEOFS -IFUSEObjC-GNUstep
5+
ADDITIONAL_INCLUDE_DIRS += -IFUSEOFS -IFUSEOFS/GSFUSE
6+
7+
ADDITIONAL_CPPFLAGS += -std=c99

Info.plist

+15-17
Original file line numberDiff line numberDiff line change
@@ -24,46 +24,44 @@
2424
<string>????</string>
2525
<key>CFBundleVersion</key>
2626
<string>1.2.0</string>
27-
<key>FUSEFileSystemClass</key>
28-
<string>iTunesFileSystem</string>
2927
<key>LSUIElement</key>
3028
<string>1</string>
3129
<key>NSHumanReadableCopyright</key>
32-
<string>Copyright 2007-2010 Mulle kybernetiK.</string>
30+
<string>Copyright 2007-2011 Mulle kybernetiK.</string>
3331
<key>NSMainNibFile</key>
3432
<string>MainMenu</string>
3533
<key>NSPrincipalClass</key>
3634
<string>NSApplication</string>
3735
<key>NSUserDefaults</key>
3836
<dict>
39-
<key>FUSEObjectFileSystemClass</key>
40-
<string>iTunesFileSystem</string>
37+
<key>AlbumsTrackFormat</key>
38+
<string>%(name).%(ext.lowercaseString)</string>
39+
<key>AutoOpenInFinder</key>
40+
<true/>
4141
<key>FUSEMountName</key>
4242
<string>iTunesFS</string>
4343
<key>FUSEMountPath</key>
4444
<string>/Volumes/iTunesFS</string>
45-
<key>NoIPods</key>
46-
<false/>
47-
<key>AutoOpenInFinder</key>
48-
<true/>
49-
<key>SymbolicLinks</key>
45+
<key>FUSEObjectFileSystemClass</key>
46+
<string>iTunesFileSystem</string>
47+
<key>iPodLibraryDebugEnabled</key>
5048
<false/>
51-
<key>UseCategories</key>
52-
<true/>
5349
<key>iTunesFileSystemDebugEnabled</key>
5450
<false/>
5551
<key>iTunesFSDebugPathLookup</key>
5652
<false/>
57-
<key>iPodLibraryDebugEnabled</key>
53+
<key>NoIPods</key>
5854
<false/>
59-
<key>ShowFormatFiles</key>
60-
<true/>
61-
<key>AlbumsTrackFormat</key>
62-
<string>%(name).%(ext.lowercaseString)</string>
6355
<key>PlaylistsTrackFormat</key>
6456
<string>%(playlistNumber#000) %(name).%(ext.lowercaseString)</string>
6557
<key>PlaylistsTrackFormat[folders]</key>
6658
<string>%(artist) / %(album) / %(trackNumber#00) %(name).%(ext.lowercaseString)</string>
59+
<key>ShowFormatFiles</key>
60+
<true/>
61+
<key>SymbolicLinks</key>
62+
<false/>
63+
<key>UseCategories</key>
64+
<true/>
6765
</dict>
6866
</dict>
6967
</plist>

StreamReader.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,4 +120,4 @@ - (void)seekToOffset:(unsigned long long)_offset {
120120
self->offset = _offset;
121121
}
122122

123-
@end // FileHandleStreamReader
123+
@end // FileHandleStreamReader

common.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
#define __iTunesFS_common_H_
3535

3636
#ifdef __OBJC__
37-
#import <Cocoa/Cocoa.h>
38-
#import <MacFUSE/MacFUSE.h>
37+
#import <Foundation/Foundation.h>
38+
#import "FUSESupport.h"
3939
#endif
4040

4141
#endif /* __iTunesFS_common_H_ */

iPodLibrary.m

+7-1
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,11 @@ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
3737
#import "NSObject+FUSEOFS.h"
3838
#import "iTunesPlaylist.h"
3939
#import "iTunesTrack.h"
40-
#import "NSImage+IconData.h"
4140
#import "NSData+ZlibDecompression.h"
4241
#import "StreamReader.h"
42+
#ifndef GNU_GUI_LIBRARY
43+
#import "NSImage+IconData.h"
44+
#endif
4345

4446
#if __LP64__ || NS_BUILD_32_LIKE_64
4547
typedef unsigned int ITDBUInt32;
@@ -570,7 +572,11 @@ - (NSString *)mountPoint {
570572

571573
- (NSData *)iconData {
572574
NSImage *icon = [[NSWorkspace sharedWorkspace] iconForFile:self->mountPoint];
575+
#ifndef GNU_GUI_LIBRARY
573576
return [icon icnsDataWithWidth:512];
577+
#else
578+
return [icon TIFFRepresentation];
579+
#endif
574580
}
575581

576582
@end /* iPodLibrary */

iTunesFS.xcodeproj/project.pbxproj

+23-15
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,15 @@
7474
AD37A2960C01C87E00DF1291 /* iTunesLibrary.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; path = iTunesLibrary.m; sourceTree = "<group>"; tabWidth = 2; usesTabs = 0; };
7575
AD37A2BE0C01CFA800DF1291 /* README */ = {isa = PBXFileReference; explicitFileType = text; fileEncoding = 4; lineEnding = 0; path = README; sourceTree = "<group>"; };
7676
AD37A2C20C01CFB400DF1291 /* NOTES */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = NOTES; sourceTree = "<group>"; };
77+
AD4C4ED912FDCAF90057C045 /* GMUserFileSystem.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = GMUserFileSystem.h; sourceTree = "<group>"; tabWidth = 2; usesTabs = 0; };
78+
AD4C4EDA12FDCAF90057C045 /* GMUserFileSystem.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; path = GMUserFileSystem.m; sourceTree = "<group>"; tabWidth = 2; usesTabs = 0; };
79+
AD4C4EDB12FDCAF90057C045 /* GNUmakefile */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; indentWidth = 8; path = GNUmakefile; sourceTree = "<group>"; tabWidth = 8; };
80+
AD4C4EDD12FDCC7A0057C045 /* GSFUSE.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GSFUSE.h; sourceTree = "<group>"; };
81+
AD4C4EE812FDCD690057C045 /* FUSESupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FUSESupport.h; sourceTree = "<group>"; };
82+
AD4C4F2512FF0E050057C045 /* GMDataBackedFileDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = GMDataBackedFileDelegate.h; sourceTree = "<group>"; tabWidth = 2; usesTabs = 0; };
83+
AD4C4F2612FF0E050057C045 /* GMDataBackedFileDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; path = GMDataBackedFileDelegate.m; sourceTree = "<group>"; tabWidth = 2; usesTabs = 0; };
84+
AD4C4F2712FF0E050057C045 /* GMDTrace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GMDTrace.h; sourceTree = "<group>"; };
7785
AD5A40700C214A1900B1A000 /* README-GNUstep */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = "README-GNUstep"; sourceTree = "<group>"; };
78-
AD5A407E0C214FCB00B1A000 /* FUSEFileSystem.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = FUSEFileSystem.h; sourceTree = "<group>"; };
79-
AD5A407F0C214FCB00B1A000 /* FUSEFileSystem.m */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.objc; path = FUSEFileSystem.m; sourceTree = "<group>"; };
80-
AD5A40800C214FCB00B1A000 /* FUSEMain.m */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.objc; path = FUSEMain.m; sourceTree = "<group>"; };
81-
AD5A40810C214FCB00B1A000 /* GNUmakefile */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 5; path = GNUmakefile; sourceTree = "<group>"; tabWidth = 8; };
8286
AD5A40820C214FCB00B1A000 /* GNUmakefile */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 5; indentWidth = 8; path = GNUmakefile; sourceTree = "<group>"; tabWidth = 8; };
8387
AD5A40830C214FCB00B1A000 /* GNUmakefile.preamble */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 5; indentWidth = 8; path = GNUmakefile.preamble; sourceTree = "<group>"; tabWidth = 8; };
8488
AD5B5E7A0C0C1A70003B1650 /* NSObject+FUSEOFS.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = "NSObject+FUSEOFS.h"; sourceTree = "<group>"; tabWidth = 2; usesTabs = 0; };
@@ -154,7 +158,6 @@
154158
08FB7795FE84155DC02AAC07 /* iTunesFS */,
155159
AD5A407C0C214FAA00B1A000 /* GNUstep */,
156160
7FEA82C10B456A36001441DE /* Resources */,
157-
AD5A407D0C214FCB00B1A000 /* FUSEObjC-GNUstep */,
158161
ADBDAB040C02F664004CF795 /* Scripts */,
159162
AD95D4090C21C7AF00B96A36 /* examples */,
160163
08FB779DFE84155DC02AAC07 /* External Frameworks and Libraries */,
@@ -226,6 +229,7 @@
226229
isa = PBXGroup;
227230
children = (
228231
AD0073DC12F0131500E05C0D /* ChangeLog */,
232+
AD4C4EE812FDCD690057C045 /* FUSESupport.h */,
229233
AD5B5E7A0C0C1A70003B1650 /* NSObject+FUSEOFS.h */,
230234
AD5B5E7B0C0C1A70003B1650 /* NSObject+FUSEOFS.m */,
231235
AD0A21B512F44D3500339646 /* FUSEOFSAppController.h */,
@@ -247,24 +251,27 @@
247251
path = FUSEOFS;
248252
sourceTree = "<group>";
249253
};
250-
AD5A407C0C214FAA00B1A000 /* GNUstep */ = {
254+
AD4C4EDC12FDCB080057C045 /* GSFUSE */ = {
251255
isa = PBXGroup;
252256
children = (
253-
AD5A40820C214FCB00B1A000 /* GNUmakefile */,
254-
AD5A40830C214FCB00B1A000 /* GNUmakefile.preamble */,
257+
AD4C4EDB12FDCAF90057C045 /* GNUmakefile */,
258+
AD4C4F2712FF0E050057C045 /* GMDTrace.h */,
259+
AD4C4EDD12FDCC7A0057C045 /* GSFUSE.h */,
260+
AD4C4ED912FDCAF90057C045 /* GMUserFileSystem.h */,
261+
AD4C4EDA12FDCAF90057C045 /* GMUserFileSystem.m */,
262+
AD4C4F2512FF0E050057C045 /* GMDataBackedFileDelegate.h */,
263+
AD4C4F2612FF0E050057C045 /* GMDataBackedFileDelegate.m */,
255264
);
256-
name = GNUstep;
265+
path = GSFUSE;
257266
sourceTree = "<group>";
258267
};
259-
AD5A407D0C214FCB00B1A000 /* FUSEObjC-GNUstep */ = {
268+
AD5A407C0C214FAA00B1A000 /* GNUstep */ = {
260269
isa = PBXGroup;
261270
children = (
262-
AD5A40810C214FCB00B1A000 /* GNUmakefile */,
263-
AD5A407E0C214FCB00B1A000 /* FUSEFileSystem.h */,
264-
AD5A407F0C214FCB00B1A000 /* FUSEFileSystem.m */,
265-
AD5A40800C214FCB00B1A000 /* FUSEMain.m */,
271+
AD5A40820C214FCB00B1A000 /* GNUmakefile */,
272+
AD5A40830C214FCB00B1A000 /* GNUmakefile.preamble */,
266273
);
267-
path = "FUSEObjC-GNUstep";
274+
name = GNUstep;
268275
sourceTree = "<group>";
269276
};
270277
AD81186F0F093D85000786C9 /* filesystems-objc-support */ = {
@@ -314,6 +321,7 @@
314321
isa = PBXGroup;
315322
children = (
316323
ADDCD76C0C26A6640031B215 /* GNUmakefile */,
324+
AD4C4EDC12FDCB080057C045 /* GSFUSE */,
317325
);
318326
name = GNUstep;
319327
sourceTree = "<group>";

iTunesFileSystem.m

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
3232

3333
#import "common.h"
3434
#import "iTunesFileSystem.h"
35+
#import "AppKit/AppKit.h"
3536
#import "iTunesLibrary.h"
3637
#import "iPodLibrary.h"
3738
#import "JBiPodLibrary.h"
@@ -260,7 +261,7 @@ - (void)didUnmountRemovableDevice:(NSNotification *)_notif {
260261
path = [[_notif userInfo] objectForKey:@"NSDevicePath"];
261262
lib = [self->volMap objectForKey:path];
262263
if (lib) {
263-
BOOL prevShowLibraries;
264+
BOOL prevShowLibraries = [self showLibraries];
264265

265266
if (doDebug)
266267
NSLog(@"Will remove library for unmounted iPod at path: %@", path);

iTunesFormatFile.m

+2
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ - (NSData *)fileContents {
228228
return [super fileContents];
229229
}
230230

231+
#ifndef NO_OSX_ADDITIONS
231232
- (NSDictionary *)extendedFileAttributes {
232233
if (!self->extAttrs) {
233234
static NSData *attrVal = nil;
@@ -244,5 +245,6 @@ - (NSDictionary *)extendedFileAttributes {
244245
}
245246
return [super extendedFileAttributes];
246247
}
248+
#endif
247249

248250
@end /* iTunesFormatFile */

iTunesLibrary.m

+2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
3939
#import "Watchdog.h"
4040
#import "NSObject+FUSEOFS.h"
4141
#import "iTunesFSFormatter.h"
42+
#ifndef GNU_GUI_LIBRARY
4243
#import "NSImage+IconData.h"
44+
#endif
4345

4446
@implementation iTunesLibrary
4547

iTunesTrack.m

+4
Original file line numberDiff line numberDiff line change
@@ -289,9 +289,13 @@ - (NSData *)fileContents {
289289
return [[self->url description] dataUsingEncoding:NSUTF8StringEncoding];
290290
}
291291
path = [self->url properlyEscapedPath];
292+
#if ! GNUSTEP_BASE_LIBRARY
292293
return [NSData dataWithContentsOfFile:path
293294
options:NSUncachedRead
294295
error:NULL];
296+
#else
297+
return [NSData dataWithContentsOfFile:path];
298+
#endif
295299
}
296300

297301
- (NSDictionary *)resourceAttributes {

0 commit comments

Comments
 (0)