summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-03-19 00:27:45 +0200
committerAndrei Karas <akaras@inbox.ru>2011-03-19 00:27:45 +0200
commitb2ac4def24379db588ffa52ca63676710f18b4fc (patch)
tree09a76cb672d032cd6b8f41fd3f5afc6c3836839f /src/gui
parentf4792bc06f21335fc2d1171d937ea7645ca0c253 (diff)
downloadplus-b2ac4def24379db588ffa52ca63676710f18b4fc.tar.gz
plus-b2ac4def24379db588ffa52ca63676710f18b4fc.tar.bz2
plus-b2ac4def24379db588ffa52ca63676710f18b4fc.tar.xz
plus-b2ac4def24379db588ffa52ca63676710f18b4fc.zip
Fix code style and add small optimisations.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/updatewindow.cpp4
-rw-r--r--src/gui/whoisonline.cpp2
-rw-r--r--src/gui/widgets/emoteshortcutcontainer.cpp4
-rw-r--r--src/gui/worldselectdialog.cpp6
4 files changed, 10 insertions, 6 deletions
diff --git a/src/gui/updatewindow.cpp b/src/gui/updatewindow.cpp
index 542d665d5..9a2b4d75a 100644
--- a/src/gui/updatewindow.cpp
+++ b/src/gui/updatewindow.cpp
@@ -450,7 +450,7 @@ void UpdaterWindow::loadUpdates()
if (mUpdateFiles.empty())
{ // updates not downloaded
mUpdateFiles = loadXMLFile(mUpdatesDir + "/" + xmlUpdateFile);
- if (!mUpdateFiles.size())
+ if (mUpdateFiles.empty())
{
logger->log("Warning this server does not have a"
" %s file falling back to %s", xmlUpdateFile.c_str(),
@@ -579,7 +579,7 @@ void UpdaterWindow::logic()
mUpdateFiles = loadXMLFile(
mUpdatesDir + "/" + xmlUpdateFile);
- if (mUpdateFiles.size() == 0)
+ if (mUpdateFiles.empty())
{
logger->log("Warning this server does not have a %s"
" file falling back to %s",
diff --git a/src/gui/whoisonline.cpp b/src/gui/whoisonline.cpp
index f64bf383e..c4d9e92a3 100644
--- a/src/gui/whoisonline.cpp
+++ b/src/gui/whoisonline.cpp
@@ -480,7 +480,7 @@ void WhoIsOnline::logic()
mUpdateButton->setEnabled(true);
mUpdateTimer = 0;
updateSize();
- if (mOnlinePlayers.size() > 0 && chatWindow)
+ if (!mOnlinePlayers.empty() && chatWindow)
chatWindow->updateOnline(mOnlinePlayers);
}
break;
diff --git a/src/gui/widgets/emoteshortcutcontainer.cpp b/src/gui/widgets/emoteshortcutcontainer.cpp
index 683b02fe6..6e15d4bf9 100644
--- a/src/gui/widgets/emoteshortcutcontainer.cpp
+++ b/src/gui/widgets/emoteshortcutcontainer.cpp
@@ -131,8 +131,8 @@ void EmoteShortcutContainer::draw(gcn::Graphics *graphics)
mEmoteImg[i]->sprite->draw(g, emoteX + 2, emoteY + 10);
}
- if (mEmoteMoved && mEmoteMoved < static_cast<unsigned>(mEmoteImg.size()) + 1
- && mEmoteMoved > 0)
+ if (mEmoteMoved && mEmoteMoved < static_cast<unsigned>(
+ mEmoteImg.size()) + 1 && mEmoteMoved > 0)
{
// Draw the emote image being dragged by the cursor.
const EmoteSprite* sprite = mEmoteImg[mEmoteMoved - 1];
diff --git a/src/gui/worldselectdialog.cpp b/src/gui/worldselectdialog.cpp
index 2bb76e306..3a35e3396 100644
--- a/src/gui/worldselectdialog.cpp
+++ b/src/gui/worldselectdialog.cpp
@@ -91,12 +91,16 @@ WorldSelectDialog::WorldSelectDialog(Worlds worlds):
reflowLayout(0, 0);
- if (worlds.size() == 0)
+ if (worlds.empty())
+ {
// Disable Ok button
mChooseWorld->setEnabled(false);
+ }
else
+ {
// Select first server
mWorldList->setSelected(0);
+ }
addKeyListener(this);