From c24dc852da4a929f5c25ddeb5c19e71f158b76e9 Mon Sep 17 00:00:00 2001
From: Elliu <elliu@hashi.re>
Date: Thu, 15 Feb 2024 01:16:37 +0900
Subject: [PATCH] MISC: idk

---
 README.md              | 41 ++++++++++++++++++-----------------------
 src/Lib/Ass/Line.hh    |  6 +-----
 src/Lib/Ass/Syl.hh     |  3 +--
 src/Lib/JsonBuilder.hh |  5 +++--
 src/Lib/Utils.hh       |  3 ---
 5 files changed, 23 insertions(+), 35 deletions(-)

diff --git a/README.md b/README.md
index 5b28b7c4..a179e61e 100644
--- a/README.md
+++ b/README.md
@@ -1,38 +1,33 @@
 # Vivy
 
-## Build
+## Prerequisites
+
+- [rust](https://www.rust-lang.org) compiler with version >= 1.70
+- [cmake](https://cmake.org/) at least the version 3.18
+- C++ compiler with [C++17 support](https://en.cppreference.com/w/cpp/17)
+- [mpv](https://mpv.io/) development library
+- [Qt6](https://www.qt.io/) development library: QtCore, QtWidgets, QtOpenGL, QtOpenGLWidgets.
+- The AV libraries: libavutil libavcodec libavformat
+- [cbindgen](https://github.com/mozilla/cbindgen): `cargo install --force cbindgen`
 
-### Using cmake
+## Build
 
 Simply use cmake to build in another folder of the source folder:
 ```
 cmake -Bbuild -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang
 ```
 
-To do a debug build, use the debug switch with cmake:
-`-DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=ON`. Note that
-the last option is here to generate the `compile_commands.json`, you
-should copy it at the root of the project.
-
-### Dependencies
-
-This project depends on cmake as a build system. For dependencies on
-Windows and MacOS, the easier thing to do is grab qtcreator and find a
-way to add the av libraries to it.
-
-- Ubuntu/debian: Vivy depends on Qt5 and libav. On ubuntu install the
-  following packages: `qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools
-  libavutil-dev libavcodec-dev libavformat-dev libmpv-dev cmake clang
-  clang-format libomp-dev`.
-- Arch/Manjaro: TODO!
-- FreeBSD and other toasters: You will need cmake, qt and av dev
-  packages. Set your favorite C++ compiler with `-DCMAKE_CXX_COMPILER`
-  and you're good to go.
+To do a debug build, use the debug switch with cmake: `-DCMAKE_BUILD_TYPE=Debug`. Note that the last
+option is here to generate the `compile_commands.json`, you should copy it at the root of the
+project.
 
 ## Licence
 
-This software is licenced under the LGPL v3.0 or latter.
+The C++ part of this software is licenced under the LGPL v3.0 or latter. The Rust part is under the
+MIT license.
 
 ---
 
-## TODO!
+# TODO!
+
+- Use the rust things for the ASS instead of the C++ thing.
diff --git a/src/Lib/Ass/Line.hh b/src/Lib/Ass/Line.hh
index 1a7bce03..940571eb 100644
--- a/src/Lib/Ass/Line.hh
+++ b/src/Lib/Ass/Line.hh
@@ -27,16 +27,12 @@ class Line final {
 
     QString contentAsText;
 
-    AssFactory *const assFactory;
+    AssFactory *assFactory;
 
 public:
-    //explicit Line(const Line &) = default;
     explicit Line(AssFactory *const, const QString &);
     explicit Line();
     explicit Line(const Line &c)  = default;
-    Line &operator=(const Line &) = delete;
-
-    ~Line() noexcept = default;
 
     void setStart(quint64 s) noexcept;
     void setEnd(quint64 s) noexcept;
diff --git a/src/Lib/Ass/Syl.hh b/src/Lib/Ass/Syl.hh
index 920dba5e..84e8ea8b 100644
--- a/src/Lib/Ass/Syl.hh
+++ b/src/Lib/Ass/Syl.hh
@@ -14,7 +14,7 @@ private:
     quint64 duration{ 0 };
 
 public:
-    Line *const parentLine;
+    Line *parentLine;
 
 public:
     enum class ConstructMode {
@@ -22,7 +22,6 @@ public:
         ReadAssTags // Read ass tags
     };
 
-    //explicit Syl(const Syl &) noexcept = default; // FIXME: define copy contructor
     explicit Syl(Line *const, const QString &,
                  ConstructMode mode = ConstructMode::ReadAssTags) noexcept;
 
diff --git a/src/Lib/JsonBuilder.hh b/src/Lib/JsonBuilder.hh
index 103187e0..9bd1a074 100644
--- a/src/Lib/JsonBuilder.hh
+++ b/src/Lib/JsonBuilder.hh
@@ -20,10 +20,11 @@ struct JsonBuilder final {
     template <PropertyConstViewable T> static QPair<QString, QJsonValue>
     getSubDocumentJson(const QString &name, std::shared_ptr<T> subDocPtr) noexcept
     {
-        if (subDocPtr == nullptr)
+        if (subDocPtr == nullptr) {
             return QPair<QString, QJsonValue>{ name, QJsonValue() };
-        else
+        } else {
             return QPair<QString, QJsonValue>{ name, subDocPtr->getProperties().object() };
+        }
     }
 
 private:
diff --git a/src/Lib/Utils.hh b/src/Lib/Utils.hh
index 3783621e..3da7aae9 100644
--- a/src/Lib/Utils.hh
+++ b/src/Lib/Utils.hh
@@ -58,9 +58,6 @@ using chrono::duration_cast;
 #define VIVY_DEFAULT_MOVE_CTOR(classname) \
     explicit classname(classname &&) noexcept = default; /* Move  */
 
-// QStringLiteral but for regexes
-#define QRegularExpressionLiteral(str) QRegularExpression(QStringLiteral(str))
-
 namespace Vivy
 {
 // Concept for classes that can be viewd inside a property view
-- 
GitLab