From 3eed2628ecb10a688f48db0c3cc7bac70dca22b7 Mon Sep 17 00:00:00 2001 From: Tametomo Date: Sun, 10 May 2009 14:45:44 -0600 Subject: Some slight logic cleanups in the shortcut classes, as well as some style cleanups. TODO: Either abstract out all of the shared information between these two classes to a parent class, or combine the two if it can be done without doing it clumsily. Signed-off-by: Tametomo --- src/emoteshortcut.cpp | 9 +-------- src/itemshortcut.cpp | 8 ++------ 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/src/emoteshortcut.cpp b/src/emoteshortcut.cpp index 80376983..50879e4f 100644 --- a/src/emoteshortcut.cpp +++ b/src/emoteshortcut.cpp @@ -31,10 +31,6 @@ EmoteShortcut *emoteShortcut; EmoteShortcut::EmoteShortcut(): mEmoteSelected(0) { - for (int i = 0; i < SHORTCUT_EMOTES; i++) - { - mEmotes[i] = i + 1; - } load(); } @@ -49,10 +45,7 @@ void EmoteShortcut::load() { int emoteId = (int) config.getValue("emoteshortcut" + toString(i), i + 1); - if (emoteId) - { - mEmotes[i] = emoteId; - } + mEmotes[i] = emoteId; } } diff --git a/src/itemshortcut.cpp b/src/itemshortcut.cpp index 50bd85b7..22cb64b3 100644 --- a/src/itemshortcut.cpp +++ b/src/itemshortcut.cpp @@ -30,14 +30,11 @@ #include "utils/stringutils.h" -ItemShortcut::ItemShortcut *itemShortcut; +ItemShortcut *itemShortcut; ItemShortcut::ItemShortcut(): mItemSelected(-1) { - for (int i = 0; i < SHORTCUT_ITEMS; i++) - mItems[i] = -1; - load(); } @@ -52,8 +49,7 @@ void ItemShortcut::load() { int itemId = (int) config.getValue("shortcut" + toString(i), -1); - if (itemId != -1) - mItems[i] = itemId; + mItems[i] = itemId; } } -- cgit v1.2.3-70-g09d2