Fixed to load the stickers only one time

This commit is contained in:
defnax 2021-01-21 22:57:27 +01:00
parent 55d8ff7b6d
commit c746af23ed
3 changed files with 5 additions and 3 deletions

View File

@ -67,7 +67,7 @@ AvatarDialog::AvatarDialog(QWidget *parent) :
connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
updateInterface();
loadFolders();
loadAvatarWidget();
}
@ -144,7 +144,7 @@ void AvatarDialog::getAvatar(QByteArray &avatar)
pixmap->save(&buffer, "PNG"); // writes image into ba in PNG format
}
void AvatarDialog::loadFolders()
void AvatarDialog::load()
{
filters << "*.png" << "*.jpg" << "*.gif";
stickerFolders << (QString::fromStdString(RsAccounts::AccountDirectory()) + "/stickers"); //under account, unique for user

View File

@ -47,13 +47,13 @@ public:
void getAvatar(QByteArray &avatar);
static QString importedStickerPath();
static void load();
private slots:
void changeAvatar();
void removeAvatar();
void addAvatar();
void loadFolders();
void loadAvatarWidget();
void loadToolTips(QWidget *container);

View File

@ -42,6 +42,7 @@ CrashStackTrace gCrashStackTrace;
#include "gui/StartDialog.h"
#include "gui/chat/ChatDialog.h"
#include "gui/connect/ConfCertDialog.h"
#include "gui/common/AvatarDialog.h"
#include "gui/common/Emoticons.h"
#include "gui/FileTransfer/SearchDialog.h"
#include "gui/FileTransfer/TransfersDialog.h"
@ -493,6 +494,7 @@ feenableexcept(FE_INVALID | FE_DIVBYZERO);
RsharePeerSettings::Create();
Emoticons::load();
AvatarDialog::load();
if (Settings->value(QString::fromUtf8("FirstRun"), true).toBool()) {
splashScreen.hide();