mirror of
https://github.com/transmission/transmission
synced 2024-12-25 09:13:06 +00:00
clean code up a little
This commit is contained in:
parent
5c2f4e5fd1
commit
41d5f3c8f5
2 changed files with 52 additions and 50 deletions
|
@ -521,7 +521,6 @@ static int static_lastid = 0;
|
|||
return fStat->ratio;
|
||||
}
|
||||
|
||||
#warning make enum
|
||||
- (int) ratioSetting
|
||||
{
|
||||
return fRatioSetting;
|
||||
|
|
|
@ -352,9 +352,6 @@
|
|||
|
||||
BOOL create = [menu numberOfItems] <= 0, folder;
|
||||
|
||||
NSMenu * supermenu = [menu supermenu];
|
||||
NSArray * items;
|
||||
NSDictionary * folderDict;
|
||||
#warning move to submethod
|
||||
if (menu == fUploadMenu || menu == fDownloadMenu)
|
||||
{
|
||||
|
@ -391,12 +388,16 @@
|
|||
|
||||
return;
|
||||
}
|
||||
else if ((folderDict = [[supermenu itemAtIndex: [supermenu indexOfItemWithSubmenu: menu]] representedObject]))
|
||||
items = [[[supermenu itemAtIndex: [supermenu indexOfItemWithSubmenu: menu]] representedObject] objectForKey: @"Children"];
|
||||
else if ([menu supermenu]) //assume the menu is part of the file list
|
||||
{
|
||||
NSMenu * supermenu = [menu supermenu];
|
||||
NSArray * items;
|
||||
NSDictionary * folderDict;
|
||||
if ((folderDict = [[supermenu itemAtIndex: [supermenu indexOfItemWithSubmenu: menu]] representedObject]))
|
||||
items = [folderDict objectForKey: @"Children"];
|
||||
else
|
||||
items = [fMenuTorrent fileList];
|
||||
|
||||
#warning move rest to submethod
|
||||
NSEnumerator * enumerator = [items objectEnumerator];
|
||||
NSDictionary * dict;
|
||||
NSMenuItem * item;
|
||||
|
@ -447,11 +448,13 @@
|
|||
[item setEnabled: [fMenuTorrent canChangeDownloadCheckForFiles: indexSet]];
|
||||
}
|
||||
}
|
||||
else;
|
||||
}
|
||||
|
||||
- (void) setQuickLimitMode: (id) sender
|
||||
{
|
||||
int tag = [sender tag];
|
||||
int mode;
|
||||
tr_speedlimit_t mode;
|
||||
if (tag == ACTION_MENU_UNLIMITED_TAG)
|
||||
mode = TR_SPEEDLIMIT_UNLIMITED;
|
||||
else if (tag == ACTION_MENU_LIMIT_TAG)
|
||||
|
|
Loading…
Reference in a new issue