From ba086a40533ca00b8dd9dc6162d22065d6c3cdb3 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 11 Oct 2013 12:31:29 +0300 Subject: Put OpenLinkHandler in own namespace. --- src/gui/widgets/itemlinkhandler.cpp | 27 +++++++++++++++------------ src/gui/windows/logindialog.cpp | 29 ++++++++++++++++------------- 2 files changed, 31 insertions(+), 25 deletions(-) diff --git a/src/gui/widgets/itemlinkhandler.cpp b/src/gui/widgets/itemlinkhandler.cpp index 804177a0a..85aa4e090 100644 --- a/src/gui/widgets/itemlinkhandler.cpp +++ b/src/gui/widgets/itemlinkhandler.cpp @@ -42,23 +42,26 @@ #include "debug.h" -struct OpenUrlListener : public gcn::ActionListener +namespace { - OpenUrlListener() : - url() + struct OpenUrlListener : public gcn::ActionListener { - } + OpenUrlListener() : + url() + { + } - A_DELETE_COPY(OpenUrlListener) + A_DELETE_COPY(OpenUrlListener) - void action(const gcn::ActionEvent &event) override - { - if (event.getId() == "yes") - openBrowser(url); - } + void action(const gcn::ActionEvent &event) override + { + if (event.getId() == "yes") + openBrowser(url); + } - std::string url; -} listener; + std::string url; + } listener; +} // namespace ItemLinkHandler::ItemLinkHandler() : mItemPopup(new ItemPopup) diff --git a/src/gui/windows/logindialog.cpp b/src/gui/windows/logindialog.cpp index 883c4606d..ab80e2db1 100644 --- a/src/gui/windows/logindialog.cpp +++ b/src/gui/windows/logindialog.cpp @@ -51,24 +51,27 @@ std::string LoginDialog::savedPassword(""); std::string LoginDialog::savedPasswordKey(""); -struct OpenUrlListener : public gcn::ActionListener +namespace { - OpenUrlListener() : - gcn::ActionListener(), - url() + struct OpenUrlListener : public gcn::ActionListener { - } + OpenUrlListener() : + gcn::ActionListener(), + url() + { + } - A_DELETE_COPY(OpenUrlListener) + A_DELETE_COPY(OpenUrlListener) - void action(const gcn::ActionEvent &event) override - { - if (event.getId() == "yes") - openBrowser(url); - } + void action(const gcn::ActionEvent &event) override + { + if (event.getId() == "yes") + openBrowser(url); + } - std::string url; -} urlListener; + std::string url; + } urlListener; +} // namespace const char *UPDATE_TYPE_TEXT[3] = { -- cgit v1.2.3-60-g2f50