removed Order, resolved a crash on several files being uploaded simultaniuosly

This commit is contained in:
Blue 2023-11-09 19:36:30 -03:00
parent 0a530bfa93
commit be466fbad1
Signed by untrusted user: blue
GPG key ID: 9B203B252A63EE38
12 changed files with 122 additions and 304 deletions

View file

@ -16,8 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CONVERSATION_H
#define CONVERSATION_H
#pragma once
#include <QWidget>
#include <QObject>
@ -30,12 +29,9 @@
#include <QAction>
#include <QDesktopServices>
#include <vector>
#include "shared/message.h"
#include "shared/order.h"
#include "shared/icons.h"
#include "shared/utils.h"
#include "shared/pathcheck.h"
#include "shared/defines.h"
#include "ui/models/account.h"
#include "ui/models/roster.h"
@ -96,7 +92,7 @@ protected:
virtual Shared::Message createMessage() const;
void setStatus(const QString& status);
void addAttachedFile(const QString& path);
void removeAttachedFile(Badge* badge);
void removeAttachedFile(const QString& id);
void clearAttachedFiles();
void dragEnterEvent(QDragEnterEvent* event) override;
void dragLeaveEvent(QDragLeaveEvent* event) override;
@ -104,6 +100,10 @@ protected:
void initializeOverlay();
virtual void onMessage(const Shared::Message& msg);
virtual void showEvent(QShowEvent * event) override;
void createFeed();
void createUI();
void subscribeEvents();
protected slots:
void initiateMessageSending();
@ -142,7 +142,7 @@ protected:
QLabel* statusLabel;
FlowLayout* filesLayout;
QWidget* overlay;
W::Order<Badge*, Badge::Comparator> filesToAttach;
std::vector<Badge*> filesToAttach;
FeedView* feed;
MessageDelegate* delegate;
bool manualSliderChange;
@ -161,5 +161,3 @@ private:
static QPixmap* avatarPixmap;
static QPainter* avatarPainter;
};
#endif // CONVERSATION_H