diff --git a/CMakeLists.txt b/CMakeLists.txt index 72ea33271f26e9a5aec319d29a5819f4278e4567..f5d95c0362204d4be714c408673ecb090a1ef1c3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -112,7 +112,7 @@ if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") # Qt generated files... -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-c++98-c++11-c++14-c++17-compat-pedantic -Wno-c++20-compat - -Wno-unsafe-buffer-usage -Wno-unused-parameter + -Wno-unsafe-buffer-usage # Different versions of MPV... -Wno-switch-enum diff --git a/src/Lib/Script/ScriptStore.cc b/src/Lib/Script/ScriptStore.cc index b3e20da77c39576ac5f7720f40248cfc657db92d..1d245bf921cbe7492df370249a779888d72c701a 100644 --- a/src/Lib/Script/ScriptStore.cc +++ b/src/Lib/Script/ScriptStore.cc @@ -38,16 +38,10 @@ ScriptStore::resetLoadedScripts() noexcept logInfo() << "TODO"; } -bool -ScriptStore::executeScript(Uuid id) noexcept -{ - logInfo() << "TODO"; - return false; -} - bool ScriptStore::executeScript(Uuid id, std::shared_ptr<Vivy::VivyDocument> doc) noexcept { - logInfo() << "TODO"; + logInfo() << "TODO: execute script " << VIVY_LOG_QUOTED(id) << " on document " + << VIVY_LOG_QUOTED(doc->getUuid()); return false; } diff --git a/src/Lib/Script/ScriptStore.hh b/src/Lib/Script/ScriptStore.hh index 8e10eabbf3eaa3b04043913d5daed57637d1ec8a..2684d9bbb7b6e7c89f15fbd540ffa5e0cbe30607 100644 --- a/src/Lib/Script/ScriptStore.hh +++ b/src/Lib/Script/ScriptStore.hh @@ -25,7 +25,6 @@ public: void resetLoadedScripts() noexcept; void loadScriptFolder(const QString &folderPath); std::vector<Item> getLoadedScripts() const noexcept; - bool executeScript(Uuid) noexcept; bool executeScript(Uuid, std::shared_ptr<Vivy::VivyDocument>) noexcept; // Get modules from scripts diff --git a/src/UI/MainWindow.cc b/src/UI/MainWindow.cc index d8b741c46616fc82141296c8a2d05c38ee3bfe2a..2b71ba6465dd7f15283379346a5e11e69ddef28b 100644 --- a/src/UI/MainWindow.cc +++ b/src/UI/MainWindow.cc @@ -310,20 +310,10 @@ MainWindow::openDocument() noexcept // Handle the different types here try { - if (fileType == Utils::DocumentType::Vivy) + if (fileType == Utils::DocumentType::Vivy) { addTab(new VivyDocumentView(vivyApp->documentStore->loadDocument(filename), documents)); - - else if (fileType == Utils::DocumentType::VivyScript) { - auto scriptDocument = vivyApp->scriptStore->loadDocument(filename); - const bool rc = vivyApp->scriptStore->executeScript(scriptDocument->getUuid()); - ScriptDocumentView *newView = new ScriptDocumentView(scriptDocument, documents); - - if (!rc) { - logError() << "Failed to execute script document " << VIVY_LOG_QUOTED(filename) - << " with code: " << rc; - } - - addTab(newView); + } else if (fileType == Utils::DocumentType::VivyScript) { + addTab(new ScriptDocumentView(vivyApp->scriptStore->loadDocument(filename), documents)); } } catch (const std::runtime_error &e) { logError() << "Failed to load document " << VIVY_LOG_QUOTED(filename)