From 3084847508cdb5f76a077f5ae7cf2ad45c3c17a7 Mon Sep 17 00:00:00 2001 From: rakshasa Date: Mon, 11 Sep 2006 13:50:28 +0000 Subject: [PATCH] * Bindings::pressed didn't use a temporary to store the result of "itr != end()" test. * Properly clean up trailing '/' in EntryList::set_root_dir(...) and fixed EntryList::make_directory so it actually makes them. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@776 e378c898-3ddf-0310-93e7-cc216c733640 --- src/input/bindings.cc | 7 ++++--- src/ui/download.cc | 8 ++------ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/input/bindings.cc b/src/input/bindings.cc index 53263a97..3beb29f5 100644 --- a/src/input/bindings.cc +++ b/src/input/bindings.cc @@ -49,10 +49,11 @@ Bindings::pressed(int key) { const_iterator itr = find(key); - if (itr != end()) - itr->second(); + if (itr == end()) + return false; - return itr != end(); + itr->second(); + return true; } } diff --git a/src/ui/download.cc b/src/ui/download.cc index 976cedd4..d443c48e 100644 --- a/src/ui/download.cc +++ b/src/ui/download.cc @@ -223,9 +223,6 @@ Download::activate_display(Display displayType, bool focusDisplay) { // Cleanup previous state. switch (m_state) { - case DISPLAY_MENU: - break; - case DISPLAY_PEER_LIST: case DISPLAY_INFO: case DISPLAY_FILE_LIST: @@ -238,6 +235,7 @@ Download::activate_display(Display displayType, bool focusDisplay) { frame->clear(); break; + case DISPLAY_MENU: case DISPLAY_MAX_SIZE: break; } @@ -247,9 +245,6 @@ Download::activate_display(Display displayType, bool focusDisplay) { // Initialize new state. switch (displayType) { - case DISPLAY_MENU: - break; - case DISPLAY_PEER_LIST: case DISPLAY_INFO: case DISPLAY_FILE_LIST: @@ -262,6 +257,7 @@ Download::activate_display(Display displayType, bool focusDisplay) { m_uiArray[displayType]->activate(frame->frame(1), focusDisplay); break; + case DISPLAY_MENU: case DISPLAY_MAX_SIZE: break; }