Skip to content
This repository
Browse code

initial commit

  • Loading branch information...
commit 72032cc7179262d1e255f559db9e4278d6ccb040 0 parents
Jacob Bandes-Storch authored August 31, 2009
14  .gitignore
... ...
@@ -0,0 +1,14 @@
  1
+# From http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
  2
+
  3
+.DS_Store
  4
+*.swp
  5
+*~.nib
  6
+
  7
+build/
  8
+
  9
+*.pbxuser
  10
+*.perspective
  11
+*.perspectivev3
  12
+
  13
+*.mode1v3
  14
+*.mode2v3
17  DIAppController.h
... ...
@@ -0,0 +1,17 @@
  1
+//
  2
+//  DIAppController.h
  3
+//  Delete Immediately
  4
+//
  5
+//  Created by Jacob Bandes-Storch on 8/30/09.
  6
+//
  7
+
  8
+#import <Cocoa/Cocoa.h>
  9
+
  10
+@interface DIAppController : NSObject <NSApplicationDelegate> {
  11
+
  12
+}
  13
+
  14
+- (void)deleteImmediately:(NSPasteboard *)pasteboard
  15
+				 userData:(NSString *)userData
  16
+					error:(NSString **)error;
  17
+@end
74  DIAppController.m
... ...
@@ -0,0 +1,74 @@
  1
+//
  2
+//  DIAppController.m
  3
+//  Delete Immediately
  4
+//
  5
+//  Created by Jacob Bandes-Storch on 8/30/09.
  6
+//
  7
+
  8
+#import "DIAppController.h"
  9
+
  10
+@implementation DIAppController
  11
+
  12
+- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
  13
+	[NSApp setServicesProvider:self];
  14
+}
  15
+
  16
+- (void)deleteImmediately:(NSPasteboard *)pasteboard
  17
+				 userData:(NSString *)userData
  18
+					error:(NSString **)error {
  19
+	NSArray *items = nil;
  20
+	NSArray *urlItems = [pasteboard readObjectsForClasses:[NSArray arrayWithObject:[NSURL class]]
  21
+												  options:[NSDictionary dictionaryWithObject:[NSNumber numberWithBool:YES]
  22
+																					  forKey:NSPasteboardURLReadingFileURLsOnlyKey]];
  23
+	NSMutableArray *new = [NSMutableArray array];
  24
+	for (NSURL *url in urlItems) {
  25
+		[new addObject:[url path]];
  26
+	}
  27
+	items = new;
  28
+	if (items && [items count] > 0) {
  29
+		NSString *messageText;
  30
+		NSString *infoText = NSLocalizedString(@"INFO_SINGLE", @"Deletion info (singular)");
  31
+		if  ([items count] > 1) {
  32
+			infoText = NSLocalizedString(@"INFO_MULTIPLE", @"Deletion info (plural)");
  33
+			messageText = NSLocalizedString(@"CONFIRM_DELETE_MULTIPLE", @"Confirm multiple file deletion");
  34
+		} else {
  35
+			messageText = [NSString stringWithFormat:
  36
+						   NSLocalizedString(@"CONFIRM_DELETE_SINGLE", @"Confirm single file deletion (with name)"),
  37
+						   [[NSFileManager defaultManager] displayNameAtPath:[items objectAtIndex:0]]];
  38
+		}
  39
+		if ([[NSUserDefaults standardUserDefaults] boolForKey:@"DIWarnBeforeDelete"]) {
  40
+			NSAlert *alert = [NSAlert alertWithMessageText:messageText
  41
+											 defaultButton:NSLocalizedString(@"CONFIRM_DELETE", @"Confirm delete button")
  42
+										   alternateButton:NSLocalizedString(@"DENY_DELETE", @"Deny deletion button")
  43
+											   otherButton:nil
  44
+								 informativeTextWithFormat:infoText];
  45
+			// [alert setShowsSuppressionButton:YES];
  46
+			// [[alert suppressionButton] setTitle:@"Don’t show this warning again"];
  47
+			
  48
+			[NSApp activateIgnoringOtherApps:YES];
  49
+			if ([alert runModal] != NSAlertDefaultReturn) {
  50
+				return; // Don't delete
  51
+			}
  52
+			// Suppression checkbox has no effect if the delete is cancelled
  53
+			// if ([[alert suppressionButton] state] == NSOnState) {
  54
+			// 	[[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"DIWarnBeforeDelete"];
  55
+			// }
  56
+		}
  57
+		for (NSString *path in items) {	
  58
+			NSError *error;
  59
+			if (![[NSFileManager defaultManager] removeItemAtPath:path error:&error]) {
  60
+				[NSApp activateIgnoringOtherApps:YES];
  61
+				NSLog(@"Error deleting file at path %@! Error: %@", path, error);
  62
+				[[NSAlert alertWithError:error] runModal];
  63
+			}
  64
+			// This doesn't really seem to work. Oh well.
  65
+			// According to the docs, we're not "normally" supposed to invoke it manually,
  66
+			// but I'm taking that to mean nothing will break outright, and it might work sometimes.
  67
+			[NSApp deactivate];
  68
+		}
  69
+	} else {
  70
+		NSLog(@"Data not available for public.file-url or NSFilenamesPboardType! Available types: %@", [pasteboard types]);
  71
+	}
  72
+}
  73
+
  74
+@end
287  Delete Immediately.xcodeproj/project.pbxproj
... ...
@@ -0,0 +1,287 @@
  1
+// !$*UTF8*$!
  2
+{
  3
+	archiveVersion = 1;
  4
+	classes = {
  5
+	};
  6
+	objectVersion = 45;
  7
+	objects = {
  8
+
  9
+/* Begin PBXBuildFile section */
  10
+		1646D61B104B611600932CE1 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 1646D618104B611500932CE1 /* main.m */; };
  11
+		1646D61C104B611600932CE1 /* DIAppController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1646D61A104B611600932CE1 /* DIAppController.m */; };
  12
+		1646D7BC104BC8AA00932CE1 /* ServicesMenu.strings in Resources */ = {isa = PBXBuildFile; fileRef = 1646D7BB104BC8AA00932CE1 /* ServicesMenu.strings */; };
  13
+		1646D7BF104BC98A00932CE1 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 1646D7BD104BC98A00932CE1 /* Localizable.strings */; };
  14
+		8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
  15
+/* End PBXBuildFile section */
  16
+
  17
+/* Begin PBXFileReference section */
  18
+		1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
  19
+		1646D618104B611500932CE1 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
  20
+		1646D619104B611500932CE1 /* DIAppController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DIAppController.h; sourceTree = "<group>"; };
  21
+		1646D61A104B611600932CE1 /* DIAppController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DIAppController.m; sourceTree = "<group>"; };
  22
+		1646D7B9104BC89A00932CE1 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/ServicesMenu.strings; sourceTree = "<group>"; };
  23
+		1646D7BE104BC98A00932CE1 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/Localizable.strings; sourceTree = "<group>"; };
  24
+		256AC3F00F4B6AF500CF3369 /* Delete Immediately_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Delete Immediately_Prefix.pch"; sourceTree = "<group>"; };
  25
+		29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
  26
+		29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
  27
+		8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
  28
+		8D1107320486CEB800E47090 /* Delete Immediately.service */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Delete Immediately.service"; sourceTree = BUILT_PRODUCTS_DIR; };
  29
+/* End PBXFileReference section */
  30
+
  31
+/* Begin PBXFrameworksBuildPhase section */
  32
+		8D11072E0486CEB800E47090 /* Frameworks */ = {
  33
+			isa = PBXFrameworksBuildPhase;
  34
+			buildActionMask = 2147483647;
  35
+			files = (
  36
+				8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */,
  37
+			);
  38
+			runOnlyForDeploymentPostprocessing = 0;
  39
+		};
  40
+/* End PBXFrameworksBuildPhase section */
  41
+
  42
+/* Begin PBXGroup section */
  43
+		080E96DDFE201D6D7F000001 /* Classes */ = {
  44
+			isa = PBXGroup;
  45
+			children = (
  46
+				1646D619104B611500932CE1 /* DIAppController.h */,
  47
+				1646D61A104B611600932CE1 /* DIAppController.m */,
  48
+			);
  49
+			name = Classes;
  50
+			sourceTree = "<group>";
  51
+		};
  52
+		1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = {
  53
+			isa = PBXGroup;
  54
+			children = (
  55
+				1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */,
  56
+			);
  57
+			name = "Linked Frameworks";
  58
+			sourceTree = "<group>";
  59
+		};
  60
+		1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = {
  61
+			isa = PBXGroup;
  62
+			children = (
  63
+				29B97324FDCFA39411CA2CEA /* AppKit.framework */,
  64
+				29B97325FDCFA39411CA2CEA /* Foundation.framework */,
  65
+			);
  66
+			name = "Other Frameworks";
  67
+			sourceTree = "<group>";
  68
+		};
  69
+		19C28FACFE9D520D11CA2CBB /* Products */ = {
  70
+			isa = PBXGroup;
  71
+			children = (
  72
+				8D1107320486CEB800E47090 /* Delete Immediately.service */,
  73
+			);
  74
+			name = Products;
  75
+			sourceTree = "<group>";
  76
+		};
  77
+		29B97314FDCFA39411CA2CEA /* TestService */ = {
  78
+			isa = PBXGroup;
  79
+			children = (
  80
+				080E96DDFE201D6D7F000001 /* Classes */,
  81
+				29B97315FDCFA39411CA2CEA /* Other Sources */,
  82
+				29B97317FDCFA39411CA2CEA /* Resources */,
  83
+				29B97323FDCFA39411CA2CEA /* Frameworks */,
  84
+				19C28FACFE9D520D11CA2CBB /* Products */,
  85
+			);
  86
+			name = TestService;
  87
+			sourceTree = "<group>";
  88
+		};
  89
+		29B97315FDCFA39411CA2CEA /* Other Sources */ = {
  90
+			isa = PBXGroup;
  91
+			children = (
  92
+				1646D618104B611500932CE1 /* main.m */,
  93
+				256AC3F00F4B6AF500CF3369 /* Delete Immediately_Prefix.pch */,
  94
+			);
  95
+			name = "Other Sources";
  96
+			sourceTree = "<group>";
  97
+		};
  98
+		29B97317FDCFA39411CA2CEA /* Resources */ = {
  99
+			isa = PBXGroup;
  100
+			children = (
  101
+				8D1107310486CEB800E47090 /* Info.plist */,
  102
+				1646D7BB104BC8AA00932CE1 /* ServicesMenu.strings */,
  103
+				1646D7BD104BC98A00932CE1 /* Localizable.strings */,
  104
+			);
  105
+			name = Resources;
  106
+			sourceTree = "<group>";
  107
+		};
  108
+		29B97323FDCFA39411CA2CEA /* Frameworks */ = {
  109
+			isa = PBXGroup;
  110
+			children = (
  111
+				1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */,
  112
+				1058C7A2FEA54F0111CA2CBB /* Other Frameworks */,
  113
+			);
  114
+			name = Frameworks;
  115
+			sourceTree = "<group>";
  116
+		};
  117
+/* End PBXGroup section */
  118
+
  119
+/* Begin PBXNativeTarget section */
  120
+		8D1107260486CEB800E47090 /* Delete Immediately */ = {
  121
+			isa = PBXNativeTarget;
  122
+			buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "Delete Immediately" */;
  123
+			buildPhases = (
  124
+				8D1107290486CEB800E47090 /* Resources */,
  125
+				8D11072C0486CEB800E47090 /* Sources */,
  126
+				8D11072E0486CEB800E47090 /* Frameworks */,
  127
+			);
  128
+			buildRules = (
  129
+			);
  130
+			dependencies = (
  131
+			);
  132
+			name = "Delete Immediately";
  133
+			productInstallPath = "$(HOME)/Applications";
  134
+			productName = TestService;
  135
+			productReference = 8D1107320486CEB800E47090 /* Delete Immediately.service */;
  136
+			productType = "com.apple.product-type.application";
  137
+		};
  138
+/* End PBXNativeTarget section */
  139
+
  140
+/* Begin PBXProject section */
  141
+		29B97313FDCFA39411CA2CEA /* Project object */ = {
  142
+			isa = PBXProject;
  143
+			buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Delete Immediately" */;
  144
+			compatibilityVersion = "Xcode 3.1";
  145
+			hasScannedForEncodings = 1;
  146
+			mainGroup = 29B97314FDCFA39411CA2CEA /* TestService */;
  147
+			projectDirPath = "";
  148
+			projectRoot = "";
  149
+			targets = (
  150
+				8D1107260486CEB800E47090 /* Delete Immediately */,
  151
+			);
  152
+		};
  153
+/* End PBXProject section */
  154
+
  155
+/* Begin PBXResourcesBuildPhase section */
  156
+		8D1107290486CEB800E47090 /* Resources */ = {
  157
+			isa = PBXResourcesBuildPhase;
  158
+			buildActionMask = 2147483647;
  159
+			files = (
  160
+				1646D7BC104BC8AA00932CE1 /* ServicesMenu.strings in Resources */,
  161
+				1646D7BF104BC98A00932CE1 /* Localizable.strings in Resources */,
  162
+			);
  163
+			runOnlyForDeploymentPostprocessing = 0;
  164
+		};
  165
+/* End PBXResourcesBuildPhase section */
  166
+
  167
+/* Begin PBXSourcesBuildPhase section */
  168
+		8D11072C0486CEB800E47090 /* Sources */ = {
  169
+			isa = PBXSourcesBuildPhase;
  170
+			buildActionMask = 2147483647;
  171
+			files = (
  172
+				1646D61B104B611600932CE1 /* main.m in Sources */,
  173
+				1646D61C104B611600932CE1 /* DIAppController.m in Sources */,
  174
+			);
  175
+			runOnlyForDeploymentPostprocessing = 0;
  176
+		};
  177
+/* End PBXSourcesBuildPhase section */
  178
+
  179
+/* Begin PBXVariantGroup section */
  180
+		1646D7BB104BC8AA00932CE1 /* ServicesMenu.strings */ = {
  181
+			isa = PBXVariantGroup;
  182
+			children = (
  183
+				1646D7B9104BC89A00932CE1 /* English */,
  184
+			);
  185
+			name = ServicesMenu.strings;
  186
+			sourceTree = "<group>";
  187
+		};
  188
+		1646D7BD104BC98A00932CE1 /* Localizable.strings */ = {
  189
+			isa = PBXVariantGroup;
  190
+			children = (
  191
+				1646D7BE104BC98A00932CE1 /* English */,
  192
+			);
  193
+			name = Localizable.strings;
  194
+			sourceTree = "<group>";
  195
+		};
  196
+/* End PBXVariantGroup section */
  197
+
  198
+/* Begin XCBuildConfiguration section */
  199
+		C01FCF4B08A954540054247B /* Debug */ = {
  200
+			isa = XCBuildConfiguration;
  201
+			buildSettings = {
  202
+				ALWAYS_SEARCH_USER_PATHS = NO;
  203
+				COPY_PHASE_STRIP = NO;
  204
+				DEPLOYMENT_LOCATION = YES;
  205
+				DSTROOT = /;
  206
+				GCC_DYNAMIC_NO_PIC = NO;
  207
+				GCC_ENABLE_FIX_AND_CONTINUE = YES;
  208
+				GCC_MODEL_TUNING = G5;
  209
+				GCC_OPTIMIZATION_LEVEL = 0;
  210
+				GCC_PRECOMPILE_PREFIX_HEADER = YES;
  211
+				GCC_PREFIX_HEADER = "Delete Immediately_Prefix.pch";
  212
+				INFOPLIST_FILE = Info.plist;
  213
+				INSTALL_PATH = "$(HOME)/Library/Services";
  214
+				PRODUCT_NAME = "Delete Immediately";
  215
+				WRAPPER_EXTENSION = service;
  216
+			};
  217
+			name = Debug;
  218
+		};
  219
+		C01FCF4C08A954540054247B /* Release */ = {
  220
+			isa = XCBuildConfiguration;
  221
+			buildSettings = {
  222
+				ALWAYS_SEARCH_USER_PATHS = NO;
  223
+				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
  224
+				DSTROOT = /;
  225
+				GCC_MODEL_TUNING = G5;
  226
+				GCC_PRECOMPILE_PREFIX_HEADER = YES;
  227
+				GCC_PREFIX_HEADER = "Delete Immediately_Prefix.pch";
  228
+				INFOPLIST_FILE = Info.plist;
  229
+				INSTALL_PATH = "$(HOME)/Library/Services";
  230
+				PRODUCT_NAME = "Delete Immediately";
  231
+				WRAPPER_EXTENSION = service;
  232
+			};
  233
+			name = Release;
  234
+		};
  235
+		C01FCF4F08A954540054247B /* Debug */ = {
  236
+			isa = XCBuildConfiguration;
  237
+			buildSettings = {
  238
+				ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
  239
+				GCC_C_LANGUAGE_STANDARD = gnu99;
  240
+				GCC_OPTIMIZATION_LEVEL = 0;
  241
+				GCC_VERSION = 4.0;
  242
+				GCC_WARN_ABOUT_RETURN_TYPE = YES;
  243
+				GCC_WARN_UNUSED_VARIABLE = YES;
  244
+				ONLY_ACTIVE_ARCH = YES;
  245
+				PREBINDING = NO;
  246
+				SDKROOT = macosx10.6;
  247
+			};
  248
+			name = Debug;
  249
+		};
  250
+		C01FCF5008A954540054247B /* Release */ = {
  251
+			isa = XCBuildConfiguration;
  252
+			buildSettings = {
  253
+				ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
  254
+				GCC_C_LANGUAGE_STANDARD = gnu99;
  255
+				GCC_VERSION = "";
  256
+				GCC_WARN_ABOUT_RETURN_TYPE = YES;
  257
+				GCC_WARN_UNUSED_VARIABLE = YES;
  258
+				PREBINDING = NO;
  259
+				SDKROOT = macosx10.6;
  260
+			};
  261
+			name = Release;
  262
+		};
  263
+/* End XCBuildConfiguration section */
  264
+
  265
+/* Begin XCConfigurationList section */
  266
+		C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "Delete Immediately" */ = {
  267
+			isa = XCConfigurationList;
  268
+			buildConfigurations = (
  269
+				C01FCF4B08A954540054247B /* Debug */,
  270
+				C01FCF4C08A954540054247B /* Release */,
  271
+			);
  272
+			defaultConfigurationIsVisible = 0;
  273
+			defaultConfigurationName = Release;
  274
+		};
  275
+		C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Delete Immediately" */ = {
  276
+			isa = XCConfigurationList;
  277
+			buildConfigurations = (
  278
+				C01FCF4F08A954540054247B /* Debug */,
  279
+				C01FCF5008A954540054247B /* Release */,
  280
+			);
  281
+			defaultConfigurationIsVisible = 0;
  282
+			defaultConfigurationName = Release;
  283
+		};
  284
+/* End XCConfigurationList section */
  285
+	};
  286
+	rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
  287
+}
7  Delete Immediately_Prefix.pch
... ...
@@ -0,0 +1,7 @@
  1
+//
  2
+// Prefix header for all source files of the 'Delete Immediately' target in the 'Delete Immediately' project
  3
+//
  4
+
  5
+#ifdef __OBJC__
  6
+    #import <Cocoa/Cocoa.h>
  7
+#endif
BIN  English.lproj/Localizable.strings
Binary file not shown
BIN  English.lproj/ServicesMenu.strings
Binary file not shown
55  Info.plist
... ...
@@ -0,0 +1,55 @@
  1
+<?xml version="1.0" encoding="UTF-8"?>
  2
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
  3
+<plist version="1.0">
  4
+<dict>
  5
+	<key>CFBundleDevelopmentRegion</key>
  6
+	<string>English</string>
  7
+	<key>CFBundleExecutable</key>
  8
+	<string>${EXECUTABLE_NAME}</string>
  9
+	<key>CFBundleIconFile</key>
  10
+	<string></string>
  11
+	<key>CFBundleIdentifier</key>
  12
+	<string>net.bandes-storch.${PRODUCT_NAME:rfc1034identifier}</string>
  13
+	<key>CFBundleInfoDictionaryVersion</key>
  14
+	<string>6.0</string>
  15
+	<key>CFBundleName</key>
  16
+	<string>${PRODUCT_NAME}</string>
  17
+	<key>CFBundlePackageType</key>
  18
+	<string>APPL</string>
  19
+	<key>CFBundleSignature</key>
  20
+	<string>????</string>
  21
+	<key>CFBundleShortVersionString</key>
  22
+	<string>1.0</string>
  23
+	<key>LSMinimumSystemVersion</key>
  24
+	<string>${MACOSX_DEPLOYMENT_TARGET}</string>
  25
+	<key>CFBundleVersion</key>
  26
+	<string>1</string>
  27
+	<key>LSUIElement</key>
  28
+	<true/>
  29
+	<key>NSPrincipalClass</key>
  30
+	<string>NSApplication</string>
  31
+	<key>NSServices</key>
  32
+	<array>
  33
+		<dict>
  34
+			<key>NSMessage</key>
  35
+			<string>deleteImmediately</string>
  36
+			<key>NSRequiredContext</key>
  37
+			<dict>
  38
+				<key>NSTextContent</key>
  39
+				<string>FilePath</string>
  40
+			</dict>
  41
+			<key>NSPortName</key>
  42
+			<string>Delete Immediately</string>
  43
+			<key>NSSendTypes</key>
  44
+			<array>
  45
+				<string>public.file-url</string>
  46
+			</array>
  47
+			<key>NSMenuItem</key>
  48
+			<dict>
  49
+				<key>default</key>
  50
+				<string>Delete Immediately</string>
  51
+			</dict>
  52
+		</dict>
  53
+	</array>
  54
+</dict>
  55
+</plist>
28  README
... ...
@@ -0,0 +1,28 @@
  1
+== Delete Immediately ==
  2
+A standalone Mac OS X 10.6 Snow Leopard Service
  3
+to delete files and folders immediately, bypassing the Trash.
  4
+By Jacob Bandes-Storch (a.k.a. jtbandes), 2009.
  5
+
  6
+== Info ==
  7
+This service takes care of the common request for the ability
  8
+to delete files in Finder without them going to the Trash.
  9
+A common solution was to open Terminal and use rm(1), which was tedious.
  10
+This Service appears in the Services menu and the Finder context menu,
  11
+allowing quick and easy deletion of files and folders without the Trash.
  12
+It even works on files that are already in the Trash!
  13
+
  14
+== Notes ==
  15
+ - By default, the service pops up a warning/confirmation dialog
  16
+   before you delete a file. The code which adds a "Don't show this
  17
+   warning again" checkbox has been intentionally commented out
  18
+   to prevent users from making bad mistakes. However, the service still
  19
+   respects the (now hidden) preference to bypass this confirmation.
  20
+   If you really want to do this, and you promise not to delete any
  21
+   important files by accident, you have two options:
  22
+    - Uncomment the relevant code and build your own version of the service
  23
+    - Use this Terminal command:
  24
+   defaults write net.bandes-storch.Delete-Immediately DIWarnBeforeDelete -bool NO
  25
+
  26
+== Todo ==
  27
+- Delete Immediately needs an icon!
  28
+- Localize into other languages
28  main.m
... ...
@@ -0,0 +1,28 @@
  1
+/*
  2
+ *  main.m
  3
+ *  Delete Immediately
  4
+ *
  5
+ *  Created by Jacob Bandes-Storch on 8/30/09.
  6
+ *
  7
+ */
  8
+
  9
+#import <Cocoa/Cocoa.h>
  10
+#import "DIAppController.h"
  11
+
  12
+int main(int argc, char *argv[]) {
  13
+	NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
  14
+	
  15
+	[NSApplication sharedApplication];
  16
+	
  17
+	[[NSUserDefaults standardUserDefaults] registerDefaults:
  18
+	 [NSDictionary dictionaryWithObject:[NSNumber numberWithBool:YES]
  19
+								 forKey:@"DIWarnBeforeDelete"]];
  20
+	
  21
+	DIAppController *controller = [[DIAppController alloc] init];
  22
+	[[NSApplication sharedApplication] setDelegate:controller];
  23
+	[NSApp run];
  24
+	[controller release];
  25
+	
  26
+	[pool release];
  27
+	return 0;
  28
+}

0 notes on commit 72032cc

Please sign in to comment.
Something went wrong with that request. Please try again.