Tiny bit of tidy up.
This commit is contained in:
parent
dac909cd3a
commit
ca9df1a6c0
|
@ -24,7 +24,7 @@
|
||||||
isa = PBXContainerItemProxy;
|
isa = PBXContainerItemProxy;
|
||||||
containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;
|
containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;
|
||||||
proxyType = 1;
|
proxyType = 1;
|
||||||
remoteGlobalIDString = D4A4962A105419AA00BE38AE /* libunrar */;
|
remoteGlobalIDString = D4A4962A105419AA00BE38AE;
|
||||||
remoteInfo = libunrar;
|
remoteInfo = libunrar;
|
||||||
};
|
};
|
||||||
/* End PBXContainerItemProxy section */
|
/* End PBXContainerItemProxy section */
|
||||||
|
|
|
@ -229,8 +229,6 @@
|
||||||
<key>Layout</key>
|
<key>Layout</key>
|
||||||
<array>
|
<array>
|
||||||
<dict>
|
<dict>
|
||||||
<key>BecomeActive</key>
|
|
||||||
<true/>
|
|
||||||
<key>ContentConfiguration</key>
|
<key>ContentConfiguration</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>PBXBottomSmartGroupGIDs</key>
|
<key>PBXBottomSmartGroupGIDs</key>
|
||||||
|
@ -275,6 +273,7 @@
|
||||||
<key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>
|
<key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>
|
||||||
<array>
|
<array>
|
||||||
<array>
|
<array>
|
||||||
|
<integer>17</integer>
|
||||||
<integer>16</integer>
|
<integer>16</integer>
|
||||||
</array>
|
</array>
|
||||||
</array>
|
</array>
|
||||||
|
@ -298,7 +297,7 @@
|
||||||
<real>150</real>
|
<real>150</real>
|
||||||
</array>
|
</array>
|
||||||
<key>RubberWindowFrame</key>
|
<key>RubberWindowFrame</key>
|
||||||
<string>4 55 1276 723 0 0 1280 778 </string>
|
<string>6 55 1276 723 0 0 1280 778 </string>
|
||||||
</dict>
|
</dict>
|
||||||
<key>Module</key>
|
<key>Module</key>
|
||||||
<string>PBXSmartGroupTreeModule</string>
|
<string>PBXSmartGroupTreeModule</string>
|
||||||
|
@ -309,6 +308,8 @@
|
||||||
<key>Dock</key>
|
<key>Dock</key>
|
||||||
<array>
|
<array>
|
||||||
<dict>
|
<dict>
|
||||||
|
<key>BecomeActive</key>
|
||||||
|
<true/>
|
||||||
<key>ContentConfiguration</key>
|
<key>ContentConfiguration</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>PBXProjectModuleGUID</key>
|
<key>PBXProjectModuleGUID</key>
|
||||||
|
@ -326,7 +327,7 @@
|
||||||
<key>_historyCapacity</key>
|
<key>_historyCapacity</key>
|
||||||
<integer>0</integer>
|
<integer>0</integer>
|
||||||
<key>bookmark</key>
|
<key>bookmark</key>
|
||||||
<string>D488BF3010B1B64800B3451C</string>
|
<string>D488BFA310B1F66B00B3451C</string>
|
||||||
<key>history</key>
|
<key>history</key>
|
||||||
<array>
|
<array>
|
||||||
<string>D4A4963610541A1C00BE38AE</string>
|
<string>D4A4963610541A1C00BE38AE</string>
|
||||||
|
@ -360,7 +361,7 @@
|
||||||
<key>Frame</key>
|
<key>Frame</key>
|
||||||
<string>{{0, 0}, {1104, 618}}</string>
|
<string>{{0, 0}, {1104, 618}}</string>
|
||||||
<key>RubberWindowFrame</key>
|
<key>RubberWindowFrame</key>
|
||||||
<string>4 55 1276 723 0 0 1280 778 </string>
|
<string>6 55 1276 723 0 0 1280 778 </string>
|
||||||
</dict>
|
</dict>
|
||||||
<key>Module</key>
|
<key>Module</key>
|
||||||
<string>PBXNavigatorGroup</string>
|
<string>PBXNavigatorGroup</string>
|
||||||
|
@ -380,7 +381,7 @@
|
||||||
<key>Frame</key>
|
<key>Frame</key>
|
||||||
<string>{{0, 623}, {1104, 59}}</string>
|
<string>{{0, 623}, {1104, 59}}</string>
|
||||||
<key>RubberWindowFrame</key>
|
<key>RubberWindowFrame</key>
|
||||||
<string>4 55 1276 723 0 0 1280 778 </string>
|
<string>6 55 1276 723 0 0 1280 778 </string>
|
||||||
</dict>
|
</dict>
|
||||||
<key>Module</key>
|
<key>Module</key>
|
||||||
<string>XCDetailModule</string>
|
<string>XCDetailModule</string>
|
||||||
|
@ -548,13 +549,13 @@
|
||||||
<string>D488BD7710AF722600B3451C</string>
|
<string>D488BD7710AF722600B3451C</string>
|
||||||
<string>D488B03D10AF1C2900B3451C</string>
|
<string>D488B03D10AF1C2900B3451C</string>
|
||||||
<string>D488B03E10AF1C2900B3451C</string>
|
<string>D488B03E10AF1C2900B3451C</string>
|
||||||
<string>1C78EAAD065D492600B07095</string>
|
|
||||||
<string>1CD10A99069EF8BA00B06720</string>
|
<string>1CD10A99069EF8BA00B06720</string>
|
||||||
<string>D4A49630105419F700BE38AE</string>
|
<string>D4A49630105419F700BE38AE</string>
|
||||||
|
<string>1C78EAAD065D492600B07095</string>
|
||||||
<string>/Users/rob/Programming/Projects - Mine/QuietUnrar/QuietUnrar.xcodeproj</string>
|
<string>/Users/rob/Programming/Projects - Mine/QuietUnrar/QuietUnrar.xcodeproj</string>
|
||||||
</array>
|
</array>
|
||||||
<key>WindowString</key>
|
<key>WindowString</key>
|
||||||
<string>4 55 1276 723 0 0 1280 778 </string>
|
<string>6 55 1276 723 0 0 1280 778 </string>
|
||||||
<key>WindowToolsV3</key>
|
<key>WindowToolsV3</key>
|
||||||
<array>
|
<array>
|
||||||
<dict>
|
<dict>
|
||||||
|
@ -927,7 +928,7 @@
|
||||||
<key>WindowToolGUID</key>
|
<key>WindowToolGUID</key>
|
||||||
<string>1C78EAAD065D492600B07095</string>
|
<string>1C78EAAD065D492600B07095</string>
|
||||||
<key>WindowToolIsVisible</key>
|
<key>WindowToolIsVisible</key>
|
||||||
<false/>
|
<true/>
|
||||||
</dict>
|
</dict>
|
||||||
<dict>
|
<dict>
|
||||||
<key>Identifier</key>
|
<key>Identifier</key>
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -84,32 +84,38 @@ int callbackFunction(UINT message, LPARAM userData, LPARAM parameterOne, LPARAM
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)application:(NSApplication *)theApplication openFiles:(NSArray *) arrayOfFilenames {
|
||||||
|
// NSLog(@"openFiles: %@", arrayOfFilenames);
|
||||||
|
|
||||||
|
for (NSString * filename in arrayOfFilenames) {
|
||||||
|
[self extractRarWith:filename];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#pragma mark "Main"
|
#pragma mark "Main"
|
||||||
- (BOOL) extractRarWith:(NSString *) filename {
|
- (BOOL) extractRarWith:(NSString *) filename {
|
||||||
quietUnrar = (void *) self;
|
quietUnrar = (void *) self;
|
||||||
char commentBuffer[BUF_LEN];
|
char commentBuffer[BUF_LEN];
|
||||||
BOOL extractionSuccessful = YES;
|
BOOL extractionSuccessful = YES;
|
||||||
|
struct RARHeaderData headerData;
|
||||||
|
NSString * lastExtractedFilename = @"";
|
||||||
|
NSString * currentFilename;
|
||||||
|
|
||||||
//Determine the folder we should extract the archive to. This by default
|
//Determine the folder we should extract the archive to. This by default
|
||||||
//is the <folderContainingTheArchive>/<archiveNameWithPathExtension>
|
//is the <folderContainingTheArchive>/<archiveNameWithPathExtension>
|
||||||
NSString * folderToExtractTo = [filename stringByDeletingPathExtension];
|
NSString * folderToExtractTo = [filename stringByDeletingPathExtension];
|
||||||
|
|
||||||
char * filenameCString = (char *)[filename cStringUsingEncoding:NSISOLatin1StringEncoding];
|
|
||||||
|
|
||||||
// Open the Archive for extraction, we set the open result to 3 so we can see it has changed
|
// Open the Archive for extraction, we set the open result to 3 so we can see it has changed
|
||||||
|
char * filenameCString = (char *)[filename cStringUsingEncoding:NSISOLatin1StringEncoding];
|
||||||
struct RAROpenArchiveData arcData = { filenameCString, RAR_OM_EXTRACT, 3, &commentBuffer[0], BUF_LEN, 0, 0};
|
struct RAROpenArchiveData arcData = { filenameCString, RAR_OM_EXTRACT, 3, &commentBuffer[0], BUF_LEN, 0, 0};
|
||||||
|
|
||||||
HANDLE archive = RAROpenArchive(&arcData);
|
HANDLE archive = RAROpenArchive(&arcData);
|
||||||
//NSLog(@"Opening Archive %s with result %d", filenameCString, arcData.OpenResult);
|
//NSLog(@"Opening Archive %s with result %d", filenameCString, arcData.OpenResult);
|
||||||
|
|
||||||
// set call backs for if password needed or need to change volume
|
// set call backs for if password needed or need to change volume
|
||||||
RARSetChangeVolProc(archive, &changeVolume);
|
RARSetChangeVolProc(archive, &changeVolume);
|
||||||
RARSetCallback(archive, &callbackFunction, (LPARAM)archive);
|
RARSetCallback(archive, &callbackFunction, (LPARAM)archive);
|
||||||
|
|
||||||
//
|
|
||||||
struct RARHeaderData headerData;
|
|
||||||
NSString * lastExtractedFilename = @"";
|
|
||||||
NSString * currentFilename;
|
|
||||||
|
|
||||||
while (RARReadHeader(archive, &headerData) != ERAR_END_ARCHIVE) {
|
while (RARReadHeader(archive, &headerData) != ERAR_END_ARCHIVE) {
|
||||||
//NSLog(@"Attempting to extract %s to %@", headerData.FileName, folderToExtractTo);
|
//NSLog(@"Attempting to extract %s to %@", headerData.FileName, folderToExtractTo);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue