From ca6f1934b3ef0bb3124f2ed9c664df7f9ae28cfa Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Mon, 20 Aug 2007 19:05:58 +0000 Subject: [PATCH] allow new menu method to use an index set instead of range --- macosx/NSMenuAdditions.h | 2 +- macosx/NSMenuAdditions.m | 14 ++++++++------ macosx/TorrentTableView.m | 6 +++--- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/macosx/NSMenuAdditions.h b/macosx/NSMenuAdditions.h index d28cbe6fe..760b37545 100644 --- a/macosx/NSMenuAdditions.h +++ b/macosx/NSMenuAdditions.h @@ -26,6 +26,6 @@ @interface NSMenu (NSMenuAdditions) -- (void) moveItemsToEndFromMenu: (NSMenu *) oldMenu inRange: (NSRange) range; +- (void) appendItemsFromMenu: (NSMenu *) menu atIndexes: (NSIndexSet *) indexes; @end diff --git a/macosx/NSMenuAdditions.m b/macosx/NSMenuAdditions.m index 17a2d4c99..92be8a1b4 100644 --- a/macosx/NSMenuAdditions.m +++ b/macosx/NSMenuAdditions.m @@ -26,15 +26,17 @@ @implementation NSMenu (NSMenuAdditions) -- (void) moveItemsToEndFromMenu: (NSMenu *) oldMenu inRange: (NSRange) range +- (void) appendItemsFromMenu: (NSMenu *) menu atIndexes: (NSIndexSet *) indexes { + int bottom = [self numberOfItems]; + NSMenuItem * item; - int i; - for (i=0; i