From eea49d96bfb58914ef031d7139571c1cc6f36d80 Mon Sep 17 00:00:00 2001 From: Phenom Date: Sat, 18 Mar 2017 11:56:11 +0100 Subject: [PATCH] Fix Clang warnings: change ChatDialog::init definition warning: 'PopupChatDialog::init' hides overloaded virtual function [- Woverloaded-virtual] virtual void init(const ChatId &chat_id, const QString &title); ^ /retroshare-gui/src/gui/chat/ChatDialog.h:87: hidden overloaded virtual function 'ChatDialog::init' declared here: type mismatch at 1st parameter ('ChatId' vs 'const ChatId &') virtual void init(ChatId id, const QString &title); ^ --- retroshare-gui/src/gui/chat/ChatDialog.cpp | 4 ++-- retroshare-gui/src/gui/chat/ChatDialog.h | 2 +- retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp | 7 +------ retroshare-gui/src/gui/chat/ChatLobbyDialog.h | 3 +-- retroshare-gui/src/gui/chat/PopupChatDialog.h | 2 +- 5 files changed, 6 insertions(+), 12 deletions(-) diff --git a/retroshare-gui/src/gui/chat/ChatDialog.cpp b/retroshare-gui/src/gui/chat/ChatDialog.cpp index 2ab8b8e90..2a52ccf35 100644 --- a/retroshare-gui/src/gui/chat/ChatDialog.cpp +++ b/retroshare-gui/src/gui/chat/ChatDialog.cpp @@ -63,7 +63,7 @@ void ChatDialog::closeEvent(QCloseEvent *event) emit dialogClose(this); } -void ChatDialog::init(ChatId id, const QString &title) +void ChatDialog::init(const ChatId &id, const QString &title) { mChatId = id; ChatWidget *cw = getChatWidget(); @@ -102,7 +102,7 @@ void ChatDialog::init(ChatId id, const QString &title) if (chatflags & RS_CHAT_OPEN) { if (id.isLobbyId()) { ChatLobbyDialog* cld = new ChatLobbyDialog(id.toLobbyId()); - cld->init(); + cld->init(ChatId(), ""); cd = cld; } else if(id.isDistantChatId()) diff --git a/retroshare-gui/src/gui/chat/ChatDialog.h b/retroshare-gui/src/gui/chat/ChatDialog.h index f6b4ae57e..a5c6a0bc3 100644 --- a/retroshare-gui/src/gui/chat/ChatDialog.h +++ b/retroshare-gui/src/gui/chat/ChatDialog.h @@ -84,7 +84,7 @@ protected: virtual QString getPeerName(const ChatId &sslid) const ; // can be overloaded for chat dialogs that have specific peers virtual QString getOwnName() const; - virtual void init(ChatId id, const QString &title); + virtual void init(const ChatId &id, const QString &title); virtual void addChatMsg(const ChatMessage& msg) = 0; ChatId mChatId; diff --git a/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp b/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp index c5dec3a67..20352b888 100644 --- a/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp +++ b/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp @@ -304,12 +304,7 @@ void ChatLobbyDialog::showInPeopleTab() idDialog->navigate(nickname); } -void ChatLobbyDialog::init(ChatId /*id*/, const QString &/*title*/) -{ - init(); -} - -void ChatLobbyDialog::init() +void ChatLobbyDialog::init(const ChatId &/*id*/, const QString &/*title*/) { ChatLobbyInfo linfo ; diff --git a/retroshare-gui/src/gui/chat/ChatLobbyDialog.h b/retroshare-gui/src/gui/chat/ChatLobbyDialog.h index 2dd66a554..420524f93 100644 --- a/retroshare-gui/src/gui/chat/ChatLobbyDialog.h +++ b/retroshare-gui/src/gui/chat/ChatLobbyDialog.h @@ -71,8 +71,7 @@ protected: virtual ~ChatLobbyDialog(); void processSettings(bool load); - virtual void init(ChatId id, const QString &title); - void init(); + virtual void init(const ChatId &id, const QString &title); virtual bool canClose(); virtual void addChatMsg(const ChatMessage &msg); diff --git a/retroshare-gui/src/gui/chat/PopupChatDialog.h b/retroshare-gui/src/gui/chat/PopupChatDialog.h index 0a304b14c..49e3036b3 100644 --- a/retroshare-gui/src/gui/chat/PopupChatDialog.h +++ b/retroshare-gui/src/gui/chat/PopupChatDialog.h @@ -46,7 +46,7 @@ protected: /** Default destructor */ virtual ~PopupChatDialog(); - virtual void init(const ChatId &chat_id, const QString &title); + virtual void init(const ChatId &chat_id, const QString &title); virtual void showDialog(uint chatflags); virtual ChatWidget *getChatWidget(); virtual bool hasPeerStatus() { return true; }