From 9336f9ccd10f25f737cad530e8aec841d858c350 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 23 Dec 2016 19:10:51 +0300 Subject: Fix style issues. --- src/being/being.cpp | 2 +- src/gui/onlineplayer.h | 2 +- src/gui/widgets/textbox.cpp | 2 +- src/gui/windows/chatwindow.cpp | 9 +++------ src/gui/windows/inventorywindow.cpp | 10 +++++----- src/test/testlauncher.cpp | 4 ++-- 6 files changed, 13 insertions(+), 16 deletions(-) diff --git a/src/being/being.cpp b/src/being/being.cpp index 578679f42..56d6aa9c6 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -2730,7 +2730,7 @@ void Being::unSetSprite(const unsigned int slot) restrict2 removeItemParticles(id1); beingSlot.spriteId = 0; - beingSlot.color = std::string(); + beingSlot.color.clear(); beingSlot.colorId = ItemColor_one; beingSlot.cardsId = CardsList(nullptr); recalcSpritesOrder(); diff --git a/src/gui/onlineplayer.h b/src/gui/onlineplayer.h index cbc58be8f..bda860af3 100644 --- a/src/gui/onlineplayer.h +++ b/src/gui/onlineplayer.h @@ -37,7 +37,7 @@ class OnlinePlayer final const GenderT gender, const signed char version) : mNick(nick), - mText(""), + mText(), mStatus(status), mLevel(level), mVersion(version), diff --git a/src/gui/widgets/textbox.cpp b/src/gui/widgets/textbox.cpp index edf360b62..daa13a3e2 100644 --- a/src/gui/widgets/textbox.cpp +++ b/src/gui/widgets/textbox.cpp @@ -494,7 +494,7 @@ void TextBox::setForegroundColorAll(const Color &color1, std::string TextBox::getText() const { if (mTextRows.empty()) - return std::string(""); + return std::string(); int i; std::string text; diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp index 726774cdf..7087d563b 100644 --- a/src/gui/windows/chatwindow.cpp +++ b/src/gui/windows/chatwindow.cpp @@ -719,12 +719,9 @@ void ChatWindow::mousePressed(MouseEvent &event) } else { - if (cTab) - { - popupMenu->showChatPopup(viewport->mMouseX, - viewport->mMouseY, - cTab); - } + popupMenu->showChatPopup(viewport->mMouseX, + viewport->mMouseY, + cTab); } } } diff --git a/src/gui/windows/inventorywindow.cpp b/src/gui/windows/inventorywindow.cpp index 05bcda0ae..4ac19daaa 100644 --- a/src/gui/windows/inventorywindow.cpp +++ b/src/gui/windows/inventorywindow.cpp @@ -172,11 +172,6 @@ InventoryWindow::InventoryWindow(Inventory *const inventory) : mItems->addSelectionListener(this); - ScrollArea *const invenScroll = new ScrollArea(this, mItems, - fromBool(getOptionBool("showbackground"), Opaque), - "inventory_background.xml"); - invenScroll->setHorizontalScrollPolicy(ScrollArea::SHOW_NEVER); - const int size = config.getIntValue("fontSize"); mFilter = new TabStrip(this, "filter_" + getWindowName(), size + 16); mFilter->addActionListener(this); @@ -194,6 +189,11 @@ InventoryWindow::InventoryWindow(Inventory *const inventory) : return; } + ScrollArea *const invenScroll = new ScrollArea(this, mItems, + fromBool(getOptionBool("showbackground"), Opaque), + "inventory_background.xml"); + invenScroll->setHorizontalScrollPolicy(ScrollArea::SHOW_NEVER); + switch (mInventory->getType()) { case InventoryType::Inventory: diff --git a/src/test/testlauncher.cpp b/src/test/testlauncher.cpp index e20721a07..2a3df56de 100644 --- a/src/test/testlauncher.cpp +++ b/src/test/testlauncher.cpp @@ -489,9 +489,9 @@ static void initBuffer(uint32_t *const buf, static void calcTime(const char *const msg1, const char *const msg2, - timespec &time1, + const timespec &time1, timespec &time2, - uint32_t *const buf) + const uint32_t *const buf) { clock_gettime(CLOCK_MONOTONIC, &time2); long diff = ((static_cast(time2.tv_sec) * 1000000000L -- cgit v1.2.3-70-g09d2