uploading multiple messages fix, some warnings fix
This commit is contained in:
parent
0c33d81c59
commit
fe27955689
14 changed files with 51 additions and 56 deletions
|
@ -24,6 +24,7 @@
|
|||
#include <QGraphicsDropShadowEffect>
|
||||
#include <QFileDialog>
|
||||
#include <QMimeDatabase>
|
||||
#include <unistd.h>
|
||||
|
||||
Conversation::Conversation(bool muc, const QString& mJid, const QString mRes, const QString pJid, const QString pRes, const QString& acc, QWidget* parent):
|
||||
QWidget(parent),
|
||||
|
@ -205,6 +206,7 @@ void Conversation::onEnterPressed()
|
|||
msg.generateRandomId();
|
||||
msg.setCurrentTime();
|
||||
line->appendMessageWithUpload(msg, badge->id);
|
||||
usleep(1000); //this is required for the messages not to have equal time when appending into messageline
|
||||
}
|
||||
clearAttachedFiles();
|
||||
}
|
||||
|
|
|
@ -145,7 +145,7 @@ QModelIndex UI::VCard::EMailsModel::addNewEmptyLine()
|
|||
return createIndex(deque.size() - 1, 0, &(deque.back()));
|
||||
}
|
||||
|
||||
bool UI::VCard::EMailsModel::isPreferred(int row) const
|
||||
bool UI::VCard::EMailsModel::isPreferred(quint32 row) const
|
||||
{
|
||||
if (row < deque.size()) {
|
||||
return deque[row].prefered;
|
||||
|
@ -154,10 +154,10 @@ bool UI::VCard::EMailsModel::isPreferred(int row) const
|
|||
}
|
||||
}
|
||||
|
||||
void UI::VCard::EMailsModel::removeLines(int index, int count)
|
||||
void UI::VCard::EMailsModel::removeLines(quint32 index, quint32 count)
|
||||
{
|
||||
if (index < deque.size()) {
|
||||
int maxCount = deque.size() - index;
|
||||
quint32 maxCount = deque.size() - index;
|
||||
if (count > maxCount) {
|
||||
count = maxCount;
|
||||
}
|
||||
|
@ -194,12 +194,12 @@ void UI::VCard::EMailsModel::setEmails(const std::deque<Shared::VCard::Email>& e
|
|||
}
|
||||
}
|
||||
|
||||
void UI::VCard::EMailsModel::revertPreferred(int row)
|
||||
void UI::VCard::EMailsModel::revertPreferred(quint32 row)
|
||||
{
|
||||
setData(createIndex(row, 2), !isPreferred(row));
|
||||
}
|
||||
|
||||
QString UI::VCard::EMailsModel::getEmail(int row) const
|
||||
QString UI::VCard::EMailsModel::getEmail(quint32 row) const
|
||||
{
|
||||
return deque[row].address;
|
||||
}
|
||||
|
|
|
@ -40,16 +40,16 @@ public:
|
|||
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
|
||||
bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
|
||||
Qt::ItemFlags flags(const QModelIndex &index) const override;
|
||||
bool isPreferred(int row) const;
|
||||
bool isPreferred(quint32 row) const;
|
||||
|
||||
void removeLines(int index, int count);
|
||||
void removeLines(quint32 index, quint32 count);
|
||||
void setEmails(const std::deque<Shared::VCard::Email>& emails);
|
||||
void getEmails(std::deque<Shared::VCard::Email>& emails) const;
|
||||
QString getEmail(int row) const;
|
||||
QString getEmail(quint32 row) const;
|
||||
|
||||
public slots:
|
||||
QModelIndex addNewEmptyLine();
|
||||
void revertPreferred(int row);
|
||||
void revertPreferred(quint32 row);
|
||||
|
||||
private:
|
||||
bool edit;
|
||||
|
|
|
@ -129,7 +129,7 @@ void UI::VCard::PhonesModel::getPhones(std::deque<Shared::VCard::Phone>& phones)
|
|||
}
|
||||
}
|
||||
|
||||
bool UI::VCard::PhonesModel::isPreferred(int row) const
|
||||
bool UI::VCard::PhonesModel::isPreferred(quint32 row) const
|
||||
{
|
||||
if (row < deque.size()) {
|
||||
return deque[row].prefered;
|
||||
|
@ -138,10 +138,10 @@ bool UI::VCard::PhonesModel::isPreferred(int row) const
|
|||
}
|
||||
}
|
||||
|
||||
void UI::VCard::PhonesModel::removeLines(int index, int count)
|
||||
void UI::VCard::PhonesModel::removeLines(quint32 index, quint32 count)
|
||||
{
|
||||
if (index < deque.size()) {
|
||||
int maxCount = deque.size() - index;
|
||||
quint32 maxCount = deque.size() - index;
|
||||
if (count > maxCount) {
|
||||
count = maxCount;
|
||||
}
|
||||
|
@ -156,7 +156,7 @@ void UI::VCard::PhonesModel::removeLines(int index, int count)
|
|||
}
|
||||
}
|
||||
|
||||
void UI::VCard::PhonesModel::revertPreferred(int row)
|
||||
void UI::VCard::PhonesModel::revertPreferred(quint32 row)
|
||||
{
|
||||
setData(createIndex(row, 3), !isPreferred(row));
|
||||
}
|
||||
|
@ -216,7 +216,7 @@ void UI::VCard::PhonesModel::setPhones(const std::deque<Shared::VCard::Phone>& p
|
|||
}
|
||||
}
|
||||
|
||||
QString UI::VCard::PhonesModel::getPhone(int row) const
|
||||
QString UI::VCard::PhonesModel::getPhone(quint32 row) const
|
||||
{
|
||||
return deque[row].number;
|
||||
}
|
||||
|
|
|
@ -41,16 +41,16 @@ public:
|
|||
int rowCount(const QModelIndex& parent) const override;
|
||||
bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
|
||||
Qt::ItemFlags flags(const QModelIndex &index) const override;
|
||||
bool isPreferred(int row) const;
|
||||
bool isPreferred(quint32 row) const;
|
||||
|
||||
void removeLines(int index, int count);
|
||||
void removeLines(quint32 index, quint32 count);
|
||||
void setPhones(const std::deque<Shared::VCard::Phone>& phones);
|
||||
void getPhones(std::deque<Shared::VCard::Phone>& phones) const;
|
||||
QString getPhone(int row) const;
|
||||
QString getPhone(quint32 row) const;
|
||||
|
||||
public slots:
|
||||
QModelIndex addNewEmptyLine();
|
||||
void revertPreferred(int row);
|
||||
void revertPreferred(quint32 row);
|
||||
|
||||
private:
|
||||
bool edit;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue