From 0959953ba455dd2b81edbaa6ea3251e7745fe723 Mon Sep 17 00:00:00 2001
From: Kubat <mael.martin31@gmail.com>
Date: Thu, 26 Aug 2021 14:34:40 +0200
Subject: [PATCH] MISC: Const-qualify some pointers + init with nullptr some
 shared pointers...

---
 src/Lib/Document/VivyDocument.cc | 2 +-
 src/Lib/Document/VivyDocument.hh | 8 ++++----
 src/UI/VivyDocumentView.cc       | 7 ++-----
 3 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/src/Lib/Document/VivyDocument.cc b/src/Lib/Document/VivyDocument.cc
index e525db39..4c38fc0d 100644
--- a/src/Lib/Document/VivyDocument.cc
+++ b/src/Lib/Document/VivyDocument.cc
@@ -213,7 +213,7 @@ VivyDocument::loadSubDocument(const QString &subName, VivyDocument::Capabilities
 }
 
 bool
-VivyDocument::detectDocumentType(const QFileInfo &file, Capabilities *ableType) noexcept
+VivyDocument::detectDocumentType(const QFileInfo &file, Capabilities *const ableType) noexcept
 {
     Vivy::Utils::DocumentType docType;
     bool rc = Vivy::Utils::detectDocumentType(file, &docType);
diff --git a/src/Lib/Document/VivyDocument.hh b/src/Lib/Document/VivyDocument.hh
index 48086b84..d59bde38 100644
--- a/src/Lib/Document/VivyDocument.hh
+++ b/src/Lib/Document/VivyDocument.hh
@@ -61,11 +61,11 @@ private:
     quint64 documentOptions{ 0 };
 
     /* Links to other files, they're not embeded inside the vivy file */
-    std::shared_ptr<AudioSubDocument> audioDocument{};
-    std::shared_ptr<VideoSubDocument> videoDocument{};
-    std::shared_ptr<AssSubDocument> assDocument{};
+    std::shared_ptr<AudioSubDocument> audioDocument{ nullptr };
+    std::shared_ptr<VideoSubDocument> videoDocument{ nullptr };
+    std::shared_ptr<AssSubDocument> assDocument{ nullptr };
 
-    static bool detectDocumentType(const QFileInfo &file, Capabilities *) noexcept;
+    static bool detectDocumentType(const QFileInfo &file, Capabilities *const) noexcept;
 
     void addDocumentType(Capabilities) noexcept;
     void saveMemoryFile(const QFileInfo &);
diff --git a/src/UI/VivyDocumentView.cc b/src/UI/VivyDocumentView.cc
index 3bbf3a9e..3693fec2 100644
--- a/src/UI/VivyDocumentView.cc
+++ b/src/UI/VivyDocumentView.cc
@@ -21,19 +21,16 @@ VivyDocumentView::VivyDocumentView(std::shared_ptr<VivyDocument> doc, QWidget *p
     : AbstractDocumentView(AbstractDocumentView::Type::Vivy, parent)
     , document(doc)
 {
-    qDebug() << "Create view for document" << doc->getName() << "with capabilities"
-             << doc->getDocumentCapabilitiesString();
+    setDockNestingEnabled(true);
 
     loadAudioView();
     loadVideoView();
     loadAssView();
 
-    setDockNestingEnabled(true);
-
     // Add some actions...
     QAction *openPropertiesAct = new QAction("Open properties", this);
     connect(openPropertiesAct, &QAction::triggered, this, &VivyDocumentView::openProperties);
-    connect(document.get(), &AbstractDocument::documentChanged, this, [=, this]() noexcept -> void {
+    connect(document.get(), &AbstractDocument::documentChanged, this, [=, this]() {
         if (property)
             openProperties();
         emit documentPropertyChanged();
-- 
GitLab