mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
Merge remote-tracking branch 'bitok/fix_performance_issues'
This commit is contained in:
commit
ecbda91764
|
@ -81,21 +81,24 @@ void OfflineMsgEngine::deliverOfflineMsgs()
|
|||
QMap<int, MsgPtr> msgs = undeliveredMsgs;
|
||||
removeAllReciepts();
|
||||
|
||||
for (auto iter = msgs.begin(); iter != msgs.end(); iter++)
|
||||
{
|
||||
if (iter.value().timestamp.msecsTo(QDateTime::currentDateTime()) < offlineTimeout)
|
||||
for (auto iter = msgs.begin(); iter != msgs.end(); ++iter)
|
||||
{
|
||||
auto val = iter.value();
|
||||
auto key = iter.key();
|
||||
|
||||
if (val.timestamp.msecsTo(QDateTime::currentDateTime()) < offlineTimeout)
|
||||
{
|
||||
registerReceipt(iter.value().receipt, iter.key(), iter.value().msg, iter.value().timestamp);
|
||||
registerReceipt(val.receipt, key, val.msg, val.timestamp);
|
||||
continue;
|
||||
}
|
||||
QString messageText = iter.value().msg->toString();
|
||||
QString messageText = val.msg->toString();
|
||||
int rec;
|
||||
if (iter.value().msg->isAction())
|
||||
if (val.msg->isAction())
|
||||
rec = Core::getInstance()->sendAction(f->getFriendID(), messageText);
|
||||
else
|
||||
rec = Core::getInstance()->sendMessage(f->getFriendID(), messageText);
|
||||
|
||||
registerReceipt(rec, iter.key(), iter.value().msg);
|
||||
registerReceipt(rec, key, val.msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ QMutex CameraDevice::openDeviceLock, CameraDevice::iformatLock;
|
|||
AVInputFormat* CameraDevice::iformat{nullptr};
|
||||
AVInputFormat* CameraDevice::idesktopFormat{nullptr};
|
||||
|
||||
CameraDevice::CameraDevice(const QString devName, AVFormatContext *context)
|
||||
CameraDevice::CameraDevice(const QString &devName, AVFormatContext *context)
|
||||
: devName{devName}, context{context}, refcount{1}
|
||||
{
|
||||
}
|
||||
|
|
|
@ -66,7 +66,7 @@ public:
|
|||
static QString getDefaultDeviceName();
|
||||
|
||||
private:
|
||||
CameraDevice(const QString devName, AVFormatContext *context);
|
||||
CameraDevice(const QString &devName, AVFormatContext *context);
|
||||
static CameraDevice* open(QString devName, AVDictionary** options);
|
||||
static bool getDefaultInputFormat(); ///< Sets CameraDevice::iformat, returns success/failure
|
||||
static QVector<QPair<QString, QString> > getRawDeviceListGeneric(); ///< Uses avdevice_list_devices
|
||||
|
|
|
@ -91,7 +91,7 @@ void TabCompleter::complete()
|
|||
|
||||
// remember charcount to delete next time and advance to next completion
|
||||
lastCompletionLength = nextCompletion->length();
|
||||
nextCompletion++;
|
||||
++nextCompletion;
|
||||
|
||||
// we're completing the first word of the line
|
||||
if (msgEdit->textCursor().position() == lastCompletionLength)
|
||||
|
|
|
@ -81,7 +81,7 @@ void MaskablePixmapWidget::setClickable(bool clickable)
|
|||
unsetCursor();
|
||||
}
|
||||
|
||||
void MaskablePixmapWidget::setPixmap(const QPixmap &pmap, QColor background)
|
||||
void MaskablePixmapWidget::setPixmap(const QPixmap &pmap, const QColor &background)
|
||||
{
|
||||
if (!pmap.isNull())
|
||||
{
|
||||
|
|
|
@ -30,7 +30,7 @@ public:
|
|||
~MaskablePixmapWidget();
|
||||
void autopickBackground();
|
||||
void setClickable(bool clickable);
|
||||
void setPixmap(const QPixmap &pmap, QColor background);
|
||||
void setPixmap(const QPixmap &pmap, const QColor &background);
|
||||
void setPixmap(const QPixmap &pmap);
|
||||
QPixmap getPixmap() const;
|
||||
void setSize(QSize size);
|
||||
|
|
|
@ -179,7 +179,7 @@ void Style::setThemeColor(int color)
|
|||
setThemeColor(themeColorColors[color]);
|
||||
}
|
||||
|
||||
void Style::setThemeColor(QColor color)
|
||||
void Style::setThemeColor(const QColor &color)
|
||||
{
|
||||
if (!color.isValid())
|
||||
{
|
||||
|
|
|
@ -65,7 +65,7 @@ public:
|
|||
static QString resolve(QString qss);
|
||||
static void repolish(QWidget* w);
|
||||
static void setThemeColor(int color);
|
||||
static void setThemeColor(QColor color); ///< Pass an invalid QColor to reset to defaults
|
||||
static void setThemeColor(const QColor &color); ///< Pass an invalid QColor to reset to defaults
|
||||
static void applyTheme(); ///< Reloads some CCS
|
||||
static QPixmap scaleSvgImage(const QString& path, uint32_t width, uint32_t height);
|
||||
|
||||
|
|
|
@ -685,7 +685,7 @@ void Widget::onTransferClicked()
|
|||
}
|
||||
}
|
||||
|
||||
void Widget::confirmExecutableOpen(const QFileInfo file)
|
||||
void Widget::confirmExecutableOpen(const QFileInfo &file)
|
||||
{
|
||||
static const QStringList dangerousExtensions = { "app", "bat", "com", "cpl", "dmg", "exe", "hta", "jar", "js", "jse", "lnk", "msc", "msh", "msh1", "msh1xml", "msh2", "msh2xml", "mshxml", "msi", "msp", "pif", "ps1", "ps1xml", "ps2", "ps2xml", "psc1", "psc2", "py", "reg", "scf", "sh", "src", "vb", "vbe", "vbs", "ws", "wsc", "wsf", "wsh" };
|
||||
|
||||
|
|
|
@ -85,7 +85,7 @@ public:
|
|||
ContentDialog* createContentDialog() const;
|
||||
ContentLayout* createContentDialog(DialogType type);
|
||||
|
||||
static void confirmExecutableOpen(const QFileInfo file);
|
||||
static void confirmExecutableOpen(const QFileInfo &file);
|
||||
|
||||
void clearAllReceipts();
|
||||
void reloadHistory();
|
||||
|
|
Loading…
Reference in New Issue
Block a user