diff --git a/src/widget/contentdialogmanager.cpp b/src/widget/contentdialogmanager.cpp index b289c0ac3..27fce8e73 100644 --- a/src/widget/contentdialogmanager.cpp +++ b/src/widget/contentdialogmanager.cpp @@ -11,17 +11,6 @@ namespace { -void removeDialog(ContentDialog* dialog, QHash& infos) -{ - for (auto it = infos.begin(); it != infos.end();) { - if (std::get<0>(*it) == dialog) { - it = infos.erase(it); - } else { - ++it; - } - } -} - void removeDialog(ContentDialog* dialog, QHash& dialogs) { for (auto it = dialogs.begin(); it != dialogs.end();) { @@ -73,7 +62,6 @@ FriendWidget* ContentDialogManager::addFriendToDialog(ContentDialog* dialog, } friendDialogs[friendId] = dialog; - friendList.insert(friendId, std::make_tuple(dialog, friendWidget)); return friendWidget; } @@ -89,22 +77,9 @@ GroupWidget* ContentDialogManager::addGroupToDialog(ContentDialog* dialog, } groupDialogs[groupId] = dialog; - groupList.insert(groupId, std::make_tuple(dialog, groupWidget)); return groupWidget; } -/** - * @brief Check, if widget is exists. - * @param id User Id. - * @param list List with contact info. - * @return True is widget exists, false otherwise. - */ -bool ContentDialogManager::existsWidget(int id, const QHash& list) -{ - auto iter = list.find(id); - return iter != list.end(); -} - void ContentDialogManager::focusFriend(int friendId) { auto dialog = focusDialog(friendId, friendDialogs); @@ -243,9 +218,6 @@ void ContentDialogManager::onDialogClose() currentDialog = nullptr; } - removeDialog(dialog, friendList); - removeDialog(dialog, groupList); - removeDialog(dialog, friendDialogs); removeDialog(dialog, groupDialogs); } \ No newline at end of file diff --git a/src/widget/contentdialogmanager.h b/src/widget/contentdialogmanager.h index 4857b83ec..df6943105 100644 --- a/src/widget/contentdialogmanager.h +++ b/src/widget/contentdialogmanager.h @@ -56,16 +56,12 @@ private slots: private: ContentDialog* focusDialog(int id, const QHash& list); - bool existsWidget(int id, const QHash& list); ContentDialog* currentDialog = nullptr; QHash friendDialogs; QHash groupDialogs; - QHash friendList; - QHash groupList; - static ContentDialogManager* instance; };