adium 2793:b9fd746d2a9a: Dont ask for confirmation or try to del...

commits at adium.im commits at adium.im
Wed Oct 28 08:00:40 UTC 2009


details:	http://hg.adium.im/adium/rev/b9fd746d2a9a
revision:	2793:b9fd746d2a9a
author:		William Bowling <will at wbowling.info>
date:		Wed Oct 28 18:27:54 2009 +1100

Dont ask for confirmation or try to delete 0 selected logs

diffs (28 lines):

diff -r e7cd7648ffd3 -r b9fd746d2a9a Source/AILogViewerWindowController.m
--- a/Source/AILogViewerWindowController.m	Tue Oct 27 23:48:47 2009 -0700
+++ b/Source/AILogViewerWindowController.m	Wed Oct 28 18:27:54 2009 +1100
@@ -1818,8 +1818,13 @@
 	NSArray *selectedLogs = [tableView_results selectedItemsFromArray:currentSearchResults];
 	[resultsLock unlock];
 	
-	NSAlert *alert = [self alertForDeletionOfLogCount:[selectedLogs count]];
-	[alert beginSheetModalForWindow:[self window] modalDelegate:self didEndSelector:@selector(deleteLogsAlertDidEnd:returnCode:contextInfo:) contextInfo:[selectedLogs retain]];
+	if ([selectedLogs count] > 0) {
+		NSAlert *alert = [self alertForDeletionOfLogCount:[selectedLogs count]];
+		[alert beginSheetModalForWindow:[self window] 
+						  modalDelegate:self 
+						 didEndSelector:@selector(deleteLogsAlertDidEnd:returnCode:contextInfo:) 
+							contextInfo:[selectedLogs retain]];
+	}
 }
 
 - (void)tableViewColumnDidResize:(NSNotification *)aNotification
@@ -2565,7 +2570,7 @@
 						  modalDelegate:self
 						 didEndSelector:@selector(deleteLogsAlertDidEnd:returnCode:contextInfo:)
 							contextInfo:[selectedLogs retain]];
-	} else {
+	} else if ([selectedLogs count] == 1) {
 		[self deleteLogsAlertDidEnd:nil
 						 returnCode:NSAlertFirstButtonReturn
 						contextInfo:[selectedLogs retain]];




More information about the commits mailing list