diff --git a/BUILDING_ON_FREEBSD.md b/BUILDING_ON_FREEBSD.md index 74098237c..25f17f8b9 100644 --- a/BUILDING_ON_FREEBSD.md +++ b/BUILDING_ON_FREEBSD.md @@ -10,6 +10,7 @@ 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` +1. Go into the project directory +1. Create a build folder and go into it (`mkdir build && cd build`) +1. Proceed to compiling using the command + `qmake .. && make` diff --git a/BUILDING_ON_LINUX.md b/BUILDING_ON_LINUX.md index 401741a27..d9df2848b 100644 --- a/BUILDING_ON_LINUX.md +++ b/BUILDING_ON_LINUX.md @@ -4,27 +4,28 @@ Note on Qt version compatibility: If you are installing Qt from a package manage ## Ubuntu 18.04 -_most likely works the same for other Debian-like distros_ +_Most likely works the same for other Debian-like distros_ -1. Install dependencies `sudo apt install qttools5-dev qtmultimedia5-dev libqt5svg5-dev libboost-dev libssl-dev libboost-system-dev libboost-filesystem-dev cmake g++` +1. 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++` -### Through Qt Creator +### Compiling through Qt Creator -1. Install C++ IDE Qt Creator `sudo apt install qtcreator` +1. Install C++ IDE Qt Creator by using `sudo apt install qtcreator` 1. Open `chatterino.pro` with Qt Creator and select build ### Manually -1. go into project directory -1. create build folder `mkdir build && cd build` +1. Go into the project directory +1. Create a build folder and go into it (`mkdir build && cd build`) +1. Use one of the options below to compile it -#### Using QMake +### Using CMake -1. `qmake .. && make` +`cmake .. && make` -#### Using CMake +### Using QMake -1. `cmake .. && make` +`qmake .. && make` ## Arch Linux @@ -34,50 +35,47 @@ _most likely works the same for other Debian-like distros_ ### Manually -1. `sudo pacman -S qt5-base qt5-multimedia qt5-svg qt5-tools gst-plugins-ugly gst-plugins-good boost rapidjson pkgconf openssl cmake` -1. go into project directory -1. create build folder `mkdir build && cd build` +1. Install all of the dependencies using `sudo pacman -S qt5-base qt5-multimedia qt5-svg qt5-tools gst-plugins-ugly gst-plugins-good boost rapidjson pkgconf openssl cmake` +1. Go into the project directory +1. Create a build folder and go into it (`mkdir build && cd build`) +1. Use one of the options below to compile it -#### Using QMake +### Using CMake -1. `qmake .. && make` +`cmake .. && make` -#### Using CMake +### Using QMake -1. `cmake .. && make` +`qmake .. && make` ## Fedora 28 and above -_most likely works the same for other Red Hat-like distros. Substitue `dnf` with `yum`._ +_Most likely works the same for other Red Hat-like distros. Substitute `dnf` with `yum`._ -1. `sudo dnf install qt5-qtbase-devel qt5-qtmultimedia-devel qt5-qtsvg-devel libsecret-devel openssl-devel boost-devel cmake` -1. go into project directory -1. create build folder `mkdir build && cd build` - -### Using QMake - -1. `qmake-qt5 .. && make -j$(nproc)` +1. Install all of the dependencies using `sudo dnf install qt5-qtbase-devel qt5-qtmultimedia-devel qt5-qtsvg-devel libsecret-devel openssl-devel boost-devel cmake` +1. Go into the project directory +1. Create a build folder and go into it (`mkdir build && cd build`) +1. Use one of the options below to compile it ### Using CMake -1. `cmake .. && make -j$(nproc)` +`cmake .. && make -j$(nproc)` -### Optional dependencies +### Using QMake -_`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)_ +`qmake-qt5 .. && make -j$(nproc)` ## NixOS 18.09+ -1. enter the development environment with all of the dependencies: `nix-shell -p openssl boost qt5.full pkg-config cmake` -1. go into project directory -1. create build folder `mkdir build && cd build` - -### Using QMake - -1. `qmake .. && make` +1. Enter the development environment with all of the dependencies: `nix-shell -p openssl boost qt5.full pkg-config cmake` +1. Go into the project directory +1. Create a build folder and go into it (`mkdir build && cd build`) +1. Use one of the options below to compile it ### Using CMake -1. `cmake .. && make` +`cmake .. && make` + +### Using QMake + +`qmake .. && make` diff --git a/BUILDING_ON_MAC.md b/BUILDING_ON_MAC.md index 3a6bcb37d..5d4182187 100644 --- a/BUILDING_ON_MAC.md +++ b/BUILDING_ON_MAC.md @@ -4,15 +4,15 @@ #### 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 Utilites -2. Start Xcode, settings -> Locations, activate your Command Line Tools +1. Install Xcode and Xcode Command Line Utilities +2. Start Xcode, go into Settings -> Locations, and 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 -7. Go into project directory -8. Create build folder `mkdir build && cd build` -9. `qmake .. && make` +4. Install the dependencies using `brew install boost openssl rapidjson` +5. Install Qt using `brew install qt` +6. Step 5 should output some directions to add Qt to your path, you will need to do this for qmake +7. Go into the project directory +8. Create a build folder and go into it (`mkdir build && cd build`) +9. Compile using `qmake .. && make` _If you want to use cmake instead of qmake, just replace the above qmake command with cmake_ @@ -21,7 +21,7 @@ If the Project does not build at this point, you might need to add additional Pa `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` diff --git a/BUILDING_ON_WINDOWS.md b/BUILDING_ON_WINDOWS.md index f46387614..a075761f8 100644 --- a/BUILDING_ON_WINDOWS.md +++ b/BUILDING_ON_WINDOWS.md @@ -1,8 +1,8 @@ # 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 2019 @@ -39,12 +39,12 @@ Note: This installation will take about 1.5 GB of disk space. ### 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://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#windows10)) +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.** @@ -82,7 +82,7 @@ Compiling with Breakpad support enables crash reports that can be of use for dev ## 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 `chatterino.pro` 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) 3. Select the profile(s) you want to build with and click "Configure Project". @@ -105,10 +105,10 @@ To produce a standalone package, you need to generate all required files using t 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_15_2_MSVC2019_64bit-Release` +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 `cmd` window and execute: +4. Open a command prompt and execute: 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 @@ -124,9 +124,9 @@ To produce all supplement files for a standalone build, follow these steps (adju 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)). -## Building with CMake +## Using CMake -Open up your terminal with the Visual Studio environment variables, then: +Open up your terminal with the Visual Studio environment variables, then enter the following commands: 1. `mkdir build` 2. `cd build` diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8bd69a762..7135e908b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ # 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 @@ -70,7 +70,7 @@ 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. +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. @@ -122,11 +122,11 @@ void main() { } ``` -Generally the lowest level of requirement should be used e.g. passing `Channel&` instead of `std::shared_ptr&` (aka `ChannelPtr`) if possible. +Generally the lowest level of requirement should be used, e.g. passing `Channel&` instead of `std::shared_ptr&` (aka `ChannelPtr`) if possible. ## Members -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). +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). ```cpp class NamedObject @@ -212,6 +212,6 @@ Keep the element on the stack if possible. If you need a pointer or have complex #### 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` 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` 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.