converted all calls to QIcon("somefile.png") into FilesDefs::getIconFromQtResourcePath("somefile.png") to save memory duplicated by Qt

This commit is contained in:
csoler 2020-08-15 22:17:52 +02:00
parent dcbcc95e41
commit 209355b9a5
63 changed files with 330 additions and 291 deletions

View file

@ -22,6 +22,7 @@
#include <QTabBar>
#include "gui/common/FilesDefs.h"
#include "ChatTabWidget.h"
#include "ui_ChatTabWidget.h"
#include "ChatDialog.h"
@ -102,9 +103,9 @@ void ChatTabWidget::tabInfoChanged(ChatDialog *dialog)
if (tab >= 0) {
if (dialog->isTyping()) {
setBlinking(tab, false);
setTabIcon(tab, QIcon(IMAGE_TYPING));
setTabIcon(tab, FilesDefs::getIconFromQtResourcePath(IMAGE_TYPING));
} else if (dialog->hasNewMessages()) {
setTabIcon(tab, QIcon(IMAGE_CHAT));
setTabIcon(tab, FilesDefs::getIconFromQtResourcePath(IMAGE_CHAT));
if (dialog->notifyBlink()) {
setBlinking(tab, true);
} else {
@ -148,9 +149,9 @@ void ChatTabWidget::getInfo(bool &isTyping, bool &hasNewMessage, QIcon *icon)
if (icon) {
if (isTyping) {
*icon = QIcon(IMAGE_TYPING);
*icon = FilesDefs::getIconFromQtResourcePath(IMAGE_TYPING);
} else if (hasNewMessage) {
*icon = QIcon(IMAGE_CHAT);
*icon = FilesDefs::getIconFromQtResourcePath(IMAGE_CHAT);
} else {
cd = dynamic_cast<ChatDialog*>(currentWidget());
if (cd && cd->hasPeerStatus()) {