mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
chore(formatting): run clang-format
This commit is contained in:
parent
a1181e10f2
commit
a3b234e6dd
|
@ -89,13 +89,14 @@ public:
|
||||||
virtual void playMono16Sound(const QString& path) = 0;
|
virtual void playMono16Sound(const QString& path) = 0;
|
||||||
|
|
||||||
virtual void playAudioBuffer(uint sourceId, const int16_t* data, int samples, unsigned channels,
|
virtual void playAudioBuffer(uint sourceId, const int16_t* data, int samples, unsigned channels,
|
||||||
int sampleRate) = 0;
|
int sampleRate) = 0;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Public default audio settings
|
// Public default audio settings
|
||||||
static constexpr uint32_t AUDIO_SAMPLE_RATE = 48000;
|
static constexpr uint32_t AUDIO_SAMPLE_RATE = 48000;
|
||||||
static constexpr uint32_t AUDIO_FRAME_DURATION = 20;
|
static constexpr uint32_t AUDIO_FRAME_DURATION = 20;
|
||||||
static constexpr uint32_t AUDIO_FRAME_SAMPLE_COUNT = AUDIO_FRAME_DURATION * AUDIO_SAMPLE_RATE / 1000;
|
static constexpr uint32_t AUDIO_FRAME_SAMPLE_COUNT =
|
||||||
|
AUDIO_FRAME_DURATION * AUDIO_SAMPLE_RATE / 1000;
|
||||||
static constexpr uint32_t AUDIO_CHANNELS = 2;
|
static constexpr uint32_t AUDIO_CHANNELS = 2;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
|
@ -42,8 +42,8 @@
|
||||||
|
|
||||||
static const unsigned int BUFFER_COUNT = 16;
|
static const unsigned int BUFFER_COUNT = 16;
|
||||||
|
|
||||||
OpenAL::OpenAL() :
|
OpenAL::OpenAL()
|
||||||
audioThread{new QThread}
|
: audioThread{new QThread}
|
||||||
, alInDev{nullptr}
|
, alInDev{nullptr}
|
||||||
, inSubscriptions{0}
|
, inSubscriptions{0}
|
||||||
, alOutDev{nullptr}
|
, alOutDev{nullptr}
|
||||||
|
@ -364,7 +364,7 @@ void OpenAL::playMono16Sound(const QByteArray& data)
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpenAL::playAudioBuffer(uint sourceId, const int16_t* data, int samples, unsigned channels,
|
void OpenAL::playAudioBuffer(uint sourceId, const int16_t* data, int samples, unsigned channels,
|
||||||
int sampleRate)
|
int sampleRate)
|
||||||
{
|
{
|
||||||
assert(channels == 1 || channels == 2);
|
assert(channels == 1 || channels == 2);
|
||||||
QMutexLocker locker(&audioLock);
|
QMutexLocker locker(&audioLock);
|
||||||
|
@ -463,9 +463,7 @@ void OpenAL::playMono16SoundCleanup()
|
||||||
alSourcei(alMainSource, AL_BUFFER, AL_NONE);
|
alSourcei(alMainSource, AL_BUFFER, AL_NONE);
|
||||||
alDeleteBuffers(1, &alMainBuffer);
|
alDeleteBuffers(1, &alMainBuffer);
|
||||||
alMainBuffer = 0;
|
alMainBuffer = 0;
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
// the audio didn't finish, try again later
|
// the audio didn't finish, try again later
|
||||||
playMono16Timer.start(10);
|
playMono16Timer.start(10);
|
||||||
}
|
}
|
||||||
|
@ -514,8 +512,8 @@ QStringList OpenAL::outDeviceNames()
|
||||||
{
|
{
|
||||||
QStringList list;
|
QStringList list;
|
||||||
const ALchar* pDeviceList = (alcIsExtensionPresent(NULL, "ALC_ENUMERATE_ALL_EXT") != AL_FALSE)
|
const ALchar* pDeviceList = (alcIsExtensionPresent(NULL, "ALC_ENUMERATE_ALL_EXT") != AL_FALSE)
|
||||||
? alcGetString(NULL, ALC_ALL_DEVICES_SPECIFIER)
|
? alcGetString(NULL, ALC_ALL_DEVICES_SPECIFIER)
|
||||||
: alcGetString(NULL, ALC_DEVICE_SPECIFIER);
|
: alcGetString(NULL, ALC_DEVICE_SPECIFIER);
|
||||||
|
|
||||||
if (pDeviceList) {
|
if (pDeviceList) {
|
||||||
while (*pDeviceList) {
|
while (*pDeviceList) {
|
||||||
|
|
|
@ -89,7 +89,6 @@ public:
|
||||||
int sampleRate);
|
int sampleRate);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
static void checkAlError() noexcept;
|
static void checkAlError() noexcept;
|
||||||
static void checkAlcError(ALCdevice* device) noexcept;
|
static void checkAlcError(ALCdevice* device) noexcept;
|
||||||
|
|
||||||
|
|
|
@ -830,21 +830,21 @@ void ChatLog::handleMultiClickEvent()
|
||||||
return;
|
return;
|
||||||
|
|
||||||
switch (clickCount) {
|
switch (clickCount) {
|
||||||
case 3:
|
case 3:
|
||||||
QPointF scenePos = mapToScene(lastClickPos);
|
QPointF scenePos = mapToScene(lastClickPos);
|
||||||
ChatLineContent* content = getContentFromPos(scenePos);
|
ChatLineContent* content = getContentFromPos(scenePos);
|
||||||
|
|
||||||
if (content) {
|
if (content) {
|
||||||
content->selectionTripleClick(scenePos);
|
content->selectionTripleClick(scenePos);
|
||||||
selClickedCol = content->getColumn();
|
selClickedCol = content->getColumn();
|
||||||
selClickedRow = content->getRow();
|
selClickedRow = content->getRow();
|
||||||
selFirstRow = content->getRow();
|
selFirstRow = content->getRow();
|
||||||
selLastRow = content->getRow();
|
selLastRow = content->getRow();
|
||||||
selectionMode = Precise;
|
selectionMode = Precise;
|
||||||
|
|
||||||
emit selectionChanged();
|
emit selectionChanged();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -99,10 +99,8 @@ FileTransferWidget::FileTransferWidget(QWidget* parent, ToxFile file)
|
||||||
&FileTransferWidget::fileTransferRemotePausedUnpaused);
|
&FileTransferWidget::fileTransferRemotePausedUnpaused);
|
||||||
connect(Core::getInstance(), &Core::fileTransferBrokenUnbroken, this,
|
connect(Core::getInstance(), &Core::fileTransferBrokenUnbroken, this,
|
||||||
&FileTransferWidget::fileTransferBrokenUnbroken);
|
&FileTransferWidget::fileTransferBrokenUnbroken);
|
||||||
connect(ui->leftButton, &QPushButton::clicked, this,
|
connect(ui->leftButton, &QPushButton::clicked, this, &FileTransferWidget::onLeftButtonClicked);
|
||||||
&FileTransferWidget::onLeftButtonClicked);
|
connect(ui->rightButton, &QPushButton::clicked, this, &FileTransferWidget::onRightButtonClicked);
|
||||||
connect(ui->rightButton, &QPushButton::clicked, this,
|
|
||||||
&FileTransferWidget::onRightButtonClicked);
|
|
||||||
connect(ui->previewButton, &QPushButton::clicked, this,
|
connect(ui->previewButton, &QPushButton::clicked, this,
|
||||||
&FileTransferWidget::onPreviewButtonClicked);
|
&FileTransferWidget::onPreviewButtonClicked);
|
||||||
|
|
||||||
|
@ -222,32 +220,32 @@ void FileTransferWidget::paintEvent(QPaintEvent*)
|
||||||
if (drawButtonAreaNeeded()) {
|
if (drawButtonAreaNeeded()) {
|
||||||
// Draw the button background:
|
// Draw the button background:
|
||||||
QPainterPath buttonBackground;
|
QPainterPath buttonBackground;
|
||||||
buttonBackground.addRoundRect(width()-2*buttonFieldWidth-lineWidth*2, 0, buttonFieldWidth,
|
buttonBackground.addRoundRect(width() - 2 * buttonFieldWidth - lineWidth * 2, 0,
|
||||||
buttonFieldWidth+lineWidth, 50, 50);
|
buttonFieldWidth, buttonFieldWidth + lineWidth, 50, 50);
|
||||||
buttonBackground.addRect(width()-2*buttonFieldWidth-lineWidth*2, 0, buttonFieldWidth*2,
|
buttonBackground.addRect(width() - 2 * buttonFieldWidth - lineWidth * 2, 0,
|
||||||
buttonFieldWidth/2);
|
buttonFieldWidth * 2, buttonFieldWidth / 2);
|
||||||
buttonBackground.addRect(width()-1.5*buttonFieldWidth-lineWidth*2, 0, buttonFieldWidth*2,
|
buttonBackground.addRect(width() - 1.5 * buttonFieldWidth - lineWidth * 2, 0,
|
||||||
buttonFieldWidth+1);
|
buttonFieldWidth * 2, buttonFieldWidth + 1);
|
||||||
buttonBackground.setFillRule(Qt::WindingFill);
|
buttonBackground.setFillRule(Qt::WindingFill);
|
||||||
painter.setBrush(QBrush(buttonBackgroundColor));
|
painter.setBrush(QBrush(buttonBackgroundColor));
|
||||||
painter.drawPath(buttonBackground);
|
painter.drawPath(buttonBackground);
|
||||||
|
|
||||||
// Draw the left button:
|
// Draw the left button:
|
||||||
QPainterPath leftButton;
|
QPainterPath leftButton;
|
||||||
leftButton.addRoundRect(QRect(width()-2*buttonFieldWidth-lineWidth, 0, buttonFieldWidth,
|
leftButton.addRoundRect(QRect(width() - 2 * buttonFieldWidth - lineWidth, 0,
|
||||||
buttonFieldWidth), 50, 50);
|
buttonFieldWidth, buttonFieldWidth),
|
||||||
leftButton.addRect(QRect(width()-2*buttonFieldWidth-lineWidth, 0, buttonFieldWidth/2,
|
50, 50);
|
||||||
buttonFieldWidth/2));
|
leftButton.addRect(QRect(width() - 2 * buttonFieldWidth - lineWidth, 0,
|
||||||
leftButton.addRect(QRect(width()-1.5*buttonFieldWidth-lineWidth, 0, buttonFieldWidth/2,
|
buttonFieldWidth / 2, buttonFieldWidth / 2));
|
||||||
buttonFieldWidth));
|
leftButton.addRect(QRect(width() - 1.5 * buttonFieldWidth - lineWidth, 0,
|
||||||
|
buttonFieldWidth / 2, buttonFieldWidth));
|
||||||
leftButton.setFillRule(Qt::WindingFill);
|
leftButton.setFillRule(Qt::WindingFill);
|
||||||
painter.setBrush(QBrush(buttonColor));
|
painter.setBrush(QBrush(buttonColor));
|
||||||
painter.drawPath(leftButton);
|
painter.drawPath(leftButton);
|
||||||
|
|
||||||
// Draw the right button:
|
// Draw the right button:
|
||||||
painter.setBrush(QBrush(buttonColor));
|
painter.setBrush(QBrush(buttonColor));
|
||||||
painter.setClipRect(QRect(width()-buttonFieldWidth, 0, buttonFieldWidth,
|
painter.setClipRect(QRect(width() - buttonFieldWidth, 0, buttonFieldWidth, buttonFieldWidth));
|
||||||
buttonFieldWidth));
|
|
||||||
painter.drawRoundRect(geometry(), r * ratio, r);
|
painter.drawRoundRect(geometry(), r * ratio, r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -366,9 +366,8 @@ QString Text::extractSanitizedText(int from, int to) const
|
||||||
QTextBlock end = doc->findBlock(to);
|
QTextBlock end = doc->findBlock(to);
|
||||||
for (QTextBlock block = begin; block != end.next() && block.isValid(); block = block.next()) {
|
for (QTextBlock block = begin; block != end.next() && block.isValid(); block = block.next()) {
|
||||||
for (QTextBlock::Iterator itr = block.begin(); itr != block.end(); ++itr) {
|
for (QTextBlock::Iterator itr = block.begin(); itr != block.end(); ++itr) {
|
||||||
int pos =
|
int pos = itr.fragment().position(); // fragment position -> position of the first
|
||||||
itr.fragment()
|
// character in the fragment
|
||||||
.position(); // fragment position -> position of the first character in the fragment
|
|
||||||
|
|
||||||
if (itr.fragment().charFormat().isImageFormat()) {
|
if (itr.fragment().charFormat().isImageFormat()) {
|
||||||
QTextImageFormat imgFmt = itr.fragment().charFormat().toImageFormat();
|
QTextImageFormat imgFmt = itr.fragment().charFormat().toImageFormat();
|
||||||
|
|
|
@ -174,7 +174,7 @@ static void processUrl(QString& str, std::function<QString(QString&)> func)
|
||||||
*/
|
*/
|
||||||
void TextFormatter::applyHtmlFontStyling(bool showFormattingSymbols)
|
void TextFormatter::applyHtmlFontStyling(bool showFormattingSymbols)
|
||||||
{
|
{
|
||||||
processUrl(message, [] (QString& str) {
|
processUrl(message, [](QString& str) {
|
||||||
for (char c : MARKDOWN_SYMBOLS) {
|
for (char c : MARKDOWN_SYMBOLS) {
|
||||||
QString charCode = QString::number(static_cast<int>(c));
|
QString charCode = QString::number(static_cast<int>(c));
|
||||||
str.replace(c, HTML_CHARACTER_CODE.arg(charCode));
|
str.replace(c, HTML_CHARACTER_CODE.arg(charCode));
|
||||||
|
@ -217,7 +217,7 @@ void TextFormatter::applyHtmlFontStyling(bool showFormattingSymbols)
|
||||||
*/
|
*/
|
||||||
void TextFormatter::wrapUrl()
|
void TextFormatter::wrapUrl()
|
||||||
{
|
{
|
||||||
processUrl(message, [] (QString& str) {
|
processUrl(message, [](QString& str) {
|
||||||
return htmlPatterns[TextStyle::HREF].arg(str.startsWith("www") ? "http://" : "", str);
|
return htmlPatterns[TextStyle::HREF].arg(str.startsWith("www") ? "http://" : "", str);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,9 +21,9 @@
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QThread>
|
#include <QThread>
|
||||||
|
#include <ctime>
|
||||||
#include <random>
|
#include <random>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <ctime>
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var time_t IPC::lastEvent
|
* @var time_t IPC::lastEvent
|
||||||
|
@ -216,8 +216,7 @@ IPC::IPCEvent* IPC::fetchEvent()
|
||||||
memset(evt, 0, sizeof(IPCEvent));
|
memset(evt, 0, sizeof(IPCEvent));
|
||||||
|
|
||||||
if (evt->posted && !evt->processed && evt->sender != getpid()
|
if (evt->posted && !evt->processed && evt->sender != getpid()
|
||||||
&& (evt->dest == profileId
|
&& (evt->dest == profileId || (evt->dest == 0 && isCurrentOwner())))
|
||||||
|| (evt->dest == 0 && isCurrentOwner())))
|
|
||||||
return evt;
|
return evt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,9 +38,9 @@
|
||||||
#include <QMutex>
|
#include <QMutex>
|
||||||
#include <QMutexLocker>
|
#include <QMutexLocker>
|
||||||
|
|
||||||
|
#include <ctime>
|
||||||
#include <sodium.h>
|
#include <sodium.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <ctime>
|
|
||||||
|
|
||||||
#if defined(Q_OS_OSX)
|
#if defined(Q_OS_OSX)
|
||||||
#include "platform/install_osx.h"
|
#include "platform/install_osx.h"
|
||||||
|
@ -168,8 +168,8 @@ int main(int argc, char* argv[])
|
||||||
|
|
||||||
uint32_t profileId = Settings::getInstance().getCurrentProfileId();
|
uint32_t profileId = Settings::getInstance().getCurrentProfileId();
|
||||||
IPC ipc(profileId);
|
IPC ipc(profileId);
|
||||||
QObject::connect(&Settings::getInstance(), &Settings::currentProfileIdChanged,
|
QObject::connect(&Settings::getInstance(), &Settings::currentProfileIdChanged, &ipc,
|
||||||
&ipc, &IPC::setProfileId);
|
&IPC::setProfileId);
|
||||||
|
|
||||||
if (sodium_init() < 0) // For the auto-updater
|
if (sodium_init() < 0) // For the auto-updater
|
||||||
{
|
{
|
||||||
|
|
|
@ -91,7 +91,8 @@ bool handleToxURI(const QString& toxURI)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString defaultMessage = QObject::tr("%1 here! Tox me maybe?",
|
const QString defaultMessage =
|
||||||
|
QObject::tr("%1 here! Tox me maybe?",
|
||||||
"Default message in Tox URI friend requests. Write something appropriate!");
|
"Default message in Tox URI friend requests. Write something appropriate!");
|
||||||
const QString username = Nexus::getCore()->getUsername();
|
const QString username = Nexus::getCore()->getUsername();
|
||||||
ToxURIDialog* dialog = new ToxURIDialog(nullptr, toxaddr, defaultMessage.arg(username));
|
ToxURIDialog* dialog = new ToxURIDialog(nullptr, toxaddr, defaultMessage.arg(username));
|
||||||
|
|
|
@ -93,7 +93,7 @@ CameraSource::CameraSource()
|
||||||
: deviceName{"none"}
|
: deviceName{"none"}
|
||||||
, device{nullptr}
|
, device{nullptr}
|
||||||
, mode(VideoMode())
|
, mode(VideoMode())
|
||||||
// clang-format off
|
// clang-format off
|
||||||
, cctx{nullptr}
|
, cctx{nullptr}
|
||||||
#if LIBAVCODEC_VERSION_INT < 3747941
|
#if LIBAVCODEC_VERSION_INT < 3747941
|
||||||
, cctxOrig{nullptr}
|
, cctxOrig{nullptr}
|
||||||
|
|
|
@ -69,11 +69,8 @@ ContentDialog::ContentDialog(SettingsWidget* settingsWidget, QWidget* parent)
|
||||||
friendLayout->setMargin(0);
|
friendLayout->setMargin(0);
|
||||||
friendLayout->setSpacing(0);
|
friendLayout->setSpacing(0);
|
||||||
|
|
||||||
layouts = {
|
layouts = {friendLayout->getLayoutOnline(), groupLayout.getLayout(),
|
||||||
friendLayout->getLayoutOnline(),
|
friendLayout->getLayoutOffline()};
|
||||||
groupLayout.getLayout(),
|
|
||||||
friendLayout->getLayoutOffline()
|
|
||||||
};
|
|
||||||
|
|
||||||
if (s.getGroupchatPosition()) {
|
if (s.getGroupchatPosition()) {
|
||||||
layouts.swap(0, 1);
|
layouts.swap(0, 1);
|
||||||
|
@ -141,8 +138,9 @@ ContentDialog::ContentDialog(SettingsWidget* settingsWidget, QWidget* parent)
|
||||||
Translator::registerHandler(std::bind(&ContentDialog::retranslateUi, this), this);
|
Translator::registerHandler(std::bind(&ContentDialog::retranslateUi, this), this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ContentDialog::removeCurrent(QHash<int, ContactInfo>& infos) {
|
void ContentDialog::removeCurrent(QHash<int, ContactInfo>& infos)
|
||||||
for (auto it = infos.begin(); it != infos.end(); ) {
|
{
|
||||||
|
for (auto it = infos.begin(); it != infos.end();) {
|
||||||
if (std::get<0>(*it) == this) {
|
if (std::get<0>(*it) == this) {
|
||||||
it = infos.erase(it);
|
it = infos.erase(it);
|
||||||
} else {
|
} else {
|
||||||
|
@ -354,9 +352,9 @@ void ContentDialog::cycleContacts(bool forward, bool inverse)
|
||||||
bool isCurOffline = currentLayout == friendLayout->getLayoutOffline();
|
bool isCurOffline = currentLayout == friendLayout->getLayoutOffline();
|
||||||
bool isCurOnline = currentLayout == friendLayout->getLayoutOnline();
|
bool isCurOnline = currentLayout == friendLayout->getLayoutOnline();
|
||||||
bool isCurGroup = currentLayout == groupLayout.getLayout();
|
bool isCurGroup = currentLayout == groupLayout.getLayout();
|
||||||
bool nextIsEmpty = (isCurOnline && offlineEmpty && (groupsEmpty || groupsOnTop)) ||
|
bool nextIsEmpty = (isCurOnline && offlineEmpty && (groupsEmpty || groupsOnTop))
|
||||||
(isCurGroup && offlineEmpty && (onlineEmpty || !groupsOnTop)) ||
|
|| (isCurGroup && offlineEmpty && (onlineEmpty || !groupsOnTop))
|
||||||
isCurOffline;
|
|| isCurOffline;
|
||||||
|
|
||||||
if (nextIsEmpty) {
|
if (nextIsEmpty) {
|
||||||
forward = !forward;
|
forward = !forward;
|
||||||
|
@ -509,12 +507,10 @@ void ContentDialog::updateTitleAndStatusIcon()
|
||||||
|
|
||||||
Status currentStatus = activeChatroomWidget->getFriend()->getStatus();
|
Status currentStatus = activeChatroomWidget->getFriend()->getStatus();
|
||||||
|
|
||||||
QMap<Status, QIcon> icons {
|
QMap<Status, QIcon> icons{{Status::Online, QIcon(":/img/status/dot_online.svg")},
|
||||||
{Status::Online, QIcon(":/img/status/dot_online.svg")},
|
{Status::Away, QIcon(":/img/status/dot_away.svg")},
|
||||||
{Status::Away, QIcon(":/img/status/dot_away.svg")},
|
{Status::Busy, QIcon(":/img/status/dot_busy.svg")},
|
||||||
{Status::Busy, QIcon(":/img/status/dot_busy.svg")},
|
{Status::Offline, QIcon(":/img/status/dot_offline.svg")}};
|
||||||
{Status::Offline, QIcon(":/img/status/dot_offline.svg")}
|
|
||||||
};
|
|
||||||
|
|
||||||
setWindowIcon(icons[currentStatus]);
|
setWindowIcon(icons[currentStatus]);
|
||||||
}
|
}
|
||||||
|
@ -821,8 +817,7 @@ bool ContentDialog::hasWidget(int id, GenericChatroomWidget* chatroomWidget,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return std::get<0>(*iter) == this &&
|
return std::get<0>(*iter) == this && std::get<1>(*iter) == chatroomWidget;
|
||||||
std::get<1>(*iter) == chatroomWidget;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -112,8 +112,7 @@ private:
|
||||||
QLayout* nextLayout(QLayout* layout, bool forward) const;
|
QLayout* nextLayout(QLayout* layout, bool forward) const;
|
||||||
int getCurrentLayout(QLayout*& layout);
|
int getCurrentLayout(QLayout*& layout);
|
||||||
|
|
||||||
bool hasWidget(int id, GenericChatroomWidget* chatroomWidget,
|
bool hasWidget(int id, GenericChatroomWidget* chatroomWidget, const QHash<int, ContactInfo>& list);
|
||||||
const QHash<int, ContactInfo>& list);
|
|
||||||
void removeCurrent(QHash<int, ContactInfo>& infos);
|
void removeCurrent(QHash<int, ContactInfo>& infos);
|
||||||
static bool existsWidget(int id, const QHash<int, ContactInfo>& list);
|
static bool existsWidget(int id, const QHash<int, ContactInfo>& list);
|
||||||
static void focusDialog(int id, const QHash<int, ContactInfo>& list);
|
static void focusDialog(int id, const QHash<int, ContactInfo>& list);
|
||||||
|
|
|
@ -610,7 +610,8 @@ void ChatForm::dropEvent(QDropEvent* ev)
|
||||||
QFile file(info.absoluteFilePath());
|
QFile file(info.absoluteFilePath());
|
||||||
|
|
||||||
QString urlString = url.toString();
|
QString urlString = url.toString();
|
||||||
if (url.isValid() && !url.isLocalFile() && urlString.length() < static_cast<int>(tox_max_message_length())) {
|
if (url.isValid() && !url.isLocalFile()
|
||||||
|
&& urlString.length() < static_cast<int>(tox_max_message_length())) {
|
||||||
SendMessageStr(urlString);
|
SendMessageStr(urlString);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,7 @@
|
||||||
* (excluded)
|
* (excluded)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define SET_STYLESHEET(x) (x)->setStyleSheet(Style::getStylesheet(":/ui/"#x"/"#x".css"))
|
#define SET_STYLESHEET(x) (x)->setStyleSheet(Style::getStylesheet(":/ui/" #x "/" #x ".css"))
|
||||||
|
|
||||||
static const QSize AVATAR_SIZE{40, 40};
|
static const QSize AVATAR_SIZE{40, 40};
|
||||||
static const QSize CALL_BUTTONS_SIZE{50, 40};
|
static const QSize CALL_BUTTONS_SIZE{50, 40};
|
||||||
|
@ -380,7 +380,7 @@ void GenericChatForm::onChatContextMenuRequested(QPoint pos)
|
||||||
* @param messageAuthor Author of the sent message
|
* @param messageAuthor Author of the sent message
|
||||||
* @return True if it's needed to hide name, false otherwise
|
* @return True if it's needed to hide name, false otherwise
|
||||||
*/
|
*/
|
||||||
bool GenericChatForm::needsToHideName(const ToxPk &messageAuthor) const
|
bool GenericChatForm::needsToHideName(const ToxPk& messageAuthor) const
|
||||||
{
|
{
|
||||||
qint64 messagesTimeDiff = prevMsgDateTime.secsTo(QDateTime::currentDateTime());
|
qint64 messagesTimeDiff = prevMsgDateTime.secsTo(QDateTime::currentDateTime());
|
||||||
return messageAuthor == previousId && messagesTimeDiff < chatWidget->repNameAfter;
|
return messageAuthor == previousId && messagesTimeDiff < chatWidget->repNameAfter;
|
||||||
|
@ -451,8 +451,7 @@ void GenericChatForm::addMessage(const ToxPk& author, const QString& message, co
|
||||||
/**
|
/**
|
||||||
* @brief Inserts int ChatLog message that you have sent
|
* @brief Inserts int ChatLog message that you have sent
|
||||||
*/
|
*/
|
||||||
void GenericChatForm::addSelfMessage(const QString& message, const QDateTime& datetime,
|
void GenericChatForm::addSelfMessage(const QString& message, const QDateTime& datetime, bool isAction)
|
||||||
bool isAction)
|
|
||||||
{
|
{
|
||||||
createSelfMessage(message, datetime, isAction, true);
|
createSelfMessage(message, datetime, isAction, true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,8 +56,8 @@ ProfileForm::ProfileForm(QWidget* parent)
|
||||||
bodyUI->setupUi(this);
|
bodyUI->setupUi(this);
|
||||||
core = Core::getInstance();
|
core = Core::getInstance();
|
||||||
|
|
||||||
bodyUI->userNameLabel->setToolTip(tr("Tox user names cannot exceed %1 characters.")
|
bodyUI->userNameLabel->setToolTip(
|
||||||
.arg(tox_max_name_length()));
|
tr("Tox user names cannot exceed %1 characters.").arg(tox_max_name_length()));
|
||||||
bodyUI->userName->setMaxLength(tox_max_name_length());
|
bodyUI->userName->setMaxLength(tox_max_name_length());
|
||||||
|
|
||||||
// tox
|
// tox
|
||||||
|
|
|
@ -209,7 +209,7 @@ void FriendListWidget::setMode(Mode mode)
|
||||||
{ Time::Month4Ago, ql.monthName(today.addMonths(-4).month()) },
|
{ Time::Month4Ago, ql.monthName(today.addMonths(-4).month()) },
|
||||||
{ Time::Month5Ago, ql.monthName(today.addMonths(-5).month()) },
|
{ Time::Month5Ago, ql.monthName(today.addMonths(-5).month()) },
|
||||||
};
|
};
|
||||||
// clang-format on
|
// clang-format on
|
||||||
#undef COMMENT
|
#undef COMMENT
|
||||||
|
|
||||||
activityLayout = new QVBoxLayout();
|
activityLayout = new QVBoxLayout();
|
||||||
|
|
|
@ -44,8 +44,7 @@ void Translator::translate(const QString& localeName)
|
||||||
|
|
||||||
// Load translations
|
// Load translations
|
||||||
QCoreApplication::removeTranslator(translator);
|
QCoreApplication::removeTranslator(translator);
|
||||||
QString locale = localeName.isEmpty() ? QLocale::system().name().section('_', 0, 0)
|
QString locale = localeName.isEmpty() ? QLocale::system().name().section('_', 0, 0) : localeName;
|
||||||
: localeName;
|
|
||||||
|
|
||||||
if (locale != "en") {
|
if (locale != "en") {
|
||||||
if (translator->load(locale, ":translations/")) {
|
if (translator->load(locale, ":translations/")) {
|
||||||
|
|
|
@ -75,7 +75,7 @@ static const StringToString multilineCode{
|
||||||
{QStringLiteral("```int main()\n{\n return 0;\n}```"),
|
{QStringLiteral("```int main()\n{\n return 0;\n}```"),
|
||||||
QStringLiteral("<font color=#595959><code>int main()\n{\n return 0;\n}</code></font>")}};
|
QStringLiteral("<font color=#595959><code>int main()\n{\n return 0;\n}</code></font>")}};
|
||||||
|
|
||||||
static const StringToString urlCases {
|
static const StringToString urlCases{
|
||||||
{QStringLiteral("https://github.com/qTox/qTox/issues/4233"),
|
{QStringLiteral("https://github.com/qTox/qTox/issues/4233"),
|
||||||
QStringLiteral("<a href=\"https://github.com/qTox/qTox/issues/4233\">"
|
QStringLiteral("<a href=\"https://github.com/qTox/qTox/issues/4233\">"
|
||||||
"https://github.com/qTox/qTox/issues/4233</a>")},
|
"https://github.com/qTox/qTox/issues/4233</a>")},
|
||||||
|
|
|
@ -32,7 +32,7 @@ struct UpdateFileMeta
|
||||||
unsigned char sig[crypto_sign_BYTES]; ///< Signature of the file (ed25519)
|
unsigned char sig[crypto_sign_BYTES]; ///< Signature of the file (ed25519)
|
||||||
QString id; ///< Unique id of the file
|
QString id; ///< Unique id of the file
|
||||||
QString installpath; ///< Local path including the file name. May be relative to qtox-updater or
|
QString installpath; ///< Local path including the file name. May be relative to qtox-updater or
|
||||||
///absolute
|
/// absolute
|
||||||
uint64_t size; ///< Size in bytes of the file
|
uint64_t size; ///< Size in bytes of the file
|
||||||
|
|
||||||
bool operator==(const UpdateFileMeta& other)
|
bool operator==(const UpdateFileMeta& other)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user