Skip to content

Commit

Permalink
Added source code
Browse files Browse the repository at this point in the history
  • Loading branch information
AmigaAbattoir committed Oct 9, 2019
1 parent 6659c9d commit f3a9e5f
Show file tree
Hide file tree
Showing 33 changed files with 3,057 additions and 1 deletion.
30 changes: 30 additions & 0 deletions .gitignore
@@ -0,0 +1,30 @@
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

## User settings
xcuserdata/

## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
*.xcscmblueprint
*.xccheckout

## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
build/
DerivedData/
*.moved-aside
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3

## Gcc Patch
/*.gcno

## OSX
.DS_Store

8 changes: 7 additions & 1 deletion README.md
@@ -1,2 +1,8 @@
# ZipCleaner
Recompile of Zip Cleaner from https://roger-jolly.nl/software/ for 64bit MacOS

Recompile of [Zip Cleaner](https://roger-jolly.nl/software/index.html#zipcleaner) from https://roger-jolly.nl/software/ for 64bit MacOS.

## Changes

* Requires Mac OS X 10.6+
* 64bit only
Binary file not shown.
48 changes: 48 additions & 0 deletions ZipCleaner source/ZipCleaner source Read me.rtfd/TXT.rtf
@@ -0,0 +1,48 @@
{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410
{\fonttbl\f0\fswiss\fcharset77 Helvetica;\f1\froman\fcharset77 Palatino-Italic;\f2\froman\fcharset77 Palatino-Bold;
\f3\froman\fcharset77 Palatino-Roman;}
{\colortbl;\red255\green255\blue255;}
\paperw11900\paperh16840\margl1440\margr1440\vieww9000\viewh8400\viewkind0
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\qc\pardirnatural

\f0\fs24 \cf0 {{\NeXTGraphic Pasted Graphic 6.tiff \width960 \height960
}¬}\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\qc\pardirnatural

\f1\i \cf0 \
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc
\f2\i0\b\fs48 \cf0 ZipCleaner 1.0 source-code
\f3\b0\fs24 \
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
\cf0 July 2007\
\

\f2\b About ZipCleaner
\f3\b0 \
ZipCleaner is a program that allows you to remove .DS_Store files and other resource information from zip-archives created by the Finder.\
\
I wrote this application mainly to help me figure out how to make a "droplet" program in objective-c and cocoa. As I often exchange zip-archives with less fortunate people, i.e. not using Macs, and dislike giving them files with a lot of "garbage" in them after unzipping, this seemed like a nice exercise.\
\
While writing this, I profited a lot from the source-code and snippets other people had made available. It seems only fair, I should do the same.\
\

\f2\b Price
\f3\b0 \
ZipCleaner and its source-code are free. If you feel they are worth something and you want to spend some money, donate it to your favourite charity. When you haven't got one, might I suggest Amnesty International? (Please note, Amnesty International has absolutely no connection with or responsibility for this application and can be blamed even less than I for what you do to your system with it.)\
\

\f2\b Author
\f3\b0 \
ZipCleaner was written by Roger Jolly. As I'm still learning objective-c / cocoa application, chances are some things could have been done a lot smarter. If you have any suggestions, comments or whatever, I would like to hear from you. You can mail me at {\field{\*\fldinst{HYPERLINK "mailto:roger_jolly@mac.com"}}{\fldrslt Roger_Jolly@mac.com}}.\
\

\f2\b Legal stuff
\f3\b0 \
Copyright 2007, Roger Jolly.\
\
Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.\
\
The software is provided "as is" and the author disclaims all warranties with regard to this software including all implied warranties of merchantability and fitness. in no event shall the author be liable for any special, direct, indirect, or consequential damages or any damages whatsoever resulting from loss of use, data or profits, whether in an action of contract, negligence or other tortious action, arising out of or in connection with the use or performance of this software.\
\
Any and all trademarks mentioned in this document belong to their respective owners. They too, are not responsible for anything you let ZipCleaner do to you.\
}
115 changes: 115 additions & 0 deletions ZipCleaner source/ZipCleaner source/Controller.h
@@ -0,0 +1,115 @@
//
// Controller.h
// ZipCleaner
//
// Copyright 2007, Roger Jolly.
//
//
// Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// The software is provided "as is" and the author disclaims all warranties with regard to this software including all implied warranties of
// merchantability and fitness. in no event shall the author be liable for any special, direct, indirect, or consequential damages or any damages
// whatsoever resulting from loss of use, data or profits, whether in an action of contract, negligence or other tortious action, arising out of
// or in connection with the use or performance of this software.

#import <Cocoa/Cocoa.h>
#import "NSEvent-CarbonAdditions.h"

typedef enum modifier_Keys {
modifierCommand = 1,
modifierControl = 2,
modifierOption = 3,
modifierShift = 4
} modifierKeys;

extern NSString *PREFwarnResourceFiles;
extern NSString *PREFkeyDS_Store;
extern NSString *PREFwarnDS_Store;
extern NSString *PREFreportSuccess;
extern int PREFshowProgressIndicatorBottomLimit;

typedef enum default_pref_values {
warnResourceFilesPrefValue = 1,
keyDS_Store = modifierOption,
warnDS_StorePrefValue = 0,
reportSuccessPrefValue = 0,
} defaultPrefValues;


@interface Controller : NSObject
{
IBOutlet NSTextField *fileNameProgressIndicator;
IBOutlet NSPopUpButton *prefKeyDS_Store;
IBOutlet NSButton *prefReportSuccess, *prefWarnDS_Store, *prefWarnResourceFiles;
IBOutlet NSProgressIndicator *progressIndicator;
IBOutlet NSWindow *detailsWindow, *dropWindow, *windowProgressIndicator;
IBOutlet NSTextView *detailsTextView;
IBOutlet NSTextField *dropInfoText, *progressIndicatorText;
IBOutlet NSView *openPanelAccessoryView;
NSMutableSet *waitingList;
NSMutableArray *cleaningDetails;
NSString *pathToZip;
NSWindow *cleaningDoneWindow;
NSAlert *anAlert;
BOOL busyCleaning, quitWhenDone, showProgressIndicator;
}

#pragma mark-
#pragma mark Starting up and shutting down
+ (void) initialize;
- (id) init;
- (void) awakeFromNib;
- (void) dealloc;

#pragma mark-
#pragma mark Accessors
- (void) setBusyCleaning: (BOOL) aBool;
- (BOOL) busyCleaning;
- (void) setShowProgressIndicator: (BOOL) aBool;
- (BOOL) showProgressIndicator;
- (void) setQuitWhenDone: (BOOL) aBool;
- (BOOL) quitWhenDone;

#pragma mark-
#pragma mark Main methods
- (IBAction) open: (id) sender;
- (void) setUpFiles: (NSArray *) filenames removingOnlyDS_Store: (BOOL) removeOnlyDS_Store;
- (void) addToWaitingList: (NSArray *) filenames removingOnlyDS_Store: (BOOL) removeOnlyDS_Store;
- (NSArray *) produceCompleteFileListfromList: (NSArray *) fileList;
- (void) processFile;
- (BOOL) continueAfterPreprocessing: (NSString *) aFile;
- (void) clearFile: (NSString *) aFile removingOnlyDS_Store: (BOOL) removeOnlyDS_Store;
- (IBAction) stopCleaning: (id) sender;
- (void) cleaningFinished: (NSNotification *) note;
- (void) alertDidEnd: (NSAlert *) alert returnCode: (int) returnCode contextInfo: (void *) contextInfo;

#pragma mark-
#pragma mark Check conditions
- (BOOL) removeOnlyDS_Store;
- (BOOL) continueAfterWarning: (BOOL) removeOnlyDS_Store;
- (NSString *) pathToZip;

#pragma mark-
#pragma mark Details methods
- (void) clearDetailsInfo;
- (void) appendToDetailsInfo: (NSString *) details forFile: (NSString *) aFile;
- (void) showDetails;

- (void) reformulateErrorMessage: (NSMutableString *) errorMessage;

#pragma mark-
#pragma mark Preferences methods
- (IBAction) prefChanged: (id) sender;
- (IBAction) prefRestore: (id) sender;

#pragma mark-
#pragma mark Application delegate
- (BOOL) applicationOpenUntitledFile: (NSApplication *) theApplication;
- (void) application: (NSApplication *) sender openFiles: (NSArray *) filenames;

@end

@interface NSMutableArray (ZipCleaner)
- (void) removeDuplicates;
@end

0 comments on commit f3a9e5f

Please sign in to comment.