Browse Source

refactor: Make few methods ConstDialog const

reviewable/pr4540/r4
Diadlo 8 years ago
parent
commit
eb13908926
No known key found for this signature in database
GPG Key ID: 5AF9F2E29107C727
  1. 8
      src/widget/contentdialog.cpp
  2. 7
      src/widget/contentdialog.h

8
src/widget/contentdialog.cpp

@ -276,12 +276,12 @@ void ContentDialog::removeGroup(int groupId) @@ -276,12 +276,12 @@ void ContentDialog::removeGroup(int groupId)
}
}
bool ContentDialog::hasFriendWidget(int friendId, GenericChatroomWidget* chatroomWidget)
bool ContentDialog::hasFriendWidget(int friendId, const GenericChatroomWidget* chatroomWidget) const
{
return hasWidget(friendId, chatroomWidget, friendList);
}
bool ContentDialog::hasGroupWidget(int groupId, GenericChatroomWidget* chatroomWidget)
bool ContentDialog::hasGroupWidget(int groupId, const GenericChatroomWidget* chatroomWidget) const
{
return hasWidget(groupId, chatroomWidget, groupList);
}
@ -811,8 +811,8 @@ void ContentDialog::saveSplitterState() @@ -811,8 +811,8 @@ void ContentDialog::saveSplitterState()
* @param list List with contact info.
* @return True, if chatroomWidget is pair for current instance.
*/
bool ContentDialog::hasWidget(int id, GenericChatroomWidget* chatroomWidget,
const QHash<int, ContactInfo>& list)
bool ContentDialog::hasWidget(int id, const GenericChatroomWidget* chatroomWidget,
const QHash<int, ContactInfo>& list) const
{
auto iter = list.find(id);
if (iter == list.end()) {

7
src/widget/contentdialog.h

@ -56,8 +56,8 @@ public: @@ -56,8 +56,8 @@ public:
GroupWidget* addGroup(int groupId, const QString& name);
void removeFriend(int friendId);
void removeGroup(int groupId);
bool hasFriendWidget(int friendId, GenericChatroomWidget* chatroomWidget);
bool hasGroupWidget(int groupId, GenericChatroomWidget* chatroomWidget);
bool hasFriendWidget(int friendId, const GenericChatroomWidget* chatroomWidget) const;
bool hasGroupWidget(int groupId, const GenericChatroomWidget* chatroomWidget) const;
int chatroomWidgetCount() const;
void ensureSplitterVisible();
void updateTitleAndStatusIcon();
@ -113,7 +113,8 @@ private: @@ -113,7 +113,8 @@ private:
QLayout* nextLayout(QLayout* layout, bool forward) const;
int getCurrentLayout(QLayout*& layout);
bool hasWidget(int id, GenericChatroomWidget* chatroomWidget, const QHash<int, ContactInfo>& list);
bool hasWidget(int id, const GenericChatroomWidget* chatroomWidget,
const QHash<int, ContactInfo>& list) const;
void removeCurrent(QHash<int, ContactInfo>& infos);
static bool existsWidget(int id, const QHash<int, ContactInfo>& list);
static void focusDialog(int id, const QHash<int, ContactInfo>& list);

Loading…
Cancel
Save