diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/widgets/itemlinkhandler.cpp | 21 | ||||
-rw-r--r-- | src/gui/windows/logindialog.cpp | 21 |
2 files changed, 5 insertions, 37 deletions
diff --git a/src/gui/widgets/itemlinkhandler.cpp b/src/gui/widgets/itemlinkhandler.cpp index efc6ef175..b1d277957 100644 --- a/src/gui/widgets/itemlinkhandler.cpp +++ b/src/gui/widgets/itemlinkhandler.cpp @@ -35,7 +35,7 @@ #include "resources/db/itemdb.h" -#include "listeners/actionlistener.h" +#include "listeners/openurllistener.h" #include "input/mouseinput.h" @@ -47,24 +47,7 @@ namespace { - struct OpenUrlListener : public ActionListener - { - OpenUrlListener() : - ActionListener(), - url() - { - } - - A_DELETE_COPY(OpenUrlListener) - - void action(const ActionEvent &event) override final - { - if (event.getId() == "yes") - openBrowser(url); - } - - std::string url; - } listener; + OpenUrlListener listener; } // namespace ItemLinkHandler::ItemLinkHandler() : diff --git a/src/gui/windows/logindialog.cpp b/src/gui/windows/logindialog.cpp index f3fcec167..9979bf8b1 100644 --- a/src/gui/windows/logindialog.cpp +++ b/src/gui/windows/logindialog.cpp @@ -29,6 +29,8 @@ #include "input/keydata.h" +#include "listeners/openurllistener.h" + #include "gui/models/updatelistmodel.h" #include "gui/models/updatetypemodel.h" @@ -57,24 +59,7 @@ std::string LoginDialog::savedPasswordKey(""); namespace { - struct OpenUrlListener : public ActionListener - { - OpenUrlListener() : - ActionListener(), - url() - { - } - - A_DELETE_COPY(OpenUrlListener) - - void action(const ActionEvent &event) override final - { - if (event.getId() == "yes") - openBrowser(url); - } - - std::string url; - } urlListener; + OpenUrlListener urlListener; } // namespace LoginDialog::LoginDialog(LoginData *const data, std::string serverName, |