diff options
Diffstat (limited to 'src/gui/widgets')
-rw-r--r-- | src/gui/widgets/chattab.cpp | 7 | ||||
-rw-r--r-- | src/gui/widgets/popup.h | 2 | ||||
-rw-r--r-- | src/gui/widgets/progressbar.h | 2 | ||||
-rw-r--r-- | src/gui/widgets/textbox.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/textfield.cpp | 4 | ||||
-rw-r--r-- | src/gui/widgets/textfield.h | 5 | ||||
-rw-r--r-- | src/gui/widgets/windowcontainer.h | 4 |
7 files changed, 12 insertions, 14 deletions
diff --git a/src/gui/widgets/chattab.cpp b/src/gui/widgets/chattab.cpp index 166ad102..5975684d 100644 --- a/src/gui/widgets/chattab.cpp +++ b/src/gui/widgets/chattab.cpp @@ -120,7 +120,6 @@ void ChatTab::chatLog(std::string line, Own own, bool ignoreRecord) CHATLOG tmp; tmp.own = own; - tmp.nick = ""; tmp.text = line; std::string::size_type pos = line.find(" : "); @@ -181,7 +180,7 @@ void ChatTab::chatLog(std::string line, Own own, bool ignoreRecord) lineColor = "##S"; break; case BY_CHANNEL: - tmp.nick = ""; + tmp.nick.clear(); // TODO: Use a predefined color lineColor = "##2"; // Equiv. to BrowserBox::GREEN break; @@ -193,7 +192,7 @@ void ChatTab::chatLog(std::string line, Own own, bool ignoreRecord) lineColor = "##I"; break; case BY_LOGGER: - tmp.nick = ""; + tmp.nick.clear(); tmp.text = line; lineColor = "##L"; break; @@ -201,7 +200,7 @@ void ChatTab::chatLog(std::string line, Own own, bool ignoreRecord) if (tmp.nick == ": ") { - tmp.nick = ""; + tmp.nick.clear(); lineColor = "##S"; } diff --git a/src/gui/widgets/popup.h b/src/gui/widgets/popup.h index 2aaa63f7..c77bf814 100644 --- a/src/gui/widgets/popup.h +++ b/src/gui/widgets/popup.h @@ -55,7 +55,7 @@ class Popup : public Container, public gcn::MouseListener * debugging purposes. * @param skin The location where the Popup's skin XML can be found. */ - Popup(const std::string &name = "", + Popup(const std::string &name = std::string(), const std::string &skin = "window.xml"); /** diff --git a/src/gui/widgets/progressbar.h b/src/gui/widgets/progressbar.h index d7289816..2f9e665f 100644 --- a/src/gui/widgets/progressbar.h +++ b/src/gui/widgets/progressbar.h @@ -116,7 +116,7 @@ class ProgressBar : public gcn::Widget */ static void render(Graphics *graphics, const gcn::Rectangle &area, const gcn::Color &color, float progress, - const std::string &text = ""); + const std::string &text = std::string()); private: float mProgress, mProgressToGo; diff --git a/src/gui/widgets/textbox.cpp b/src/gui/widgets/textbox.cpp index ac1c22c9..419fa16e 100644 --- a/src/gui/widgets/textbox.cpp +++ b/src/gui/widgets/textbox.cpp @@ -112,7 +112,7 @@ void TextBox::setTextWrapped(const std::string &text, int minDimension) { mMinWidth = minWidth; wrappedStream.clear(); - wrappedStream.str(""); + wrappedStream.str(std::string()); spacePos = 0; lastNewlinePos = 0; newlinePos = text.find("\n", lastNewlinePos); diff --git a/src/gui/widgets/textfield.cpp b/src/gui/widgets/textfield.cpp index 872227ea..3e1665d3 100644 --- a/src/gui/widgets/textfield.cpp +++ b/src/gui/widgets/textfield.cpp @@ -207,14 +207,14 @@ void TextField::keyPressed(gcn::KeyEvent &keyEvent) } else { - setText(""); + setText(std::string()); mHistory->current = prevHist; } } else if (!getText().empty()) { // Always clear (easy access to useful function) - setText(""); + setText(std::string()); } } break; diff --git a/src/gui/widgets/textfield.h b/src/gui/widgets/textfield.h index bb39810b..3b997ba8 100644 --- a/src/gui/widgets/textfield.h +++ b/src/gui/widgets/textfield.h @@ -65,7 +65,7 @@ struct TextHistory class AutoCompleteLister { public: - virtual ~AutoCompleteLister() {} + virtual ~AutoCompleteLister() = default; virtual void getAutoCompleteList(std::vector<std::string>&) const {} }; @@ -80,7 +80,8 @@ class TextField : public gcn::TextField /** * Constructor, initializes the text field with the given string. */ - TextField(const std::string &text = "", bool loseFocusOnTab = true); + TextField(const std::string &text = std::string(), + bool loseFocusOnTab = true); ~TextField() override; /** diff --git a/src/gui/widgets/windowcontainer.h b/src/gui/widgets/windowcontainer.h index 3e01bb36..646e5d00 100644 --- a/src/gui/widgets/windowcontainer.h +++ b/src/gui/widgets/windowcontainer.h @@ -55,9 +55,7 @@ class WindowContainer : public Container /** * List of widgets that are scheduled to be deleted. */ - using Widgets = std::list<gcn::Widget *>; - using WidgetIterator = Widgets::iterator; - Widgets mDeathList; + std::list<gcn::Widget *> mDeathList; }; extern WindowContainer *windowContainer; |