mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
Merge remote-tracking branch 'origin/master' into custom-highlight-color-tabs
This commit is contained in:
commit
d4c1ef5f80
|
@ -14,10 +14,15 @@ script_path=$(readlink -f "$0")
|
|||
script_dir=$(dirname "$script_path")
|
||||
chatterino_dir=$(dirname "$script_dir")
|
||||
|
||||
qmake_path=$(command -v qmake)
|
||||
|
||||
echo "Running LDD on chatterino binary:"
|
||||
ldd ./bin/chatterino
|
||||
echo ""
|
||||
|
||||
echo "Running make install in the appdir"
|
||||
make INSTALL_ROOT=appdir -j"$(nproc)" install ; find appdir/
|
||||
echo ""
|
||||
|
||||
cp "$chatterino_dir"/resources/icon.png ./appdir/chatterino.png
|
||||
|
||||
linuxdeployqt_path="linuxdeployqt-6-x86_64.AppImage"
|
||||
|
@ -31,16 +36,18 @@ if [ ! -f appimagetool-x86_64.AppImage ]; then
|
|||
wget -nv "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage"
|
||||
chmod a+x appimagetool-x86_64.AppImage
|
||||
fi
|
||||
echo "Run LinuxDeployQT"
|
||||
./"$linuxdeployqt_path" \
|
||||
appdir/usr/share/applications/*.desktop \
|
||||
-no-translations \
|
||||
-bundle-non-qt-libs \
|
||||
-unsupported-allow-new-glibc \
|
||||
-qmake="$qmake_path"
|
||||
-unsupported-allow-new-glibc
|
||||
|
||||
rm -rf appdir/home
|
||||
rm -f appdir/AppRun
|
||||
|
||||
echo "Run AppImageTool"
|
||||
|
||||
# shellcheck disable=SC2016
|
||||
echo '#!/bin/sh
|
||||
here="$(dirname "$(readlink -f "${0}")")"
|
||||
|
|
|
@ -1,7 +1,12 @@
|
|||
#!/bin/sh
|
||||
|
||||
if [ -d bin/chatterino.app ] && [ ! -d chatterino.app ]; then
|
||||
>&2 echo "Moving bin/chatterino.app down one directory"
|
||||
mv bin/chatterino.app chatterino.app
|
||||
fi
|
||||
|
||||
echo "Running MACDEPLOYQT"
|
||||
/usr/local/opt/qt/bin/macdeployqt chatterino.app
|
||||
$Qt5_DIR/bin/macdeployqt chatterino.app
|
||||
echo "Creating python3 virtual environment"
|
||||
python3 -m venv venv
|
||||
echo "Entering python3 virtual environment"
|
||||
|
|
35
.CI/CreateUbuntuDeb.sh
Executable file
35
.CI/CreateUbuntuDeb.sh
Executable file
|
@ -0,0 +1,35 @@
|
|||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
if [ ! -f ./bin/chatterino ] || [ ! -x ./bin/chatterino ]; then
|
||||
echo "ERROR: No chatterino binary file found. This script must be run in the build folder, and chatterino must be built first."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
chatterino_version=$(git describe | cut -c 2-)
|
||||
echo "Found Chatterino version $chatterino_version via git"
|
||||
|
||||
rm -vrf "./package" || true # delete any old packaging dir
|
||||
|
||||
# create ./package/ from scratch
|
||||
mkdir package/DEBIAN -p
|
||||
packaging_dir="$(realpath ./package)"
|
||||
|
||||
echo "Making control file"
|
||||
cat >> "$packaging_dir/DEBIAN/control" << EOF
|
||||
Package: chatterino
|
||||
Section: net
|
||||
Priority: optional
|
||||
Architecture: amd64
|
||||
Maintainer: Mm2PL <mm2pl@kotmisia.pl>
|
||||
Description: Testing out chatterino as a Ubuntu package
|
||||
Depends: libc6, libqt5concurrent5, libqt5core5a, libqt5dbus5, libqt5gui5, libqt5multimedia5, libqt5network5, libqt5svg5, libqt5widgets5, libssl1.1, libstdc++6
|
||||
EOF
|
||||
echo "Version: $chatterino_version" >> "$packaging_dir/DEBIAN/control"
|
||||
|
||||
echo "Running make install in package dir"
|
||||
DESTDIR="$packaging_dir" make INSTALL_ROOT="$packaging_dir" -j"$(nproc)" install; find "$packaging_dir/"
|
||||
echo ""
|
||||
|
||||
echo "Building package..."
|
||||
dpkg-deb --build "$packaging_dir" "Chatterino.deb"
|
|
@ -1,6 +0,0 @@
|
|||
git clone http://code.qt.io/qt/qtstyleplugins.git
|
||||
cd qtstyleplugins
|
||||
/opt/qt512/bin/qmake CONFIG+=release
|
||||
make -j$(nproc)
|
||||
sudo make install
|
||||
cd -
|
|
@ -1,9 +1,20 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import biplist
|
||||
import sys
|
||||
import os.path
|
||||
|
||||
# Before Python 3.4, use biplist; afterwards, use plistlib
|
||||
if sys.version_info < (3, 4):
|
||||
import biplist
|
||||
def read_plist(path):
|
||||
return biplist.readPlist(path)
|
||||
else:
|
||||
import plistlib
|
||||
def read_plist(path):
|
||||
with open(path, 'rb') as f:
|
||||
return plistlib.load(f)
|
||||
|
||||
#
|
||||
# Example settings file for dmgbuild
|
||||
#
|
||||
|
@ -22,7 +33,7 @@ appname = os.path.basename(application)
|
|||
|
||||
def icon_from_app(app_path):
|
||||
plist_path = os.path.join(app_path, 'Contents', 'Info.plist')
|
||||
plist = biplist.readPlist(plist_path)
|
||||
plist = read_plist(plist_path)
|
||||
icon_name = plist['CFBundleIconFile']
|
||||
icon_root,icon_ext = os.path.splitext(icon_name)
|
||||
if not icon_ext:
|
||||
|
|
13
.cirrus.yml
Normal file
13
.cirrus.yml
Normal file
|
@ -0,0 +1,13 @@
|
|||
freebsd_instance:
|
||||
image: freebsd-12-1-release-amd64
|
||||
|
||||
task:
|
||||
install_script:
|
||||
- pkg install -y boost-libs git qt5-buildtools qt5-concurrent qt5-core qt5-multimedia qt5-svg qtkeychain qt5-qmake cmake qt5-linguist
|
||||
script: |
|
||||
git submodule init
|
||||
git submodule update
|
||||
mkdir build
|
||||
cd build
|
||||
cmake CMAKE_C_COMPILER="cc" -DCMAKE_CXX_COMPILER="c++" -DCMAKE_C_FLAGS="-O2 -pipe -fstack-protector-strong -fno-strict-aliasing " -DCMAKE_CXX_FLAGS="-O2 -pipe -fstack-protector-strong -fno-strict-aliasing " -DLINK_OPTIONS="-fstack-protector-strong" -DCMAKE_INSTALL_PREFIX="/usr/local" -DCMAKE_BUILD_TYPE="release" ..
|
||||
make -j $(getconf _NPROCESSORS_ONLN)
|
47
.clang-tidy
Normal file
47
.clang-tidy
Normal file
|
@ -0,0 +1,47 @@
|
|||
Checks: '-*,
|
||||
clang-diagnostic-*,
|
||||
llvm-*,
|
||||
misc-*,
|
||||
-misc-unused-parameters,
|
||||
readability-identifier-naming,
|
||||
-llvm-header-guard,
|
||||
modernize-*,
|
||||
readability-*,
|
||||
performance-*,
|
||||
misc-*,
|
||||
bugprone-*,
|
||||
cert-*,
|
||||
cppcoreguidelines-*,
|
||||
-cppcoreguidelines-pro-type-cstyle-cast,
|
||||
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
|
||||
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
|
||||
-cppcoreguidelines-pro-type-member-init,
|
||||
-cppcoreguidelines-owning-memory,
|
||||
-cppcoreguidelines-avoid-magic-numbers,
|
||||
-readability-magic-numbers,
|
||||
-performance-noexcept-move-constructor,
|
||||
-misc-non-private-member-variables-in-classes,
|
||||
-cppcoreguidelines-non-private-member-variables-in-classes,
|
||||
-modernize-use-nodiscard,
|
||||
-modernize-use-trailing-return-type,
|
||||
-readability-identifier-length,
|
||||
-readability-function-cognitive-complexity,
|
||||
-bugprone-easily-swappable-parameters,
|
||||
'
|
||||
CheckOptions:
|
||||
- key: readability-identifier-naming.ClassCase
|
||||
value: CamelCase
|
||||
- key: readability-identifier-naming.EnumCase
|
||||
value: CamelCase
|
||||
- key: readability-identifier-naming.FunctionCase
|
||||
value: camelBack
|
||||
- key: readability-identifier-naming.MemberCase
|
||||
value: camelBack
|
||||
- key: readability-identifier-naming.PrivateMemberSuffix
|
||||
value: _
|
||||
- key: readability-identifier-naming.UnionCase
|
||||
value: CamelCase
|
||||
- key: readability-identifier-naming.GlobalVariableCase
|
||||
value: UPPER_CASE
|
||||
- key: readability-identifier-naming.VariableCase
|
||||
value: camelBack
|
|
@ -1,22 +0,0 @@
|
|||
FROM ubuntu:18.04
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get -y install wget libdbus-1-dev qt5-default
|
||||
|
||||
RUN apt-get -y install libboost-dev libssl-dev libboost-system-dev libboost-filesystem-dev
|
||||
RUN apt-get -y install libpulse-dev
|
||||
|
||||
WORKDIR /build
|
||||
|
||||
RUN wget --quiet http://download.qt.io/official_releases/qt/5.12/5.12.4/qt-opensource-linux-x64-5.12.4.run && chmod +x *qt*.run
|
||||
ADD qt-installer-noninteractive.qs .
|
||||
RUN ls -la
|
||||
RUN ./qt-opensource-linux-x64-*.run --platform minimal --verbose --script qt-installer-noninteractive.qs
|
||||
RUN qtchooser -install 5.12.4 ~/Qt/5.12.4/gcc_64/bin/qmake
|
||||
ENV QT_SELECT=5.12.4
|
||||
RUN qmake --version
|
||||
|
||||
CMD ["/bin/sh"]
|
||||
ENTRYPOINT ["./tools/docker/build.sh"]
|
|
@ -1,81 +0,0 @@
|
|||
// Emacs mode hint: -*- mode: JavaScript -*-
|
||||
|
||||
function Controller() {
|
||||
installer.autoRejectMessageBoxes();
|
||||
installer.installationFinished.connect(function() {
|
||||
gui.clickButton(buttons.NextButton);
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
Controller.prototype.WelcomePageCallback = function() {
|
||||
// click delay here because the next button is initially disabled for ~1 second
|
||||
gui.clickButton(buttons.NextButton, 3000);
|
||||
|
||||
}
|
||||
|
||||
Controller.prototype.CredentialsPageCallback = function() {
|
||||
gui.clickButton(buttons.NextButton);
|
||||
|
||||
}
|
||||
|
||||
Controller.prototype.IntroductionPageCallback = function() {
|
||||
gui.clickButton(buttons.NextButton);
|
||||
|
||||
}
|
||||
|
||||
Controller.prototype.TargetDirectoryPageCallback = function()
|
||||
{
|
||||
gui.currentPageWidget().TargetDirectoryLineEdit.setText(installer.value("HomeDir") + "/Qt");
|
||||
gui.clickButton(buttons.NextButton);
|
||||
|
||||
}
|
||||
|
||||
Controller.prototype.ComponentSelectionPageCallback = function() {
|
||||
var widget = gui.currentPageWidget();
|
||||
|
||||
widget.deselectAll();
|
||||
widget.selectComponent("qt.qt5.5124.gcc_64");
|
||||
|
||||
// widget.deselectComponent("qt.tools.qtcreator");
|
||||
// widget.deselectComponent("qt.55.qt3d");
|
||||
// widget.deselectComponent("qt.55.qtcanvas3d");
|
||||
// widget.deselectComponent("qt.55.qtlocation");
|
||||
// widget.deselectComponent("qt.55.qtquick1");
|
||||
// widget.deselectComponent("qt.55.qtscript");
|
||||
// widget.deselectComponent("qt.55.qtwebengine");
|
||||
// widget.deselectComponent("qt.extras");
|
||||
// widget.deselectComponent("qt.tools.doc");
|
||||
// widget.deselectComponent("qt.tools.examples");
|
||||
|
||||
gui.clickButton(buttons.NextButton);
|
||||
|
||||
}
|
||||
|
||||
Controller.prototype.LicenseAgreementPageCallback = function() {
|
||||
gui.currentPageWidget().AcceptLicenseRadioButton.setChecked(true);
|
||||
gui.clickButton(buttons.NextButton);
|
||||
|
||||
}
|
||||
|
||||
Controller.prototype.StartMenuDirectoryPageCallback = function() {
|
||||
gui.clickButton(buttons.NextButton);
|
||||
|
||||
}
|
||||
|
||||
Controller.prototype.ReadyForInstallationPageCallback = function()
|
||||
{
|
||||
gui.clickButton(buttons.NextButton);
|
||||
|
||||
}
|
||||
|
||||
Controller.prototype.FinishedPageCallback = function() {
|
||||
var checkBoxForm = gui.currentPageWidget().LaunchQtCreatorCheckBoxForm;
|
||||
if (checkBoxForm && checkBoxForm.launchQtCreatorCheckBox) {
|
||||
checkBoxForm.launchQtCreatorCheckBox.checked = false;
|
||||
|
||||
}
|
||||
gui.clickButton(buttons.FinishButton);
|
||||
|
||||
}
|
1
.github/FUNDING.yml
vendored
Normal file
1
.github/FUNDING.yml
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
custom: "https://streamelements.com/fourtf/tip"
|
53
.github/ISSUE_TEMPLATE/a_make_a_report.yml
vendored
Normal file
53
.github/ISSUE_TEMPLATE/a_make_a_report.yml
vendored
Normal file
|
@ -0,0 +1,53 @@
|
|||
name: Issue report
|
||||
description: Report something that's missing, that you have trouble with or that stopped working
|
||||
labels: [issue-report]
|
||||
|
||||
body:
|
||||
- type: checkboxes
|
||||
id: acknowledgments
|
||||
attributes:
|
||||
label: Checklist
|
||||
description:
|
||||
options:
|
||||
- label: I'm reporting a problem with Chatterino
|
||||
required: true
|
||||
- label: I've verified that I'm running **the most** recent nightly build or stable release
|
||||
required: true
|
||||
- label: I've looked for my problem on the [wiki](https://wiki.chatterino.com/Help/)
|
||||
required: true
|
||||
- label: I've searched the [issues and pull requests](https://github.com/Chatterino/chatterino2/issues?q=) for similar looking reports
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: description
|
||||
validations:
|
||||
required: true
|
||||
attributes:
|
||||
label: Describe your issue
|
||||
description: |
|
||||
Write a brief description of your issue.
|
||||
Important:
|
||||
Focus on the problem instead of a concrete solution. This ensures that the focus of the thread is to resolve your issue.
|
||||
If you want to voice a concrete idea you can add a comment below after posting the issue.
|
||||
placeholder: |
|
||||
Examples:
|
||||
- I cannot do X.
|
||||
- I have trouble doing X.
|
||||
- Feature X has stopped working for me.
|
||||
|
||||
- type: textarea
|
||||
id: screenshots
|
||||
attributes:
|
||||
label: Screenshots
|
||||
description: While optional, it's highly encouraged to include screenshots or videos to illustrate what you mean.
|
||||
placeholder: You can upload them using the text editor's dedicated button.
|
||||
|
||||
- type: input
|
||||
id: versions
|
||||
validations:
|
||||
required: true
|
||||
attributes:
|
||||
label: OS and Chatterino Version
|
||||
description: The name of your Operating System and the version shown in Chatterino's about settings page (⚙ -> about tab).
|
||||
placeholder: Chatterino 2.3.5 (commit 81a62764, 2022-04-05) on Windows 10 Version 2009, kernel 10.0.19043
|
||||
|
26
.github/ISSUE_TEMPLATE/bug_report.md
vendored
26
.github/ISSUE_TEMPLATE/bug_report.md
vendored
|
@ -1,26 +0,0 @@
|
|||
---
|
||||
name: Bug report
|
||||
about: Report something not working correctly that should be fixed
|
||||
title: ''
|
||||
labels: bug, needs triage
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
<!-- A clear and concise description of what the bug is. -->
|
||||
|
||||
**To reproduce**
|
||||
<!-- Steps to reproduce the behavior -->
|
||||
|
||||
**Screenshots**
|
||||
<!-- If applicable, add screenshots to help explain your problem. Use the integrated uploader of the issue form to upload images, or copy an image to the clipboard and paste it in the input box -->
|
||||
|
||||
**Chatterino version**
|
||||
<!-- Copy the version information from the "About" page in the Settings, e.g. `Chatterino 2.1.4 (commit 35c7853c4, 16.09.2019)` -->
|
||||
|
||||
**Operating system**
|
||||
<!-- E.g. Windows 10 -->
|
||||
|
||||
**Additional information**
|
||||
<!-- If applicable, add additional context. -->
|
11
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
11
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
|
@ -0,0 +1,11 @@
|
|||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: Issue about the Chatterino Browser Extension
|
||||
url: https://github.com/Chatterino/chatterino-browser-ext/issues
|
||||
about: Make a suggestion or report a bug about the Chatterino browser extension.
|
||||
- name: Suggestions or feature request
|
||||
url: https://github.com/chatterino/chatterino2/discussions/categories/ideas
|
||||
about: Got something you think should change or be added? Search for or start a new discussion!
|
||||
- name: Help
|
||||
url: https://github.com/chatterino/chatterino2/discussions/categories/q-a
|
||||
about: Chatterino2 not working as you'd expect? Not sure it's a bug? Check the Q&A section!
|
14
.github/ISSUE_TEMPLATE/feature-suggestion.md
vendored
14
.github/ISSUE_TEMPLATE/feature-suggestion.md
vendored
|
@ -1,14 +0,0 @@
|
|||
---
|
||||
name: Feature suggestion
|
||||
about: Suggest an idea for this project
|
||||
title: ''
|
||||
labels: enhancement, needs triage
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**What should be added?**
|
||||
<!-- A clear and concise description of the requested feature. -->
|
||||
|
||||
**Why should it be added?**
|
||||
<!-- A clear and concise description of what motivates you to request this change. -->
|
|
@ -1,14 +0,0 @@
|
|||
---
|
||||
name: Something completely different
|
||||
about: If you have something completely different
|
||||
title: ''
|
||||
labels: needs triage
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
<!--
|
||||
Please be as descriptive as possible.
|
||||
Attach screenshots where helpful.
|
||||
If your concern relates to chatterino2 behaviour, please also include the version info from the program's title bar, e.g. `2.0.4 (15.08.2019 c1afbd5-1)`
|
||||
-->
|
15
.github/dependabot.yml
vendored
Normal file
15
.github/dependabot.yml
vendored
Normal file
|
@ -0,0 +1,15 @@
|
|||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
labels:
|
||||
- "ci"
|
||||
- package-ecosystem: "gitsubmodule"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
labels:
|
||||
- "ci"
|
||||
- "submodules"
|
216
.github/workflows/build.yml
vendored
216
.github/workflows/build.yml
vendored
|
@ -3,13 +3,14 @@ name: Build
|
|||
|
||||
on:
|
||||
push:
|
||||
paths-ignore:
|
||||
- 'docs/**'
|
||||
- '*.md'
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- 'docs/**'
|
||||
- '*.md'
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: build-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
@ -17,105 +18,176 @@ jobs:
|
|||
strategy:
|
||||
matrix:
|
||||
os: [windows-latest, ubuntu-latest, macos-latest]
|
||||
qt-version: [5.15.2, 5.12.12]
|
||||
pch: [true]
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
qt-version: 5.15.2
|
||||
pch: false
|
||||
fail-fast: false
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set environment variables for windows-latest
|
||||
if: matrix.os == 'windows-latest'
|
||||
run: |
|
||||
echo "vs_version=2022" >> $GITHUB_ENV
|
||||
shell: bash
|
||||
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: true
|
||||
fetch-depth: 0 # allows for tags access
|
||||
|
||||
- name: Cache Qt
|
||||
id: cache-qt
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ../Qt
|
||||
key: ${{ runner.os }}-QtCache-v2
|
||||
path: "${{ github.workspace }}/qt/"
|
||||
key: ${{ runner.os }}-QtCache-${{ matrix.qt-version }}
|
||||
|
||||
# LINUX
|
||||
- name: Install Qt
|
||||
uses: jurplel/install-qt-action@v2
|
||||
with:
|
||||
mirror: 'http://mirrors.ocf.berkeley.edu/qt/'
|
||||
cached: ${{ steps.cache-qt.outputs.cache-hit }}
|
||||
version: ${{ matrix.qt-version }}
|
||||
dir: "${{ github.workspace }}/qt/"
|
||||
|
||||
# WINDOWS
|
||||
- name: Cache conan
|
||||
- name: Cache conan packages part 1
|
||||
if: startsWith(matrix.os, 'windows')
|
||||
uses: actions/cache@v1
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
key: ${{ runner.os }}-conan-user-${{ hashFiles('**/conanfile.txt') }}
|
||||
path: ~/.conan/
|
||||
|
||||
- name: Cache conan packages part 2
|
||||
if: startsWith(matrix.os, 'windows')
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
key: ${{ runner.os }}-conan-root-${{ hashFiles('**/conanfile.txt') }}
|
||||
path: ~/.conan
|
||||
|
||||
- name: Cache conan packages
|
||||
if: startsWith(matrix.os, 'windows')
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
key: ${{ runner.os }}-conan-pkg-${{ hashFiles('**/conanfile.txt') }}
|
||||
path: C:/.conan/
|
||||
|
||||
- name: Add Conan to path
|
||||
if: startsWith(matrix.os, 'windows')
|
||||
run: echo "C:\Program Files\Conan\conan\" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||||
|
||||
- name: Install dependencies (Windows)
|
||||
if: startsWith(matrix.os, 'windows')
|
||||
run: |
|
||||
choco install conan -y
|
||||
|
||||
refreshenv
|
||||
shell: cmd
|
||||
- name: Enable Developer Command Prompt
|
||||
if: startsWith(matrix.os, 'windows')
|
||||
uses: ilammy/msvc-dev-cmd@v1.10.0
|
||||
|
||||
- name: Build (Windows)
|
||||
if: startsWith(matrix.os, 'windows')
|
||||
run: |
|
||||
call "%programfiles(x86)%\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
|
||||
mkdir build
|
||||
cd build
|
||||
"C:\Program Files\Conan\conan\conan.exe" install ..
|
||||
qmake ..
|
||||
conan install .. -b missing
|
||||
cmake -G"NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DUSE_CONAN=ON ..
|
||||
set cl=/MP
|
||||
nmake /S /NOLOGO
|
||||
windeployqt release/chatterino.exe --release --no-compiler-runtime --no-translations --no-opengl-sw --dir Chatterino2/
|
||||
cp release/chatterino.exe Chatterino2/
|
||||
windeployqt bin/chatterino.exe --release --no-compiler-runtime --no-translations --no-opengl-sw --dir Chatterino2/
|
||||
cp bin/chatterino.exe Chatterino2/
|
||||
echo nightly > Chatterino2/modes
|
||||
7z a chatterino-windows-x86-64.zip Chatterino2/
|
||||
shell: cmd
|
||||
|
||||
- name: Upload artifact (Windows)
|
||||
if: startsWith(matrix.os, 'windows')
|
||||
uses: actions/upload-artifact@v1
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: chatterino-windows-x86-64.zip
|
||||
name: chatterino-windows-x86-64-${{ matrix.qt-version }}.zip
|
||||
path: build/chatterino-windows-x86-64.zip
|
||||
|
||||
- name: Clean Conan pkgs
|
||||
if: startsWith(matrix.os, 'windows')
|
||||
run: conan remove "*" -fsb
|
||||
shell: bash
|
||||
|
||||
# LINUX
|
||||
- name: Install dependencies (Ubuntu)
|
||||
if: startsWith(matrix.os, 'ubuntu')
|
||||
run: sudo apt-get update && sudo apt-get -y install libssl-dev libboost-dev libboost-system-dev libboost-filesystem-dev libpulse-dev libxkbcommon-x11-0 libgstreamer-plugins-base1.0-0 build-essential libgl1-mesa-dev
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get -y install \
|
||||
cmake \
|
||||
virtualenv \
|
||||
rapidjson-dev \
|
||||
libssl-dev \
|
||||
libboost-dev \
|
||||
libxcb-randr0-dev \
|
||||
libboost-system-dev \
|
||||
libboost-filesystem-dev \
|
||||
libpulse-dev \
|
||||
libxkbcommon-x11-0 \
|
||||
libgstreamer-plugins-base1.0-0 \
|
||||
build-essential \
|
||||
libgl1-mesa-dev \
|
||||
libxcb-icccm4 \
|
||||
libxcb-image0 \
|
||||
libxcb-keysyms1 \
|
||||
libxcb-render-util0 \
|
||||
libxcb-xinerama0
|
||||
|
||||
- name: Build (Ubuntu)
|
||||
if: startsWith(matrix.os, 'ubuntu')
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
qmake PREFIX=/usr ..
|
||||
make -j8
|
||||
cmake \
|
||||
-DCMAKE_INSTALL_PREFIX=appdir/usr/ \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DPAJLADA_SETTINGS_USE_BOOST_FILESYSTEM=On \
|
||||
-DUSE_PRECOMPILED_HEADERS=${{ matrix.pch }} \
|
||||
-DCMAKE_EXPORT_COMPILE_COMMANDS=On \
|
||||
..
|
||||
make -j$(nproc)
|
||||
shell: bash
|
||||
|
||||
- name: Package (Ubuntu)
|
||||
- name: clang-tidy review
|
||||
if: (startsWith(matrix.os, 'ubuntu') && matrix.pch == false && matrix.qt-version == '5.15.2' && github.event_name == 'pull_request')
|
||||
uses: ZedThree/clang-tidy-review@v0.9.0
|
||||
id: review
|
||||
with:
|
||||
build_dir: build
|
||||
config_file: '.clang-tidy'
|
||||
|
||||
- name: Package - AppImage (Ubuntu)
|
||||
if: startsWith(matrix.os, 'ubuntu')
|
||||
run: |
|
||||
cd build
|
||||
sh ./../.CI/CreateAppImage.sh
|
||||
shell: bash
|
||||
|
||||
- name: Upload artifact (Ubuntu)
|
||||
- name: Package - .deb (Ubuntu)
|
||||
if: startsWith(matrix.os, 'ubuntu')
|
||||
uses: actions/upload-artifact@v1
|
||||
run: |
|
||||
cd build
|
||||
sh ./../.CI/CreateUbuntuDeb.sh
|
||||
shell: bash
|
||||
|
||||
- name: Upload artifact - AppImage (Ubuntu)
|
||||
if: startsWith(matrix.os, 'ubuntu')
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: Chatterino-x86_64.AppImage
|
||||
name: Chatterino-x86_64-${{ matrix.qt-version }}.AppImage
|
||||
path: build/Chatterino-x86_64.AppImage
|
||||
|
||||
- name: Upload artifact - .deb (Ubuntu)
|
||||
if: startsWith(matrix.os, 'ubuntu')
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: Chatterino-${{ matrix.qt-version }}.deb
|
||||
path: build/Chatterino.deb
|
||||
|
||||
# MACOS
|
||||
- name: Install dependencies (MacOS)
|
||||
if: startsWith(matrix.os, 'macos')
|
||||
run: |
|
||||
brew install boost openssl rapidjson qt p7zip create-dmg
|
||||
brew install boost openssl rapidjson p7zip create-dmg cmake tree
|
||||
shell: bash
|
||||
|
||||
- name: Build (MacOS)
|
||||
|
@ -123,9 +195,13 @@ jobs:
|
|||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
/usr/local/opt/qt/bin/qmake .. DEFINES+=$dateOfBuild
|
||||
sed -ie 's/-framework\\\ /-framework /g' Makefile
|
||||
make -j8
|
||||
cmake \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 \
|
||||
-DOPENSSL_ROOT_DIR=/usr/local/opt/openssl \
|
||||
-DUSE_PRECOMPILED_HEADERS=${{ matrix.pch }} \
|
||||
..
|
||||
make -j$(sysctl -n hw.logicalcpu)
|
||||
shell: bash
|
||||
|
||||
- name: Package (MacOS)
|
||||
|
@ -140,9 +216,9 @@ jobs:
|
|||
|
||||
- name: Upload artifact (MacOS)
|
||||
if: startsWith(matrix.os, 'macos')
|
||||
uses: actions/upload-artifact@v1
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: chatterino-osx.dmg
|
||||
name: chatterino-osx-${{ matrix.qt-version }}.dmg
|
||||
path: build/chatterino-osx.dmg
|
||||
|
||||
create-release:
|
||||
|
@ -153,51 +229,46 @@ jobs:
|
|||
steps:
|
||||
- name: Create release
|
||||
id: create_release
|
||||
uses: pajlada/create-release@v2
|
||||
uses: pajlada/create-release@v2.0.3
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
tag_name: github-actions-nightly
|
||||
backup_tag_name: backup-github-actions-nightly
|
||||
release_name: GitHub Actions Nightly Test
|
||||
tag_name: nightly-build
|
||||
backup_tag_name: backup-nightly-build
|
||||
release_name: Nightly Release
|
||||
body: |
|
||||
1 ${{ github.eventName }}
|
||||
2 ${{ github.sha }}
|
||||
3 ${{ github.ref }}
|
||||
4 ${{ github.workflow }}
|
||||
5 ${{ github.action }}
|
||||
6 ${{ github.actor }}
|
||||
Nightly Build
|
||||
prerelease: true
|
||||
|
||||
- uses: actions/download-artifact@v1
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: chatterino-windows-x86-64.zip
|
||||
name: chatterino-windows-x86-64-5.15.2.zip
|
||||
path: windows/
|
||||
|
||||
- uses: actions/download-artifact@v1
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: Chatterino-x86_64.AppImage
|
||||
name: Chatterino-x86_64-5.15.2.AppImage
|
||||
path: linux/
|
||||
|
||||
- uses: actions/download-artifact@v1
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: chatterino-osx.dmg
|
||||
name: Chatterino-5.15.2.deb
|
||||
path: ubuntu/
|
||||
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: chatterino-osx-5.15.2.dmg
|
||||
path: macos/
|
||||
|
||||
# TODO: Extract dmg and appimage
|
||||
|
||||
- name: TREE
|
||||
run: |
|
||||
sudo apt update && sudo apt install tree
|
||||
tree .
|
||||
|
||||
# - name: Read upload URL into output
|
||||
# id: upload_url
|
||||
# run: |
|
||||
# echo "::set-output name=upload_url::$(cat release-upload-url.txt/release-upload-url.txt)"
|
||||
|
||||
- name: Upload release asset (Windows)
|
||||
uses: actions/upload-release-asset@v1.0.1
|
||||
uses: actions/upload-release-asset@v1.0.2
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
|
@ -207,7 +278,7 @@ jobs:
|
|||
asset_content_type: application/zip
|
||||
|
||||
- name: Upload release asset (Ubuntu)
|
||||
uses: actions/upload-release-asset@v1.0.1
|
||||
uses: actions/upload-release-asset@v1.0.2
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
|
@ -216,8 +287,18 @@ jobs:
|
|||
asset_name: Chatterino-x86_64.AppImage
|
||||
asset_content_type: application/x-executable
|
||||
|
||||
- name: Upload release asset (Ubuntu .deb)
|
||||
uses: actions/upload-release-asset@v1.0.2
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: ./ubuntu/Chatterino.deb
|
||||
asset_name: Chatterino-x86_64.deb
|
||||
asset_content_type: application/vnd.debian.binary-package
|
||||
|
||||
- name: Upload release asset (MacOS)
|
||||
uses: actions/upload-release-asset@v1.0.1
|
||||
uses: actions/upload-release-asset@v1.0.2
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
|
@ -225,3 +306,4 @@ jobs:
|
|||
asset_path: ./macos/chatterino-osx.dmg
|
||||
asset_name: chatterino-osx.dmg
|
||||
asset_content_type: application/x-bzip2
|
||||
|
||||
|
|
17
.github/workflows/changelog-check.yml
vendored
Normal file
17
.github/workflows/changelog-check.yml
vendored
Normal file
|
@ -0,0 +1,17 @@
|
|||
name: Changelog Check
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
types: [ opened, synchronize, reopened, ready_for_review, labeled, unlabeled ]
|
||||
|
||||
jobs:
|
||||
check-changelog:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
# Gives an error if there's no change in the changelog (except using label)
|
||||
- name: Changelog check
|
||||
uses: dangoslen/changelog-enforcer@v3
|
||||
with:
|
||||
changeLogPath: 'CHANGELOG.md'
|
||||
skipLabels: 'no changelog entry needed, ci, submodules'
|
29
.github/workflows/check-formatting.yml
vendored
29
.github/workflows/check-formatting.yml
vendored
|
@ -1,28 +1,31 @@
|
|||
---
|
||||
name: Check formatting
|
||||
|
||||
on:
|
||||
push:
|
||||
paths-ignore:
|
||||
- 'docs/**'
|
||||
- '*.md'
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- 'docs/**'
|
||||
- '*.md'
|
||||
|
||||
concurrency:
|
||||
group: check-formatting-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ubuntu:19.10
|
||||
check:
|
||||
runs-on: ubuntu-20.04
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: apt-get update
|
||||
run: apt-get update
|
||||
run: sudo apt-get update
|
||||
|
||||
- name: Install clang-format
|
||||
run: apt-get -y install clang-format
|
||||
run: sudo apt-get -y install clang-format dos2unix
|
||||
|
||||
- name: Check formatting
|
||||
run: ./tools/check-format.sh
|
||||
|
||||
- name: Check line-endings
|
||||
run: ./tools/check-line-endings.sh
|
||||
|
|
28
.github/workflows/homebrew.yml
vendored
Normal file
28
.github/workflows/homebrew.yml
vendored
Normal file
|
@ -0,0 +1,28 @@
|
|||
name: 'Publish Homebrew Cask on Release'
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
# Should match semver for mainline releases (not including -beta)
|
||||
- 'v2.[0-9]+.[0-9]+'
|
||||
# TODO: handle beta and nightly releases
|
||||
# Need to make those casks manually first
|
||||
# - v2.[0-9]+.[0-9]+-beta(?:[0-9]+)
|
||||
|
||||
env:
|
||||
# This gets updated later on in the run by a bash script to strip the prefix
|
||||
C2_CASK_NAME: 'chatterino'
|
||||
C2_TAGGED_VERSION: '${{ github.ref }}'
|
||||
|
||||
jobs:
|
||||
update_stable_homebrew_cask:
|
||||
name: 'Update the stable homebrew cask'
|
||||
runs-on: 'macos-latest'
|
||||
steps:
|
||||
# Pulls out the version from the ref (e.g. refs/tags/v2.3.1 -> 2.3.1)
|
||||
- name: 'Extract version from tag'
|
||||
run: |
|
||||
'STRIPPED_VERSION=$(echo "refs/tags/$C2_TAGGED_VERSION" | sed "s/refs\/tags\/v//gm")'
|
||||
'echo "C2_TAGGED_VERSION=$STRIPPED_VERSION" >> $GITHUB_ENV'
|
||||
- name: 'Execute ''brew bump-cask-pr'' with version'
|
||||
run: 'brew bump-cask-pr --version $C2_TAGGED_VERSION $C2_CASK_NAME'
|
||||
|
25
.github/workflows/lint.yml
vendored
Normal file
25
.github/workflows/lint.yml
vendored
Normal file
|
@ -0,0 +1,25 @@
|
|||
---
|
||||
name: Lint
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
|
||||
concurrency:
|
||||
group: lint-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Lint Markdown files
|
||||
uses: actionsx/prettier@v2
|
||||
with:
|
||||
# prettier CLI arguments.
|
||||
args: --check '**/*.md'
|
26
.github/workflows/push-aur.yml
vendored
Normal file
26
.github/workflows/push-aur.yml
vendored
Normal file
|
@ -0,0 +1,26 @@
|
|||
---
|
||||
name: Build on Arch Linux
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
|
||||
concurrency:
|
||||
group: build-archlinux-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Sync AUR package with current version
|
||||
uses: pajlada/aur-sync-action@master
|
||||
with:
|
||||
package_name: chatterino2-git
|
||||
commit_username: chatterino2-ci
|
||||
commit_email: chatterino2-ci@pajlada.com
|
||||
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
|
||||
dry_run: true
|
90
.github/workflows/test.yml
vendored
Normal file
90
.github/workflows/test.yml
vendored
Normal file
|
@ -0,0 +1,90 @@
|
|||
---
|
||||
name: Test
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
TWITCH_PUBSUB_SERVER_IMAGE: ghcr.io/chatterino/twitch-pubsub-server-test:v1.0.3
|
||||
|
||||
concurrency:
|
||||
group: test-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-20.04]
|
||||
qt-version: [5.15.2]
|
||||
fail-fast: false
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Cache Qt
|
||||
id: cache-qt
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: "${{ github.workspace }}/qt/"
|
||||
key: ${{ runner.os }}-QtCache-${{ matrix.qt-version }}
|
||||
|
||||
# LINUX
|
||||
- name: Install Qt
|
||||
uses: jurplel/install-qt-action@v2
|
||||
with:
|
||||
cached: ${{ steps.cache-qt.outputs.cache-hit }}
|
||||
version: ${{ matrix.qt-version }}
|
||||
dir: "${{ github.workspace }}/qt/"
|
||||
|
||||
# LINUX
|
||||
- name: Install dependencies (Ubuntu)
|
||||
if: startsWith(matrix.os, 'ubuntu')
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get -y install \
|
||||
cmake \
|
||||
rapidjson-dev \
|
||||
libssl-dev \
|
||||
libboost-dev \
|
||||
libboost-system-dev \
|
||||
libboost-filesystem-dev \
|
||||
libpulse-dev \
|
||||
libxkbcommon-x11-0 \
|
||||
libgstreamer-plugins-base1.0-0 \
|
||||
build-essential \
|
||||
libgl1-mesa-dev \
|
||||
libxcb-icccm4 \
|
||||
libxcb-image0 \
|
||||
libxcb-keysyms1 \
|
||||
libxcb-render-util0 \
|
||||
libxcb-xinerama0
|
||||
|
||||
- name: Create build directory (Ubuntu)
|
||||
if: startsWith(matrix.os, 'ubuntu')
|
||||
run: |
|
||||
mkdir build-test
|
||||
shell: bash
|
||||
|
||||
- name: Build (Ubuntu)
|
||||
if: startsWith(matrix.os, 'ubuntu')
|
||||
run: |
|
||||
cmake -DBUILD_TESTS=On -DBUILD_APP=OFF ..
|
||||
cmake --build . --config Release
|
||||
working-directory: build-test
|
||||
shell: bash
|
||||
|
||||
- name: Test (Ubuntu)
|
||||
if: startsWith(matrix.os, 'ubuntu')
|
||||
run: |
|
||||
docker pull kennethreitz/httpbin
|
||||
docker pull ${{ env.TWITCH_PUBSUB_SERVER_IMAGE }}
|
||||
docker run --network=host --detach ${{ env.TWITCH_PUBSUB_SERVER_IMAGE }}
|
||||
docker run -p 9051:80 --detach kennethreitz/httpbin
|
||||
./bin/chatterino-test --platform minimal
|
||||
working-directory: build-test
|
||||
shell: bash
|
40
.gitignore
vendored
40
.gitignore
vendored
|
@ -26,7 +26,8 @@ qrc_*.cpp
|
|||
ui_*.h
|
||||
Makefile*
|
||||
*build-*/
|
||||
/build/
|
||||
[bB]uild
|
||||
/_build/
|
||||
|
||||
# QtCreator
|
||||
|
||||
|
@ -73,5 +74,40 @@ rapidjson/*
|
|||
|
||||
Thumbs.db
|
||||
|
||||
#I HATE MAC
|
||||
# I HATE MAC
|
||||
.DS_Store
|
||||
|
||||
# Other editors/IDEs
|
||||
.vscode
|
||||
.vs
|
||||
.idea
|
||||
dependencies
|
||||
.cache
|
||||
.editorconfig
|
||||
|
||||
### CMake ###
|
||||
CMakeLists.txt.user
|
||||
CMakeCache.txt
|
||||
CMakeFiles
|
||||
CMakeScripts
|
||||
Testing
|
||||
Makefile
|
||||
cmake_install.cmake
|
||||
install_manifest.txt
|
||||
compile_commands.json
|
||||
CTestTestfile.cmake
|
||||
_deps
|
||||
CMakeUserPresets.json
|
||||
CMakePresets.json
|
||||
CMakeSettings.json
|
||||
|
||||
### CMake Patch ###
|
||||
# External projects
|
||||
*-prefix/
|
||||
Stamp
|
||||
tmp
|
||||
Source
|
||||
Dependencies_*
|
||||
|
||||
# vcpkg
|
||||
vcpkg_installed/
|
||||
|
|
15
.gitmodules
vendored
15
.gitmodules
vendored
|
@ -1,9 +1,7 @@
|
|||
[submodule "lib/libcommuni"]
|
||||
path = lib/libcommuni
|
||||
url = https://github.com/Chatterino/libcommuni
|
||||
[submodule "lib/humanize"]
|
||||
path = lib/humanize
|
||||
url = https://github.com/pajlada/humanize.git
|
||||
branch = chatterino-cmake
|
||||
[submodule "lib/qBreakpad"]
|
||||
path = lib/qBreakpad
|
||||
url = https://github.com/jiakuan/qBreakpad.git
|
||||
|
@ -27,4 +25,13 @@
|
|||
url = https://github.com/Chatterino/qtkeychain
|
||||
[submodule "lib/websocketpp"]
|
||||
path = lib/websocketpp
|
||||
url = https://github.com/ziocleto/websocketpp
|
||||
url = https://github.com/zaphoyd/websocketpp
|
||||
[submodule "cmake/sanitizers-cmake"]
|
||||
path = cmake/sanitizers-cmake
|
||||
url = https://github.com/arsenm/sanitizers-cmake
|
||||
[submodule "lib/magic_enum"]
|
||||
path = lib/magic_enum
|
||||
url = https://github.com/Neargye/magic_enum
|
||||
[submodule "lib/googletest"]
|
||||
path = lib/googletest
|
||||
url = https://github.com/google/googletest.git
|
||||
|
|
6
.prettierignore
Normal file
6
.prettierignore
Normal file
|
@ -0,0 +1,6 @@
|
|||
# Ignore submodule files
|
||||
lib/*/
|
||||
conan-pkgs/*/
|
||||
cmake/sanitizers-cmake/
|
||||
|
||||
.github/
|
6
.prettierrc.toml
Normal file
6
.prettierrc.toml
Normal file
|
@ -0,0 +1,6 @@
|
|||
trailingComma = "es5"
|
||||
|
||||
[[overrides]]
|
||||
files = ["*.md"]
|
||||
[overrides.options]
|
||||
proseWrap = "preserve"
|
|
@ -1,6 +1,6 @@
|
|||
# FreeBSD
|
||||
|
||||
Note on Qt version compatibility: If you are installing Qt from a package manager, please ensure the version you are installing is at least **Qt 5.10 or newer**.
|
||||
Note on Qt version compatibility: If you are installing Qt from a package manager, please ensure the version you are installing is at least **Qt 5.12 or newer**.
|
||||
|
||||
## FreeBSD 12.1-RELEASE
|
||||
|
||||
|
@ -9,9 +9,17 @@ high that this also works on older FreeBSD releases, architectures and
|
|||
FreeBSD 13.0-CURRENT.
|
||||
|
||||
1. Install build dependencies from package sources (or build from the
|
||||
ports tree): `# pkg install qt5-core qt5-multimedia qt5-svg
|
||||
qt5-qmake qt5-buildtools gstreamer-plugins-good boost-libs
|
||||
rapidjson`
|
||||
1. go into project directory
|
||||
1. create build folder `$ mkdir build && cd build`
|
||||
1. `$ qmake .. && make`
|
||||
ports tree): `# pkg install qt5-core qt5-multimedia qt5-svg qt5-buildtools gstreamer-plugins-good boost-libs rapidjson cmake`
|
||||
1. In the project directory, create a build directory and enter it
|
||||
```sh
|
||||
mkdir build
|
||||
cd build
|
||||
```
|
||||
1. Generate build files
|
||||
```sh
|
||||
cmake ..
|
||||
```
|
||||
1. Build the project
|
||||
```sh
|
||||
make
|
||||
```
|
||||
|
|
|
@ -1,32 +1,50 @@
|
|||
# Linux
|
||||
|
||||
Note on Qt version compatibility: If you are installing Qt from a package manager, please ensure the version you are installing is at least **Qt 5.10 or newer**.
|
||||
Note on Qt version compatibility: If you are installing Qt from a package manager, please ensure the version you are installing is at least **Qt 5.12 or newer**.
|
||||
|
||||
## Ubuntu 18.04
|
||||
*most likely works the same for other Debian-like distros*
|
||||
1. Install dependencies (and the C++ IDE Qt Creator) `sudo apt install qtcreator qtmultimedia5-dev libqt5svg5-dev libboost-dev libssl-dev libboost-system-dev libboost-filesystem-dev`
|
||||
1. Open `chatterino.pro` with QT Creator and build
|
||||
## Install dependencies
|
||||
|
||||
## Arch Linux
|
||||
install [chatterino2-git](https://aur.archlinux.org/packages/chatterino2-git/) from the aur or build manually as follows:
|
||||
1. `sudo pacman -S qt5-base qt5-multimedia qt5-svg gst-plugins-ugly gst-plugins-good boost rapidjson`
|
||||
1. go into project directory
|
||||
1. create build folder `mkdir build && cd build`
|
||||
1. `qmake .. && make`
|
||||
### Ubuntu 20.04
|
||||
|
||||
## Fedora 28 and above
|
||||
*most likely works the same for other Red Hat-like distros. Substitue `dnf` with `yum`.*
|
||||
### Development dependencies
|
||||
1. `sudo dnf install qt5-qtbase-devel qt5-qtmultimedia-devel qt5-qtsvg-devel libsecret-devel openssl-devel boost-devel`
|
||||
1. go into project directory
|
||||
1. create build folder `mkdir build && cd build`
|
||||
1. `qmake-qt5 .. && make -j$(nproc)`
|
||||
### Optional dependencies
|
||||
*`gstreamer-plugins-good` package is retired in Fedora 31, see: [rhbz#1735324](https://bugzilla.redhat.com/show_bug.cgi?id=1735324)*
|
||||
1. `sudo dnf install gstreamer-plugins-good` *(optional: for audio output)*
|
||||
_Most likely works the same for other Debian-like distros_
|
||||
|
||||
## NixOS 18.09+
|
||||
1. enter the development environment with all of the dependencies: `nix-shell -p openssl boost qt5.full`
|
||||
1. go into project directory
|
||||
1. create build folder `mkdir build && cd build`
|
||||
1. `qmake .. && make`
|
||||
Install all of the dependencies using `sudo apt install qttools5-dev qtmultimedia5-dev libqt5svg5-dev libboost-dev libssl-dev libboost-system-dev libboost-filesystem-dev cmake g++`
|
||||
|
||||
### Arch Linux
|
||||
|
||||
Install all of the dependencies using `sudo pacman -S --needed qt5-base qt5-multimedia qt5-svg qt5-tools gst-plugins-ugly gst-plugins-good boost rapidjson pkgconf openssl cmake`
|
||||
|
||||
Alternatively you can use the [chatterino2-git](https://aur.archlinux.org/packages/chatterino2-git/) package to build and install Chatterino for you.
|
||||
|
||||
### Fedora 28 and above
|
||||
|
||||
_Most likely works the same for other Red Hat-like distros. Substitute `dnf` with `yum`._
|
||||
|
||||
Install all of the dependencies using `sudo dnf install qt5-qtbase-devel qt5-qtmultimedia-devel qt5-qtsvg-devel qt5-linguist libsecret-devel openssl-devel boost-devel cmake`
|
||||
|
||||
### NixOS 18.09+
|
||||
|
||||
Enter the development environment with all of the dependencies: `nix-shell -p openssl boost qt5.full pkg-config cmake`
|
||||
|
||||
## Compile
|
||||
|
||||
### Through Qt Creator
|
||||
|
||||
1. Install C++ IDE Qt Creator by using `sudo apt install qtcreator`
|
||||
1. Open `CMakeLists.txt` with Qt Creator and select build
|
||||
|
||||
## Manually
|
||||
|
||||
1. In the project directory, create a build directory and enter it
|
||||
```sh
|
||||
mkdir build
|
||||
cd build
|
||||
```
|
||||
1. Generate build files
|
||||
```sh
|
||||
cmake ..
|
||||
```
|
||||
1. Build the project
|
||||
```sh
|
||||
make
|
||||
```
|
||||
|
|
|
@ -1,21 +1,26 @@
|
|||
# Building on macOS
|
||||
#### Note - If you want to develop Chatterino 2 you will also need to install Qt Creator (make sure to install **Qt 5.10 or newer**)
|
||||
1. Install Xcode and Xcode Command Line Utilites
|
||||
2. Start Xcode, settings -> Locations, activate your Command Line Tools
|
||||
3. Install brew https://brew.sh/
|
||||
4. `brew install boost openssl rapidjson`
|
||||
5. `brew install qt`
|
||||
6. Step 5 should output some directions to add qt to your path, you will need to do this for qmake
|
||||
5. Go into project directory
|
||||
6. Create build folder `mkdir build && cd build`
|
||||
7. `qmake .. && make`
|
||||
|
||||
#### Note - If you want to develop Chatterino 2 you might also want to install Qt Creator (make sure to install **Qt 5.12 or newer**), it is not required though and any C++ IDE (might require additional setup for cmake to find Qt libraries) or a normal text editor + running cmake from terminal should work as well
|
||||
|
||||
#### Note - Chatterino 2 is only tested on macOS 10.14 and above - anything below that is considered unsupported. It may or may not work on earlier versions
|
||||
|
||||
1. Install Xcode and Xcode Command Line Utilities
|
||||
1. Start Xcode, go into Settings -> Locations, and activate your Command Line Tools
|
||||
1. Install brew https://brew.sh/
|
||||
1. Install the dependencies using `brew install boost openssl rapidjson cmake`
|
||||
1. Install Qt5 using `brew install qt@5`
|
||||
1. (_OPTIONAL_) Install [ccache](https://ccache.dev) (used to speed up compilation by using cached results from previous builds) using `brew install ccache`
|
||||
1. Go into the project directory
|
||||
1. Create a build folder and go into it (`mkdir build && cd build`)
|
||||
1. Compile using `cmake .. && make`
|
||||
|
||||
If the Project does not build at this point, you might need to add additional Paths/Libs, because brew does not install openssl and boost in the common path. You can get their path using
|
||||
|
||||
`brew info openssl`
|
||||
`brew info boost`
|
||||
|
||||
If brew doesn't link openssl properly then you should be able to link it yourself using those two commands:
|
||||
If brew doesn't link OpenSSL properly then you should be able to link it yourself by using these two commands:
|
||||
|
||||
- `ln -s /usr/local/opt/openssl/lib/* /usr/local/lib`
|
||||
- `ln -s /usr/local/opt/openssl/include/openssl /usr/local/include/openssl`
|
||||
|
||||
|
|
|
@ -1,72 +1,80 @@
|
|||
# Building on Windows
|
||||
|
||||
**Note that installing all the development prerequisites and libraries will require about 30 GB of free disk space. Please ensure this space is available on your `C:` drive before proceeding.**
|
||||
**Note that installing all of the development prerequisites and libraries will require about 30 GB of free disk space. Please ensure this space is available on your `C:` drive before proceeding.**
|
||||
|
||||
This guide assumes you are on a 64-bit system. You might need to manually search out alternate download links should you desire to build chatterino on a 32-bit system.
|
||||
This guide assumes you are on a 64-bit system. You might need to manually search out alternate download links should you desire to build Chatterino on a 32-bit system.
|
||||
|
||||
## Visual Studio 2017
|
||||
## Visual Studio 2022
|
||||
|
||||
Download and install [Visual Studio 2017 Community](https://visualstudio.microsoft.com/downloads/). In the installer, select "Desktop development with C++" and "Universal Windows Platform development".
|
||||
Download and install [Visual Studio 2022 Community](https://visualstudio.microsoft.com/downloads/). In the installer, select "Desktop development with C++" and "Universal Windows Platform development".
|
||||
|
||||
Notes:
|
||||
|
||||
- This installation will take about 17 GB of disk space
|
||||
- You do not need to sign in with a Microsoft account after setup completes. You may simply exit the login dialog.
|
||||
- This installation will take about 17 GB of disk space
|
||||
- You do not need to sign in with a Microsoft account after setup completes. You may simply exit the login dialog.
|
||||
|
||||
## Boost
|
||||
|
||||
1. First, download a boost installer appropriate for your version of Visual Studio.
|
||||
- Visit the downloads list [on Bintray](https://dl.bintray.com/boostorg/release/).
|
||||
- Select the latest version from the list and navigate into the `binaries/` directory. (Note: 1.70.0 did not work)
|
||||
- Download the `.exe` file appropriate to your Visual Studio installation version and system bitness (choose `x64` for 64-bit systems).
|
||||
Visual Studio versions map as follows: `14.1` in the filename corresponds to MSVC 2017, `14.0` to 2015, `12.0` to 2013, `11` to 2012, `10` to 2010, `9` to 2008 and `8` to 2005. _Only Visual Studio 2015 and 2017 are supported. Please upgrade should you have an older installation._
|
||||
|
||||
**Convenience link for Visual Studio 2017: [Boost 1.69.0-MSVC-14.1](https://dl.bintray.com/boostorg/release/1.69.0/binaries/boost_1_69_0-msvc-14.1-64.exe)**
|
||||
- Visit the downloads list on [SourceForge](https://sourceforge.net/projects/boost/files/boost-binaries/).
|
||||
- Select the latest version from the list.
|
||||
- Download the `.exe` file appropriate to your Visual Studio installation version and system bitness (choose `-64` for 64-bit systems).
|
||||
Visual Studio versions map as follows: `14.3` in the filename corresponds to MSVC 2022,`14.2` to 2019, `14.1` to 2017, `14.0` to 2015. _Anything prior to Visual Studio 2015 is unsupported. Please upgrade should you have an older installation._
|
||||
|
||||
**Convenience link for Visual Studio 2022: [boost_1_79_0-msvc-14.3-64.exe](https://sourceforge.net/projects/boost/files/boost-binaries/1.79.0/boost_1_79_0-msvc-14.3-64.exe/download)**
|
||||
|
||||
2. When prompted where to install Boost, set the location to `C:\local\boost`.
|
||||
3. After the installation finishes, rename the `C:\local\boost\lib64-msvc-14.1` (or similar) directory to simply `lib` (`C:\local\boost\lib`).
|
||||
3. After the installation finishes, rename the `C:\local\boost\lib64-msvc-14.3` (or similar) directory to simply `lib` (`C:\local\boost\lib`).
|
||||
|
||||
Note: This installation will take about 1.5 GB of disk space.
|
||||
Note: This installation will take about 2.1 GB of disk space.
|
||||
|
||||
## OpenSSL
|
||||
|
||||
### For our websocket library, we need OpenSSL 1.1
|
||||
1. Download OpenSSL for windows, version `1.1.1g`: **[Download](https://slproweb.com/download/Win64OpenSSL-1_1_1g.exe)**
|
||||
|
||||
1. Download OpenSSL for windows, version `1.1.1q`: **[Download](https://slproweb.com/download/Win64OpenSSL-1_1_1q.exe)**
|
||||
2. When prompted, install OpenSSL to `C:\local\openssl`
|
||||
3. When prompted, copy the OpenSSL DLLs to "The OpenSSL binaries (/bin) directory".
|
||||
|
||||
### For Qt SSL, we need OpenSSL 1.0
|
||||
1. Download OpenSSL for windows, version `1.0.2u`: **[Download](https://slproweb.com/download/Win64OpenSSL-1_0_2u.exe)**
|
||||
|
||||
1. Download OpenSSL for Windows, version `1.0.2u`: **[Download](https://web.archive.org/web/20211109231823/https://slproweb.com/download/Win64OpenSSL-1_0_2u.exe)**
|
||||
2. When prompted, install it to any arbitrary empty directory.
|
||||
3. When prompted, copy the OpenSSL DLLs to "The OpenSSL binaries (/bin) directory".
|
||||
4. Copy the OpenSSL 1.0 files from its `\bin` folder to `C:\local\bin` (You will need to create the folder)
|
||||
5. Then copy the OpenSSL 1.1 files from its `\bin` folder to `C:\local\bin` (Overwrite any duplicate files)
|
||||
6. Add `C:\local\bin` to your path folder ([Follow guide here if you don't know how to do it]( https://www.computerhope.com/issues/ch000549.htm#windows8))
|
||||
6. Add `C:\local\bin` to your path folder ([Follow the guide here if you don't know how to do it](https://www.computerhope.com/issues/ch000549.htm#windows10))
|
||||
|
||||
**If the download links above do not work, try downloading similar 1.1.x & 1.0.x versions [here](https://slproweb.com/products/Win32OpenSSL.html). Note: Don't download the "light" installers, they do not have the required files.**
|
||||
**If the 1.1.x download link above does not work, try downloading the similar 1.1.x version found [here](https://slproweb.com/products/Win32OpenSSL.html). Note: Don't download the "light" installer, it does not have the required files.**
|
||||
![Screenshot Slproweb layout](https://user-images.githubusercontent.com/41973452/175827529-97802939-5549-4ab1-95c4-d39f012d06e9.png)
|
||||
|
||||
Note: This installation will take about 200 MB of disk space.
|
||||
|
||||
## Qt
|
||||
1. Visit the [Qt download page](https://www.qt.io/download).
|
||||
2. Select "Open source" at the bottom of this page
|
||||
3. Then select "Download"
|
||||
|
||||
1. Visit the [Qt Open Source Page](https://www.qt.io/download-open-source).
|
||||
2. Scroll down to the bottom
|
||||
3. Then select "Download the Qt Online Installer"
|
||||
|
||||
Notes:
|
||||
- Creating/linking an account with your Qt installation is entirely optional, you may simply click "Skip" in the installer instead of entering any information.
|
||||
- Installing the latest Qt version is advised for new installations, but if you want to use your existing installation please ensure you are running **Qt 5.10 or later**.
|
||||
|
||||
- Installing the latest **stable** Qt version is advised for new installations, but if you want to use your existing installation please ensure you are running **Qt 5.12 or later**.
|
||||
|
||||
### When prompted which components to install:
|
||||
|
||||
1. Unfold the tree element that says "Qt"
|
||||
2. Unfold the top most tree element (latest Qt version, e.g. `Qt 5.11.2`)
|
||||
2. Unfold the top most tree element (latest stable Qt version, e.g. `Qt 5.15.2`)
|
||||
3. Under this version, select the following entries:
|
||||
- `MSVC 2017 64-bit` (or alternative version if you are using that)
|
||||
- `MSVC 2019 64-bit` (or alternative version if you are using that)
|
||||
- `Qt WebEngine` (optional)
|
||||
4. Under the "Tools" tree element (at the bottom), ensure that `Qt Creator X.X.X` and `Qt Creator X.X.X CDB Debugger Support` are selected. (they should be checked by default)
|
||||
4. Under the "Tools" tree element (at the bottom), ensure that `Qt Creator X.X.X` and `Debugging Tools for Windows` are selected. (they should be checked by default)
|
||||
5. Continue through the installer and let the installer finish installing Qt.
|
||||
|
||||
Note: This installation will take about 2 GB of disk space.
|
||||
|
||||
## Compile with Breakpad support (Optional)
|
||||
|
||||
Compiling with Breakpad support enables crash reports that can be of use for developing/beta versions of Chatterino. If you have no interest in reporting crashes anyways, this optional dependency will probably be of no use to you.
|
||||
|
||||
1. Open up `lib/qBreakpad/handler/handler.pro`in Qt Creator
|
||||
|
@ -74,44 +82,110 @@ Compiling with Breakpad support enables crash reports that can be of use for dev
|
|||
3. Copy the newly built `qBreakpad.lib` to the following directory: `lib/qBreakpad/build/handler` (You will have to manually create this directory)
|
||||
|
||||
## Run the build in Qt Creator
|
||||
1. Open the `chatterino.pro` file by double-clicking or by opening it via Qt Creator.
|
||||
|
||||
1. Open the `CMakeLists.txt` file by double-clicking it, or by opening it via Qt Creator.
|
||||
2. You will be presented with a screen that is titled "Configure Project". In this screen, you should have at least one option present ready to be configured, like this:
|
||||
![Qt Create Configure Project screenshot](https://i.imgur.com/dbz45mB.png)
|
||||
![Qt Create Configure Project screenshot](https://user-images.githubusercontent.com/69117321/169887645-2ae0871a-fe8a-4eb9-98db-7b996dea3a54.png)
|
||||
3. Select the profile(s) you want to build with and click "Configure Project".
|
||||
|
||||
### How to run and produce builds
|
||||
|
||||
- In the main screen, click the green "play symbol" on the bottom left to run the project directly.
|
||||
- Click the hammer on the bottom left to generate a build (does not run the build though).
|
||||
- In the main screen, click the green "play symbol" on the bottom left to run the project directly.
|
||||
- Click the hammer on the bottom left to generate a build (does not run the build though).
|
||||
|
||||
Build results will be placed in a folder at the same level as the "chatterino2" project folder (e.g. if your sources are at `C:\Users\example\src\chatterino2`, then the build will be placed in an automatically generated folder under `C:\Users\example\src`, e.g. `C:\Users\example\src\build-chatterino-Desktop_Qt_5_11_2_MSVC2017_64bit-Release`.)
|
||||
Build results will be placed in a folder at the same level as the "chatterino2" project folder (e.g. if your sources are at `C:\Users\example\src\chatterino2`, then the build will be placed in an automatically generated folder under `C:\Users\example\src`, e.g. `C:\Users\example\src\build-chatterino-Desktop_Qt_5_15_2_MSVC2019_64bit-Release`.)
|
||||
|
||||
- Note that if you are building chatterino purely for usage, not for development, it is recommended that you click the "PC" icon above the play icon and select "Release" instead of "Debug".
|
||||
- Output and error messages produced by the compiler can be seen under the "4 Compile Output" tab in Qt Creator.
|
||||
- Note that if you are building chatterino purely for usage, not for development, it is recommended that you click the "PC" icon above the play icon and select "Release" instead of "Debug".
|
||||
- Output and error messages produced by the compiler can be seen under the "4 Compile Output" tab in Qt Creator.
|
||||
|
||||
## Producing standalone builds
|
||||
|
||||
If you build chatterino, the result directories will contain a `chatterino.exe` file in the `$OUTPUTDIR\release\` directory. This `.exe` file will not directly run on any given target system, because it will be lacking various Qt runtimes.
|
||||
|
||||
To produce a standalone package, you need to generate all required files using the tool `windeployqt`. This tool can be found in the `bin` directory of your Qt installation, e.g. at `C:\Qt\5.11.2\msvc2017_64\bin\windeployqt.exe`.
|
||||
To produce a standalone package, you need to generate all required files using the tool `windeployqt`. This tool can be found in the `bin` directory of your Qt installation, e.g. at `C:\Qt\5.15.2\msvc2019_64\bin\windeployqt.exe`.
|
||||
|
||||
To produce all supplement files for a standalone build, follow these steps (adjust paths as required):
|
||||
|
||||
1. Navigate to your build output directory with windows explorer, e.g. `C:\Users\example\src\build-chatterino-Desktop_Qt_5_11_2_MSVC2017_64bit-Release`
|
||||
2. Enter the `release` directory
|
||||
3. Delete all files except the `chatterino.exe` file. You should be left with a directory only containing `chatterino.exe`.
|
||||
4. Open a `cmd` window and execute:
|
||||
1. Navigate to your build output directory with Windows Explorer, e.g. `C:\Users\example\src\build-chatterino-Desktop_Qt_5_15_2_MSVC2019_64bit-Release`
|
||||
2. Enter the `release` directory
|
||||
3. Delete all files except the `chatterino.exe` file. You should be left with a directory only containing `chatterino.exe`.
|
||||
4. Open a command prompt and execute:
|
||||
|
||||
cd C:\Users\example\src\build-chatterino-Desktop_Qt_5_11_2_MSVC2017_64bit-Release\release
|
||||
C:\Qt\5.11.2\msvc2017_64\bin\windeployqt.exe chatterino.exe
|
||||
cd C:\Users\example\src\build-chatterino-Desktop_Qt_5_15_2_MSVC2019_64bit-Release\release
|
||||
C:\Qt\5.15.2\msvc2019_64\bin\windeployqt.exe chatterino.exe
|
||||
|
||||
5. Go to `C:\local\bin\` and copy these dll's into your `release folder`.
|
||||
5. Go to `C:\local\bin\` and copy these dll's into your `release folder`.
|
||||
|
||||
libssl-1_1-x64.dll
|
||||
libcrypto-1_1-x64.dll
|
||||
ssleay32.dll
|
||||
libeay32.dll
|
||||
|
||||
6. The `releases` directory will now be populated with all the required files to make the chatterino build standalone.
|
||||
6. The `releases` directory will now be populated with all the required files to make the chatterino build standalone.
|
||||
|
||||
You can now create a zip archive of all the contents in `releases` and distribute the program as is, without requiring any development tools to be present on the target system. (However, the vcredist package must be present, as usual - see the [README](README.md)).
|
||||
|
||||
## Using CMake
|
||||
|
||||
Open up your terminal with the Visual Studio environment variables, then enter the following commands:
|
||||
|
||||
1. `mkdir build`
|
||||
2. `cd build`
|
||||
3. `cmake -G"NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DUSE_CONAN=ON ..`
|
||||
4. `nmake`
|
||||
|
||||
## Building/Running in CLion
|
||||
|
||||
_Note:_ We're using `build` instead of the CLion default `cmake-build-debug` folder.
|
||||
|
||||
Install [conan](https://conan.io/downloads.html) and make sure it's in your `PATH` (default setting).
|
||||
|
||||
Clone the repository as described in the readme. Open a terminal in the cloned folder and enter the following commands:
|
||||
|
||||
1. `mkdir build && cd build`
|
||||
2. `conan install .. -s build_type=Debug`
|
||||
|
||||
Now open the project in CLion. You will be greeted with the _Open Project Wizard_. Set the _CMake Options_ to
|
||||
|
||||
```
|
||||
-DCMAKE_PREFIX_PATH=C:\Qt\5.15.2\msvc2019_64\lib\cmake\Qt5
|
||||
-DUSE_CONAN=ON
|
||||
-DCMAKE_CXX_FLAGS=/bigobj
|
||||
```
|
||||
|
||||
and the _Build Directory_ to `build`.
|
||||
|
||||
<details>
|
||||
<summary>Screenshot of CMake configuration</summary>
|
||||
|
||||
![Screenshot CMake configuration](https://user-images.githubusercontent.com/41973452/160240561-26ec205c-20af-4aa5-a6a3-b87a27fc16eb.png)
|
||||
|
||||
</details>
|
||||
|
||||
After the CMake project is loaded, open the _Run/Debug Configurations_.
|
||||
|
||||
Select the `CMake Applications > chatterino` configuration and add a new _Run External tool_ task to _Before launch_.
|
||||
|
||||
- Set the _Program_ to `C:\Qt\5.15.2\msvc2019_64\bin\windeployqt.exe`
|
||||
- Set the _Arguments_
|
||||
to `$CMakeCurrentProductFile$ --debug --no-compiler-runtime --no-translations --no-opengl-sw --dir bin/`
|
||||
- Set the _Working directory_ to `$ProjectFileDir$\build`
|
||||
|
||||
<details>
|
||||
<summary>Screenshot of External tool</summary>
|
||||
|
||||
![Screenshot of External Tool](https://user-images.githubusercontent.com/41973452/160240818-f4b41525-3de9-4e3d-8228-98beab2a3ead.png)
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>Screenshot of chatterino configuration</summary>
|
||||
|
||||
![Screenshot of chatterino configuration](https://user-images.githubusercontent.com/41973452/160240843-dc0c603c-227f-4f56-98ca-57f03989dfb4.png)
|
||||
|
||||
</details>
|
||||
|
||||
Now you can run the `chatterino | Debug` configuration.
|
||||
|
||||
If you want to run the portable version of Chatterino, create a file called `modes` inside of `build/bin` and
|
||||
write `portable` into it.
|
||||
|
|
35
BUILDING_ON_WINDOWS_WITH_VCPKG.md
Normal file
35
BUILDING_ON_WINDOWS_WITH_VCPKG.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Building on Windows with vcpkg
|
||||
|
||||
## Prerequisites
|
||||
|
||||
1. Install [Visual Studio](https://visualstudio.microsoft.com/) with "Desktop development with C++" (~9.66 GB)
|
||||
1. Install [CMake](https://cmake.org/) (~109 MB)
|
||||
1. Install [git](https://git-scm.com/) (~264 MB)
|
||||
1. Install [vcpkg](https://vcpkg.io/) (~80 MB)
|
||||
- `git clone https://github.com/Microsoft/vcpkg.git`
|
||||
- `cd .\vcpkg\`
|
||||
- `.\bootstrap-vcpkg.bat`
|
||||
- `.\vcpkg integrate install`
|
||||
- `.\vcpkg integrate powershell`
|
||||
- `cd ..`
|
||||
1. Configure the environment for vcpkg
|
||||
- `set VCPKG_DEFAULT_TRIPLET=x64-windows`
|
||||
- [default](https://github.com/microsoft/vcpkg/blob/master/docs/users/triplets.md#additional-remarks) is `x86-windows`
|
||||
- `set VCPKG_ROOT=C:\path\to\vcpkg\`
|
||||
- `set PATH=%PATH%;%VCPKG_ROOT%`
|
||||
|
||||
## Building
|
||||
|
||||
1. Clone
|
||||
- `git clone --recurse-submodules https://github.com/Chatterino/chatterino2.git`
|
||||
1. Install dependencies (~21 GB)
|
||||
- `cd .\chatterino2\`
|
||||
- `vcpkg install`
|
||||
1. Build
|
||||
- `mkdir .\build\`
|
||||
- `cd .\build\`
|
||||
- (cmd) `cmake .. -DCMAKE_TOOLCHAIN_FILE=%VCPKG_ROOT%/scripts/buildsystems/vcpkg.cmake`
|
||||
- (ps1) `cmake .. -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake"`
|
||||
- `cmake --build . --parallel <threads> --config Release`
|
||||
1. Run
|
||||
- `.\bin\chatterino2.exe`
|
397
CHANGELOG.md
397
CHANGELOG.md
|
@ -2,8 +2,401 @@
|
|||
|
||||
## Unversioned
|
||||
|
||||
- Major: Added support for Twitch's Chat Replies. [Wiki Page](https://wiki.chatterino.com/Features/#message-replies) (#3722)
|
||||
- Major: Added multi-channel searching to search dialog via keyboard shortcut. (Ctrl+Shift+F by default) (#3694, #3875)
|
||||
- Minor: Added option to display tabs on the right and bottom. (#3847)
|
||||
- Minor: Added `is:first-msg` search option. (#3700)
|
||||
- Minor: Added quotation marks in the permitted/blocked Automod messages for clarity. (#3654)
|
||||
- Minor: Added a `Scroll to top` keyboard shortcut for splits. (#3802)
|
||||
- Minor: Adjust large stream thumbnail to 16:9 (#3655)
|
||||
- Minor: Fixed being unable to load Twitch Usercards from the `/mentions` tab. (#3623)
|
||||
- Minor: Add information about the user's operating system in the About page. (#3663)
|
||||
- Minor: Added chatter count for each category in viewer list. (#3683, #3719)
|
||||
- Minor: Sorted usernames in /vips message to be case-insensitive. (#3696)
|
||||
- Minor: Strip leading @ and trailing , from usernames in the `/block` and `/unblock` commands. (#3816)
|
||||
- Minor: Added option to open a user's chat in a new tab from the usercard profile picture context menu. (#3625)
|
||||
- Minor: Fixed tag parsing for consecutive escaped characters. (#3711)
|
||||
- Minor: Prevent user from entering incorrect characters in Live Notifications channels list. (#3715, #3730)
|
||||
- Minor: Fixed automod caught message notice appearing twice for mods. (#3717)
|
||||
- Minor: Streamer mode now automatically detects if XSplit, PRISM Live Studio, Twitch Studio, or vMix are running. (#3740)
|
||||
- Minor: Add scrollbar to `Select filters` dialog. (#3737)
|
||||
- Minor: Added `/requests` command. Usage: `/requests [channel]`. Opens the channel points requests queue for the provided channel or the current channel if no input is provided. (#3746)
|
||||
- Minor: Added ability to execute commands on chat messages using the message context menu. (#3738, #3765)
|
||||
- Minor: Added `/copy` command. Usage: `/copy <text>`. Copies provided text to clipboard - can be useful with custom commands. (#3763)
|
||||
- Minor: Removed total views from the usercard, as Twitch no longer updates the number. (#3792)
|
||||
- Minor: Add Quick Switcher item to open a channel in a new popup window. (#3828)
|
||||
- Minor: Warn when parsing an environment variable fails. (#3904)
|
||||
- Minor: Load missing messages from Recent Messages API upon reconnecting (#3878, #3932)
|
||||
- Minor: Add settings to toggle BTTV/FFZ global/channel emotes (#3935)
|
||||
- Bugfix: Fix crash that can occur when closing and quickly reopening a split, then running a command. (#3852)
|
||||
- Bugfix: Connection to Twitch PubSub now recovers more reliably. (#3643, #3716)
|
||||
- Bugfix: Fix crash that can occur when changing channels. (#3799)
|
||||
- Bugfix: Fixed viewers list search not working when used before loading finishes. (#3774)
|
||||
- Bugfix: Fixed live notifications for usernames containing uppercase characters. (#3646)
|
||||
- Bugfix: Fixed live notifications not getting updated for closed streams going offline. (#3678)
|
||||
- Bugfix: Fixed certain settings dialogs appearing behind the main window, when `Always on top` was used. (#3679)
|
||||
- Bugfix: Fixed an issue in the emote picker where an emotes tooltip would not properly disappear. (#3686)
|
||||
- Bugfix: Fixed incorrect spacing of settings icons at high DPI. (#3698)
|
||||
- Bugfix: Fixed highlights triggering from own resub messages. (#3707)
|
||||
- Bugfix: Fixed existing emote popups not being raised from behind other windows when refocusing them on macOS (#3713)
|
||||
- Bugfix: Fixed automod queue pubsub topic persisting after user change. (#3718)
|
||||
- Bugfix: Fixed viewer list not closing after pressing escape key. (#3734)
|
||||
- Bugfix: Fixed links with no thumbnail having previous link's thumbnail. (#3720)
|
||||
- Bugfix: Fixed message only showing a maximum of one global FrankerFaceZ badge even if the user has multiple. (#3818)
|
||||
- Bugfix: Add icon in the CMake macOS bundle. (#3832)
|
||||
- Bugfix: Adopt popup windows in order to force floating behavior on some window managers. (#3836)
|
||||
- Bugfix: Fix split focusing being broken in certain circumstances when the "Show input when it's empty" setting was disabled. (#3838, #3860)
|
||||
- Bugfix: Always refresh tab when a contained split's channel is set. (#3849)
|
||||
- Bugfix: Drop trailing whitespace from Twitch system messages. (#3888)
|
||||
- Bugfix: Fix crash related to logging IRC channels (#3918)
|
||||
- Bugfix: Mentions of "You" in timeouts will link to your own user now instead of the user "You". (#3922)
|
||||
- Dev: Remove official support for QMake. (#3839, #3883)
|
||||
- Dev: Rewrite LimitedQueue (#3798)
|
||||
- Dev: Overhaul highlight system by moving all checks into a Controller allowing for easier tests. (#3399, #3801, #3835)
|
||||
- Dev: Use Game Name returned by Get Streams instead of querying it from the Get Games API. (#3662)
|
||||
- Dev: Batch checking live status for all channels after startup. (#3757, #3762, #3767)
|
||||
- Dev: Move most command context into the command controller. (#3824)
|
||||
|
||||
## 2.3.5
|
||||
|
||||
- Major: Added highlights for first messages (#3267)
|
||||
- Major: Added customizable shortcuts. (#2340, #3633)
|
||||
- Minor: Make animated emote playback speed match browser (Firefox and Chrome) behaviour. (#3506)
|
||||
- Minor: Added middle click split to open in browser (#3356)
|
||||
- Minor: Added new search predicate to filter for messages matching a regex (#3282)
|
||||
- Minor: Add `{channel.name}`, `{channel.id}`, `{stream.game}`, `{stream.title}`, `{my.id}`, `{my.name}` placeholders for commands (#3155)
|
||||
- Minor: Remove TwitchEmotes.com attribution and the open/copy options when right-clicking a Twitch Emote. (#2214, #3136)
|
||||
- Minor: Strip leading @ and trailing , from username in /user and /usercard commands. (#3143)
|
||||
- Minor: Display a system message when reloading subscription emotes to match BTTV/FFZ behavior (#3135)
|
||||
- Minor: Allow resub messages to show in `/mentions` tab (#3148)
|
||||
- Minor: Added a setting to hide similar messages by any user. (#2716)
|
||||
- Minor: Duplicate spaces now count towards the display message length. (#3002)
|
||||
- Minor: Commands are now backed up. (#3168)
|
||||
- Minor: Subcategories in settings are now searchable. (#3157)
|
||||
- Minor: Added the ability to open an entire tab as a popup. (#3082)
|
||||
- Minor: Added optional parameter to /usercard command for opening a usercard in a different channel context. (#3172)
|
||||
- Minor: Added regex option to Nicknames. (#3146)
|
||||
- Minor: Highlight usernames in /mods and /vips messages (#3187)
|
||||
- Minor: Added `/raw` command. (#3189)
|
||||
- Minor: Colorizing usernames on IRC, originally made for Mm2PL/dankerino (#3206)
|
||||
- Minor: Fixed `/streamlink` command not stripping leading @'s or #'s (#3215)
|
||||
- Minor: Strip leading @ and trailing , from username in `/popout` command. (#3217)
|
||||
- Minor: Added `flags.reward_message` filter variable (#3231)
|
||||
- Minor: Added chatter count to viewer list popout (#3261)
|
||||
- Minor: Ignore out of bounds check for tiling wms (#3270)
|
||||
- Minor: Add clear cache button to cache settings section (#3277)
|
||||
- Minor: Added `flags.first_message` filter variable (#3292)
|
||||
- Minor: Removed duplicate setting for toggling `Channel Point Redeemed Message` highlights (#3296)
|
||||
- Minor: Added support for opening channels from twitch.tv/popout links. (#3309)
|
||||
- Minor: Clean up chat messages of special line characters prior to sending. (#3312)
|
||||
- Minor: IRC now parses/displays links like Twitch chat. (#3334)
|
||||
- Minor: Added button & label for copying login name of user instead of display name in the user info popout. (#3335)
|
||||
- Minor: Make `/delete` errors a bit more verbose (#3350)
|
||||
- Minor: Made join and part message have links to usercards. (#3358)
|
||||
- Minor: Show picked outcome in prediction badges. (#3357)
|
||||
- Minor: Add support for Emoji in IRC (#3354)
|
||||
- Minor: Added logging to experimental IRC (#2996)
|
||||
- Minor: Moved `/live` logs to its own subdirectory. (Logs from before this change will still be available in `Channels -> live`). (#3393)
|
||||
- Minor: Added clear button to settings search bar. (#3403)
|
||||
- Minor: Added autocompletion for default Twitch commands starting with the dot (e.g. `.mods` which does the same as `/mods`). (#3144)
|
||||
- Minor: Sorted usernames in `Users joined/parted` messages alphabetically. (#3421)
|
||||
- Minor: Mod list, VIP list, and Users joined/parted messages are now searchable. (#3426)
|
||||
- Minor: Add search to emote popup. (#3404, #3527, #3543)
|
||||
- Minor: Messages can now be highlighted by subscriber or founder badges. (#3445)
|
||||
- Minor: User timeout buttons can now be triggered using hotkeys. (#3483)
|
||||
- Minor: Add workaround for multipart emoji as described in [the RFC](https://mm2pl.github.io/emoji_rfc.pdf). (#3469)
|
||||
- Minor: Added a way to open channel popup by right-clicking the avatar in a usercard. (#3486)
|
||||
- Minor: Add feedback when using the whisper command `/w` incorrectly. (#3439)
|
||||
- Minor: Add feedback when writing a non-command message in the `/whispers` split. (#3439)
|
||||
- Minor: Opening streamlink through hotkeys and/or split header menu matches `/streamlink` command and shows feedback in chat as well. (#3510)
|
||||
- Minor: Removed timestamp from AutoMod messages. (#3503)
|
||||
- Minor: Added ability to copy message ID with `Shift + Right Click`. (#3481)
|
||||
- Minor: Added /popup command to open currently focused split or supplied channel in a new window. (#3529)
|
||||
- Minor: Colorize the entire split header when focused. (#3379)
|
||||
- Minor: Added incremental search to channel search. (#3544)
|
||||
- Minor: Show right click context menu anywhere within a message's line. (#3566)
|
||||
- Minor: Make Tab Layout setting only accept predefined values (#3564)
|
||||
- Minor: Added librewolf, icecat, and waterfox incognito support. (#3588)
|
||||
- Minor: Updated to Emoji v14.0 (#3612)
|
||||
- Minor: Add support for locking tab arrangement (#3627)
|
||||
- Bugfix: Fixed rendering of moderator announcements. (#3639)
|
||||
- Bugfix: Fix Split Input hotkeys not being available when input is hidden (#3362)
|
||||
- Bugfix: Fixed colored usernames sometimes not working. (#3170)
|
||||
- Bugfix: Restored ability to send duplicate `/me` messages. (#3166)
|
||||
- Bugfix: Notifications for moderators about other moderators deleting messages can now be disabled. (#3121)
|
||||
- Bugfix: Moderation mode and active filters are now preserved when opening a split as a popup. (#3113, #3130)
|
||||
- Bugfix: Fixed a bug that caused all badge highlights to use the same color. (#3132, #3134)
|
||||
- Bugfix: Allow starting Streamlink from Chatterino when running as a Flatpak. (#3178)
|
||||
- Bugfix: Fixed own IRC messages not having metadata and a link to a usercard. (#3203)
|
||||
- Bugfix: Fixed some channels still not loading in rare cases. (#3219)
|
||||
- Bugfix: Fixed a bug with usernames or emotes completing from the wrong position. (#3229)
|
||||
- Bugfix: Fixed a bug that caused zero-width emotes to be misaligned when the "Remove spaces between emotes" setting is on. (#3249)
|
||||
- Bugfix: Fixed second chatterino icon appearing in the dock when restarting on a crash in macOS. (#3268)
|
||||
- Bugfix: Fixed the "Change channel" popup showing a wrong window title (#3273)
|
||||
- Bugfix: Fixed built-in Chatterino commands not working in whispers and mentions special channels (#3288)
|
||||
- Bugfix: Fixed `QCharRef with an index pointing outside the valid range of a QString` warning that was emitted on every Tab press. (#3234)
|
||||
- Bugfix: Fixed being unable to disable `First Message` highlights (#3293)
|
||||
- Bugfix: Fixed `First Message` custom sound not persisting through restart. (#3303)
|
||||
- Bugfix: Fixed `First Message` scrollbar highlights not being disabled. (#3325)
|
||||
- Bugfix: Fixed the reconnection backoff accidentally resetting when thrown out of certain IRC servers. (#3328)
|
||||
- Bugfix: Fixed underlying text from disabled emotes not being colorized properly. (#3333)
|
||||
- Bugfix: Fixed IRC ACTION messages (/me) not being colorized properly. (#3341)
|
||||
- Bugfix: Fixed splits losing filters when closing and reopening them (#3351)
|
||||
- Bugfix: Fixed the first usercard being broken in `/mods` and `/vips` (#3349)
|
||||
- Bugfix: Fixed IRC colors not being applied correctly to NOTICE messages. (#3383)
|
||||
- Bugfix: Fixed Chatterino attempting to send empty messages (#3355)
|
||||
- Bugfix: Fixed IRC highlights not triggering sounds or alerts properly. (#3368)
|
||||
- Bugfix: Fixed IRC /kick command crashing if parameters were malformed. (#3382)
|
||||
- Bugfix: Fixed crash that would occur if the user tries to modify the currently connected IRC connection. (#3398)
|
||||
- Bugfix: Fixed IRC mentions not showing up in the /mentions split. (#3400)
|
||||
- Bugfix: Fixed a crash that could occur on certain Linux systems when toggling the Always on Top flag. (#3385)
|
||||
- Bugfix: Fixed zero-width emotes sometimes wrapping lines incorrectly. (#3389)
|
||||
- Bugfix: Fixed using special chars in Windows username breaking the storage of custom commands (#3397)
|
||||
- Bugfix: Fixed character counter changing fonts after going over the limit. (#3422)
|
||||
- Bugfix: Fixed crash that could occur if the user opens/closes ChannelViews (e.g. EmotePopup, or Splits) then modifies the showLastMessageIndicator setting. (#3444)
|
||||
- Bugfix: Removed ability to reload emotes really fast (#3450)
|
||||
- Bugfix: Re-add date of build to the "About" page on nightly versions. (#3464)
|
||||
- Bugfix: Fixed crash that would occur if the user right-clicked AutoMod badge. (#3496)
|
||||
- Bugfix: Fixed being unable to drag the user card window from certain spots. (#3508)
|
||||
- Bugfix: Fixed being unable to open a usercard from inside a usercard while "Automatically close user popup when it loses focus" was enabled. (#3518)
|
||||
- Bugfix: Usercards no longer close when the originating window (e.g. a search popup) is closed. (#3518)
|
||||
- Bugfix: Disabled /popout and /streamlink from working in non-twitch channels (e.g. /whispers) when supplied no arguments. (#3541)
|
||||
- Bugfix: Fixed automod and unban messages showing when moderation actions were disabled (#3548)
|
||||
- Bugfix: Fixed crash when rendering a highlight inside of a sub message, with sub message highlights themselves turned off. (#3556)
|
||||
- Bugfix: Don't grab the keyboard in channel picker dialog (#3575)
|
||||
- BugFix: Fixed SplitInput placeholder color. (#3606)
|
||||
- BugFix: Remove game from stream/split title when set to "nothing." (#3609)
|
||||
- BugFix: Fixed double-clicking on usernames with right/middle click causing text selection. (#3608)
|
||||
- Dev: Batch checking live status for channels with live notifications that aren't connected. (#3442)
|
||||
- Dev: Add GitHub action to test builds without precompiled headers enabled. (#3327)
|
||||
- Dev: Renamed CMake's build option `USE_SYSTEM_QT5KEYCHAIN` to `USE_SYSTEM_QTKEYCHAIN`. (#3103)
|
||||
- Dev: Add benchmarks that can be compiled with the `BUILD_BENCHMARKS` CMake flag. Off by default. (#3038)
|
||||
- Dev: Added CMake build option `BUILD_WITH_QTKEYCHAIN` to build with or without Qt5Keychain support (On by default). (#3318)
|
||||
- Dev: Added /fakemsg command for debugging (#3448)
|
||||
- Dev: Notebook::select\* functions now take an optional `focusPage` parameter (true by default) which keeps the default behaviour of selecting the page after it has been selected. If set to false, the page is _not_ focused after being selected. (#3446)
|
||||
- Dev: Updated PubSub client to use TLS v1.2 (#3599)
|
||||
- Dev: Use system logical core count for Ubuntu/macOS GitHub actions builds. (#3602)
|
||||
|
||||
## 2.3.4
|
||||
|
||||
- Major: Newly uploaded Twitch emotes are once again present in emote picker and can be autocompleted with Tab as well. (#2992)
|
||||
- Major: Deprecated `/(un)follow` commands and (un)following in the usercards as Twitch has removed this feature for 3rd party applications. (#3076, #3078)
|
||||
- Major: Added the ability to add nicknames for users. (#137, #2981)
|
||||
- Major: Fixed constant disconnections with more than 20 channels by rate-limiting outgoing JOIN messages. (#3112, #3115)
|
||||
- Minor: Added autocompletion in /whispers for Twitch emotes, Global Bttv/Ffz emotes and emojis. (#2999, #3033)
|
||||
- Minor: Received Twitch messages now use the exact same timestamp (obtained from Twitch's server) for every Chatterino user instead of assuming message timestamp on client's side. (#3021)
|
||||
- Minor: Received IRC messages use `time` message tag for timestamp if it's available. (#3021)
|
||||
- Minor: Added informative messages for recent-messages API's errors. (#3029)
|
||||
- Minor: Added section with helpful Chatterino-related links to the About page. (#3068)
|
||||
- Minor: Now uses spaces instead of magic Unicode character for sending duplicate messages (#3081)
|
||||
- Minor: Added `channel.live` filter variable (#3092, #3110)
|
||||
- Bugfix: Fixed "smiley" emotes being unable to be "Tabbed" with autocompletion, introduced in v2.3.3. (#3010)
|
||||
- Bugfix: Fixed PubSub not properly trying to resolve pending listens when the pending listens list was larger than 50. (#3037)
|
||||
- Bugfix: Copy buttons in usercard now show properly in light mode (#3057)
|
||||
- Bugfix: Fixed comma appended to username completion when not at the beginning of the message. (#3060)
|
||||
- Bugfix: Fixed bug misplacing chat when zooming on Chrome with Chatterino Native Host extension (#1936)
|
||||
- Bugfix: Channel point redemptions from ignored users are now properly blocked. (#3102)
|
||||
- Dev: Allow building against Qt 5.11 (#3105)
|
||||
- Dev: Ubuntu packages are now available (#2936)
|
||||
- Dev: Disabled update checker on Flatpak. (#3051)
|
||||
- Dev: Add logging for HTTP requests (#2991)
|
||||
|
||||
## 2.3.3
|
||||
|
||||
- Major: Added username autocompletion popup menu when typing usernames with an @ prefix. (#1979, #2866)
|
||||
- Major: Added ability to toggle visibility of Channel Tabs - This can be done by right-clicking the tab area or pressing the keyboard shortcut (default: Ctrl+U). (#2600)
|
||||
- Minor: Username in channel points rewards redemption messages is now clickable. (#2673, #2953)
|
||||
- Minor: Channel name in `<channel> has gone offline. Exiting host mode.` messages is now clickable. (#2922)
|
||||
- Minor: Added `/openurl` command. Usage: `/openurl <URL>`. Opens the provided URL in the browser. (#2461, #2926)
|
||||
- Minor: Updated to Emoji v13.1 (#2958)
|
||||
- Minor: Added "Open in: new tab, browser player, streamlink" in twitch link context menu. (#2988)
|
||||
- Minor: Sender username in automod messages shown to moderators shows correct color and display name. (#2967)
|
||||
- Minor: The /live split now shows channels going offline. (#2880)
|
||||
- Minor: Restore automod functionality for moderators (#2817, #2887)
|
||||
- Minor: Add setting for username style (#2889, #2891)
|
||||
- Minor: Searching for users in the viewer list now searches anywhere in the user's name. (#2861)
|
||||
- Minor: Added moderation buttons to search popup when searching in a split with moderation mode enabled. (#2148, #2803)
|
||||
- Minor: Made "#channel" in `/mentions` tab show in usercards and in the search popup. (#2802)
|
||||
- Minor: Added settings to disable custom FrankerFaceZ VIP/mod badges. (#2693, #2759)
|
||||
- Minor: Limit the number of recent chatters to improve memory usage and reduce freezes. (#2796, #2814)
|
||||
- Minor: Added `/popout` command. Usage: `/popout [channel]`. It opens browser chat for the provided channel. Can also be used without arguments to open current channels browser chat. (#2556, #2812)
|
||||
- Minor: Improved matching of game names when using `/setgame` command (#2636)
|
||||
- Minor: Now shows deletions of messages like timeouts (#1155, #2841, #2867, #2874)
|
||||
- Minor: Added a link to accounts page in settings to "You need to be logged in to send messages" message. (#2862)
|
||||
- Minor: Switch to Twitch v2 emote API for animated emote support. (#2863)
|
||||
- Bugfix: Now deleting cache files that weren't modified in the past 14 days. (#2947)
|
||||
- Bugfix: Fixed large timeout durations in moderation buttons overlapping with usernames or other buttons. (#2865, #2921)
|
||||
- Bugfix: Middle mouse click no longer scrolls in not fully populated usercards and splits. (#2933)
|
||||
- Bugfix: Fix bad behavior of the HTML color picker edit when user input is being entered. (#2942)
|
||||
- Bugfix: Made follower emotes suggested (in emote popup menu, tab completion, emote input menu) only in their origin channel, not globally. (#2951)
|
||||
- Bugfix: Fixed founder badge not being respected by `author.subbed` filter. (#2971)
|
||||
- Bugfix: Usercards on IRC will now only show user's messages. (#1780, #2979)
|
||||
- Bugfix: Messages that couldn't be searched or filtered are now handled correctly. (#2962)
|
||||
- Bugfix: Moderation buttons now show the correct time unit when using units other than seconds. (#1719, #2864)
|
||||
- Bugfix: Fixed FFZ emote links for global emotes (#2807, #2808)
|
||||
- Bugfix: Fixed pasting text with URLs included (#1688, #2855)
|
||||
- Bugfix: Fix reconnecting when IRC write connection is lost (#1831, #2356, #2850, #2892)
|
||||
- Bugfix: Fixed bit and new subscriber emotes not (re)loading in some rare cases. (#2856, #2857)
|
||||
- Bugfix: Fixed subscription emotes showing up incorrectly in the emote menu. (#2905)
|
||||
|
||||
## 2.3.2
|
||||
|
||||
- Major: New split for channels going live! /live. (#1797)
|
||||
- Minor: Added a message that displays a new date on new day. (#1016)
|
||||
- Minor: Hosting messages are now clickable. (#2655)
|
||||
- Minor: Messages held by automod are now shown to the user. (#2626)
|
||||
- Minor: Load 100 blocked users rather than the default 20. (#2772)
|
||||
- Bugfix: Fixed a potential crashing issue related to the browser extension. (#2774)
|
||||
- Bugfix: Strip newlines from stream titles to prevent text going off of split header (#2755)
|
||||
- Bugfix: Automod messages now work properly again. (#2682)
|
||||
- Bugfix: `Login expired` message no longer highlights all tabs. (#2735)
|
||||
- Bugfix: Fix a deadlock that would occur during user badge loading. (#1704, #2756)
|
||||
- Bugfix: Tabbing in `Select a channel to open` is now consistent. (#1797)
|
||||
- Bugfix: Fix Ctrl + Backspace not closing colon emote picker. (#2780)
|
||||
- Bugfix: Approving/denying AutoMod messages works again. (#2779)
|
||||
- Dev: Migrated AutoMod approve/deny endpoints to Helix. (#2779)
|
||||
- Dev: Migrated Get Cheermotes endpoint to Helix. (#2440)
|
||||
|
||||
## 2.3.1
|
||||
|
||||
- Major: Fixed crashing with the extension (#2704)
|
||||
- Major: Added the ability to highlight messages based on user badges. (#1704)
|
||||
- Minor: Added visual indicator to message length if over 500 characters long (#2659)
|
||||
- Minor: Added `is:<flags>` search filter to find messages of specific types. (#2653, #2671)
|
||||
- Minor: Added image links to the badge context menu. (#2667)
|
||||
- Minor: Added a setting to hide Twitch Predictions badges. (#2668)
|
||||
- Minor: Optionally remove spaces between emotes, originally made for Mm2PL/Dankerino. (#2651)
|
||||
- Minor: Improved UX of `Rename Tab` dialog. (#2713)
|
||||
- Bugfix: Added missing Copy/Open link context menu entries to emotes in Emote Picker. (#2670)
|
||||
- Bugfix: Fixed visual glitch with smooth scrolling. (#2084)
|
||||
- Bugfix: Clicking on split header focuses its split. (#2720)
|
||||
- Bugfix: Handle new user messages ("rituals") properly. (#2703)
|
||||
|
||||
## 2.3.0
|
||||
|
||||
- Major: Added custom FrankerFaceZ VIP Badges. (#2628)
|
||||
- Minor: Added `in:<channels>` search filter to find messages sent in specific channels. (#2299, #2634)
|
||||
- Minor: Allow for built-in Chatterino commands to be used in custom commands. (#2632)
|
||||
- Bugfix: Size of splits not saved properly (#2362, #2548)
|
||||
- Bugfix: Fix crash that could occur when the user changed the "Custom stream player URI Scheme" setting if the user had closed down and splits in the application runtime. (#2592)
|
||||
- Major: Added clip creation support. You can create clips with `/clip` command, `Alt+X` keybind or `Create a clip` option in split header's context menu. This requires a new authentication scope so re-authentication will be required to use it. (#2271, #2377, #2528)
|
||||
- Major: Added "Channel Filters". See https://wiki.chatterino.com/Filters/ for how they work or how to configure them. (#1748, #2083, #2090, #2200, #2225)
|
||||
- Major: Added Streamer Mode configuration (under `Settings -> General`), where you can select which features of Chatterino should behave differently when you are in Streamer Mode. (#2001, #2316, #2342, #2376)
|
||||
- Major: Add `/settitle` and `/setgame` commands, originally made for Mm2PL/Dankerino. (#2534, #2609)
|
||||
- Major: Color mentions to match the mentioned users. You can disable this by unchecking "Color @usernames" under `Settings -> General -> Advanced (misc.)`. (#1963, #2284, #2597)
|
||||
- Major: Commands `/ignore` and `/unignore` have been renamed to `/block` and `/unblock` in order to keep consistency with Twitch's terms. (#2370)
|
||||
- Major: Added support for bit emotes - the ones you unlock after cheering to streamer. (#2550)
|
||||
- Minor: Added `/clearmessages` command - does what "Burger menu -> More -> Clear messages" does. (#2485)
|
||||
- Minor: Added `/marker` command - similar to webchat, it creates a stream marker. (#2360)
|
||||
- Minor: Added `/chatters` command showing chatter count. (#2344)
|
||||
- Minor: Added a button to the split context menu to open the moderation view for a channel when the account selected has moderator permissions. (#2321)
|
||||
- Minor: Made BetterTTV emote tooltips use authors' display name. (#2267)
|
||||
- Minor: Added Ctrl + 1/2/3/... and Ctrl+9 shortcuts to Emote Popup (activated with Ctrl+E). They work exactly the same as shortcuts in main window. (#2263)
|
||||
- Minor: Added reconnect link to the "You are banned" message. (#2266)
|
||||
- Minor: Improved search popup window titles. (#2268)
|
||||
- Minor: Made "#channel" in `/mentions` tab a clickable link which takes you to the channel that you were mentioned in. (#2220)
|
||||
- Minor: Added a keyboard shortcut (Ctrl+F5) for "Reconnect" (#2215)
|
||||
- Minor: Made `Try to find usernames without @ prefix` option still resolve usernames when special characters (commas, dots, (semi)colons, exclamation mark, question mark) are appended to them. (#2212)
|
||||
- Minor: Made usercard update user's display name (#2160)
|
||||
- Minor: Added placeholder text for message text input box. (#2143, #2149, #2264)
|
||||
- Minor: Added support for FrankerFaceZ badges. (#2101, part of #1658)
|
||||
- Minor: Added a navigation list to the settings and reordered them.
|
||||
- Minor: Added a link to twitchemotes.com to context menu when right-clicking Twitch emotes. (#2214)
|
||||
- Minor: Improved viewer list window.
|
||||
- Minor: Added emote completion with `:` to the whispers channel (#2075)
|
||||
- Minor: Made the current channels emotes appear at the top of the emote picker popup. (#2057)
|
||||
- Minor: Added viewer list button to twitch channel header. (#1978)
|
||||
- Minor: Added followage and subage information to usercard. (#2023)
|
||||
- Minor: Added an option to only open channels specified in command line with `-c` parameter. You can also use `--help` to display short help message (#1940, #2368)
|
||||
- Minor: Added customizable timeout buttons to the user info popup
|
||||
- Minor: Deprecate loading of "v1" window layouts. If you haven't updated Chatterino in more than 2 years, there's a chance you will lose your window layout.
|
||||
- Minor: User popup will now automatically display messages as they are received. (#1982, #2514)
|
||||
- Minor: Changed the English in two rate-limited system messages (#1878)
|
||||
- Minor: Added a setting to disable messages sent to /mentions split from making the tab highlight with the red marker (#1994)
|
||||
- Minor: Added image for streamer mode in the user popup icon.
|
||||
- Minor: Added vip and unvip buttons.
|
||||
- Minor: Added settings for displaying where the last message was.
|
||||
- Minor: Commands are now saved upon pressing Ok in the settings window
|
||||
- Minor: Colorized nicknames now enabled by default
|
||||
- Minor: Show channels live now enabled by default
|
||||
- Minor: Bold usernames enabled by default
|
||||
- Minor: Improve UX of the "Login expired!" message (#2029)
|
||||
- Minor: PageUp and PageDown now scroll in the selected split and in the emote popup (#2070, #2081, #2410, #2607)
|
||||
- Minor: Allow highlights to be excluded from `/mentions`. Excluded highlights will not trigger tab highlights either. (#1793, #2036)
|
||||
- Minor: Flag all popup dialogs as actual dialogs so they get the relevant window manager hints (#1843, #2182, #2185, #2232, #2234)
|
||||
- Minor: Don't show update button for nightly builds on macOS and Linux, this was already the case for Windows (#2163, #2164)
|
||||
- Minor: Tab and split titles now use display/localized channel names (#2189)
|
||||
- Minor: Add a setting to limit the amount of historical messages loaded from the Recent Messages API (#2250, #2252)
|
||||
- Minor: Made username autocompletion truecase (#1199, #1883)
|
||||
- Minor: Update the listing of top-level domains. (#2345)
|
||||
- Minor: Properly respect RECONNECT messages from Twitch (#2347)
|
||||
- Minor: Added command line option to attach chatterino to another window.
|
||||
- Minor: Hide "Case-sensitive" column for user highlights. (#2404)
|
||||
- Minor: Added human-readable formatting to remaining timeout duration. (#2398)
|
||||
- Minor: Update emojis version to 13 (2020). (#1555)
|
||||
- Minor: Remove EmojiOne 2 and 3 due to license restrictions. (#1555)
|
||||
- Minor: Added `/streamlink` command. Usage: `/streamlink <channel>`. You can also use the command without arguments in any twitch channel to open it in streamlink. (#2443, #2495)
|
||||
- Minor: Humanized all numbers visible to end-users. (#2488)
|
||||
- Minor: Added a context menu to avatar in usercard. It opens on right-clicking the avatar in usercard. (#2517)
|
||||
- Minor: Handle messages that users can share after unlocking a new bits badge. (#2611)
|
||||
- Bugfix: Fix crash occurring when pressing Escape in the Color Picker Dialog (#1843)
|
||||
- Bugfix: Fix bug where the "check user follow state" event could trigger a network request requesting the user to follow or unfollow a user. By itself its quite harmless as it just repeats to Twitch the same follow state we had, so no follows should have been lost by this but it meant there was a rogue network request that was fired that could cause a crash (#1906)
|
||||
- Bugfix: /usercard command will now respect the "Automatically close user popup" setting (#1918)
|
||||
- Bugfix: Handle symlinks properly when saving commands & settings (#1856, #1908)
|
||||
- Bugfix: Starting Chatterino in a minimized state after an update will no longer cause a crash
|
||||
- Bugfix: Modify the emote parsing to handle some edge-cases with dots and stuff. (#1704, #1714, #2490)
|
||||
- Bugfix: Fixed timestamps being incorrect on some messages loaded from the recent-messages service on startup (#1286, #2020)
|
||||
- Bugfix: Fixed timestamps missing on channel point redemption messages (#1943)
|
||||
- Bugfix: Fixed tooltip didn't show in `EmotePopup` depending on the `Link preview` setting enabled or no (#2008)
|
||||
- Bugfix: Fixed Stream thumbnail not updating after using the "Change channel" feature (#2074, #2080)
|
||||
- Bugfix: Fixed previous link info not updating after `Link information` setting is enabled (#2054)
|
||||
- Bugfix: Fix Tab key not working in the Ctrl+K Quick Switcher (#2065)
|
||||
- Bugfix: Fix bug preventing moderator actions when viewing a user card from the search window (#1089)
|
||||
- Bugfix: Fix `:` emote completion menu ignoring emote capitalization and inconsistent emote names. (#1962, #2543)
|
||||
- Bugfix: Fix a bug that caused `Ignore page` to fall into an infinity loop with an empty pattern and regex enabled (#2125)
|
||||
- Bugfix: Fix a crash caused by FrankerFaceZ responding with invalid emote links (#2191)
|
||||
- Bugfix: Fix a freeze caused by ignored & replaced phrases followed by Twitch Emotes (#2231)
|
||||
- Bugfix: Fix a crash bug that occurred when moving splits across windows and closing the "parent tab" (#2249, #2259)
|
||||
- Bugfix: Fix a crash bug that occurred when the "Limit message height" setting was enabled and a message was being split up into multiple lines. IRC only. (#2329)
|
||||
- Bugfix: Fix anonymous users being pinged by "username" justinfan64537 (#2156, #2352)
|
||||
- Bugfix: Fixed hidden tooltips when always on top is active (#2384)
|
||||
- Bugfix: Fix CLI arguments (`--help`, `--version`, `--channels`) not being respected (#2368, #2190)
|
||||
- Bugfix: Fixed search field not being focused on popup open (#2540)
|
||||
- Bugfix: Fix Twitch cheer emotes not displaying tooltips when hovered (#2434, #2503)
|
||||
- Bugfix: Fix BTTV/FFZ channel emotes saying unknown error when no emotes found (#2542)
|
||||
- Bugfix: Fix directory not opening when clicking "Open AppData Directory" setting button on macOS (#2531, #2537)
|
||||
- Bugfix: Fix quickswitcher not respecting order of tabs when filtering (#2519, #2561)
|
||||
- Bugfix: Fix GNOME not associating Chatterino's window with its desktop entry (#1863, #2587)
|
||||
- Bugfix: Fix buffer overflow in emoji parsing. (#2602)
|
||||
- Bugfix: Fix windows being brought back to life after the settings dialog was closed. (#1892, #2613)
|
||||
- Dev: Updated minimum required Qt framework version to 5.12. (#2210)
|
||||
- Dev: Migrated `Kraken::getUser` to Helix (#2260)
|
||||
- Dev: Migrated `TwitchAccount::(un)followUser` from Kraken to Helix and moved it to `Helix::(un)followUser`. (#2306)
|
||||
- Dev: Migrated `Kraken::getChannel` to Helix. (#2381)
|
||||
- Dev: Migrated `TwitchAccount::(un)ignoreUser` to Helix and made `TwitchAccount::loadIgnores` use Helix call. (#2370)
|
||||
- Dev: Build in CI with multiple Qt versions (#2349)
|
||||
- Dev: Updated minimum required macOS version to 10.14 (#2386)
|
||||
- Dev: Removed unused `humanize` library (#2422)
|
||||
|
||||
## 2.2.2
|
||||
|
||||
- Bugfix: Fix a potential crash related to channel point rewards (279a80b)
|
||||
|
||||
## 2.2.1
|
||||
|
||||
- Minor: Disable checking for updates on unsupported platforms (#1874)
|
||||
- Bugfix: Fix bug preventing users from setting the highlight color of the second entry in the "User" highlights tab (#1898)
|
||||
|
||||
## 2.2.0
|
||||
|
||||
- Major: We now support image thumbnails coming from the link resolver. This feature is off by default and can be enabled in the settings with the "Show link thumbnail" setting. This feature also requires the "Show link info when hovering" setting to be enabled (#1664)
|
||||
- Major: Added image upload functionality to i.nuuls.com with an ability to change upload destination. This works by dragging and dropping an image into a split, or pasting an image into the text edit field. (#1332, #1741)
|
||||
- Major: Added option to display tabs vertically. (#1815)
|
||||
- Major: Support the highlighted messages redeemed with channel points on twitch.tv.
|
||||
- Major: Added emote completion with `:`
|
||||
- Minor: Added a "Streamer Mode" that hides user generated images while obs is open.
|
||||
- Minor: Added extension support for Brave browser and Microsoft Edge. (#1862)
|
||||
- Minor: Add a switcher widget, similar to Discord. It can be opened by pressing Ctrl+K. (#1588)
|
||||
- Minor: Clicking on `Open in browser` in a whisper split will now open your whispers on twitch. (#1828)
|
||||
- Minor: Clicking on @mentions will open the User Popup. (#1674)
|
||||
- Minor: You can now open the Twitch User Card by middle-mouse clicking a username. (#1669)
|
||||
|
@ -13,11 +406,15 @@
|
|||
- Minor: Removed "Online Logs" functionality as services are shut down (#1640)
|
||||
- Minor: CTRL+F now selects the Find text input field in the Settings Dialog (#1806 #1811)
|
||||
- Minor: CTRL+F now selects the search text input field in the Search Popup (#1812)
|
||||
- Minor: Modify our word boundary logic in highlight phrase searching to accomodate non-regex phrases with "word-boundary-creating" characters like ! (#1885, #1890)
|
||||
- Bugfix: Fixed not being able to open links in incognito with Microsoft Edge (Chromium) (#1875)
|
||||
- Bugfix: Fix the incorrect `Open stream in browser` labelling in the whisper split (#1860)
|
||||
- Bugfix: Fix preview on hover not working when Animated emotes options was disabled (#1546)
|
||||
- Bugfix: FFZ custom mod badges no longer scale with the emote scale options (#1602)
|
||||
- Bugfix: MacOS updater looked for non-existing fields, causing it to always fail the update check (#1642)
|
||||
- Bugfix: Fixed message menu crashing if the message you right-clicked goes out of scope before you select an action (#1783) (#1787)
|
||||
- Bugfix: Fixed alternate messages flickering in UserInfoPopup when clicking Refresh if there was an odd number of messages in there (#1789 #1810)
|
||||
- Bugfix: Fix a crash when using middle click scroll on a chat window. (#1870)
|
||||
- Settings open faster
|
||||
- Dev: Fully remove Twitch Chatroom support
|
||||
- Dev: Handle conversion of historical CLEARCHAT messages to NOTICE messages in Chatterino instead of relying on the Recent Messages API to handle it for us. (#1804)
|
||||
|
|
164
CMakeLists.txt
164
CMakeLists.txt
|
@ -1,37 +1,159 @@
|
|||
cmake_minimum_required(VERSION 3.8)
|
||||
cmake_policy(SET CMP0087 NEW)
|
||||
include(FeatureSummary)
|
||||
|
||||
project(chatterino)
|
||||
|
||||
include_directories(src)
|
||||
|
||||
set(chatterino_SOURCES
|
||||
src/common/UsernameSet.cpp
|
||||
list(APPEND CMAKE_MODULE_PATH
|
||||
"${CMAKE_SOURCE_DIR}/cmake"
|
||||
"${CMAKE_SOURCE_DIR}/cmake/sanitizers-cmake/cmake"
|
||||
)
|
||||
|
||||
find_package(Qt5Widgets CONFIG REQUIRED)
|
||||
find_package(Qt5 5.9.0 REQUIRED COMPONENTS
|
||||
project(chatterino VERSION 2.3.5)
|
||||
|
||||
option(BUILD_APP "Build Chatterino" ON)
|
||||
option(BUILD_TESTS "Build the tests for Chatterino" OFF)
|
||||
option(BUILD_BENCHMARKS "Build the benchmarks for Chatterino" OFF)
|
||||
option(USE_SYSTEM_PAJLADA_SETTINGS "Use system pajlada settings library" OFF)
|
||||
option(USE_SYSTEM_LIBCOMMUNI "Use system communi library" OFF)
|
||||
option(USE_SYSTEM_QTKEYCHAIN "Use system QtKeychain library" OFF)
|
||||
option(BUILD_WITH_QTKEYCHAIN "Build Chatterino with support for your system key chain" ON)
|
||||
option(USE_PRECOMPILED_HEADERS "Use precompiled headers" ON)
|
||||
option(BUILD_WITH_QT6 "Use Qt6 instead of default Qt5" OFF)
|
||||
|
||||
option(USE_CONAN "Use conan" OFF)
|
||||
|
||||
if (BUILD_WITH_QT6)
|
||||
set(MAJOR_QT_VERSION "6")
|
||||
else()
|
||||
set(MAJOR_QT_VERSION "5")
|
||||
endif()
|
||||
|
||||
if (USE_CONAN OR CONAN_EXPORTED)
|
||||
include(${CMAKE_CURRENT_BINARY_DIR}/conanbuildinfo.cmake)
|
||||
conan_basic_setup(TARGETS NO_OUTPUT_DIRS)
|
||||
else ()
|
||||
set(QT_CREATOR_SKIP_CONAN_SETUP ON)
|
||||
endif()
|
||||
|
||||
find_program(CCACHE_PROGRAM ccache)
|
||||
if (CCACHE_PROGRAM)
|
||||
set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
|
||||
message("Using ${CCACHE_PROGRAM} for speeding up build")
|
||||
endif ()
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/cmake/GIT.cmake)
|
||||
|
||||
find_package(Qt${MAJOR_QT_VERSION} REQUIRED
|
||||
COMPONENTS
|
||||
Core
|
||||
Widgets
|
||||
Gui
|
||||
Network
|
||||
Multimedia
|
||||
Svg
|
||||
Concurrent
|
||||
)
|
||||
|
||||
# set(CMAKE_AUTOMOC ON)
|
||||
if (WIN32)
|
||||
find_package(WinToast REQUIRED)
|
||||
endif ()
|
||||
|
||||
find_package(Sanitizers)
|
||||
|
||||
# Find boost on the system
|
||||
find_package(Boost REQUIRED)
|
||||
find_package(Boost COMPONENTS random)
|
||||
|
||||
# Find OpenSSL on the system
|
||||
find_package(OpenSSL REQUIRED)
|
||||
|
||||
find_package(Threads REQUIRED)
|
||||
|
||||
find_library(LIBRT rt)
|
||||
|
||||
if (USE_SYSTEM_LIBCOMMUNI)
|
||||
find_package(LibCommuni REQUIRED)
|
||||
else()
|
||||
set(LIBCOMMUNI_ROOT_LIB_FOLDER "${CMAKE_SOURCE_DIR}/lib/libcommuni")
|
||||
if (NOT EXISTS "${LIBCOMMUNI_ROOT_LIB_FOLDER}/CMakeLists.txt")
|
||||
message(FATAL_ERROR "Submodules probably not loaded, unable to find lib/libcommuni/CMakeLists.txt")
|
||||
endif()
|
||||
|
||||
add_subdirectory("${LIBCOMMUNI_ROOT_LIB_FOLDER}" EXCLUDE_FROM_ALL)
|
||||
endif()
|
||||
|
||||
if (BUILD_WITH_QTKEYCHAIN)
|
||||
# Link QtKeychain statically
|
||||
option(QTKEYCHAIN_STATIC "" ON)
|
||||
if (USE_SYSTEM_QTKEYCHAIN)
|
||||
find_package(Qt${MAJOR_QT_VERSION}Keychain REQUIRED)
|
||||
else()
|
||||
set(QTKEYCHAIN_ROOT_LIB_FOLDER "${CMAKE_SOURCE_DIR}/lib/qtkeychain")
|
||||
if (NOT EXISTS "${QTKEYCHAIN_ROOT_LIB_FOLDER}/CMakeLists.txt")
|
||||
message(FATAL_ERROR "Submodules probably not loaded, unable to find lib/qtkeychain/CMakeLists.txt")
|
||||
endif()
|
||||
|
||||
add_subdirectory("${QTKEYCHAIN_ROOT_LIB_FOLDER}" EXCLUDE_FROM_ALL)
|
||||
if (NOT TARGET qt${MAJOR_QT_VERSION}keychain)
|
||||
message(FATAL_ERROR "qt${MAJOR_QT_VERSION}keychain target was not created :@")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
find_package(RapidJSON REQUIRED)
|
||||
|
||||
find_package(Websocketpp REQUIRED)
|
||||
|
||||
if (BUILD_TESTS)
|
||||
message("++ Tests enabled")
|
||||
find_package(GTest)
|
||||
enable_testing()
|
||||
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/lib/googletest" "lib/googletest")
|
||||
|
||||
add_executable(chatterino-test
|
||||
${chatterino_SOURCES}
|
||||
|
||||
tests/src/main.cpp
|
||||
tests/src/UsernameSet.cpp
|
||||
mark_as_advanced(
|
||||
BUILD_GMOCK BUILD_GTEST BUILD_SHARED_LIBS
|
||||
gmock_build_tests gtest_build_samples gtest_build_tests
|
||||
gtest_disable_pthreads gtest_force_shared_crt gtest_hide_internal_symbols
|
||||
)
|
||||
|
||||
target_link_libraries(chatterino-test Qt5::Core)
|
||||
set_target_properties(gtest PROPERTIES FOLDER lib)
|
||||
set_target_properties(gtest_main PROPERTIES FOLDER lib)
|
||||
set_target_properties(gmock PROPERTIES FOLDER lib)
|
||||
set_target_properties(gmock_main PROPERTIES FOLDER lib)
|
||||
endif ()
|
||||
|
||||
target_link_libraries(chatterino-test gtest gtest_main)
|
||||
if (BUILD_BENCHMARKS)
|
||||
# Include system benchmark (Google Benchmark)
|
||||
find_package(benchmark REQUIRED)
|
||||
endif ()
|
||||
|
||||
gtest_discover_tests(chatterino-test)
|
||||
find_package(PajladaSerialize REQUIRED)
|
||||
find_package(PajladaSignals REQUIRED)
|
||||
find_package(LRUCache REQUIRED)
|
||||
find_package(MagicEnum REQUIRED)
|
||||
|
||||
if (USE_SYSTEM_PAJLADA_SETTINGS)
|
||||
find_package(PajladaSettings REQUIRED)
|
||||
else()
|
||||
message(FATAL_ERROR "This cmake file is only intended for tests right now. Use qmake to build chatterino2")
|
||||
if (NOT EXISTS "${CMAKE_SOURCE_DIR}/lib/settings/CMakeLists.txt")
|
||||
message(FATAL_ERROR "Submodules probably not loaded, unable to find lib/settings/CMakeLists.txt")
|
||||
endif()
|
||||
|
||||
add_subdirectory("${CMAKE_SOURCE_DIR}/lib/settings" EXCLUDE_FROM_ALL)
|
||||
endif()
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
if (BUILD_TESTS OR BUILD_BENCHMARKS)
|
||||
add_definitions(-DCHATTERINO_TEST)
|
||||
endif ()
|
||||
|
||||
add_subdirectory(src)
|
||||
|
||||
if (BUILD_TESTS)
|
||||
enable_testing()
|
||||
add_subdirectory(tests)
|
||||
endif ()
|
||||
|
||||
if (BUILD_BENCHMARKS)
|
||||
add_subdirectory(benchmarks)
|
||||
endif ()
|
||||
|
||||
feature_summary(WHAT ALL)
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
# Chatterino code guidelines
|
||||
|
||||
This is a set of guidelines for contributing to Chatterino. The goal is to teach programmers without C++ background (java/python/etc.), people who haven't used Qt or otherwise have different experience the idioms of the codebase. Thus we will focus on those which are different from those other environments. There are extra guidelines available [here](https://hackmd.io/@fourtf/chatterino-pendantic-guidelines) but they are considered as extras and not as important.
|
||||
This is a set of guidelines for contributing to Chatterino. The goal is to teach programmers without a C++ background (java/python/etc.), people who haven't used Qt, or otherwise have different experience, the idioms of the codebase. Thus we will focus on those which are different from those other environments. There are extra guidelines available [here](https://hackmd.io/@fourtf/chatterino-pendantic-guidelines) but they are considered as extras and not as important.
|
||||
|
||||
# Tooling
|
||||
|
||||
Formatting
|
||||
------
|
||||
## Formatting
|
||||
|
||||
Code is automatically formatted using `clang-format`. It takes the burden off of the programmer and ensures that all contributors use the same style (even if mess something up accidentally). We recommend that you set up automatic formatting on file save in your editor.
|
||||
|
||||
|
@ -20,7 +19,7 @@ Try to structure your code so that comments are not required.
|
|||
|
||||
#### Good example
|
||||
|
||||
``` cpp
|
||||
```cpp
|
||||
/// Result is 0 if a == b, negative if a < b and positive if b > a.
|
||||
/// ^^^ You can't know this from the function signature!
|
||||
// Even better: Return a "strong ordering" type.
|
||||
|
@ -30,7 +29,7 @@ int compare(const QString &a, const QString &b);
|
|||
|
||||
#### Bad example
|
||||
|
||||
``` cpp
|
||||
```cpp
|
||||
/*
|
||||
* Matches a link and returns boost::none if it failed and a
|
||||
* QRegularExpressionMatch on success.
|
||||
|
@ -43,15 +42,13 @@ int compare(const QString &a, const QString &b);
|
|||
boost::optional<QRegularExpressionMatch> matchLink(const QString &text);
|
||||
```
|
||||
|
||||
|
||||
# Code
|
||||
|
||||
Arithmetic Types
|
||||
-----
|
||||
## Arithmetic Types
|
||||
|
||||
Arithmetic types (like char, short, int, long, float and double), bool, and pointers are NOT initialized by default in c++. They keep whatever value is already at their position in the memory. This makes debugging harder and is unpredictable, so we initialize them to zero by using `{}` after their name when declaring them.
|
||||
|
||||
``` cpp
|
||||
```cpp
|
||||
class ArithmeticTypes
|
||||
{
|
||||
int thisIs0{};
|
||||
|
@ -71,12 +68,13 @@ void myFunc() {
|
|||
}
|
||||
```
|
||||
|
||||
Passing parameters
|
||||
------
|
||||
The way a parameter is passed signals how it is going to be used inside of the function. C++ doesn't have multiple return values so there is "out parameters" (reference to a variable that is going to be assigned inside of the function) to simulate multiple return values.
|
||||
## Passing parameters
|
||||
|
||||
The way a parameter is passed, signals how it is going to be used inside of the function. C++ doesn't have multiple return values, so there are "out parameters" (reference to a variable that is going to be assigned inside of the function) to simulate multiple return values.
|
||||
|
||||
**Cheap to copy types** like int/enum/etc. can be passed in per value since copying them is fast.
|
||||
``` cpp
|
||||
|
||||
```cpp
|
||||
void setValue(int value) {
|
||||
// ...
|
||||
}
|
||||
|
@ -84,20 +82,20 @@ void setValue(int value) {
|
|||
|
||||
**References** mean that the variable doesn't need to be copied when it is passed to a function.
|
||||
|
||||
|type|meaning|
|
||||
|-|-|
|
||||
|`const Type& name`|*in* Parameter. It is NOT going to be modified and may be copied inside of the function.|
|
||||
|`Type& name`|*out* or *in+out* Parmameter. It will be modified.|
|
||||
| type | meaning |
|
||||
| ------------------ | ---------------------------------------------------------------------------------------- |
|
||||
| `const Type& name` | _in_ Parameter. It is NOT going to be modified and may be copied inside of the function. |
|
||||
| `Type& name` | _out_ or _in+out_ Parmameter. It will be modified. |
|
||||
|
||||
**Pointers** signal that objects are managed manually. While the above are only guaranteed to live as long as the function call (= don't store and use later) these may have more complex lifetimes.
|
||||
|
||||
|type|meaning|
|
||||
|-|-|
|
||||
|`Type* name`|The lifetime of the parameter may exceed the length of the function call. It may use the `QObject` parent/children system.|
|
||||
| type | meaning |
|
||||
| ------------ | -------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `Type* name` | The lifetime of the parameter may exceed the length of the function call. It may use the `QObject` parent/children system. |
|
||||
|
||||
**R-value references** `&&` work similar to regular references but signal the parameter should be "consumed".
|
||||
|
||||
``` cpp
|
||||
```cpp
|
||||
void storeLargeObject(LargeObject &&object) {
|
||||
// ...
|
||||
}
|
||||
|
@ -124,14 +122,13 @@ void main() {
|
|||
}
|
||||
```
|
||||
|
||||
Generally the lowest level of requirement should be used e.g. passing `Channel&` instead of `std::shared_ptr<Channel>&` (aka `ChannelPtr`) if possible.
|
||||
Generally the lowest level of requirement should be used, e.g. passing `Channel&` instead of `std::shared_ptr<Channel>&` (aka `ChannelPtr`) if possible.
|
||||
|
||||
## Members
|
||||
|
||||
Members
|
||||
-----
|
||||
All function names are in `camelCase`. _Private_ member variables are in `camelCase_` (note the underscore at the end). We don't use the `get` prefix for getters. We mark functions as `const` [if applicable](https://stackoverflow.com/questions/751681/meaning-of-const-last-in-a-function-declaration-of-a-class).
|
||||
|
||||
All functions names are in `camelCase`. *Private* member variables are in `camelCase_` (note the underscore at the end). We don't use the `get` prefix for getters. We mark functions as `const` [if applicable](https://stackoverflow.com/questions/751681/meaning-of-const-last-in-a-function-declaration-of-a-class).
|
||||
``` cpp
|
||||
```cpp
|
||||
class NamedObject
|
||||
{
|
||||
public:
|
||||
|
@ -151,15 +148,14 @@ private:
|
|||
void myFreeStandingFunction(); // <- also lower case
|
||||
```
|
||||
|
||||
Casts
|
||||
------
|
||||
## Casts
|
||||
|
||||
- **Avoid** c-style casts: `(type)variable`.
|
||||
- Instead use explicit type casts: `type(variable)`
|
||||
- Or use one of [static_cast](https://en.cppreference.com/w/cpp/language/static_cast), [const_cast](https://en.cppreference.com/w/cpp/language/const_cast) and [dynamic_cast](https://en.cppreference.com/w/cpp/language/dynamic_cast)
|
||||
- Try to avoid [reinterpret_cast](https://en.cppreference.com/w/cpp/language/reinterpret_cast) unless necessary.
|
||||
|
||||
``` cpp
|
||||
```cpp
|
||||
void example() {
|
||||
float f = 123.456;
|
||||
int i = (int)f; // <- don't
|
||||
|
@ -181,12 +177,11 @@ void example() {
|
|||
}
|
||||
```
|
||||
|
||||
## This
|
||||
|
||||
This
|
||||
------
|
||||
Always use `this` to refer to instance members to make it clear where we use either locals or members.
|
||||
|
||||
``` cpp
|
||||
```cpp
|
||||
class Test
|
||||
{
|
||||
void testFunc(int a);
|
||||
|
@ -206,15 +201,42 @@ Test::testFunc(int a)
|
|||
}
|
||||
```
|
||||
|
||||
Managing resources
|
||||
------
|
||||
## Managing resources
|
||||
|
||||
#### Regular classes
|
||||
|
||||
Keep the element on the stack if possible. If you need a pointer or have complex ownership you should use one of these classes:
|
||||
|
||||
- Use `std::unique_ptr` if the resource has a single owner.
|
||||
- Use `std::shared_ptr` if the resource has multiple owners.
|
||||
|
||||
#### QObject classes
|
||||
- Use the [object tree](https://doc.qt.io/qt-5/objecttrees.html#) to manage lifetime where possible. Objects are destroyed when their parent object is destroyed.
|
||||
|
||||
- Use the [object tree](https://doc.qt.io/qt-5/objecttrees.html#) to manage lifetimes where possible. Objects are destroyed when their parent object is destroyed.
|
||||
- If you have to explicitly delete an object use `variable->deleteLater()` instead of `delete variable`. This ensures that it will be deleted on the correct thread.
|
||||
- If an object doesn't have a parent consider using `std::unique_ptr<Type, DeleteLater>` with `DeleteLater` from "src/common/Common.hpp". This will call `deleteLater()` on the pointer once it goes out of scope or the object is destroyed.
|
||||
- If an object doesn't have a parent, consider using `std::unique_ptr<Type, DeleteLater>` with `DeleteLater` from "src/common/Common.hpp". This will call `deleteLater()` on the pointer once it goes out of scope, or the object is destroyed.
|
||||
|
||||
## Conventions
|
||||
|
||||
#### Usage strings
|
||||
|
||||
When informing the user about how a command is supposed to be used, we aim to follow [this standard](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html) where possible.
|
||||
|
||||
- Square brackets are reserved for `[optional arguments]`.
|
||||
- Angle brackets are reserved for `<required arguments>`.
|
||||
- The word _Usage_ should be capitalized and must be followed by a colon.
|
||||
- If the usage deserves a description, put a dot after all parameters and explain it briefly.
|
||||
|
||||
##### Good
|
||||
|
||||
- `Usage: /block <user>`
|
||||
- `Usage: /unblock <user>. Unblocks a user.`
|
||||
- `Usage: /streamlink [channel]`
|
||||
- `Usage: /usercard <user> [channel]`
|
||||
|
||||
##### Bad
|
||||
|
||||
- `Usage /streamlink <channel>` - Missing colon after _Usage_.
|
||||
- `usage: /streamlink <channel>` - _Usage_ must be capitalized.
|
||||
- `Usage: /streamlink channel` - The required argument `channel` must be wrapped in angle brackets.
|
||||
- `Usage: /streamlink <channel>.` - Don't put a dot after usage if it's not followed by a description.
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
<!-- Please create a different issue for every bug report or feature request that you have. Feel free to create multiple issues. -->
|
20
Jenkinsfile
vendored
20
Jenkinsfile
vendored
|
@ -1,20 +0,0 @@
|
|||
pipeline {
|
||||
agent any
|
||||
|
||||
stages {
|
||||
stage('Build') {
|
||||
parallel {
|
||||
stage('GCC') {
|
||||
steps {
|
||||
sh 'mkdir -p build-linux-gcc && cd build-linux-gcc && make distclean; qmake .. && make'
|
||||
}
|
||||
}
|
||||
stage('Clang') {
|
||||
steps {
|
||||
sh 'mkdir -p build-linux-clang && cd build-linux-clang && make distclean; qmake -spec linux-clang .. && make'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
25
README.md
25
README.md
|
@ -1,25 +1,33 @@
|
|||
![alt text](https://fourtf.com/img/chatterino-icon-64.png)
|
||||
Chatterino 2
|
||||
Chatterino 2 [![GitHub Actions Build (Windows, Ubuntu, MacOS)](https://github.com/Chatterino/chatterino2/workflows/Build/badge.svg?branch=master)](https://github.com/Chatterino/chatterino2/actions?query=workflow%3ABuild+branch%3Amaster) [![Cirrus CI Build (FreeBSD only)](https://api.cirrus-ci.com/github/Chatterino/chatterino2.svg?branch=master)](https://cirrus-ci.com/github/Chatterino/chatterino2/master) [![Chocolatey Package](https://img.shields.io/chocolatey/v/chatterino?include_prereleases)](https://chocolatey.org/packages/chatterino) [![Flatpak Package](https://img.shields.io/flathub/v/com.chatterino.chatterino)](https://flathub.org/apps/details/com.chatterino.chatterino)
|
||||
============
|
||||
|
||||
Chatterino 2 is the second installment of the Twitch chat client series "Chatterino".
|
||||
Chatterino 2 is a chat client for [Twitch.tv](https://twitch.tv).
|
||||
The Chatterino 2 wiki can be found [here](https://wiki.chatterino.com).
|
||||
Contribution guidelines can be found [here](https://wiki.chatterino.com/Contributing%20for%20Developers).
|
||||
|
||||
## Download
|
||||
|
||||
Current releases are available at [https://chatterino.com](https://chatterino.com).
|
||||
Windows users can also install Chatterino [from Chocolatey](https://chocolatey.org/packages/chatterino).
|
||||
|
||||
## Nightly build
|
||||
|
||||
You can download the latest Chatterino 2 build over [here](https://github.com/Chatterino/chatterino2/releases/tag/nightly-build)
|
||||
|
||||
You might also need to install the [VC++ 2017 Redistributable](https://aka.ms/vs/15/release/vc_redist.x64.exe) from Microsoft if you do not have it installed already.
|
||||
If you still receive an error about `MSVCR120.dll missing`, then you should install the [VC++ 2013 Restributable](https://download.microsoft.com/download/2/E/6/2E61CFA4-993B-4DD4-91DA-3737CD5CD6E3/vcredist_x64.exe
|
||||
).
|
||||
You might also need to install the [VC++ Redistributables](https://aka.ms/vs/17/release/vc_redist.x64.exe) from Microsoft if you do not have it installed already.
|
||||
If you still receive an error about `MSVCR120.dll missing`, then you should install the [VC++ 2013 Restributable](https://download.microsoft.com/download/2/E/6/2E61CFA4-993B-4DD4-91DA-3737CD5CD6E3/vcredist_x64.exe).
|
||||
|
||||
## Building
|
||||
|
||||
To get source code with required submodules run:
|
||||
|
||||
```
|
||||
git clone --recurse-submodules https://github.com/Chatterino/chatterino2.git
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```
|
||||
git clone https://github.com/Chatterino/chatterino2.git
|
||||
cd chatterino2
|
||||
|
@ -28,6 +36,8 @@ git submodule update --init --recursive
|
|||
|
||||
[Building on Windows](../master/BUILDING_ON_WINDOWS.md)
|
||||
|
||||
[Building on Windows with vcpkg](../master/BUILDING_ON_WINDOWS_WITH_VCPKG.md)
|
||||
|
||||
[Building on Linux](../master/BUILDING_ON_LINUX.md)
|
||||
|
||||
[Building on Mac](../master/BUILDING_ON_MAC.md)
|
||||
|
@ -35,10 +45,12 @@ git submodule update --init --recursive
|
|||
[Building on FreeBSD](../master/BUILDING_ON_FREEBSD.md)
|
||||
|
||||
## Code style
|
||||
|
||||
The code is formatted using clang format in Qt Creator. [.clang-format](src/.clang-format) contains the style file for clang format.
|
||||
|
||||
### Get it automated with QT Creator + Beautifier + Clang Format
|
||||
1. Download LLVM: https://releases.llvm.org/9.0.0/LLVM-9.0.0-win64.exe
|
||||
|
||||
1. Download LLVM: https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.0/LLVM-11.0.0-win64.exe
|
||||
2. During the installation, make sure to add it to your path
|
||||
3. In QT Creator, select `Help` > `About Plugins` > `C++` > `Beautifier` to enable the plugin
|
||||
4. Restart QT Creator
|
||||
|
@ -49,4 +61,5 @@ The code is formatted using clang format in Qt Creator. [.clang-format](src/.cla
|
|||
Qt creator should now format the documents when saving it.
|
||||
|
||||
## Doxygen
|
||||
|
||||
Doxygen is used to generate project information daily and is available [here](https://doxygen.chatterino.com).
|
||||
|
|
99
_.travis.yml
99
_.travis.yml
|
@ -1,99 +0,0 @@
|
|||
|
||||
matrix:
|
||||
include:
|
||||
# gcc build
|
||||
- os: linux
|
||||
name: Linux Build (Bionic)
|
||||
dist: bionic
|
||||
language: cpp
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- sourceline: 'ppa:beineri/opt-qt-5.12.3-bionic'
|
||||
packages:
|
||||
- qt512-meta-minimal
|
||||
- qt512multimedia
|
||||
- qt512svg
|
||||
- libboost-dev
|
||||
- libgl1-mesa-dev
|
||||
- libboost-system-dev
|
||||
- libboost-filesystem-dev
|
||||
- libgtk2.0-dev
|
||||
|
||||
install:
|
||||
- sh ./.CI/InstallQTStylePlugins.sh
|
||||
|
||||
script:
|
||||
- dateOfBuild="CHATTERINO_NIGHTLY_VERSION_STRING=\"\\\"$(date +%d.%m.%Y)\\\"\""
|
||||
- /opt/qt512/bin/qmake CONFIG+=release PREFIX=/usr DEFINES+=$dateOfBuild
|
||||
- make -j$(nproc)
|
||||
|
||||
before_deploy:
|
||||
- git config --global user.email "builds@travis-ci.com"
|
||||
- git config --global user.name "Travis CI"
|
||||
- export GIT_TAG=nightly-build
|
||||
- export TRAVIS_TAG=nightly-build
|
||||
- git tag $GIT_TAG -f
|
||||
- sh ./.CI/CreateAppImage.sh
|
||||
|
||||
deploy:
|
||||
skip_cleanup: true
|
||||
overwrite: true
|
||||
provider: releases
|
||||
api_key:
|
||||
secure: ZzS55wlwtLAVEBaDDMqiuqZwuTpvLbNnaNw0enfiqpjWT7hgbbp/SBw2rbYIkVqm7tBHCLnEzKto6p4Gz6ROo0gGACARmx7EwIloX18rMCuBWygNHRyVruDSlmEOLWRqYByDbUdCkKhYr9aegnkm7zhzCmSBCTW28/uVlxM2bTHIgqKEpB4k1W8OqKdJDxqZKeF4r7nDNSOx5ylhpiK+WNFK8yfiaF1SQlSwsdv9o1RkbJlew7iigvHvEM2kDMkiMWYlJ2khkUWVCVQDQGe4/ya5pgTIHDLu5sZuclp5zhgfDf1U3STvsbQWvxJfsmCId7IQHJ83OSFeoUf6y849i3GMqlNi3aXrxEx0fi0dILQ76/Sj246FPMA4kC0/W49uaxqD784wFuJDjSWeWwi/NPoJ/gz0mGZy+08BoztOGqqOKjJJdESBYTio71N8VcK09zQ0LjXRmX+g3BbrK6a2F3hiMKeuYwdaN2/KdMMoqFDau6L3fXLdpcHKdJC8K/yzJtyyIe0CRB2nj8sZLHfxDwoRm7gOTDXq1zPL7CP9cCwCnCR6nm3CqUW/CnSWuMKpSoQRlP5EBI7zzYT2/tZc/vat5nob7Xif6yFF9fh/VHx4tC6zsfkA1nPPN3+QpdVInRo7dCVxtTqey5FdVjSiv7n11TrFhZ7+Fr5x6CZqa58=
|
||||
file: "Chatterino-x86_64.AppImage"
|
||||
prerelease: true
|
||||
on:
|
||||
branch: master
|
||||
|
||||
- os: osx
|
||||
osx_image: xcode11
|
||||
name: xcode Build
|
||||
compiler: clang
|
||||
|
||||
addons:
|
||||
homebrew:
|
||||
packages:
|
||||
- boost
|
||||
- openssl
|
||||
- rapidjson
|
||||
- qt
|
||||
- p7zip
|
||||
- create-dmg
|
||||
|
||||
script:
|
||||
- mkdir build && cd build
|
||||
- dateOfBuild="CHATTERINO_NIGHTLY_VERSION_STRING=\"\\\"$(date +%d.%m.%Y)\\\"\""
|
||||
- /usr/local/opt/qt/bin/qmake .. DEFINES+=$dateOfBuild
|
||||
- sed -ie 's/-framework\\\ /-framework /g' Makefile
|
||||
- make -j8
|
||||
- /usr/local/opt/qt/bin/macdeployqt chatterino.app -dmg
|
||||
- mkdir app
|
||||
- hdiutil attach chatterino.dmg
|
||||
- cp -r /Volumes/chatterino/chatterino.app app/
|
||||
- "create-dmg \
|
||||
--volname Chatterino2 \
|
||||
--volicon ../resources/chatterino.icns \
|
||||
--icon-size 50 \
|
||||
--app-drop-link 0 0 \
|
||||
--format UDBZ \
|
||||
chatterino-osx.dmg app/"
|
||||
|
||||
before_deploy:
|
||||
- git config --global user.email "builds@travis-ci.com"
|
||||
- git config --global user.name "Travis CI"
|
||||
- export GIT_TAG=nightly-build
|
||||
- export TRAVIS_TAG=nightly-build
|
||||
- git tag $GIT_TAG -f
|
||||
|
||||
deploy:
|
||||
skip_cleanup: true
|
||||
overwrite: true
|
||||
provider: releases
|
||||
api_key:
|
||||
secure: ZzS55wlwtLAVEBaDDMqiuqZwuTpvLbNnaNw0enfiqpjWT7hgbbp/SBw2rbYIkVqm7tBHCLnEzKto6p4Gz6ROo0gGACARmx7EwIloX18rMCuBWygNHRyVruDSlmEOLWRqYByDbUdCkKhYr9aegnkm7zhzCmSBCTW28/uVlxM2bTHIgqKEpB4k1W8OqKdJDxqZKeF4r7nDNSOx5ylhpiK+WNFK8yfiaF1SQlSwsdv9o1RkbJlew7iigvHvEM2kDMkiMWYlJ2khkUWVCVQDQGe4/ya5pgTIHDLu5sZuclp5zhgfDf1U3STvsbQWvxJfsmCId7IQHJ83OSFeoUf6y849i3GMqlNi3aXrxEx0fi0dILQ76/Sj246FPMA4kC0/W49uaxqD784wFuJDjSWeWwi/NPoJ/gz0mGZy+08BoztOGqqOKjJJdESBYTio71N8VcK09zQ0LjXRmX+g3BbrK6a2F3hiMKeuYwdaN2/KdMMoqFDau6L3fXLdpcHKdJC8K/yzJtyyIe0CRB2nj8sZLHfxDwoRm7gOTDXq1zPL7CP9cCwCnCR6nm3CqUW/CnSWuMKpSoQRlP5EBI7zzYT2/tZc/vat5nob7Xif6yFF9fh/VHx4tC6zsfkA1nPPN3+QpdVInRo7dCVxtTqey5FdVjSiv7n11TrFhZ7+Fr5x6CZqa58=
|
||||
file: "chatterino-osx.dmg"
|
||||
prerelease: true
|
||||
on:
|
||||
branch: master
|
65
appveyor.yml
65
appveyor.yml
|
@ -1,65 +0,0 @@
|
|||
version: "{build}"
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
image: Visual Studio 2017
|
||||
platform: Any CPU
|
||||
clone_depth: 1
|
||||
install:
|
||||
- cmd: >-
|
||||
choco source add -n=AFG -s="https://api.bintray.com/nuget/anotherfoxguy/choco-pkg"
|
||||
|
||||
choco install conan -y
|
||||
|
||||
refreshenv
|
||||
|
||||
conan user
|
||||
|
||||
git submodule update --init --recursive
|
||||
|
||||
set QTDIR=C:\Qt\5.13\msvc2017_64
|
||||
|
||||
set PATH=%PATH%;%QTDIR%\bin
|
||||
|
||||
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
|
||||
build_script:
|
||||
- cmd: >-
|
||||
dir
|
||||
|
||||
mkdir build
|
||||
|
||||
cd build
|
||||
|
||||
conan install ..
|
||||
|
||||
set dateOfBuild=%date:~7,2%.%date:~4,2%.%date:~10,4%
|
||||
|
||||
qmake ../chatterino.pro DEFINES+="CHATTERINO_NIGHTLY_VERSION_STRING=\\\"'$s%dateOfBuild% '$$system(git describe --always)-$$system(git rev-list master --count)\\\""
|
||||
|
||||
set cl=/MP
|
||||
|
||||
nmake /S /NOLOGO
|
||||
|
||||
windeployqt release/chatterino.exe --release --no-compiler-runtime --no-translations --no-opengl-sw --dir Chatterino2/
|
||||
|
||||
cp release/chatterino.exe Chatterino2/
|
||||
|
||||
echo nightly > Chatterino2/modes
|
||||
|
||||
7z a chatterino-windows-x86-64.zip Chatterino2/
|
||||
artifacts:
|
||||
- path: build/chatterino-windows-x86-64.zip
|
||||
name: chatterino
|
||||
deploy:
|
||||
- provider: GitHub
|
||||
tag: nightly-build
|
||||
release: nightly-build
|
||||
description: 'nightly v$(appveyor_build_version) built 👉 $(APPVEYOR_REPO_COMMIT_TIMESTAMP) 👈\nLast change: $(APPVEYOR_REPO_COMMIT_MESSAGE) \n$(APPVEYOR_REPO_COMMIT_MESSAGE_EXTENDED)'
|
||||
auth_token:
|
||||
secure: sAJzAbiQSsYZLT+byDar9u61X0E9o35anaPMSFkOzdHeDFHjx1kW4cDP/4EEbxhx
|
||||
repository: Chatterino/chatterino2
|
||||
artifact: build/chatterino-windows-x86-64.zip
|
||||
prerelease: true
|
||||
force_update: true
|
||||
on:
|
||||
branch: master
|
35
benchmarks/.clang-format
Normal file
35
benchmarks/.clang-format
Normal file
|
@ -0,0 +1,35 @@
|
|||
Language: Cpp
|
||||
|
||||
AccessModifierOffset: -4
|
||||
AlignEscapedNewlinesLeft: true
|
||||
AllowShortFunctionsOnASingleLine: false
|
||||
AllowShortIfStatementsOnASingleLine: false
|
||||
AllowShortLambdasOnASingleLine: Empty
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
AlwaysBreakAfterDefinitionReturnType: false
|
||||
AlwaysBreakBeforeMultilineStrings: false
|
||||
BasedOnStyle: Google
|
||||
BraceWrapping: {
|
||||
AfterClass: 'true'
|
||||
AfterControlStatement: 'true'
|
||||
AfterFunction: 'true'
|
||||
AfterNamespace: 'false'
|
||||
BeforeCatch: 'true'
|
||||
BeforeElse: 'true'
|
||||
}
|
||||
BreakBeforeBraces: Custom
|
||||
BreakConstructorInitializersBeforeComma: true
|
||||
ColumnLimit: 80
|
||||
ConstructorInitializerAllOnOneLineOrOnePerLine: false
|
||||
DerivePointerBinding: false
|
||||
FixNamespaceComments: true
|
||||
IndentCaseLabels: true
|
||||
IndentWidth: 4
|
||||
IndentWrappedFunctionNames: true
|
||||
IndentPPDirectives: AfterHash
|
||||
IncludeBlocks: Preserve
|
||||
NamespaceIndentation: Inner
|
||||
PointerBindsToType: false
|
||||
SpacesBeforeTrailingComments: 2
|
||||
Standard: Auto
|
||||
ReflowComments: false
|
32
benchmarks/CMakeLists.txt
Normal file
32
benchmarks/CMakeLists.txt
Normal file
|
@ -0,0 +1,32 @@
|
|||
project(chatterino-benchmark)
|
||||
|
||||
set(benchmark_SOURCES
|
||||
${CMAKE_CURRENT_LIST_DIR}/src/main.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/src/Emojis.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/src/Highlights.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/src/FormatTime.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/src/Helpers.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/src/LimitedQueue.cpp
|
||||
# Add your new file above this line!
|
||||
)
|
||||
|
||||
add_executable(${PROJECT_NAME} ${benchmark_SOURCES})
|
||||
add_sanitizers(${PROJECT_NAME})
|
||||
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE chatterino-lib)
|
||||
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE benchmark::benchmark)
|
||||
|
||||
target_compile_definitions(${PROJECT_NAME} PRIVATE
|
||||
CHATTERINO_TEST
|
||||
)
|
||||
|
||||
set_target_properties(${PROJECT_NAME}
|
||||
PROPERTIES
|
||||
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
|
||||
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
|
||||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
|
||||
RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/bin"
|
||||
RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/bin"
|
||||
RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_BINARY_DIR}/bin"
|
||||
)
|
57
benchmarks/src/Emojis.cpp
Normal file
57
benchmarks/src/Emojis.cpp
Normal file
|
@ -0,0 +1,57 @@
|
|||
#include "providers/emoji/Emojis.hpp"
|
||||
|
||||
#include <benchmark/benchmark.h>
|
||||
#include <QDebug>
|
||||
#include <QString>
|
||||
|
||||
using namespace chatterino;
|
||||
|
||||
static void BM_ShortcodeParsing(benchmark::State &state)
|
||||
{
|
||||
Emojis emojis;
|
||||
|
||||
emojis.load();
|
||||
|
||||
struct TestCase {
|
||||
QString input;
|
||||
QString expectedOutput;
|
||||
};
|
||||
|
||||
std::vector<TestCase> tests{
|
||||
{
|
||||
// input
|
||||
"foo :penguin: bar",
|
||||
// expected output
|
||||
"foo 🐧 bar",
|
||||
},
|
||||
{
|
||||
// input
|
||||
"foo :nonexistantcode: bar",
|
||||
// expected output
|
||||
"foo :nonexistantcode: bar",
|
||||
},
|
||||
{
|
||||
// input
|
||||
":male-doctor:",
|
||||
// expected output
|
||||
"👨⚕️",
|
||||
},
|
||||
};
|
||||
|
||||
for (auto _ : state)
|
||||
{
|
||||
for (const auto &test : tests)
|
||||
{
|
||||
auto output = emojis.replaceShortCodes(test.input);
|
||||
|
||||
auto matches = output == test.expectedOutput;
|
||||
if (!matches && !output.endsWith(QChar(0xFE0F)))
|
||||
{
|
||||
// Try to append 0xFE0F if needed
|
||||
output = output.append(QChar(0xFE0F));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BENCHMARK(BM_ShortcodeParsing);
|
38
benchmarks/src/FormatTime.cpp
Normal file
38
benchmarks/src/FormatTime.cpp
Normal file
|
@ -0,0 +1,38 @@
|
|||
#include "util/FormatTime.hpp"
|
||||
|
||||
#include <benchmark/benchmark.h>
|
||||
|
||||
using namespace chatterino;
|
||||
|
||||
template <class... Args>
|
||||
void BM_TimeFormatting(benchmark::State &state, Args &&...args)
|
||||
{
|
||||
auto args_tuple = std::make_tuple(std::move(args)...);
|
||||
for (auto _ : state)
|
||||
{
|
||||
formatTime(std::get<0>(args_tuple));
|
||||
}
|
||||
}
|
||||
|
||||
BENCHMARK_CAPTURE(BM_TimeFormatting, 0, 0);
|
||||
BENCHMARK_CAPTURE(BM_TimeFormatting, qs0, "0");
|
||||
BENCHMARK_CAPTURE(BM_TimeFormatting, 1337, 1337);
|
||||
BENCHMARK_CAPTURE(BM_TimeFormatting, qs1337, "1337");
|
||||
BENCHMARK_CAPTURE(BM_TimeFormatting, 623452, 623452);
|
||||
BENCHMARK_CAPTURE(BM_TimeFormatting, qs623452, "623452");
|
||||
BENCHMARK_CAPTURE(BM_TimeFormatting, 8345, 8345);
|
||||
BENCHMARK_CAPTURE(BM_TimeFormatting, qs8345, "8345");
|
||||
BENCHMARK_CAPTURE(BM_TimeFormatting, 314034, 314034);
|
||||
BENCHMARK_CAPTURE(BM_TimeFormatting, qs314034, "314034");
|
||||
BENCHMARK_CAPTURE(BM_TimeFormatting, 27, 27);
|
||||
BENCHMARK_CAPTURE(BM_TimeFormatting, qs27, "27");
|
||||
BENCHMARK_CAPTURE(BM_TimeFormatting, 34589, 34589);
|
||||
BENCHMARK_CAPTURE(BM_TimeFormatting, qs34589, "34589");
|
||||
BENCHMARK_CAPTURE(BM_TimeFormatting, 3659, 3659);
|
||||
BENCHMARK_CAPTURE(BM_TimeFormatting, qs3659, "3659");
|
||||
BENCHMARK_CAPTURE(BM_TimeFormatting, 1045345, 1045345);
|
||||
BENCHMARK_CAPTURE(BM_TimeFormatting, qs1045345, "1045345");
|
||||
BENCHMARK_CAPTURE(BM_TimeFormatting, 86432, 86432);
|
||||
BENCHMARK_CAPTURE(BM_TimeFormatting, qs86432, "86432");
|
||||
BENCHMARK_CAPTURE(BM_TimeFormatting, qsempty, "");
|
||||
BENCHMARK_CAPTURE(BM_TimeFormatting, qsinvalid, "asd");
|
46
benchmarks/src/Helpers.cpp
Normal file
46
benchmarks/src/Helpers.cpp
Normal file
|
@ -0,0 +1,46 @@
|
|||
#include "util/Helpers.hpp"
|
||||
|
||||
#include <benchmark/benchmark.h>
|
||||
|
||||
using namespace chatterino;
|
||||
|
||||
template <class... Args>
|
||||
void BM_SplitListIntoBatches(benchmark::State &state, Args &&...args)
|
||||
{
|
||||
auto args_tuple = std::make_tuple(std::move(args)...);
|
||||
for (auto _ : state)
|
||||
{
|
||||
auto result = splitListIntoBatches(std::get<0>(args_tuple),
|
||||
std::get<1>(args_tuple));
|
||||
assert(!result.empty());
|
||||
}
|
||||
}
|
||||
|
||||
BENCHMARK_CAPTURE(BM_SplitListIntoBatches, 7 / 3,
|
||||
QStringList{"", "", "", "", "", "", ""}, 3);
|
||||
BENCHMARK_CAPTURE(BM_SplitListIntoBatches, 6 / 3,
|
||||
QStringList{"", "", "", "", "", ""}, 3);
|
||||
BENCHMARK_CAPTURE(BM_SplitListIntoBatches, 100 / 3,
|
||||
QStringList{
|
||||
"", "", "", "", "", "", "", "", "", "", "", "", "",
|
||||
"", "", "", "", "", "", "", "", "", "", "", "", "",
|
||||
"", "", "", "", "", "", "", "", "", "", "", "", "",
|
||||
"", "", "", "", "", "", "", "", "", "", "", "", "",
|
||||
"", "", "", "", "", "", "", "", "", "", "", "", "",
|
||||
"", "", "", "", "", "", "", "", "", "", "", "", "",
|
||||
"", "", "", "", "", "", "", "", "", "", "", "", "",
|
||||
"", "", "", "", "", "", "", "", "",
|
||||
},
|
||||
3);
|
||||
BENCHMARK_CAPTURE(BM_SplitListIntoBatches, 100 / 49,
|
||||
QStringList{
|
||||
"", "", "", "", "", "", "", "", "", "", "", "", "",
|
||||
"", "", "", "", "", "", "", "", "", "", "", "", "",
|
||||
"", "", "", "", "", "", "", "", "", "", "", "", "",
|
||||
"", "", "", "", "", "", "", "", "", "", "", "", "",
|
||||
"", "", "", "", "", "", "", "", "", "", "", "", "",
|
||||
"", "", "", "", "", "", "", "", "", "", "", "", "",
|
||||
"", "", "", "", "", "", "", "", "", "", "", "", "",
|
||||
"", "", "", "", "", "", "", "", "",
|
||||
},
|
||||
49);
|
134
benchmarks/src/Highlights.cpp
Normal file
134
benchmarks/src/Highlights.cpp
Normal file
|
@ -0,0 +1,134 @@
|
|||
#include "Application.hpp"
|
||||
#include "BaseSettings.hpp"
|
||||
#include "common/Channel.hpp"
|
||||
#include "controllers/accounts/AccountController.hpp"
|
||||
#include "controllers/highlights/HighlightController.hpp"
|
||||
#include "controllers/highlights/HighlightPhrase.hpp"
|
||||
#include "messages/Message.hpp"
|
||||
#include "messages/SharedMessageBuilder.hpp"
|
||||
#include "util/Helpers.hpp"
|
||||
|
||||
#include <benchmark/benchmark.h>
|
||||
#include <QDebug>
|
||||
#include <QString>
|
||||
|
||||
using namespace chatterino;
|
||||
|
||||
class BenchmarkMessageBuilder : public SharedMessageBuilder
|
||||
{
|
||||
public:
|
||||
explicit BenchmarkMessageBuilder(
|
||||
Channel *_channel, const Communi::IrcPrivateMessage *_ircMessage,
|
||||
const MessageParseArgs &_args)
|
||||
: SharedMessageBuilder(_channel, _ircMessage, _args)
|
||||
{
|
||||
}
|
||||
virtual MessagePtr build()
|
||||
{
|
||||
// PARSE
|
||||
this->parse();
|
||||
this->usernameColor_ = getRandomColor(this->ircMessage->nick());
|
||||
|
||||
// words
|
||||
// this->addWords(this->originalMessage_.split(' '));
|
||||
|
||||
this->message().messageText = this->originalMessage_;
|
||||
this->message().searchText = this->message().localizedName + " " +
|
||||
this->userName + ": " +
|
||||
this->originalMessage_;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void bench()
|
||||
{
|
||||
this->parseHighlights();
|
||||
}
|
||||
};
|
||||
|
||||
class MockApplication : IApplication
|
||||
{
|
||||
public:
|
||||
Theme *getThemes() override
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
Fonts *getFonts() override
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
Emotes *getEmotes() override
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
AccountController *getAccounts() override
|
||||
{
|
||||
return &this->accounts;
|
||||
}
|
||||
HotkeyController *getHotkeys() override
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
WindowManager *getWindows() override
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
Toasts *getToasts() override
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
CommandController *getCommands() override
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
NotificationController *getNotifications() override
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
HighlightController *getHighlights() override
|
||||
{
|
||||
return &this->highlights;
|
||||
}
|
||||
TwitchIrcServer *getTwitch() override
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
ChatterinoBadges *getChatterinoBadges() override
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
FfzBadges *getFfzBadges() override
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
AccountController accounts;
|
||||
HighlightController highlights;
|
||||
// TODO: Figure this out
|
||||
};
|
||||
|
||||
static void BM_HighlightTest(benchmark::State &state)
|
||||
{
|
||||
MockApplication mockApplication;
|
||||
Settings settings("/tmp/c2-mock");
|
||||
|
||||
std::string message =
|
||||
R"(@badge-info=subscriber/34;badges=moderator/1,subscriber/24;color=#FF0000;display-name=테스트계정420;emotes=41:6-13,15-22;flags=;id=a3196c7e-be4c-4b49-9c5a-8b8302b50c2a;mod=1;room-id=11148817;subscriber=1;tmi-sent-ts=1590922213730;turbo=0;user-id=117166826;user-type=mod :testaccount_420!testaccount_420@testaccount_420.tmi.twitch.tv PRIVMSG #pajlada :-tags Kreygasm,Kreygasm (no space))";
|
||||
auto ircMessage = Communi::IrcMessage::fromData(message.c_str(), nullptr);
|
||||
auto privMsg = dynamic_cast<Communi::IrcPrivateMessage *>(ircMessage);
|
||||
assert(privMsg != nullptr);
|
||||
MessageParseArgs args;
|
||||
auto emptyChannel = Channel::getEmpty();
|
||||
|
||||
for (auto _ : state)
|
||||
{
|
||||
state.PauseTiming();
|
||||
BenchmarkMessageBuilder b(emptyChannel.get(), privMsg, args);
|
||||
|
||||
b.build();
|
||||
state.ResumeTiming();
|
||||
|
||||
b.bench();
|
||||
}
|
||||
}
|
||||
|
||||
BENCHMARK(BM_HighlightTest);
|
116
benchmarks/src/LimitedQueue.cpp
Normal file
116
benchmarks/src/LimitedQueue.cpp
Normal file
|
@ -0,0 +1,116 @@
|
|||
#include "messages/LimitedQueue.hpp"
|
||||
|
||||
#include <benchmark/benchmark.h>
|
||||
|
||||
#include <memory>
|
||||
#include <numeric>
|
||||
#include <vector>
|
||||
|
||||
using namespace chatterino;
|
||||
|
||||
void BM_LimitedQueue_PushBack(benchmark::State &state)
|
||||
{
|
||||
LimitedQueue<int> queue(1000);
|
||||
for (auto _ : state)
|
||||
{
|
||||
queue.pushBack(1);
|
||||
}
|
||||
}
|
||||
|
||||
void BM_LimitedQueue_PushFront_One(benchmark::State &state)
|
||||
{
|
||||
std::vector<int> items = {1};
|
||||
LimitedQueue<int> queue(2);
|
||||
|
||||
for (auto _ : state)
|
||||
{
|
||||
state.PauseTiming();
|
||||
queue.clear();
|
||||
state.ResumeTiming();
|
||||
queue.pushFront(items);
|
||||
}
|
||||
}
|
||||
|
||||
void BM_LimitedQueue_PushFront_Many(benchmark::State &state)
|
||||
{
|
||||
std::vector<int> items;
|
||||
items.resize(10000);
|
||||
std::iota(items.begin(), items.end(), 0);
|
||||
|
||||
for (auto _ : state)
|
||||
{
|
||||
state.PauseTiming();
|
||||
LimitedQueue<int> queue(1000);
|
||||
state.ResumeTiming();
|
||||
queue.pushFront(items);
|
||||
}
|
||||
}
|
||||
|
||||
void BM_LimitedQueue_Replace(benchmark::State &state)
|
||||
{
|
||||
LimitedQueue<int> queue(1000);
|
||||
for (int i = 0; i < 1000; ++i)
|
||||
{
|
||||
queue.pushBack(i);
|
||||
}
|
||||
|
||||
for (auto _ : state)
|
||||
{
|
||||
queue.replaceItem(500, 500);
|
||||
}
|
||||
}
|
||||
|
||||
void BM_LimitedQueue_Snapshot(benchmark::State &state)
|
||||
{
|
||||
LimitedQueue<int> queue(1000);
|
||||
for (int i = 0; i < 1000; ++i)
|
||||
{
|
||||
queue.pushBack(i);
|
||||
}
|
||||
|
||||
for (auto _ : state)
|
||||
{
|
||||
auto snapshot = queue.getSnapshot();
|
||||
benchmark::DoNotOptimize(snapshot);
|
||||
}
|
||||
}
|
||||
|
||||
void BM_LimitedQueue_Snapshot_ExpensiveCopy(benchmark::State &state)
|
||||
{
|
||||
LimitedQueue<std::shared_ptr<int>> queue(1000);
|
||||
for (int i = 0; i < 1000; ++i)
|
||||
{
|
||||
queue.pushBack(std::make_shared<int>(i));
|
||||
}
|
||||
|
||||
for (auto _ : state)
|
||||
{
|
||||
auto snapshot = queue.getSnapshot();
|
||||
benchmark::DoNotOptimize(snapshot);
|
||||
}
|
||||
}
|
||||
|
||||
void BM_LimitedQueue_Find(benchmark::State &state)
|
||||
{
|
||||
LimitedQueue<int> queue(1000);
|
||||
for (int i = 0; i < 10000; ++i)
|
||||
{
|
||||
queue.pushBack(i);
|
||||
}
|
||||
|
||||
for (auto _ : state)
|
||||
{
|
||||
auto res = queue.find([](const auto &val) {
|
||||
return val == 500;
|
||||
});
|
||||
benchmark::DoNotOptimize(res);
|
||||
}
|
||||
}
|
||||
|
||||
BENCHMARK(BM_LimitedQueue_PushBack);
|
||||
BENCHMARK(BM_LimitedQueue_PushFront_One);
|
||||
BENCHMARK(BM_LimitedQueue_PushFront_Many);
|
||||
BENCHMARK(BM_LimitedQueue_Replace);
|
||||
BENCHMARK(BM_LimitedQueue_Snapshot);
|
||||
BENCHMARK(BM_LimitedQueue_Snapshot_ExpensiveCopy);
|
||||
BENCHMARK(BM_LimitedQueue_Find);
|
18
benchmarks/src/main.cpp
Normal file
18
benchmarks/src/main.cpp
Normal file
|
@ -0,0 +1,18 @@
|
|||
#include <benchmark/benchmark.h>
|
||||
#include <QApplication>
|
||||
#include <QtConcurrent>
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
QApplication app(argc, argv);
|
||||
|
||||
::benchmark::Initialize(&argc, argv);
|
||||
|
||||
QtConcurrent::run([&app] {
|
||||
::benchmark::RunSpecifiedBenchmarks();
|
||||
|
||||
app.exit(0);
|
||||
});
|
||||
|
||||
return app.exec();
|
||||
}
|
573
chatterino.pro
573
chatterino.pro
|
@ -1,573 +0,0 @@
|
|||
# Exposed build flags:
|
||||
# from lib/websocketpp.pri
|
||||
# - WEBSOCKETPP_PREFIX ($$PWD by default)
|
||||
# - WEBSOCKETPP_SYSTEM (1 = true) (unix only)
|
||||
# from lib/rapidjson.pri
|
||||
# - RAPIDJSON_PREFIX ($$PWD by default)
|
||||
# - RAPIDJSON_SYSTEM (1 = true) (Linux only, uses pkg-config)
|
||||
# from lib/boost.pri
|
||||
# - BOOST_DIRECTORY (C:\local\boost\ by default) (Windows only)
|
||||
|
||||
QT += widgets core gui network multimedia svg concurrent
|
||||
CONFIG += communi
|
||||
COMMUNI += core model util
|
||||
|
||||
INCLUDEPATH += src/
|
||||
TARGET = chatterino
|
||||
TEMPLATE = app
|
||||
PRECOMPILED_HEADER = src/PrecompiledHeader.hpp
|
||||
CONFIG += precompile_header
|
||||
DEFINES += CHATTERINO
|
||||
DEFINES += AB_CUSTOM_THEME
|
||||
DEFINES += AB_CUSTOM_SETTINGS
|
||||
CONFIG += AB_NOT_STANDALONE
|
||||
|
||||
useBreakpad {
|
||||
LIBS += -L$$PWD/lib/qBreakpad/handler/build
|
||||
include(lib/qBreakpad/qBreakpad.pri)
|
||||
DEFINES += C_USE_BREAKPAD
|
||||
}
|
||||
|
||||
# use C++17
|
||||
CONFIG += c++17
|
||||
|
||||
# C++17 backwards compatability
|
||||
win32-msvc* {
|
||||
QMAKE_CXXFLAGS += /std:c++17
|
||||
} else {
|
||||
QMAKE_CXXFLAGS += -std=c++17
|
||||
}
|
||||
|
||||
linux {
|
||||
LIBS += -lrt
|
||||
QMAKE_LFLAGS += -lrt
|
||||
|
||||
# Enable linking libraries using PKGCONFIG += libraryname
|
||||
CONFIG += link_pkgconfig
|
||||
}
|
||||
|
||||
macx {
|
||||
INCLUDEPATH += /usr/local/include
|
||||
INCLUDEPATH += /usr/local/opt/openssl/include
|
||||
LIBS += -L/usr/local/opt/openssl/lib
|
||||
}
|
||||
|
||||
# https://bugreports.qt.io/browse/QTBUG-27018
|
||||
equals(QMAKE_CXX, "clang++")|equals(QMAKE_CXX, "g++") {
|
||||
TARGET = bin/chatterino
|
||||
}
|
||||
|
||||
# Icons
|
||||
macx:ICON = resources/chatterino.icns
|
||||
win32:RC_FILE = resources/windows.rc
|
||||
|
||||
macx {
|
||||
LIBS += -L/usr/local/lib
|
||||
}
|
||||
|
||||
# Set C_DEBUG if it's a debug build
|
||||
CONFIG(debug, debug|release) {
|
||||
DEFINES += C_DEBUG
|
||||
DEFINES += QT_DEBUG
|
||||
}
|
||||
|
||||
# Submodules
|
||||
include(lib/warnings.pri)
|
||||
include(lib/humanize.pri)
|
||||
include(lib/libcommuni.pri)
|
||||
include(lib/websocketpp.pri)
|
||||
include(lib/wintoast.pri)
|
||||
include(lib/signals.pri)
|
||||
include(lib/settings.pri)
|
||||
include(lib/serialize.pri)
|
||||
include(lib/winsdk.pri)
|
||||
include(lib/rapidjson.pri)
|
||||
include(lib/qtkeychain.pri)
|
||||
|
||||
exists( $$OUT_PWD/conanbuildinfo.pri ) {
|
||||
message("Using conan packages")
|
||||
CONFIG += conan_basic_setup
|
||||
include($$OUT_PWD/conanbuildinfo.pri)
|
||||
LIBS += -lGdi32
|
||||
}
|
||||
else{
|
||||
include(lib/boost.pri)
|
||||
include(lib/openssl.pri)
|
||||
}
|
||||
|
||||
# Optional feature: QtWebEngine
|
||||
#exists ($(QTDIR)/include/QtWebEngine/QtWebEngine) {
|
||||
# message(Using QWebEngine)
|
||||
# QT += webenginewidgets
|
||||
# DEFINES += "USEWEBENGINE"
|
||||
#}
|
||||
|
||||
SOURCES += \
|
||||
src/Application.cpp \
|
||||
src/autogenerated/ResourcesAutogen.cpp \
|
||||
src/BaseSettings.cpp \
|
||||
src/BaseTheme.cpp \
|
||||
src/BrowserExtension.cpp \
|
||||
src/common/Args.cpp \
|
||||
src/common/Channel.cpp \
|
||||
src/common/ChannelChatters.cpp \
|
||||
src/common/ChatterinoSetting.cpp \
|
||||
src/common/CompletionModel.cpp \
|
||||
src/common/Credentials.cpp \
|
||||
src/common/DownloadManager.cpp \
|
||||
src/common/Env.cpp \
|
||||
src/common/LinkParser.cpp \
|
||||
src/common/Modes.cpp \
|
||||
src/common/NetworkManager.cpp \
|
||||
src/common/NetworkPrivate.cpp \
|
||||
src/common/NetworkRequest.cpp \
|
||||
src/common/NetworkResult.cpp \
|
||||
src/common/UsernameSet.cpp \
|
||||
src/common/Version.cpp \
|
||||
src/controllers/accounts/Account.cpp \
|
||||
src/controllers/accounts/AccountController.cpp \
|
||||
src/controllers/accounts/AccountModel.cpp \
|
||||
src/controllers/commands/Command.cpp \
|
||||
src/controllers/commands/CommandController.cpp \
|
||||
src/controllers/commands/CommandModel.cpp \
|
||||
src/controllers/highlights/HighlightBlacklistModel.cpp \
|
||||
src/controllers/highlights/HighlightModel.cpp \
|
||||
src/controllers/highlights/HighlightPhrase.cpp \
|
||||
src/controllers/highlights/UserHighlightModel.cpp \
|
||||
src/controllers/ignores/IgnoreModel.cpp \
|
||||
src/controllers/moderationactions/ModerationAction.cpp \
|
||||
src/controllers/moderationactions/ModerationActionModel.cpp \
|
||||
src/controllers/notifications/NotificationController.cpp \
|
||||
src/controllers/notifications/NotificationModel.cpp \
|
||||
src/controllers/pings/MutedChannelModel.cpp \
|
||||
src/controllers/taggedusers/TaggedUser.cpp \
|
||||
src/controllers/taggedusers/TaggedUsersModel.cpp \
|
||||
src/debug/Benchmark.cpp \
|
||||
src/main.cpp \
|
||||
src/messages/Emote.cpp \
|
||||
src/messages/Image.cpp \
|
||||
src/messages/ImageSet.cpp \
|
||||
src/messages/layouts/MessageLayout.cpp \
|
||||
src/messages/layouts/MessageLayoutContainer.cpp \
|
||||
src/messages/layouts/MessageLayoutElement.cpp \
|
||||
src/messages/Link.cpp \
|
||||
src/messages/Message.cpp \
|
||||
src/messages/MessageBuilder.cpp \
|
||||
src/messages/MessageColor.cpp \
|
||||
src/messages/MessageContainer.cpp \
|
||||
src/messages/MessageElement.cpp \
|
||||
src/messages/SharedMessageBuilder.cpp \
|
||||
src/messages/search/AuthorPredicate.cpp \
|
||||
src/messages/search/LinkPredicate.cpp \
|
||||
src/messages/search/SubstringPredicate.cpp \
|
||||
src/providers/bttv/BttvEmotes.cpp \
|
||||
src/providers/bttv/LoadBttvChannelEmote.cpp \
|
||||
src/providers/chatterino/ChatterinoBadges.cpp \
|
||||
src/providers/colors/ColorProvider.cpp \
|
||||
src/providers/emoji/Emojis.cpp \
|
||||
src/providers/ffz/FfzEmotes.cpp \
|
||||
src/providers/irc/AbstractIrcServer.cpp \
|
||||
src/providers/irc/Irc2.cpp \
|
||||
src/providers/irc/IrcAccount.cpp \
|
||||
src/providers/irc/IrcChannel2.cpp \
|
||||
src/providers/irc/IrcCommands.cpp \
|
||||
src/providers/irc/IrcConnection2.cpp \
|
||||
src/providers/irc/IrcMessageBuilder.cpp \
|
||||
src/providers/irc/IrcServer.cpp \
|
||||
src/providers/LinkResolver.cpp \
|
||||
src/providers/twitch/ChannelPointReward.cpp \
|
||||
src/providers/twitch/api/Helix.cpp \
|
||||
src/providers/twitch/api/Kraken.cpp \
|
||||
src/providers/twitch/IrcMessageHandler.cpp \
|
||||
src/providers/twitch/PubsubActions.cpp \
|
||||
src/providers/twitch/PubsubClient.cpp \
|
||||
src/providers/twitch/PubsubHelpers.cpp \
|
||||
src/providers/twitch/TwitchAccount.cpp \
|
||||
src/providers/twitch/TwitchAccountManager.cpp \
|
||||
src/providers/twitch/TwitchBadge.cpp \
|
||||
src/providers/twitch/TwitchBadges.cpp \
|
||||
src/providers/twitch/TwitchChannel.cpp \
|
||||
src/providers/twitch/TwitchEmotes.cpp \
|
||||
src/providers/twitch/TwitchHelpers.cpp \
|
||||
src/providers/twitch/TwitchIrcServer.cpp \
|
||||
src/providers/twitch/TwitchMessageBuilder.cpp \
|
||||
src/providers/twitch/TwitchParseCheerEmotes.cpp \
|
||||
src/providers/twitch/TwitchUser.cpp \
|
||||
src/RunGui.cpp \
|
||||
src/singletons/Badges.cpp \
|
||||
src/singletons/Emotes.cpp \
|
||||
src/singletons/Fonts.cpp \
|
||||
src/singletons/helper/GifTimer.cpp \
|
||||
src/singletons/helper/LoggingChannel.cpp \
|
||||
src/singletons/Logging.cpp \
|
||||
src/singletons/NativeMessaging.cpp \
|
||||
src/singletons/Paths.cpp \
|
||||
src/singletons/Resources.cpp \
|
||||
src/singletons/Settings.cpp \
|
||||
src/singletons/Theme.cpp \
|
||||
src/singletons/Toasts.cpp \
|
||||
src/singletons/TooltipPreviewImage.cpp \
|
||||
src/singletons/Updates.cpp \
|
||||
src/singletons/WindowManager.cpp \
|
||||
src/util/Clipboard.cpp \
|
||||
src/util/DebugCount.cpp \
|
||||
src/util/FormatTime.cpp \
|
||||
src/util/FunctionEventFilter.cpp \
|
||||
src/util/FuzzyConvert.cpp \
|
||||
src/util/Helpers.cpp \
|
||||
src/util/IncognitoBrowser.cpp \
|
||||
src/util/InitUpdateButton.cpp \
|
||||
src/util/JsonQuery.cpp \
|
||||
src/util/RapidjsonHelpers.cpp \
|
||||
src/util/StreamLink.cpp \
|
||||
src/util/StreamerMode.cpp \
|
||||
src/util/Twitch.cpp \
|
||||
src/util/NuulsUploader.cpp \
|
||||
src/util/WindowsHelper.cpp \
|
||||
src/widgets/AccountSwitchPopup.cpp \
|
||||
src/widgets/AccountSwitchWidget.cpp \
|
||||
src/widgets/AttachedWindow.cpp \
|
||||
src/widgets/BasePopup.cpp \
|
||||
src/widgets/BaseWidget.cpp \
|
||||
src/widgets/BaseWindow.cpp \
|
||||
src/widgets/dialogs/ColorPickerDialog.cpp \
|
||||
src/widgets/dialogs/EmotePopup.cpp \
|
||||
src/widgets/dialogs/IrcConnectionEditor.cpp \
|
||||
src/widgets/dialogs/LastRunCrashDialog.cpp \
|
||||
src/widgets/dialogs/LoginDialog.cpp \
|
||||
src/widgets/dialogs/NotificationPopup.cpp \
|
||||
src/widgets/dialogs/QualityPopup.cpp \
|
||||
src/widgets/dialogs/SelectChannelDialog.cpp \
|
||||
src/widgets/dialogs/SettingsDialog.cpp \
|
||||
src/widgets/dialogs/TextInputDialog.cpp \
|
||||
src/widgets/dialogs/UpdateDialog.cpp \
|
||||
src/widgets/dialogs/UserInfoPopup.cpp \
|
||||
src/widgets/dialogs/WelcomeDialog.cpp \
|
||||
src/widgets/helper/Button.cpp \
|
||||
src/widgets/helper/ChannelView.cpp \
|
||||
src/widgets/helper/ColorButton.cpp \
|
||||
src/widgets/helper/ComboBoxItemDelegate.cpp \
|
||||
src/widgets/helper/DebugPopup.cpp \
|
||||
src/widgets/helper/EditableModelView.cpp \
|
||||
src/widgets/helper/EffectLabel.cpp \
|
||||
src/widgets/helper/NotebookButton.cpp \
|
||||
src/widgets/helper/NotebookTab.cpp \
|
||||
src/widgets/helper/QColorPicker.cpp \
|
||||
src/widgets/helper/ResizingTextEdit.cpp \
|
||||
src/widgets/helper/ScrollbarHighlight.cpp \
|
||||
src/widgets/helper/SearchPopup.cpp \
|
||||
src/widgets/helper/SettingsDialogTab.cpp \
|
||||
src/widgets/helper/SignalLabel.cpp \
|
||||
src/widgets/helper/TitlebarButton.cpp \
|
||||
src/widgets/Label.cpp \
|
||||
src/widgets/Notebook.cpp \
|
||||
src/widgets/Scrollbar.cpp \
|
||||
src/widgets/settingspages/AboutPage.cpp \
|
||||
src/widgets/settingspages/AccountsPage.cpp \
|
||||
src/widgets/settingspages/CommandPage.cpp \
|
||||
src/widgets/settingspages/ExternalToolsPage.cpp \
|
||||
src/widgets/settingspages/GeneralPage.cpp \
|
||||
src/widgets/settingspages/HighlightingPage.cpp \
|
||||
src/widgets/settingspages/IgnoresPage.cpp \
|
||||
src/widgets/settingspages/KeyboardSettingsPage.cpp \
|
||||
src/widgets/settingspages/ModerationPage.cpp \
|
||||
src/widgets/settingspages/NotificationPage.cpp \
|
||||
src/widgets/settingspages/SettingsPage.cpp \
|
||||
src/widgets/splits/ClosedSplits.cpp \
|
||||
src/widgets/splits/Split.cpp \
|
||||
src/widgets/splits/SplitContainer.cpp \
|
||||
src/widgets/splits/SplitHeader.cpp \
|
||||
src/widgets/splits/SplitInput.cpp \
|
||||
src/widgets/splits/SplitOverlay.cpp \
|
||||
src/widgets/StreamView.cpp \
|
||||
src/widgets/TooltipWidget.cpp \
|
||||
src/widgets/Window.cpp \
|
||||
|
||||
HEADERS += \
|
||||
src/Application.hpp \
|
||||
src/autogenerated/ResourcesAutogen.hpp \
|
||||
src/BaseSettings.hpp \
|
||||
src/BaseTheme.hpp \
|
||||
src/BrowserExtension.hpp \
|
||||
src/common/Aliases.hpp \
|
||||
src/common/Args.hpp \
|
||||
src/common/Atomic.hpp \
|
||||
src/common/Channel.hpp \
|
||||
src/common/ChannelChatters.hpp \
|
||||
src/common/ChatterinoSetting.hpp \
|
||||
src/common/Common.hpp \
|
||||
src/common/CompletionModel.hpp \
|
||||
src/common/ConcurrentMap.hpp \
|
||||
src/common/Credentials.hpp \
|
||||
src/common/DownloadManager.hpp \
|
||||
src/common/Env.hpp \
|
||||
src/common/FlagsEnum.hpp \
|
||||
src/common/IrcColors.hpp \
|
||||
src/common/LinkParser.hpp \
|
||||
src/common/Modes.hpp \
|
||||
src/common/NetworkCommon.hpp \
|
||||
src/common/NetworkManager.hpp \
|
||||
src/common/NetworkPrivate.hpp \
|
||||
src/common/NetworkRequest.hpp \
|
||||
src/common/NetworkResult.hpp \
|
||||
src/common/NullablePtr.hpp \
|
||||
src/common/Outcome.hpp \
|
||||
src/common/ProviderId.hpp \
|
||||
src/common/SignalVector.hpp \
|
||||
src/common/SignalVectorModel.hpp \
|
||||
src/common/Singleton.hpp \
|
||||
src/common/UniqueAccess.hpp \
|
||||
src/common/UsernameSet.hpp \
|
||||
src/common/Version.hpp \
|
||||
src/controllers/accounts/Account.hpp \
|
||||
src/controllers/accounts/AccountController.hpp \
|
||||
src/controllers/accounts/AccountModel.hpp \
|
||||
src/controllers/commands/Command.hpp \
|
||||
src/controllers/commands/CommandController.hpp \
|
||||
src/controllers/commands/CommandModel.hpp \
|
||||
src/controllers/highlights/HighlightBlacklistModel.hpp \
|
||||
src/controllers/highlights/HighlightBlacklistUser.hpp \
|
||||
src/controllers/highlights/HighlightModel.hpp \
|
||||
src/controllers/highlights/HighlightPhrase.hpp \
|
||||
src/controllers/highlights/UserHighlightModel.hpp \
|
||||
src/controllers/ignores/IgnoreController.hpp \
|
||||
src/controllers/ignores/IgnoreModel.hpp \
|
||||
src/controllers/ignores/IgnorePhrase.hpp \
|
||||
src/controllers/moderationactions/ModerationAction.hpp \
|
||||
src/controllers/moderationactions/ModerationActionModel.hpp \
|
||||
src/controllers/notifications/NotificationController.hpp \
|
||||
src/controllers/notifications/NotificationModel.hpp \
|
||||
src/controllers/pings/MutedChannelModel.hpp \
|
||||
src/controllers/taggedusers/TaggedUser.hpp \
|
||||
src/controllers/taggedusers/TaggedUsersModel.hpp \
|
||||
src/debug/AssertInGuiThread.hpp \
|
||||
src/debug/Benchmark.hpp \
|
||||
src/ForwardDecl.hpp \
|
||||
src/messages/Emote.hpp \
|
||||
src/messages/Image.hpp \
|
||||
src/messages/ImageSet.hpp \
|
||||
src/messages/layouts/MessageLayout.hpp \
|
||||
src/messages/layouts/MessageLayoutContainer.hpp \
|
||||
src/messages/layouts/MessageLayoutElement.hpp \
|
||||
src/messages/LimitedQueue.hpp \
|
||||
src/messages/LimitedQueueSnapshot.hpp \
|
||||
src/messages/Link.hpp \
|
||||
src/messages/Message.hpp \
|
||||
src/messages/MessageBuilder.hpp \
|
||||
src/messages/MessageColor.hpp \
|
||||
src/messages/MessageContainer.hpp \
|
||||
src/messages/MessageElement.hpp \
|
||||
src/messages/MessageParseArgs.hpp \
|
||||
src/messages/SharedMessageBuilder.hpp \
|
||||
src/messages/search/AuthorPredicate.hpp \
|
||||
src/messages/search/LinkPredicate.hpp \
|
||||
src/messages/search/MessagePredicate.hpp \
|
||||
src/messages/search/SubstringPredicate.hpp \
|
||||
src/messages/Selection.hpp \
|
||||
src/PrecompiledHeader.hpp \
|
||||
src/providers/bttv/BttvEmotes.hpp \
|
||||
src/providers/bttv/LoadBttvChannelEmote.hpp \
|
||||
src/providers/chatterino/ChatterinoBadges.hpp \
|
||||
src/providers/colors/ColorProvider.hpp \
|
||||
src/providers/emoji/Emojis.hpp \
|
||||
src/providers/ffz/FfzEmotes.hpp \
|
||||
src/providers/irc/AbstractIrcServer.hpp \
|
||||
src/providers/irc/Irc2.hpp \
|
||||
src/providers/irc/IrcAccount.hpp \
|
||||
src/providers/irc/IrcChannel2.hpp \
|
||||
src/providers/irc/IrcCommands.hpp \
|
||||
src/providers/irc/IrcConnection2.hpp \
|
||||
src/providers/irc/IrcMessageBuilder.hpp \
|
||||
src/providers/irc/IrcServer.hpp \
|
||||
src/providers/LinkResolver.hpp \
|
||||
src/providers/twitch/ChannelPointReward.hpp \
|
||||
src/providers/twitch/api/Helix.hpp \
|
||||
src/providers/twitch/api/Kraken.hpp \
|
||||
src/providers/twitch/EmoteValue.hpp \
|
||||
src/providers/twitch/IrcMessageHandler.hpp \
|
||||
src/providers/twitch/PubsubActions.hpp \
|
||||
src/providers/twitch/PubsubClient.hpp \
|
||||
src/providers/twitch/PubsubHelpers.hpp \
|
||||
src/providers/twitch/TwitchAccount.hpp \
|
||||
src/providers/twitch/TwitchAccountManager.hpp \
|
||||
src/providers/twitch/TwitchBadge.hpp \
|
||||
src/providers/twitch/TwitchBadges.hpp \
|
||||
src/providers/twitch/TwitchChannel.hpp \
|
||||
src/providers/twitch/TwitchCommon.hpp \
|
||||
src/providers/twitch/TwitchEmotes.hpp \
|
||||
src/providers/twitch/TwitchHelpers.hpp \
|
||||
src/providers/twitch/TwitchIrcServer.hpp \
|
||||
src/providers/twitch/TwitchMessageBuilder.hpp \
|
||||
src/providers/twitch/TwitchParseCheerEmotes.hpp \
|
||||
src/providers/twitch/TwitchUser.hpp \
|
||||
src/RunGui.hpp \
|
||||
src/singletons/Badges.hpp \
|
||||
src/singletons/Emotes.hpp \
|
||||
src/singletons/Fonts.hpp \
|
||||
src/singletons/helper/GifTimer.hpp \
|
||||
src/singletons/helper/LoggingChannel.hpp \
|
||||
src/singletons/Logging.hpp \
|
||||
src/singletons/NativeMessaging.hpp \
|
||||
src/singletons/Paths.hpp \
|
||||
src/singletons/Resources.hpp \
|
||||
src/singletons/Settings.hpp \
|
||||
src/singletons/Theme.hpp \
|
||||
src/singletons/Toasts.hpp \
|
||||
src/singletons/TooltipPreviewImage.hpp \
|
||||
src/singletons/Updates.hpp \
|
||||
src/singletons/WindowManager.hpp \
|
||||
src/util/Clamp.hpp \
|
||||
src/util/Clipboard.hpp \
|
||||
src/util/CombinePath.hpp \
|
||||
src/util/ConcurrentMap.hpp \
|
||||
src/util/DebugCount.hpp \
|
||||
src/util/DistanceBetweenPoints.hpp \
|
||||
src/util/FormatTime.hpp \
|
||||
src/util/FunctionEventFilter.hpp \
|
||||
src/util/FuzzyConvert.hpp \
|
||||
src/util/Helpers.hpp \
|
||||
src/util/IncognitoBrowser.hpp \
|
||||
src/util/InitUpdateButton.hpp \
|
||||
src/util/IrcHelpers.hpp \
|
||||
src/util/IsBigEndian.hpp \
|
||||
src/util/JsonQuery.hpp \
|
||||
src/util/LayoutCreator.hpp \
|
||||
src/util/LayoutHelper.hpp \
|
||||
src/util/Overloaded.hpp \
|
||||
src/util/PersistSignalVector.hpp \
|
||||
src/util/PostToThread.hpp \
|
||||
src/util/QObjectRef.hpp \
|
||||
src/util/QStringHash.hpp \
|
||||
src/util/StreamerMode.hpp \
|
||||
src/util/Twitch.hpp \
|
||||
src/util/rangealgorithm.hpp \
|
||||
src/util/RapidjsonHelpers.hpp \
|
||||
src/util/RapidJsonSerializeQString.hpp \
|
||||
src/util/RemoveScrollAreaBackground.hpp \
|
||||
src/util/SampleCheerMessages.hpp \
|
||||
src/util/SampleLinks.hpp \
|
||||
src/util/SharedPtrElementLess.hpp \
|
||||
src/util/Shortcut.hpp \
|
||||
src/util/StandardItemHelper.hpp \
|
||||
src/util/StreamLink.hpp \
|
||||
src/util/NuulsUploader.hpp \
|
||||
src/util/WindowsHelper.hpp \
|
||||
src/widgets/AccountSwitchPopup.hpp \
|
||||
src/widgets/AccountSwitchWidget.hpp \
|
||||
src/widgets/AttachedWindow.hpp \
|
||||
src/widgets/BasePopup.hpp \
|
||||
src/widgets/BaseWidget.hpp \
|
||||
src/widgets/BaseWindow.hpp \
|
||||
src/widgets/dialogs/ColorPickerDialog.hpp \
|
||||
src/widgets/dialogs/EmotePopup.hpp \
|
||||
src/widgets/dialogs/IrcConnectionEditor.hpp \
|
||||
src/widgets/dialogs/LastRunCrashDialog.hpp \
|
||||
src/widgets/dialogs/LoginDialog.hpp \
|
||||
src/widgets/dialogs/NotificationPopup.hpp \
|
||||
src/widgets/dialogs/QualityPopup.hpp \
|
||||
src/widgets/dialogs/SelectChannelDialog.hpp \
|
||||
src/widgets/dialogs/SettingsDialog.hpp \
|
||||
src/widgets/dialogs/TextInputDialog.hpp \
|
||||
src/widgets/dialogs/UpdateDialog.hpp \
|
||||
src/widgets/dialogs/UserInfoPopup.hpp \
|
||||
src/widgets/dialogs/WelcomeDialog.hpp \
|
||||
src/widgets/helper/Button.hpp \
|
||||
src/widgets/helper/ChannelView.hpp \
|
||||
src/widgets/helper/ColorButton.hpp \
|
||||
src/widgets/helper/ComboBoxItemDelegate.hpp \
|
||||
src/widgets/helper/CommonTexts.hpp \
|
||||
src/widgets/helper/DebugPopup.hpp \
|
||||
src/widgets/helper/EditableModelView.hpp \
|
||||
src/widgets/helper/EffectLabel.hpp \
|
||||
src/widgets/helper/Line.hpp \
|
||||
src/widgets/helper/NotebookButton.hpp \
|
||||
src/widgets/helper/NotebookTab.hpp \
|
||||
src/widgets/helper/QColorPicker.hpp \
|
||||
src/widgets/helper/ResizingTextEdit.hpp \
|
||||
src/widgets/helper/ScrollbarHighlight.hpp \
|
||||
src/widgets/helper/SearchPopup.hpp \
|
||||
src/widgets/helper/SettingsDialogTab.hpp \
|
||||
src/widgets/helper/SignalLabel.hpp \
|
||||
src/widgets/helper/TitlebarButton.hpp \
|
||||
src/widgets/Label.hpp \
|
||||
src/widgets/Notebook.hpp \
|
||||
src/widgets/Scrollbar.hpp \
|
||||
src/widgets/settingspages/AboutPage.hpp \
|
||||
src/widgets/settingspages/AccountsPage.hpp \
|
||||
src/widgets/settingspages/CommandPage.hpp \
|
||||
src/widgets/settingspages/ExternalToolsPage.hpp \
|
||||
src/widgets/settingspages/GeneralPage.hpp \
|
||||
src/widgets/settingspages/HighlightingPage.hpp \
|
||||
src/widgets/settingspages/IgnoresPage.hpp \
|
||||
src/widgets/settingspages/KeyboardSettingsPage.hpp \
|
||||
src/widgets/settingspages/ModerationPage.hpp \
|
||||
src/widgets/settingspages/NotificationPage.hpp \
|
||||
src/widgets/settingspages/SettingsPage.hpp \
|
||||
src/widgets/splits/ClosedSplits.hpp \
|
||||
src/widgets/splits/Split.hpp \
|
||||
src/widgets/splits/SplitContainer.hpp \
|
||||
src/widgets/splits/SplitHeader.hpp \
|
||||
src/widgets/splits/SplitInput.hpp \
|
||||
src/widgets/splits/SplitOverlay.hpp \
|
||||
src/widgets/StreamView.hpp \
|
||||
src/widgets/TooltipWidget.hpp \
|
||||
src/widgets/Window.hpp \
|
||||
|
||||
RESOURCES += \
|
||||
resources/resources.qrc \
|
||||
resources/resources_autogenerated.qrc
|
||||
|
||||
DISTFILES +=
|
||||
|
||||
FORMS += \
|
||||
src/widgets/dialogs/IrcConnectionEditor.ui
|
||||
|
||||
# do not use windows min/max macros
|
||||
#win32 {
|
||||
# DEFINES += NOMINMAX
|
||||
#}
|
||||
|
||||
linux:isEmpty(PREFIX) {
|
||||
message("Using default installation prefix (/usr/local). Change PREFIX in qmake command")
|
||||
PREFIX = /usr/local
|
||||
}
|
||||
|
||||
linux {
|
||||
desktop.files = resources/com.chatterino.chatterino.desktop
|
||||
desktop.path = $$PREFIX/share/applications
|
||||
|
||||
build_icons.path = .
|
||||
build_icons.commands = @echo $$PWD && mkdir -p $$PWD/resources/linuxinstall/icons/hicolor/256x256 && cp $$PWD/resources/icon.png $$PWD/resources/linuxinstall/icons/hicolor/256x256/com.chatterino.chatterino.png
|
||||
|
||||
icon.files = $$PWD/resources/linuxinstall/icons/hicolor/256x256/com.chatterino.chatterino.png
|
||||
icon.path = $$PREFIX/share/icons/hicolor/256x256/apps
|
||||
|
||||
target.path = $$PREFIX/bin
|
||||
|
||||
INSTALLS += desktop build_icons icon target
|
||||
}
|
||||
|
||||
git_commit=$$(GIT_COMMIT)
|
||||
git_release=$$(GIT_RELEASE)
|
||||
# Git data
|
||||
isEmpty(git_commit) {
|
||||
git_commit=$$system(git rev-parse HEAD)
|
||||
}
|
||||
isEmpty(git_release) {
|
||||
git_release=$$system(git describe)
|
||||
}
|
||||
git_hash = $$str_member($$git_commit, 0, 8)
|
||||
|
||||
# Passing strings as defines requires you to use this weird triple-escape then quotation mark syntax.
|
||||
# https://stackoverflow.com/questions/3348711/add-a-define-to-qmake-with-a-value/18343449#18343449
|
||||
DEFINES += CHATTERINO_GIT_COMMIT=\\\"$$git_commit\\\"
|
||||
DEFINES += CHATTERINO_GIT_RELEASE=\\\"$$git_release\\\"
|
||||
DEFINES += CHATTERINO_GIT_HASH=\\\"$$git_hash\\\"
|
||||
|
||||
CONFIG(debug, debug|release) {
|
||||
message("Building Chatterino2 DEBUG")
|
||||
} else {
|
||||
message("Building Chatterino2 RELEASE")
|
||||
}
|
||||
|
||||
message("Injected git values: $$git_commit ($$git_release) $$git_hash")
|
14
cmake/FindLRUCache.cmake
Normal file
14
cmake/FindLRUCache.cmake
Normal file
|
@ -0,0 +1,14 @@
|
|||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_path(LRUCache_INCLUDE_DIR lrucache/lrucache.hpp HINTS ${CMAKE_SOURCE_DIR}/lib/lrucache)
|
||||
|
||||
find_package_handle_standard_args(LRUCache DEFAULT_MSG LRUCache_INCLUDE_DIR)
|
||||
|
||||
if (LRUCache_FOUND)
|
||||
add_library(LRUCache INTERFACE IMPORTED)
|
||||
set_target_properties(LRUCache PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${LRUCache_INCLUDE_DIR}"
|
||||
)
|
||||
endif ()
|
||||
|
||||
mark_as_advanced(LRUCache_INCLUDE_DIR)
|
28
cmake/FindLibCommuni.cmake
Normal file
28
cmake/FindLibCommuni.cmake
Normal file
|
@ -0,0 +1,28 @@
|
|||
find_path(IrcCore_INCLUDE_DIR irc.h PATH_SUFFIXES IrcCore)
|
||||
find_library(IrcCore_LIBRARY Core)
|
||||
|
||||
find_path(IrcModel_INCLUDE_DIR ircmodel.h PATH_SUFFIXES IrcModel)
|
||||
find_library(IrcModel_LIBRARY Model)
|
||||
|
||||
find_path(IrcUtil_INCLUDE_DIR ircutil.h PATH_SUFFIXES IrcUtil)
|
||||
find_library(IrcUtil_LIBRARY Util)
|
||||
|
||||
set(LibCommuni_INCLUDE_DIRS ${IrcCore_INCLUDE_DIR} ${IrcModel_INCLUDE_DIR} ${IrcUtil_INCLUDE_DIR})
|
||||
set(LibCommuni_LIBRARIES ${IrcCore_LIBRARY} ${IrcModel_LIBRARY} ${IrcUtil_LIBRARY})
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(LibCommuni
|
||||
DEFAULT_MSG IrcCore_LIBRARY IrcModel_LIBRARY IrcUtil_LIBRARY IrcCore_INCLUDE_DIR IrcModel_INCLUDE_DIR IrcUtil_INCLUDE_DIR
|
||||
)
|
||||
|
||||
if (LibCommuni_FOUND)
|
||||
add_library(LibCommuni::LibCommuni INTERFACE IMPORTED)
|
||||
set_target_properties(LibCommuni::LibCommuni PROPERTIES
|
||||
INTERFACE_LINK_LIBRARIES "${LibCommuni_LIBRARIES}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${LibCommuni_INCLUDE_DIRS}"
|
||||
)
|
||||
endif ()
|
||||
|
||||
mark_as_advanced(LibCommuni_INCLUDE_DIRS LibCommuni_LIBRARIES
|
||||
IrcCore_LIBRARY IrcModel_LIBRARY IrcUtil_LIBRARY
|
||||
IrcCore_INCLUDE_DIR IrcModel_INCLUDE_DIR IrcUtil_INCLUDE_DIR)
|
14
cmake/FindMagicEnum.cmake
Normal file
14
cmake/FindMagicEnum.cmake
Normal file
|
@ -0,0 +1,14 @@
|
|||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_path(MagicEnum_INCLUDE_DIR magic_enum.hpp HINTS ${CMAKE_SOURCE_DIR}/lib/magic_enum/include)
|
||||
|
||||
find_package_handle_standard_args(MagicEnum DEFAULT_MSG MagicEnum_INCLUDE_DIR)
|
||||
|
||||
if (MagicEnum_FOUND)
|
||||
add_library(MagicEnum INTERFACE IMPORTED)
|
||||
set_target_properties(MagicEnum PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${MagicEnum_INCLUDE_DIR}"
|
||||
)
|
||||
endif ()
|
||||
|
||||
mark_as_advanced(MagicEnum_INCLUDE_DIR)
|
14
cmake/FindPajladaSerialize.cmake
Normal file
14
cmake/FindPajladaSerialize.cmake
Normal file
|
@ -0,0 +1,14 @@
|
|||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_path(PajladaSerialize_INCLUDE_DIR pajlada/serialize.hpp HINTS ${CMAKE_SOURCE_DIR}/lib/serialize/include)
|
||||
|
||||
find_package_handle_standard_args(PajladaSerialize DEFAULT_MSG PajladaSerialize_INCLUDE_DIR)
|
||||
|
||||
if (PajladaSerialize_FOUND)
|
||||
add_library(Pajlada::Serialize INTERFACE IMPORTED)
|
||||
set_target_properties(Pajlada::Serialize PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${PajladaSerialize_INCLUDE_DIR}"
|
||||
)
|
||||
endif ()
|
||||
|
||||
mark_as_advanced(PajladaSerialize_INCLUDE_DIR)
|
16
cmake/FindPajladaSettings.cmake
Normal file
16
cmake/FindPajladaSettings.cmake
Normal file
|
@ -0,0 +1,16 @@
|
|||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_path(PajladaSettings_INCLUDE_DIR pajlada/settings.hpp)
|
||||
find_library(PajladaSettings_LIBRARY PajladaSettings)
|
||||
|
||||
find_package_handle_standard_args(PajladaSettings DEFAULT_MSG PajladaSettings_INCLUDE_DIR PajladaSettings_LIBRARY)
|
||||
|
||||
if (PajladaSettings_FOUND)
|
||||
add_library(Pajlada::Settings INTERFACE IMPORTED)
|
||||
set_target_properties(Pajlada::Settings PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${PajladaSettings_INCLUDE_DIR}"
|
||||
INTERFACE_LINK_LIBRARIES "${PajladaSettings_LIBRARY}"
|
||||
)
|
||||
endif ()
|
||||
|
||||
mark_as_advanced(PajladaSettings_INCLUDE_DIR PajladaSettings_LIBRARY)
|
14
cmake/FindPajladaSignals.cmake
Normal file
14
cmake/FindPajladaSignals.cmake
Normal file
|
@ -0,0 +1,14 @@
|
|||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_path(PajladaSignals_INCLUDE_DIR pajlada/signals/signal.hpp HINTS ${CMAKE_SOURCE_DIR}/lib/signals/include)
|
||||
|
||||
find_package_handle_standard_args(PajladaSignals DEFAULT_MSG PajladaSignals_INCLUDE_DIR)
|
||||
|
||||
if (PajladaSignals_FOUND)
|
||||
add_library(Pajlada::Signals INTERFACE IMPORTED)
|
||||
set_target_properties(Pajlada::Signals PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${PajladaSignals_INCLUDE_DIR}"
|
||||
)
|
||||
endif ()
|
||||
|
||||
mark_as_advanced(PajladaSignals_INCLUDE_DIR)
|
14
cmake/FindRapidJSON.cmake
Normal file
14
cmake/FindRapidJSON.cmake
Normal file
|
@ -0,0 +1,14 @@
|
|||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_path(RapidJSON_INCLUDE_DIR rapidjson/rapidjson.h HINTS ${CMAKE_SOURCE_DIR}/lib/rapidjson/include)
|
||||
|
||||
find_package_handle_standard_args(RapidJSON DEFAULT_MSG RapidJSON_INCLUDE_DIR)
|
||||
|
||||
if (RapidJSON_FOUND)
|
||||
add_library(RapidJSON::RapidJSON INTERFACE IMPORTED)
|
||||
set_target_properties(RapidJSON::RapidJSON PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${RapidJSON_INCLUDE_DIR}"
|
||||
)
|
||||
endif ()
|
||||
|
||||
mark_as_advanced(RapidJSON_INCLUDE_DIR)
|
14
cmake/FindWebsocketpp.cmake
Normal file
14
cmake/FindWebsocketpp.cmake
Normal file
|
@ -0,0 +1,14 @@
|
|||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_path(Websocketpp_INCLUDE_DIR websocketpp/version.hpp HINTS ${CMAKE_SOURCE_DIR}/lib/websocketpp)
|
||||
|
||||
find_package_handle_standard_args(Websocketpp DEFAULT_MSG Websocketpp_INCLUDE_DIR)
|
||||
|
||||
if (Websocketpp_FOUND)
|
||||
add_library(websocketpp::websocketpp INTERFACE IMPORTED)
|
||||
set_target_properties(websocketpp::websocketpp PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${Websocketpp_INCLUDE_DIR}"
|
||||
)
|
||||
endif ()
|
||||
|
||||
mark_as_advanced(Websocketpp_INCLUDE_DIR)
|
12
cmake/FindWinToast.cmake
Normal file
12
cmake/FindWinToast.cmake
Normal file
|
@ -0,0 +1,12 @@
|
|||
if (EXISTS ${CMAKE_SOURCE_DIR}/lib/WinToast/src/wintoastlib.cpp)
|
||||
set(WinToast_FOUND TRUE)
|
||||
add_library(WinToast ${CMAKE_SOURCE_DIR}/lib/WinToast/src/wintoastlib.cpp)
|
||||
target_include_directories(WinToast PUBLIC "${CMAKE_SOURCE_DIR}/lib/WinToast/src/")
|
||||
else ()
|
||||
set(WinToast_FOUND FALSE)
|
||||
message("WinToast submodule not found!")
|
||||
endif ()
|
||||
|
||||
|
||||
|
||||
|
84
cmake/GIT.cmake
Normal file
84
cmake/GIT.cmake
Normal file
|
@ -0,0 +1,84 @@
|
|||
# This script will set the following variables:
|
||||
# GIT_HASH
|
||||
# If the git binary is found and the git work tree is intact, GIT_HASH is worked out using the `git rev-parse --short HEAD` command
|
||||
# The value of GIT_HASH can be overriden by defining the GIT_HASH environment variable
|
||||
# GIT_COMMIT
|
||||
# If the git binary is found and the git work tree is intact, GIT_COMMIT is worked out using the `git rev-parse HEAD` command
|
||||
# The value of GIT_COMMIT can be overriden by defining the GIT_COMMIT environment variable
|
||||
# GIT_RELEASE
|
||||
# If the git binary is found and the git work tree is intact, GIT_RELEASE is worked out using the `git describe` command
|
||||
# The value of GIT_RELEASE can be overriden by defining the GIT_RELEASE environment variable
|
||||
# GIT_MODIFIED
|
||||
# If the git binary is found and the git work tree is intact, GIT_MODIFIED is worked out by checking if output of `git status --porcelain -z` command is empty
|
||||
# The value of GIT_MODIFIED cannot be overriden
|
||||
|
||||
find_package(Git)
|
||||
|
||||
set(GIT_HASH "GIT-REPOSITORY-NOT-FOUND")
|
||||
set(GIT_COMMIT "GIT-REPOSITORY-NOT-FOUND")
|
||||
set(GIT_RELEASE "${PROJECT_VERSION}")
|
||||
set(GIT_MODIFIED 0)
|
||||
|
||||
if (DEFINED ENV{CHATTERINO_SKIP_GIT_GEN})
|
||||
return()
|
||||
endif ()
|
||||
|
||||
if (GIT_EXECUTABLE)
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} rev-parse --is-inside-work-tree
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
RESULT_VARIABLE GIT_REPOSITORY_NOT_FOUND
|
||||
ERROR_QUIET
|
||||
)
|
||||
if (GIT_REPOSITORY_NOT_FOUND)
|
||||
set(GIT_REPOSITORY_FOUND 0)
|
||||
else ()
|
||||
set(GIT_REPOSITORY_FOUND 1)
|
||||
endif()
|
||||
|
||||
if (GIT_REPOSITORY_FOUND)
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE GIT_HASH
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} rev-parse HEAD
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE GIT_COMMIT
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} describe
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE GIT_RELEASE
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} status --porcelain -z
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE GIT_MODIFIED_OUTPUT
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
endif (GIT_REPOSITORY_FOUND)
|
||||
endif (GIT_EXECUTABLE)
|
||||
|
||||
if (GIT_MODIFIED_OUTPUT)
|
||||
set(GIT_MODIFIED 1)
|
||||
endif ()
|
||||
|
||||
if (DEFINED ENV{GIT_HASH})
|
||||
set(GIT_HASH "$ENV{GIT_HASH}")
|
||||
endif ()
|
||||
if (DEFINED ENV{GIT_COMMIT})
|
||||
set(GIT_COMMIT "$ENV{GIT_COMMIT}")
|
||||
endif ()
|
||||
if (DEFINED ENV{GIT_RELEASE})
|
||||
set(GIT_RELEASE "$ENV{GIT_RELEASE}")
|
||||
endif ()
|
||||
|
||||
message(STATUS "Injected git values: ${GIT_COMMIT} (${GIT_RELEASE}) modified: ${GIT_MODIFIED}")
|
36
cmake/MacOSXBundleInfo.plist.in
Normal file
36
cmake/MacOSXBundleInfo.plist.in
Normal file
|
@ -0,0 +1,36 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleGetInfoString</key>
|
||||
<string>${MACOSX_BUNDLE_INFO_STRING}</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>${MACOSX_BUNDLE_ICON_FILE}</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleLongVersionString</key>
|
||||
<string>${MACOSX_BUNDLE_LONG_VERSION_STRING}</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
|
||||
<key>CSResourcesFileMapped</key>
|
||||
<true/>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>${MACOSX_BUNDLE_COPYRIGHT}</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
</dict>
|
||||
</plist>
|
1
cmake/sanitizers-cmake
Submodule
1
cmake/sanitizers-cmake
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 99e159ec9bc8dd362b08d18436bd40ff0648417b
|
|
@ -1,12 +1,14 @@
|
|||
[requires]
|
||||
openssl/1.1.1d
|
||||
boost/1.71.0
|
||||
openssl/1.1.1m
|
||||
boost/1.78.0
|
||||
|
||||
[generators]
|
||||
qmake
|
||||
cmake
|
||||
|
||||
[options]
|
||||
openssl:shared=True
|
||||
|
||||
[imports]
|
||||
bin, *.dll -> ./bin @ keep_path=False
|
||||
bin, *.dll -> ./Chatterino2 @ keep_path=False
|
||||
lib, *.so* -> ./bin @ keep_path=False
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
Commands are used as shortcuts for long messages. If a message starts with the "trigger" then the message will be replaced with the Command.
|
||||
|
||||
#### Example
|
||||
Add Command `Hello chat :)` with the trigger `/hello`. Now typing `/hello` in chat will send `Hello chat :)` instead of `/hello`.
|
||||
|
||||
## Advanced
|
||||
|
||||
- The trigger has to be matched at the **start** of the message but there is a setting to also match them at the **end**.
|
||||
- Triggers don't need to start with `/`
|
||||
|
||||
#### Using placeholders
|
||||
- `{1}`, `{2}`, `{3}` and so on can be used to insert the 1st, 2nd, 3rd, ... word after the trigger.
|
||||
|
||||
Example: Add Command `/timeout {1} 1` with trigger `/warn`. Now typing `/warn user123` will send `/timeout user123 1`
|
||||
|
||||
- Similarly `{1+}` and so on can be used to insert all words starting with the 1st, ... word.
|
||||
|
||||
Example: Add Command `Have a {1+} day!` with trigger `/day`. Now typing `/day very super nice` will send `Have a very super nice day!`
|
||||
|
||||
- You can use `{{1}` if you want to send `{1}` literally.
|
34
docs/ENV.md
34
docs/ENV.md
|
@ -1,34 +0,0 @@
|
|||
# Environment variables
|
||||
Below I have tried to list all environment variables that can be used to modify the behaviour of Chatterino. Used for things that I don't feel like fit in the settings system.
|
||||
|
||||
### CHATTERINO2_RECENT_MESSAGES_URL
|
||||
Used to change the URL that Chatterino2 uses when trying to load historic Twitch chat messages (if the setting is enabled).
|
||||
Default value: `https://recent-messages.robotty.de/api/v2/recent-messages/%1` (an [open-source service](https://github.com/robotty/recent-messages2) written and currently run by [@RAnders00](https://github.com/RAnders00) - [visit the homepage for more details about the service](https://recent-messages.robotty.de/))
|
||||
Arguments:
|
||||
- `%1` = Name of the Twitch channel
|
||||
|
||||
### CHATTERINO2_LINK_RESOLVER_URL
|
||||
Used to change the URL that Chatterino2 uses when trying to get link information to display in the tooltip on hover.
|
||||
Default value: `https://braize.pajlada.com/chatterino/link_resolver/%1`
|
||||
Arguments:
|
||||
- `%1` = Escaped URL the link resolver should resolve
|
||||
|
||||
### CHATTERINO2_TWITCH_EMOTE_SET_RESOLVER_URL
|
||||
Used to change the URL that Chatterino2 uses when trying to get emote set information
|
||||
Default value: `https://braize.pajlada.com/chatterino/twitchemotes/set/%1/`
|
||||
Arguments:
|
||||
- `%1` = Emote set ID
|
||||
|
||||
### CHATTERINO2_TWITCH_SERVER_HOST
|
||||
String value used to change what Twitch chat server host to connect to.
|
||||
Default value: `irc.chat.twitch.tv`
|
||||
|
||||
### CHATTERINO2_TWITCH_SERVER_PORT
|
||||
Number value used to change what port to use when connecting to Twitch chat servers.
|
||||
Currently known valid ports for secure usage: 6697, 443.
|
||||
Currently known valid ports for non-secure usage (CHATTERINO2_TWITCH_SERVER_SECURE set to false): 6667, 80.
|
||||
Default value: `443`
|
||||
|
||||
### CHATTERINO2_TWITCH_SERVER_SECURE
|
||||
Bool value used to tell Chatterino whether to try to connect securely (secure irc) to the Twitch chat server.
|
||||
Default value: `true`
|
|
@ -1,47 +0,0 @@
|
|||
## Image Uploader
|
||||
You can drag and drop images to Chatterino or paste them from clipboard to upload them to an external service.
|
||||
|
||||
By default, images are uploaded to [i.nuuls.com](https://i.nuuls.com).
|
||||
You can change that in `Chatterino Settings -> External Tools -> Image Uploader`.
|
||||
|
||||
Note to advanced users: This module sends multipart-form requests via POST method, so uploading via SFTP/FTP won't work.
|
||||
However, popular hosts like [imgur.com](https://imgur.com) are [s-ul.eu](https://s-ul.eu) supported. Scroll down to see example cofiguration.
|
||||
|
||||
### General settings explanation:
|
||||
|
||||
|Row|Description|
|
||||
|-|-|
|
||||
|Request URL|Link to an API endpoint, which is requested by chatterino. Any needed URL parameters should be included here.|
|
||||
|Form field|Name of a field, which contains image data.|
|
||||
|Extra headers|Extra headers, that will be included in the request. Header name and value must be separated by colon (`:`). Multiple headers need to be separated with semicolons (`;`).<br>Example: `Authorization: supaKey ; NextHeader: value` .|
|
||||
|Image link|Schema that tells where is the link in service's response. Leave empty if server's response is just the link itself. Refer to json properties by `{property}`. Supports dot-notation, example: `{property.anotherProperty}` .|
|
||||
|Deletion link|Same as above.|
|
||||
|
||||
<br>
|
||||
|
||||
## Examples
|
||||
|
||||
### i.nuuls.com
|
||||
|
||||
Simply clear all the fields.
|
||||
|
||||
### imgur.com
|
||||
|
||||
|Row|Description|
|
||||
|-|-|
|
||||
|Request URL|`https://api.imgur.com/3/image`|
|
||||
|Form field|`image`|
|
||||
|Extra headers|`Authorization: Client-ID c898c0bb848ca39`|
|
||||
|Image link|`{data.link}`|
|
||||
|Deletion link|`https://imgur.com/delete/{data.deletehash}`|
|
||||
|
||||
### s-ul.eu
|
||||
|
||||
Replace `XXXXXXXXXXXXXXX` with your API key from s-ul.eu. It can be found on [your account's configuration page](https://s-ul.eu/account/configurations).
|
||||
|Row|Description|
|
||||
|-|-|
|
||||
|Request URL|`https://s-ul.eu/api/v1/upload?wizard=true&key=XXXXXXXXXXXXXXX`|
|
||||
|Form field|`file`|
|
||||
|Extra headers||
|
||||
|Image link|`{url}`|
|
||||
|Deletion link|`https://s-ul.eu/delete.php?file={filename}&key=XXXXXXXXXXXXXXX`|
|
|
@ -1,21 +0,0 @@
|
|||
# Documents
|
||||
|
||||
Welcome to the Chatterino2 documentation!
|
||||
|
||||
Table of contents:
|
||||
- [Environment variables](ENV.md)
|
||||
- [Commands](Commands.md)
|
||||
- [Regex](Regex.md)
|
||||
- [Notes](notes/README.md)
|
||||
- [TCaccountmanager](notes/TCaccountmanager.md)
|
||||
- [TCappearanceSettings.md](notes/TCappearanceSettings.md)
|
||||
- [TCchannelNavigation.md](notes/TCchannelNavigation.md)
|
||||
- [TCchatterinoFeatures.md](notes/TCchatterinoFeatures.md)
|
||||
- [TCchatting.md](notes/TCchatting.md)
|
||||
- [TCchatWindowNavigation.md](notes/TCchatWindowNavigation.md)
|
||||
- [TCemotes.md](notes/TCemotes.md)
|
||||
- [TCgeneral.md](notes/TCgeneral.md)
|
||||
- [TChighlighting.md](notes/TChighlighting.md)
|
||||
- [TCtabsAndSplits.md](notes/TCtabsAndSplits.md)
|
||||
- [TCusernameTabbing.md](notes/TCusernameTabbing.md)
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
_Regular expressions_ (or short _regexes_) are often used to check if a text matches a certain pattern. For example the regex `ab?c` would match `abc` or `ac`, but not `abbc` or `123`. In Chatterino, you can use them to highlight messages (and more) based on complex conditions.
|
||||
|
||||
Basic patterns:
|
||||
|
||||
|Pattern |Matches|
|
||||
|-|-|
|
||||
|`x?` |nothing or `x`|
|
||||
|`x*` |`x`, repeated any number of times|
|
||||
|`x+` |`x`, repeated any number of times but at least 1|
|
||||
|`^` |The start of the text|
|
||||
|`$` |The end of the text|
|
||||
|`x\|y` |`x` or `y`|
|
||||
|
||||
You can group multiple statements with `()`:
|
||||
|
||||
|Pattern |Matches|
|
||||
|-|-|
|
||||
|`asd?` |`asd` or `as`|
|
||||
|`(asd)?` |`asd` or nothing|
|
||||
|`\(asd\)` |`(asd)`, literally|
|
||||
|
||||
You can also group multiple characters with `[]`:
|
||||
|
||||
|Pattern |Matches|
|
||||
|-|-|
|
||||
|`[xyz]` |`x`, `y` or `z`|
|
||||
|`[1-5a-f]` |`1`,`2`,`3`,`4`,`5`,`a`,`b`,`c`,`d`,`e`,`f`|
|
||||
|`[^abc]` |Anything, **except** `a`, `b` and `c`|
|
||||
|`[\-]` |`-`, literally (escaped with `\`)|
|
||||
|`\[xyz\]` |`[xyz]`, literally|
|
||||
|
||||
Special patterns:
|
||||
|
||||
|Pattern |Matches|
|
||||
|-|-|
|
||||
|`\d` |Digit characters (0-9)|
|
||||
|`\D` |Non-digit characters|
|
||||
|`\w` |Word characters (a-zA-Z0-9_)|
|
||||
|`\W` |Non-word characters|
|
||||
|`\s` |Spaces, tabs, etc.|
|
||||
|`\S` |Not spaces, tabs, etc.|
|
||||
|`\b` |Word boundaries (between \w and \W)|
|
||||
|`\B` |Non-word boundaries|
|
||||
|
||||
You can try out your regex pattern on websites like [https://regex101.com/](regex101.com).
|
BIN
docs/imember.png
BIN
docs/imember.png
Binary file not shown.
Before Width: | Height: | Size: 29 KiB |
4
docs/make-release.md
Normal file
4
docs/make-release.md
Normal file
|
@ -0,0 +1,4 @@
|
|||
# Checklist for making a release
|
||||
|
||||
- [ ] Updated version code in `src/common/Version.hpp`
|
||||
- [ ] Updated version code in `CMakeLists.txt`
|
|
@ -1 +0,0 @@
|
|||
# This is a list of obvious things to try before deploying
|
|
@ -1,4 +0,0 @@
|
|||
1. log into an account
|
||||
2. add a second account
|
||||
3. switch accounts
|
||||
4. remove one account
|
|
@ -1,11 +0,0 @@
|
|||
* change theme
|
||||
* change font size
|
||||
* test red line (last message)
|
||||
* timestamp settings
|
||||
* disable timestamps
|
||||
* enable
|
||||
* show seconds
|
||||
* use 12 hour format (am/pm)
|
||||
* Display messages with message seperator
|
||||
* rescale the window
|
||||
* test "rainbow color"-option
|
|
@ -1,6 +0,0 @@
|
|||
1. check the info of a channel that's live
|
||||
2. open the twitch page of a channel
|
||||
3. open a channel in popout player
|
||||
4. open a channel with stream link
|
||||
5. manual reconnect to a channel
|
||||
6. reload channel emotes
|
|
@ -1,17 +0,0 @@
|
|||
* open a link
|
||||
* enable double click option for links
|
||||
* click a link once (doesn't open)
|
||||
* open a link by double clicking
|
||||
* right click on hyperlink (opens a context menu)
|
||||
* open link in browser
|
||||
* copy the hyperlink
|
||||
* mouse over an emote (info is displayed)
|
||||
* mouse over a badge (info is displayed)
|
||||
* click on a user to open his short profile
|
||||
* copy the username
|
||||
* open the twitch profile
|
||||
* (un-)follow the user
|
||||
* ignore the user
|
||||
* disable higlights from this user
|
||||
* message the user
|
||||
* scroll up and down in chat
|
|
@ -1,12 +0,0 @@
|
|||
* open the /mentions tab (& get mentioned)
|
||||
* open /whispers (& recveive a whisper)
|
||||
* read the changelog
|
||||
* add a custom command and use it
|
||||
* ignore an emote
|
||||
* change the emote scale
|
||||
* ignore an user
|
||||
* ignore a new message keyword
|
||||
* activate inline whispers
|
||||
* send a whisper (/w)
|
||||
* receive an inline answer
|
||||
* reply to a whisper (/r)
|
|
@ -1,11 +0,0 @@
|
|||
* write a message containing:
|
||||
1) text
|
||||
2) a global twitch emote
|
||||
3) a sub emote
|
||||
4) a bttv emote
|
||||
5) a ffz emote
|
||||
6) an emoji
|
||||
* copy text from chat
|
||||
* paste text into chat
|
||||
* write a /me message (=> message is the color of your user name)
|
||||
* get timed out (=> messages becomes "grayed out")
|
|
@ -1,5 +0,0 @@
|
|||
1. use an emote by typing out the name
|
||||
2. use an emote by tabbing the name
|
||||
3. use an emote by picking it from the emote picker
|
||||
4. use an emoji by tabbing the name
|
||||
5. use a gif-emote
|
|
@ -1 +0,0 @@
|
|||
1. close and reopen chatterino => settings, tabs, splits and sizing should be have the same state before and after
|
|
@ -1,3 +0,0 @@
|
|||
1. add highlight word (& get pinged)
|
||||
2. add user to highlight blacklist (& get NOT pinged by him)
|
||||
3. add custom ping sound (& get pinged)
|
|
@ -1,9 +0,0 @@
|
|||
1. open a tab (& connect to a channel)
|
||||
2. open a 2nd tab (& connect to a channel)
|
||||
3. open a new split (& connect to a channel)
|
||||
4. move a split to a different tab
|
||||
5. change tab order
|
||||
6. rename a tab
|
||||
7. close a split
|
||||
8. close a tab
|
||||
9. change a channel in a tab/split
|
|
@ -1,4 +0,0 @@
|
|||
1. tab username
|
||||
2. test "prioritize username over emotes" setting
|
||||
3. enable localized name tabbing
|
||||
4. enable @ for mentions
|
88
docs/test-and-benchmark.md
Normal file
88
docs/test-and-benchmark.md
Normal file
|
@ -0,0 +1,88 @@
|
|||
# Test and Benchmark
|
||||
|
||||
Chatterino includes a set of unit tests and benchmarks. These can be built using cmake by adding the `-DBUILD_TESTS=On` and `-DBUILD_BENCHMARKS=On` flags respectively.
|
||||
|
||||
## Adding your own test
|
||||
|
||||
1. Create a new file for the file you're adding tests for. If you're creating tests for `src/providers/emoji/Emojis.cpp`, create `tests/src/Emojis.cpp`.
|
||||
2. Add the newly created file to `tests/CMakeLists.txt` in the `test_SOURCES` variable (see the comment near it)
|
||||
|
||||
See `tests/src/Emojis.cpp` for simple tests you can base your tests off of.
|
||||
|
||||
Read up on http://google.github.io/googletest/primer.html to figure out how GoogleTest works.
|
||||
|
||||
## Building and running tests
|
||||
|
||||
```sh
|
||||
mkdir build-tests
|
||||
cd build-tests
|
||||
cmake -DBUILD_TESTS=On ..
|
||||
make
|
||||
./bin/chatterino-test
|
||||
```
|
||||
|
||||
### Example output
|
||||
|
||||
```
|
||||
[==========] Running 26 tests from 8 test suites.
|
||||
[----------] Global test environment set-up.
|
||||
[----------] 2 tests from AccessGuardLocker
|
||||
[ RUN ] AccessGuardLocker.NonConcurrentUsage
|
||||
[ OK ] AccessGuardLocker.NonConcurrentUsage (0 ms)
|
||||
[ RUN ] AccessGuardLocker.ConcurrentUsage
|
||||
[ OK ] AccessGuardLocker.ConcurrentUsage (686 ms)
|
||||
[----------] 2 tests from AccessGuardLocker (686 ms total)
|
||||
|
||||
[----------] 4 tests from NetworkCommon
|
||||
[ RUN ] NetworkCommon.parseHeaderList1
|
||||
[ OK ] NetworkCommon.parseHeaderList1 (0 ms)
|
||||
[ RUN ] NetworkCommon.parseHeaderListTrimmed
|
||||
[ OK ] NetworkCommon.parseHeaderListTrimmed (0 ms)
|
||||
[ RUN ] NetworkCommon.parseHeaderListColonInValue
|
||||
...
|
||||
[ RUN ] TwitchAccount.NotEnoughForMoreThanOneBatch
|
||||
[ OK ] TwitchAccount.NotEnoughForMoreThanOneBatch (0 ms)
|
||||
[ RUN ] TwitchAccount.BatchThreeParts
|
||||
[ OK ] TwitchAccount.BatchThreeParts (0 ms)
|
||||
[----------] 3 tests from TwitchAccount (2 ms total)
|
||||
|
||||
[----------] Global test environment tear-down
|
||||
[==========] 26 tests from 8 test suites ran. (10297 ms total)
|
||||
[ PASSED ] 26 tests.
|
||||
```
|
||||
|
||||
## Adding your own benchmark
|
||||
|
||||
1. Create a new file for the file you're adding benchmark for. If you're creating benchmarks for `src/providers/emoji/Emojis.cpp`, create `benchmarks/src/Emojis.cpp`.
|
||||
2. Add the newly created file to `benchmarks/CMakeLists.txt` in the `benchmark_SOURCES` variable (see the comment near it)
|
||||
|
||||
See `benchmarks/src/Emojis.cpp` for simple benchmark you can base your benchmarks off of.
|
||||
|
||||
## Building and running benchmarks
|
||||
|
||||
```sh
|
||||
mkdir build-benchmarks
|
||||
cd build-benchmarks
|
||||
cmake -DBUILD_BENCHMARKS=On ..
|
||||
make
|
||||
./bin/chatterino-benchmark
|
||||
```
|
||||
|
||||
### Example output
|
||||
|
||||
```
|
||||
2021-07-18T13:12:11+02:00
|
||||
Running ./bin/chatterino-benchmark
|
||||
Run on (12 X 4000 MHz CPU s)
|
||||
CPU Caches:
|
||||
L1 Data 32 KiB (x6)
|
||||
L1 Instruction 32 KiB (x6)
|
||||
L2 Unified 256 KiB (x6)
|
||||
L3 Unified 15360 KiB (x1)
|
||||
Load Average: 2.86, 3.08, 3.51
|
||||
***WARNING*** CPU scaling is enabled, the benchmark real time measurements may be noisy and will incur extra overhead.
|
||||
--------------------------------------------------------------
|
||||
Benchmark Time CPU Iterations
|
||||
--------------------------------------------------------------
|
||||
BM_ShortcodeParsing 2394 ns 2389 ns 278933
|
||||
```
|
|
@ -1 +1 @@
|
|||
Subproject commit ce441336ef057576dfb377be754bc5357a04ff85
|
||||
Subproject commit 5e441fd03543b999edb663caf8df7be37c0d575c
|
|
@ -1,25 +0,0 @@
|
|||
# boost
|
||||
# Exposed build flags:
|
||||
# - BOOST_DIRECTORY (C:\local\boost\ by default) (Windows only)
|
||||
|
||||
pajlada {
|
||||
BOOST_DIRECTORY = C:\dev\projects\boost_1_66_0\
|
||||
}
|
||||
|
||||
win32 {
|
||||
isEmpty(BOOST_DIRECTORY) {
|
||||
message(Using default boost directory C:\\local\\boost\\)
|
||||
BOOST_DIRECTORY = C:\local\boost\
|
||||
}
|
||||
|
||||
INCLUDEPATH += $$BOOST_DIRECTORY
|
||||
|
||||
isEmpty(BOOST_LIB_SUFFIX) {
|
||||
message(Using default boost lib directory suffix lib)
|
||||
BOOST_LIB_SUFFIX = lib
|
||||
}
|
||||
|
||||
LIBS += -L$$BOOST_DIRECTORY\\$$BOOST_LIB_SUFFIX
|
||||
} else {
|
||||
LIBS += -lboost_system -lboost_filesystem
|
||||
}
|
1
lib/googletest
Submodule
1
lib/googletest
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 8d51dc50eb7e7698427fed81b85edad0e032112e
|
|
@ -1 +0,0 @@
|
|||
Subproject commit 4e00a03623966723f23ca3034c1ad944009cd7be
|
|
@ -1,2 +0,0 @@
|
|||
# settings
|
||||
INCLUDEPATH += $$PWD/../lib/humanize/include/
|
|
@ -1 +1 @@
|
|||
Subproject commit f3e7f97914d9bf1166d349a83d93a2b4f4743c39
|
||||
Subproject commit a7b32cd6fa0640721b6114b31d37d79ebf832411
|
|
@ -1,5 +0,0 @@
|
|||
DEFINES += IRC_NAMESPACE=Communi
|
||||
|
||||
include(../lib/libcommuni/src/core/core.pri)
|
||||
include(../lib/libcommuni/src/model/model.pri)
|
||||
include(../lib/libcommuni/src/util/util.pri)
|
35
lib/lrucache/.clang-format
Normal file
35
lib/lrucache/.clang-format
Normal file
|
@ -0,0 +1,35 @@
|
|||
Language: Cpp
|
||||
|
||||
AccessModifierOffset: -4
|
||||
AlignEscapedNewlinesLeft: true
|
||||
AllowShortFunctionsOnASingleLine: false
|
||||
AllowShortIfStatementsOnASingleLine: false
|
||||
AllowShortLambdasOnASingleLine: Empty
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
AlwaysBreakAfterDefinitionReturnType: false
|
||||
AlwaysBreakBeforeMultilineStrings: false
|
||||
BasedOnStyle: Google
|
||||
BraceWrapping: {
|
||||
AfterClass: 'true'
|
||||
AfterControlStatement: 'true'
|
||||
AfterFunction: 'true'
|
||||
AfterNamespace: 'false'
|
||||
BeforeCatch: 'true'
|
||||
BeforeElse: 'true'
|
||||
}
|
||||
BreakBeforeBraces: Custom
|
||||
BreakConstructorInitializersBeforeComma: true
|
||||
ColumnLimit: 80
|
||||
ConstructorInitializerAllOnOneLineOrOnePerLine: false
|
||||
DerivePointerBinding: false
|
||||
FixNamespaceComments: true
|
||||
IndentCaseLabels: true
|
||||
IndentWidth: 4
|
||||
IndentWrappedFunctionNames: true
|
||||
IndentPPDirectives: AfterHash
|
||||
IncludeBlocks: Preserve
|
||||
NamespaceIndentation: Inner
|
||||
PointerBindsToType: false
|
||||
SpacesBeforeTrailingComments: 2
|
||||
Standard: Auto
|
||||
ReflowComments: false
|
27
lib/lrucache/LICENSE
Normal file
27
lib/lrucache/LICENSE
Normal file
|
@ -0,0 +1,27 @@
|
|||
Copyright (c) 2014, lamerman
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
* Neither the name of lamerman nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
117
lib/lrucache/lrucache/lrucache.hpp
Normal file
117
lib/lrucache/lrucache/lrucache.hpp
Normal file
|
@ -0,0 +1,117 @@
|
|||
/*
|
||||
* File: lrucache.hpp
|
||||
* Original Author: Alexander Ponomarev
|
||||
*
|
||||
* Created on June 20, 2013, 5:09 PM
|
||||
*/
|
||||
|
||||
#ifndef _LRUCACHE_HPP_INCLUDED_
|
||||
#define _LRUCACHE_HPP_INCLUDED_
|
||||
|
||||
#include <cstddef>
|
||||
#include <list>
|
||||
#include <stdexcept>
|
||||
#include <unordered_map>
|
||||
|
||||
namespace cache {
|
||||
|
||||
template <typename key_t, typename value_t>
|
||||
class lru_cache
|
||||
{
|
||||
public:
|
||||
typedef typename std::pair<key_t, value_t> key_value_pair_t;
|
||||
typedef typename std::list<key_value_pair_t>::iterator list_iterator_t;
|
||||
|
||||
lru_cache(size_t max_size)
|
||||
: _max_size(max_size)
|
||||
{
|
||||
}
|
||||
|
||||
// copy doesn't make sense since we reference the linked list elements directly
|
||||
lru_cache(lru_cache<key_t, value_t> &) = delete;
|
||||
lru_cache<key_t, value_t> &operator=(lru_cache<key_t, value_t> &) = delete;
|
||||
|
||||
// move
|
||||
lru_cache(lru_cache<key_t, value_t> &&other)
|
||||
: _cache_items_list(std::move(other._cache_items_list))
|
||||
, _cache_items_map(std::move(other._cache_items_map))
|
||||
, _max_size(other._max_size)
|
||||
{
|
||||
other._cache_items_list.clear();
|
||||
other._cache_items_map.clear();
|
||||
}
|
||||
|
||||
lru_cache<key_t, value_t> &operator=(lru_cache<key_t, value_t> &&other)
|
||||
{
|
||||
_cache_items_list = std::move(other._cache_items_list);
|
||||
_cache_items_map = std::move(other._cache_items_map);
|
||||
_max_size = other._max_size;
|
||||
other._cache_items_list.clear();
|
||||
other._cache_items_map.clear();
|
||||
return *this;
|
||||
}
|
||||
|
||||
void put(const key_t &key, const value_t &value)
|
||||
{
|
||||
auto it = _cache_items_map.find(key);
|
||||
_cache_items_list.push_front(key_value_pair_t(key, value));
|
||||
if (it != _cache_items_map.end())
|
||||
{
|
||||
_cache_items_list.erase(it->second);
|
||||
_cache_items_map.erase(it);
|
||||
}
|
||||
_cache_items_map[key] = _cache_items_list.begin();
|
||||
|
||||
if (_cache_items_map.size() > _max_size)
|
||||
{
|
||||
auto last = _cache_items_list.end();
|
||||
last--;
|
||||
_cache_items_map.erase(last->first);
|
||||
_cache_items_list.pop_back();
|
||||
}
|
||||
}
|
||||
|
||||
const value_t &get(const key_t &key)
|
||||
{
|
||||
auto it = _cache_items_map.find(key);
|
||||
if (it == _cache_items_map.end())
|
||||
{
|
||||
throw std::range_error("There is no such key in cache");
|
||||
}
|
||||
else
|
||||
{
|
||||
_cache_items_list.splice(_cache_items_list.begin(),
|
||||
_cache_items_list, it->second);
|
||||
return it->second->second;
|
||||
}
|
||||
}
|
||||
|
||||
bool exists(const key_t &key) const
|
||||
{
|
||||
return _cache_items_map.find(key) != _cache_items_map.end();
|
||||
}
|
||||
|
||||
size_t size() const
|
||||
{
|
||||
return _cache_items_map.size();
|
||||
}
|
||||
|
||||
auto begin() const
|
||||
{
|
||||
return _cache_items_list.begin();
|
||||
}
|
||||
|
||||
auto end() const
|
||||
{
|
||||
return _cache_items_list.end();
|
||||
}
|
||||
|
||||
private:
|
||||
std::list<key_value_pair_t> _cache_items_list;
|
||||
std::unordered_map<key_t, list_iterator_t> _cache_items_map;
|
||||
size_t _max_size;
|
||||
};
|
||||
|
||||
} // namespace cache
|
||||
|
||||
#endif /* _LRUCACHE_HPP_INCLUDED_ */
|
1
lib/magic_enum
Submodule
1
lib/magic_enum
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit f4ebb4f185ce956bf50b93acbef1516030ecdb36
|
|
@ -1,17 +0,0 @@
|
|||
win32 {
|
||||
isEmpty(OPENSSL_DIRECTORY) {
|
||||
message(Using default openssl directory C:\\local\\openssl)
|
||||
OPENSSL_DIRECTORY = C:\local\openssl
|
||||
}
|
||||
|
||||
INCLUDEPATH += $$OPENSSL_DIRECTORY\\include
|
||||
|
||||
LIBS += -L$$OPENSSL_DIRECTORY\lib
|
||||
|
||||
LIBS += -llibssl
|
||||
LIBS += -llibcrypto
|
||||
} else {
|
||||
PKGCONFIG += openssl
|
||||
|
||||
LIBS += -lssl -lcrypto
|
||||
}
|
|
@ -1 +1 @@
|
|||
Subproject commit 832f550da3f6655168a737d2e1b7df37272e936d
|
||||
Subproject commit de954627363b0b4bff9a2616f1a409b7e14d5df9
|
|
@ -1 +0,0 @@
|
|||
include(qtkeychain/qt5keychain.pri)
|
|
@ -1,15 +0,0 @@
|
|||
# rapidjson
|
||||
# Chatterino2 is tested with RapidJSON v1.1.0
|
||||
# - RAPIDJSON_PREFIX ($$PWD by default)
|
||||
# - RAPIDJSON_SYSTEM (1 = true) (Linux only, uses pkg-config)
|
||||
|
||||
!defined(RAPIDJSON_PREFIX) {
|
||||
RAPIDJSON_PREFIX = $$PWD
|
||||
}
|
||||
|
||||
linux:equals(RAPIDJSON_SYSTEM, "1") {
|
||||
message("Building with system RapidJSON")
|
||||
PKGCONFIG += RapidJSON
|
||||
} else {
|
||||
INCLUDEPATH += $$RAPIDJSON_PREFIX/rapidjson/include/
|
||||
}
|
|
@ -1 +1 @@
|
|||
Subproject commit 130ffc3ec722284ca454a1e70c5478a75f380144
|
||||
Subproject commit 7d37cbfd5ac3bfbe046118e1cec3d32ba4696469
|
|
@ -1,2 +0,0 @@
|
|||
# serialize
|
||||
INCLUDEPATH += $$PWD/serialize/include/
|
|
@ -1 +1 @@
|
|||
Subproject commit a5040463c01e6b0e562eab82e0decb29cab9b450
|
||||
Subproject commit 04792d853c7f83c9d7ab4df00279442a658d3be3
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue