1
0
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:
sudden6 2021-02-28 12:49:23 +01:00
commit 9287d5e2ec
No known key found for this signature in database
GPG Key ID: 279509B499E032B9
5 changed files with 57 additions and 7 deletions

View File

@ -57,6 +57,20 @@ RUN git checkout v0.2.12 && \
echo '/usr/local/lib/' >> /etc/ld.so.conf.d/locallib.conf && \
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
WORKDIR /qtox
RUN cmake . && cmake --build .

View File

@ -54,6 +54,20 @@ RUN git checkout v0.2.12 && \
echo '/usr/local/lib/' >> /etc/ld.so.conf.d/locallib.conf && \
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
WORKDIR /qtox
RUN cmake . && cmake --build .

View File

@ -105,6 +105,13 @@ QString getAsRichText(const QString& key)
return RICH_TEXT_PATTERN.arg(key);
}
bool isAscii(const QString& string)
{
constexpr auto asciiExtMask = 0x80;
return (string.toUtf8()[0] & asciiExtMask) == 0;
}
SmileyPack::SmileyPack()
: cleanupTimer{new QTimer(this)}
{
@ -257,19 +264,30 @@ bool SmileyPack::load(const QString& filename)
void SmileyPack::constructRegex()
{
QString allPattern = QStringLiteral("(");
QString regularPatterns;
QString multiCharacterEmojiPatterns;
// construct one big regex that matches on every emoticon
for (const QString& emote : emoticonToPath.keys()) {
if (!isAscii(emote)) {
if (emote.toUcs4().length() == 1) {
// UTF-8 emoji
allPattern = allPattern % emote;
regularPatterns.append(emote);
regularPatterns.append(QStringLiteral("|"));
}
else {
multiCharacterEmojiPatterns.append(emote);
multiCharacterEmojiPatterns.append(QStringLiteral("|"));
}
} else {
// 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(')');
// compile and optimize regex
@ -297,6 +315,7 @@ QString SmileyPack::smileyfied(const QString& msg)
result.replace(startPos + replaceDiff, keyLength, imgRichText);
replaceDiff += imgRichText.length() - keyLength;
}
return result;
}

View File

@ -206,6 +206,7 @@ QVector<QPair<QString, QString>> v4l2::getDeviceList()
ioctl(fd, VIDIOC_QUERYCAP, &caps);
close(fd);
if (caps.device_caps & V4L2_CAP_VIDEO_CAPTURE)
devices += {file, reinterpret_cast<const char*>(caps.card)};
}
return devices;

View File

@ -115,8 +115,10 @@ FriendListWidget::FriendListWidget(const Core &_core, Widget* parent, bool group
mode = Settings::getInstance().getFriendSortingMode();
sortByMode(mode);
if (mode != SortingMode::Name) {
listLayout->insertLayout(0, groupLayout.getLayout());
}
onGroupchatPositionChanged(groupsOnTop);
dayTimer = new QTimer(this);
dayTimer->setTimerType(Qt::VeryCoarseTimer);
connect(dayTimer, &QTimer::timeout, this, &FriendListWidget::dayTimeout);