mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
Merge pull request #6309
Anthony Bilinski (3): Merge pull request #6302 Merge pull request #6304 Merge pull request #6308 Jamie Westell (2): chore(docker): add missing deps to dockerfiles fix(video): only list video devices with video capture capability Waris Boonyasiriwat (1): fix(smileys): fix flag emojis bodwok (1): fix(ui): add group widgets on start with "Activity" mode
This commit is contained in:
commit
9287d5e2ec
|
@ -57,6 +57,20 @@ RUN git checkout v0.2.12 && \
|
||||||
echo '/usr/local/lib/' >> /etc/ld.so.conf.d/locallib.conf && \
|
echo '/usr/local/lib/' >> /etc/ld.so.conf.d/locallib.conf && \
|
||||||
ldconfig
|
ldconfig
|
||||||
|
|
||||||
|
RUN git clone https://github.com/toxext/toxext.git /toxext
|
||||||
|
WORKDIR /toxext
|
||||||
|
RUN git checkout v0.0.2 && \
|
||||||
|
cmake . && \
|
||||||
|
cmake --build . -- -j $(nproc) && \
|
||||||
|
cmake --build . --target install
|
||||||
|
|
||||||
|
RUN git clone https://github.com/toxext/tox_extension_messages.git /tox_extension_messages
|
||||||
|
WORKDIR /tox_extension_messages
|
||||||
|
RUN git checkout v0.0.2 && \
|
||||||
|
cmake . && \
|
||||||
|
cmake --build . -- -j $(nproc) && \
|
||||||
|
cmake --build . --target install
|
||||||
|
|
||||||
COPY . /qtox
|
COPY . /qtox
|
||||||
WORKDIR /qtox
|
WORKDIR /qtox
|
||||||
RUN cmake . && cmake --build .
|
RUN cmake . && cmake --build .
|
||||||
|
|
|
@ -54,6 +54,20 @@ RUN git checkout v0.2.12 && \
|
||||||
echo '/usr/local/lib/' >> /etc/ld.so.conf.d/locallib.conf && \
|
echo '/usr/local/lib/' >> /etc/ld.so.conf.d/locallib.conf && \
|
||||||
ldconfig
|
ldconfig
|
||||||
|
|
||||||
|
RUN git clone https://github.com/toxext/toxext.git /toxext
|
||||||
|
WORKDIR /toxext
|
||||||
|
RUN git checkout v0.0.2 && \
|
||||||
|
cmake . && \
|
||||||
|
cmake --build . -- -j $(nproc) && \
|
||||||
|
cmake --build . --target install
|
||||||
|
|
||||||
|
RUN git clone https://github.com/toxext/tox_extension_messages.git /tox_extension_messages
|
||||||
|
WORKDIR /tox_extension_messages
|
||||||
|
RUN git checkout v0.0.2 && \
|
||||||
|
cmake . && \
|
||||||
|
cmake --build . -- -j $(nproc) && \
|
||||||
|
cmake --build . --target install
|
||||||
|
|
||||||
COPY . /qtox
|
COPY . /qtox
|
||||||
WORKDIR /qtox
|
WORKDIR /qtox
|
||||||
RUN cmake . && cmake --build .
|
RUN cmake . && cmake --build .
|
||||||
|
|
|
@ -105,6 +105,13 @@ QString getAsRichText(const QString& key)
|
||||||
return RICH_TEXT_PATTERN.arg(key);
|
return RICH_TEXT_PATTERN.arg(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isAscii(const QString& string)
|
||||||
|
{
|
||||||
|
constexpr auto asciiExtMask = 0x80;
|
||||||
|
|
||||||
|
return (string.toUtf8()[0] & asciiExtMask) == 0;
|
||||||
|
}
|
||||||
|
|
||||||
SmileyPack::SmileyPack()
|
SmileyPack::SmileyPack()
|
||||||
: cleanupTimer{new QTimer(this)}
|
: cleanupTimer{new QTimer(this)}
|
||||||
{
|
{
|
||||||
|
@ -257,19 +264,30 @@ bool SmileyPack::load(const QString& filename)
|
||||||
void SmileyPack::constructRegex()
|
void SmileyPack::constructRegex()
|
||||||
{
|
{
|
||||||
QString allPattern = QStringLiteral("(");
|
QString allPattern = QStringLiteral("(");
|
||||||
|
QString regularPatterns;
|
||||||
|
QString multiCharacterEmojiPatterns;
|
||||||
|
|
||||||
// construct one big regex that matches on every emoticon
|
// construct one big regex that matches on every emoticon
|
||||||
for (const QString& emote : emoticonToPath.keys()) {
|
for (const QString& emote : emoticonToPath.keys()) {
|
||||||
if (emote.toUcs4().length() == 1) {
|
if (!isAscii(emote)) {
|
||||||
// UTF-8 emoji
|
if (emote.toUcs4().length() == 1) {
|
||||||
allPattern = allPattern % emote;
|
regularPatterns.append(emote);
|
||||||
|
regularPatterns.append(QStringLiteral("|"));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
multiCharacterEmojiPatterns.append(emote);
|
||||||
|
multiCharacterEmojiPatterns.append(QStringLiteral("|"));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// patterns like ":)" or ":smile:", don't match inside a word or else will hit punctuation and html tags
|
// patterns like ":)" or ":smile:", don't match inside a word or else will hit punctuation and html tags
|
||||||
allPattern = allPattern % QStringLiteral(R"((?<=^|\s))") % QRegularExpression::escape(emote) % QStringLiteral(R"((?=$|\s))");
|
regularPatterns.append(QStringLiteral(R"((?<=^|\s))") % QRegularExpression::escape(emote) % QStringLiteral(R"((?=$|\s))"));
|
||||||
|
regularPatterns.append(QStringLiteral("|"));
|
||||||
}
|
}
|
||||||
allPattern = allPattern % QStringLiteral("|");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Regexps are evaluated from left to right, insert multichar emojis first so they are evaluated first
|
||||||
|
allPattern.append(multiCharacterEmojiPatterns);
|
||||||
|
allPattern.append(regularPatterns);
|
||||||
allPattern[allPattern.size() - 1] = QChar(')');
|
allPattern[allPattern.size() - 1] = QChar(')');
|
||||||
|
|
||||||
// compile and optimize regex
|
// compile and optimize regex
|
||||||
|
@ -297,6 +315,7 @@ QString SmileyPack::smileyfied(const QString& msg)
|
||||||
result.replace(startPos + replaceDiff, keyLength, imgRichText);
|
result.replace(startPos + replaceDiff, keyLength, imgRichText);
|
||||||
replaceDiff += imgRichText.length() - keyLength;
|
replaceDiff += imgRichText.length() - keyLength;
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -206,7 +206,8 @@ QVector<QPair<QString, QString>> v4l2::getDeviceList()
|
||||||
ioctl(fd, VIDIOC_QUERYCAP, &caps);
|
ioctl(fd, VIDIOC_QUERYCAP, &caps);
|
||||||
close(fd);
|
close(fd);
|
||||||
|
|
||||||
devices += {file, reinterpret_cast<const char*>(caps.card)};
|
if (caps.device_caps & V4L2_CAP_VIDEO_CAPTURE)
|
||||||
|
devices += {file, reinterpret_cast<const char*>(caps.card)};
|
||||||
}
|
}
|
||||||
return devices;
|
return devices;
|
||||||
}
|
}
|
||||||
|
|
|
@ -115,8 +115,10 @@ FriendListWidget::FriendListWidget(const Core &_core, Widget* parent, bool group
|
||||||
|
|
||||||
mode = Settings::getInstance().getFriendSortingMode();
|
mode = Settings::getInstance().getFriendSortingMode();
|
||||||
sortByMode(mode);
|
sortByMode(mode);
|
||||||
|
if (mode != SortingMode::Name) {
|
||||||
|
listLayout->insertLayout(0, groupLayout.getLayout());
|
||||||
|
}
|
||||||
|
|
||||||
onGroupchatPositionChanged(groupsOnTop);
|
|
||||||
dayTimer = new QTimer(this);
|
dayTimer = new QTimer(this);
|
||||||
dayTimer->setTimerType(Qt::VeryCoarseTimer);
|
dayTimer->setTimerType(Qt::VeryCoarseTimer);
|
||||||
connect(dayTimer, &QTimer::timeout, this, &FriendListWidget::dayTimeout);
|
connect(dayTimer, &QTimer::timeout, this, &FriendListWidget::dayTimeout);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user