diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index fb12120e..00000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "Common/qt-google-analytics"] - path = Common/qt-google-analytics - url = https://github.com/HSAnet/qt-google-analytics.git diff --git a/Common/qt-google-analytics b/Common/qt-google-analytics deleted file mode 160000 index c1eda356..00000000 --- a/Common/qt-google-analytics +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c1eda35682b4b4c21a313eb8b4670527bf4a6f09 diff --git a/ScreenPlay/CMakeLists.txt b/ScreenPlay/CMakeLists.txt index 44039a0a..f717f648 100644 --- a/ScreenPlay/CMakeLists.txt +++ b/ScreenPlay/CMakeLists.txt @@ -27,7 +27,6 @@ endif() set(src main.cpp app.cpp - ../Common/qt-google-analytics/ganalytics.cpp src/globalvariables.cpp src/createimportvideo.cpp src/installedlistmodel.cpp @@ -46,7 +45,6 @@ set(src set(headers app.h - ../Common/qt-google-analytics/ganalytics.h src/globalvariables.h src/createimportvideo.h src/installedlistmodel.h diff --git a/ScreenPlay/app.cpp b/ScreenPlay/app.cpp index e9aa9ea8..314731c7 100644 --- a/ScreenPlay/app.cpp +++ b/ScreenPlay/app.cpp @@ -54,7 +54,7 @@ App::App() QGuiApplication::setOrganizationName("ScreenPlay"); QGuiApplication::setOrganizationDomain("https://screen-play.app"); QGuiApplication::setApplicationName("ScreenPlay"); - QGuiApplication::setApplicationVersion("0.13.1"); + QGuiApplication::setApplicationVersion("0.13.2"); QGuiApplication::setQuitOnLastWindowClosed(false); QFontDatabase::addApplicationFont(":/assets/fonts/LibreBaskerville-Italic.ttf"); @@ -128,7 +128,6 @@ App::App() // ScreenPlayManager first to check if another ScreenPlay Instace is running m_screenPlayManager = std::make_unique(); m_isAnotherScreenPlayInstanceRunning = m_screenPlayManager->isAnotherScreenPlayInstanceRunning(); - Util::appendToMetricsFile("screenplay_app_constructor", m_continuousIntegrationMetricsTimer.msecsSinceReference()); } /*! @@ -140,8 +139,6 @@ App::App() void App::init() { - Util::appendToMetricsFile("screenplay_app_init", m_continuousIntegrationMetricsTimer.msecsSinceReference()); - using std::make_shared, std::make_unique; // Util should be created as first so we redirect qDebugs etc. into the log @@ -154,13 +151,8 @@ void App::init() m_settings = make_shared(m_globalVariables); m_mainWindowEngine = make_unique(); - // Only create tracker if user did not disallow! + // Only create anonymousTelemetry if user did not disallow! if (m_settings->anonymousTelemetry()) { - m_telemetry = make_shared("UA-152830367-3"); - m_telemetry->setNetworkAccessManager(&m_networkAccessManager); - m_telemetry->setSendInterval(1000); - m_telemetry->startSession(); - m_telemetry->sendEvent("version", QApplication::applicationVersion()); #ifdef Q_OS_WIN sentry_options_t* options = sentry_options_new(); @@ -199,12 +191,10 @@ void App::init() } qmlRegisterSingletonInstance("ScreenPlay", 1, 0, "ScreenPlay", this); - Util::appendToMetricsFile("Screenplay_app_qqmlapplicationengine_load_begin", m_continuousIntegrationMetricsTimer.msecsSinceReference()); m_mainWindowEngine->load(QUrl(QStringLiteral("qrc:/main.qml"))); - Util::appendToMetricsFile("Screenplay_app_qqmlapplicationengine_load_end", m_continuousIntegrationMetricsTimer.msecsSinceReference()); // Must be called last to display a error message on startup by the qml engine - m_screenPlayManager->init(m_globalVariables, m_monitorListModel, m_telemetry, m_settings); + m_screenPlayManager->init(m_globalVariables, m_monitorListModel, m_settings); QObject::connect(m_monitorListModel.get(), &MonitorListModel::monitorConfigurationChanged, m_screenPlayManager.get(), &ScreenPlayManager::removeAllWallpapers); } @@ -214,19 +204,12 @@ QString App::version() const } /*! - \brief Tries to send the telemetry quit event before we call quit ourself. + \brief Calls QApplication quit() and can be used to do additional + tasks before exiting. */ void App::exit() { - if (!m_telemetry) { - QApplication::instance()->quit(); - return; - } else { - // Workaround because we cannot force to send exit event - m_telemetry->setSendInterval(5); - m_telemetry->endSession(); - QTimer::singleShot(150, this, []() { QApplication::instance()->quit(); }); - } + QApplication::instance()->quit(); } /*! diff --git a/ScreenPlay/app.h b/ScreenPlay/app.h index 5d7fc855..6ee17fe1 100644 --- a/ScreenPlay/app.h +++ b/ScreenPlay/app.h @@ -49,7 +49,6 @@ #include #include -#include "ganalytics.h" #include "src/create.h" #include "src/globalvariables.h" #include "src/installedlistfilter.h" @@ -123,12 +122,6 @@ public slots: void exit(); bool loadSteamPlugin(); bool unloadSteamPlugin(); - void setTrackerSendEvent(const QString& category, const QString& page) - { - if (m_telemetry) { - m_telemetry->sendEvent(category, page); - } - } void setGlobalVariables(GlobalVariables* globalVariables) { @@ -238,7 +231,6 @@ private: std::unique_ptr m_screenPlayManager; std::unique_ptr m_util; - std::shared_ptr m_telemetry; std::shared_ptr m_globalVariables; std::shared_ptr m_settings; diff --git a/ScreenPlay/main.cpp b/ScreenPlay/main.cpp index ba4163b2..2808d062 100644 --- a/ScreenPlay/main.cpp +++ b/ScreenPlay/main.cpp @@ -51,18 +51,6 @@ int main(int argc, char* argv[]) QApplication qtGuiApp(argc, argv); - // Benchmarks - if (QGuiApplication::arguments().contains("--benchmark")) { - QFile metricsFile { QGuiApplication::applicationDirPath() + "/metrics.txt" }; - if (metricsFile.exists()) - qInfo() << "Removing old Continuous Integration Metrics Timer: " << metricsFile.remove(); - - QTimer::singleShot(10000, []() { - qInfo() << "Exit ScreenPlay benchmark mode!"; - QGuiApplication::quit(); - }); - } - // Unit tests doctest::Context context; context.setOption("abort-after", 5); // stop test execution after 5 failed assertions diff --git a/ScreenPlay/main.qml b/ScreenPlay/main.qml index 39a41a11..c2e3cdf4 100644 --- a/ScreenPlay/main.qml +++ b/ScreenPlay/main.qml @@ -43,9 +43,6 @@ ApplicationWindow { if (!ScreenPlay.settings.silentStart) { window.show() - ScreenPlay.setTrackerSendEvent("navigation", "Installed") - } else { - ScreenPlay.setTrackerSendEvent("navigation", "Silent") } } diff --git a/ScreenPlay/qml/Common/Slider.qml b/ScreenPlay/qml/Common/Slider.qml index b8fb770b..de0ed887 100644 --- a/ScreenPlay/qml/Common/Slider.qml +++ b/ScreenPlay/qml/Common/Slider.qml @@ -16,7 +16,7 @@ Item { id: txtHeadline text: headline height: 20 - font.pointSize: 10 + font.pointSize: 14 font.family: ScreenPlay.settings.font color: QQCM.Material.primaryTextColor @@ -31,6 +31,7 @@ Item { spacing: 30 anchors { top: txtHeadline.bottom + right: parent.right bottom: parent.bottom left: parent.left diff --git a/ScreenPlay/qml/Community/Community.qml b/ScreenPlay/qml/Community/Community.qml index 947dfbc3..fdbb5dde 100644 --- a/ScreenPlay/qml/Community/Community.qml +++ b/ScreenPlay/qml/Community/Community.qml @@ -32,29 +32,29 @@ Item { CommunityNavItem { text: qsTr("News") - openLink: webModel.get(0).url + openLink: "https://screen-play.app/blog/" icon.source: "qrc:/assets/icons/icon_document.svg" } CommunityNavItem { text: qsTr("Wiki") - openLink: webModel.get(1).url + openLink: "https://kelteseth.gitlab.io/ScreenPlayDocs/" icon.source: "qrc:/assets/icons/icon_help_center.svg" } CommunityNavItem { text: qsTr("Forum") - openLink: webModel.get(2).url + openLink: "https://forum.screen-play.app/" icon.source: "qrc:/assets/icons/icon_forum.svg" } CommunityNavItem { text: qsTr("Issue List") - openLink: webModel.get(3).url + openLink: "https://gitlab.com/kelteseth/ScreenPlay/-/issues" icon.source: "qrc:/assets/icons/icon_report_problem.svg" } CommunityNavItem { text: qsTr("Contribute") - openLink: webModel.get(4).url + openLink: "https://gitlab.com/kelteseth/ScreenPlay#general-contributing" icon.source: "qrc:/assets/icons/icon_supervisor_account.svg" } CommunityNavItem { @@ -134,7 +134,7 @@ Item { Timer { id: timer interval: 200 - onTriggered: webView.url = webModel.get(index).url + onTriggered: webView.url = webModel.get(index +1).url } WebEngineView { diff --git a/ScreenPlay/qml/Create/Wizards/ImportVideoAndConvert/CreateWallpaperInit.qml b/ScreenPlay/qml/Create/Wizards/ImportVideoAndConvert/CreateWallpaperInit.qml index 6652fdcd..1dc24b3e 100644 --- a/ScreenPlay/qml/Create/Wizards/ImportVideoAndConvert/CreateWallpaperInit.qml +++ b/ScreenPlay/qml/Create/Wizards/ImportVideoAndConvert/CreateWallpaperInit.qml @@ -41,47 +41,51 @@ Item { wrapMode: Text.WrapAtWordBoundaryOrAnywhere font.family: ScreenPlay.settings.font } - Text { - id: txtComboboxHeadline - text: qsTr("Set your preffered video codec:") - color: Material.secondaryTextColor - width: parent.width - font.pointSize: 14 - font.family: ScreenPlay.settings.font - } - ComboBox { - id: comboBoxCodec - Layout.preferredWidth: 400 - textRole: "text" - valueRole: "value" - currentIndex: 1 - font.family: ScreenPlay.settings.font - model: ListModel { - id: model - ListElement { - text: "VP8 (Better for older hardware)" - value: Create.VP9 + ColumnLayout { + spacing: 20 + Text { + id: txtComboboxHeadline + text: qsTr("Set your preffered video codec:") + color: Material.primaryTextColor + width: parent.width + font.pointSize: 14 + font.family: ScreenPlay.settings.font + } + ComboBox { + id: comboBoxCodec + Layout.preferredWidth: 400 + textRole: "text" + valueRole: "value" + currentIndex: 1 + font.family: ScreenPlay.settings.font + model: ListModel { + id: model + ListElement { + text: "VP8 (Better for older hardware)" + value: Create.VP9 + } + ListElement { + text: "VP9 (Better for newer hardware 2018+)" + value: Create.VP8 + } + // Import works but the QWebEngine cannot display AV1 :( + // ListElement { + // text: "AV1 (NVidia 3000, AMD 6000 or newer). ULTRA SLOW ENCODING!" + // value: Create.AV1 + // } } - ListElement { - text: "VP9 (Better for newer hardware 2018+)" - value: Create.VP8 - } -// Import works but the QWebEngine cannot display AV1 :( -// ListElement { -// text: "AV1 (NVidia 3000, AMD 6000 or newer). ULTRA SLOW ENCODING!" -// value: Create.AV1 -// } } } + + Common.Slider { id: sliderQuality iconSource: "qrc:/assets/icons/icon_settings.svg" - headline: qsTr( - "Quality slider. Greater value means better quality.") + headline: qsTr("Quality slider. Lower value means better quality.") slider { - from: 4 - value: 50 - to: 63 + from: 63 + value: 22 + to: 0 stepSize: 1 } Layout.preferredWidth: 400 diff --git a/ScreenPlay/qml/Create/Wizards/ImportVideoAndConvert/CreateWallpaperResult.qml b/ScreenPlay/qml/Create/Wizards/ImportVideoAndConvert/CreateWallpaperResult.qml index 06621006..9f1e2a37 100644 --- a/ScreenPlay/qml/Create/Wizards/ImportVideoAndConvert/CreateWallpaperResult.qml +++ b/ScreenPlay/qml/Create/Wizards/ImportVideoAndConvert/CreateWallpaperResult.qml @@ -95,7 +95,6 @@ Item { margins: 10 } onClicked: { - ScreenPlay.setTrackerSendEvent("createWallpaperError",txtFFMPEGDebug.text); ScreenPlay.util.setNavigationActive(true) ScreenPlay.util.setNavigation("Create") } diff --git a/ScreenPlay/qml/Create/Wizards/ImportVideoAndConvert/CreateWallpaperVideoImportConvert.qml b/ScreenPlay/qml/Create/Wizards/ImportVideoAndConvert/CreateWallpaperVideoImportConvert.qml index bd568e25..41d4b017 100644 --- a/ScreenPlay/qml/Create/Wizards/ImportVideoAndConvert/CreateWallpaperVideoImportConvert.qml +++ b/ScreenPlay/qml/Create/Wizards/ImportVideoAndConvert/CreateWallpaperVideoImportConvert.qml @@ -89,7 +89,6 @@ Item { busyIndicator.running = false root.checkCanSave() - ScreenPlay.setTrackerSendEvent("createWallpaperSuccessful", "") break } } diff --git a/ScreenPlay/qml/Create/Wizards/ImportWebm/ImportWebmConvert.qml b/ScreenPlay/qml/Create/Wizards/ImportWebm/ImportWebmConvert.qml index 06c8ebb3..89560d2a 100644 --- a/ScreenPlay/qml/Create/Wizards/ImportWebm/ImportWebmConvert.qml +++ b/ScreenPlay/qml/Create/Wizards/ImportWebm/ImportWebmConvert.qml @@ -88,7 +88,6 @@ Item { busyIndicator.running = false root.checkCanSave() - ScreenPlay.setTrackerSendEvent("createWallpaperSuccessful", "") break } } diff --git a/ScreenPlay/qml/Navigation/Navigation.qml b/ScreenPlay/qml/Navigation/Navigation.qml index 2ba3f686..c6db95dc 100644 --- a/ScreenPlay/qml/Navigation/Navigation.qml +++ b/ScreenPlay/qml/Navigation/Navigation.qml @@ -61,8 +61,6 @@ Rectangle { function onPageChanged(name) { - ScreenPlay.setTrackerSendEvent("navigation", name) - if (!navActive) return diff --git a/ScreenPlay/qml/Navigation/NavigationWallpaperConfiguration.qml b/ScreenPlay/qml/Navigation/NavigationWallpaperConfiguration.qml index ba7ad385..832f2912 100644 --- a/ScreenPlay/qml/Navigation/NavigationWallpaperConfiguration.qml +++ b/ScreenPlay/qml/Navigation/NavigationWallpaperConfiguration.qml @@ -27,8 +27,6 @@ Item { target: ScreenPlay.screenPlayManager function onActiveWallpaperCounterChanged() { rippleEffect.trigger() - ScreenPlay.setTrackerSendEvent("navigation", - "wallpaperConfiguration") } } diff --git a/ScreenPlay/qml/Workshop/Navigation.qml b/ScreenPlay/qml/Workshop/Navigation.qml index 156e567d..d3c3695b 100644 --- a/ScreenPlay/qml/Workshop/Navigation.qml +++ b/ScreenPlay/qml/Workshop/Navigation.qml @@ -6,7 +6,6 @@ import QtGraphicalEffects 1.0 import QtQuick.Controls.Material.impl 2.12 import ScreenPlay.Workshop 1.0 -import ScreenPlay.Workshop.SteamEnums 1.0 import SteamQMLImageProvider 1.0 import ScreenPlay 1.0 diff --git a/ScreenPlay/qml/Workshop/Workshop.qml b/ScreenPlay/qml/Workshop/Workshop.qml index 5718283b..62d25106 100644 --- a/ScreenPlay/qml/Workshop/Workshop.qml +++ b/ScreenPlay/qml/Workshop/Workshop.qml @@ -38,15 +38,14 @@ Item { Component.onCompleted: { if (steamWorkshop.online) { - steamWorkshop.workshopListModel.searchWorkshop( - SteamEnums.K_EUGCQuery_RankedByTrend) + steamWorkshop.searchWorkshop(SteamEnums.K_EUGCQuery_RankedByTrend) } else { popupOffline.open() } } Connections { - target: steamWorkshop.workshopListModel + target: steamWorkshop function onWorkshopSearched() { bannerTxt.text = steamWorkshop.workshopListModel.getBannerText() background.backgroundImage = steamWorkshop.workshopListModel.getBannerUrl() @@ -130,7 +129,7 @@ Item { Item { id: header - height: 440 + height: 350 anchors { top: parent.top topMargin: nav.height @@ -258,7 +257,7 @@ Item { } header: Item { - height: 70 + height: 80 width: gridView.width - gridView.anchors.leftMargin property alias searchField: tiSearch @@ -266,7 +265,7 @@ Item { color: Material.backgroundColor radius: 3 width: parent.width - 10 - height: parent.height + height: 70 anchors.centerIn: parent Item { @@ -279,7 +278,6 @@ Item { leftMargin: 10 } - TextField { id: tiSearch anchors { @@ -289,14 +287,14 @@ Item { left: parent.left leftMargin: 10 } - leftPadding:25 - selectByMouse:true + leftPadding: 25 + selectByMouse: true placeholderText: qsTr("Search for Wallpaper and Widgets...") onTextChanged: timerSearch.restart() Timer { id: timerSearch interval: 500 - onTriggered: steamWorkshop.workshopListModel.searchWorkshopByText( + onTriggered: steamWorkshop.searchWorkshopByText( tiSearch.text) } } @@ -305,22 +303,25 @@ Item { source: "qrc:/assets/icons/icon_search.svg" width: 14 height: width - sourceSize: Qt.size(width,width) + sourceSize: Qt.size(width, width) anchors { left: parent.left leftMargin: 15 - verticalCenter: parent.verticalCenter + bottom: parent.bottom + bottomMargin: 22 } } ToolButton { - id:tb + id: tb enabled: tiSearch.text !== "" anchors { right: parent.right - verticalCenter: parent.verticalCenter + bottom: parent.bottom + bottomMargin: 10 } - text: "X" + icon.source: "qrc:/assets/icons/font-awsome/close.svg" + onClicked: tiSearch.text = "" } } @@ -378,7 +379,7 @@ Item { Layout.preferredHeight: searchWrapper.height font.family: ScreenPlay.settings.font onActivated: { - steamWorkshop.workshopListModel.searchWorkshop( + steamWorkshop.searchWorkshop( cbQuerySort.currentValue) } model: [{ @@ -453,7 +454,7 @@ Item { onClicked: { steamWorkshop.workshopListModel.setCurrentPage( steamWorkshop.workshopListModel.currentPage - 1) - steamWorkshop.workshopListModel.searchWorkshop( + steamWorkshop.searchWorkshop( SteamEnums.K_EUGCQuery_RankedByTrend) } } @@ -474,7 +475,7 @@ Item { onClicked: { steamWorkshop.workshopListModel.setCurrentPage( steamWorkshop.workshopListModel.currentPage + 1) - steamWorkshop.workshopListModel.searchWorkshop( + steamWorkshop.searchWorkshop( SteamEnums.K_EUGCQuery_RankedByTrend) } } diff --git a/ScreenPlay/qml/Workshop/upload/UploadProject.qml b/ScreenPlay/qml/Workshop/upload/UploadProject.qml index e9692e41..5b2f239a 100644 --- a/ScreenPlay/qml/Workshop/upload/UploadProject.qml +++ b/ScreenPlay/qml/Workshop/upload/UploadProject.qml @@ -128,7 +128,6 @@ Popup { id: btnAbort text: qsTr("Abort") onClicked: { - steamWorkshop.uploadListModel.clear() wrapper.requestClosePopup() } @@ -147,7 +146,6 @@ Popup { anchors { right: parent.right bottom: parent.bottom - margins: 10 } @@ -202,8 +200,7 @@ Popup { id: btnFinish text: qsTr("Finish") onClicked: { - steamWorkshop.uploadListModel.clear() - wrapper.requestClosePopup() + root.close() } highlighted: true enabled: false diff --git a/ScreenPlay/qml/Workshop/upload/UploadProjectItem.qml b/ScreenPlay/qml/Workshop/upload/UploadProjectItem.qml index 63df51e7..74c3d0b5 100644 --- a/ScreenPlay/qml/Workshop/upload/UploadProjectItem.qml +++ b/ScreenPlay/qml/Workshop/upload/UploadProjectItem.qml @@ -35,10 +35,13 @@ Page { onSteamStatusChanged: { let errorText switch (steamStatus) { + // Everyting that is not OK is a fail. See steam_qt_enums_generated.h case SteamEnums.K_EResultNone: root.contentItem.state = "uploadComplete" return - // Everyting that is not OK is a fail. See steam_qt_enums_generated.h + case SteamEnums.K_EResultOK: + root.contentItem.state = "uploadComplete" + return case SteamEnums.K_EResultFail: errorText = qsTr("Fail") break @@ -461,7 +464,7 @@ Page { Layout.fillWidth: true Text { text: qsTr("Upload Progress: ") + " " + Math.ceil( - root.progress * 100) + "%" + root.progress) + "%" verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignHCenter wrapMode: Text.WrapAtWordBoundaryOrAnywhere @@ -475,6 +478,7 @@ Page { id: progressBar Layout.fillWidth: true value: root.progress + to: 100 } } } diff --git a/ScreenPlay/src/createimportvideo.cpp b/ScreenPlay/src/createimportvideo.cpp index e9eb7324..3db4ad62 100644 --- a/ScreenPlay/src/createimportvideo.cpp +++ b/ScreenPlay/src/createimportvideo.cpp @@ -609,6 +609,15 @@ bool CreateImportVideo::createWallpaperVideo() if (m_codec == "av1") args.append("libaom-av1"); args.append("-b:v"); + args.append("3000k"); + args.append("-threads"); + args.append(QString::number(QThread::idealThreadCount())); + qInfo() << "threads" << QThread::idealThreadCount() << "m_quality" << m_quality; + args.append("-speed"); + args.append("4"); + args.append("-tile-columns"); + args.append("0"); + args.append("-frame-parallel"); args.append("0"); args.append("-crf"); args.append(QString::number(m_quality)); @@ -643,7 +652,19 @@ bool CreateImportVideo::createWallpaperVideo() if (m_codec == "av1") args.append("libaom-av1"); args.append("-b:v"); + args.append("3000k"); + args.append("-threads"); + args.append(QString::number(QThread::idealThreadCount())); + args.append("-speed"); args.append("0"); + args.append("-tile-columns"); + args.append("0"); + args.append("-frame-parallel"); + args.append("0"); + args.append("-auto-alt-ref"); + args.append("1"); + args.append("-lag-in-frames"); + args.append("25"); args.append("-crf"); args.append(QString::number(m_quality)); args.append("-pass"); diff --git a/ScreenPlay/src/globalvariables.h b/ScreenPlay/src/globalvariables.h index d72a4e7e..e8476c38 100644 --- a/ScreenPlay/src/globalvariables.h +++ b/ScreenPlay/src/globalvariables.h @@ -59,7 +59,7 @@ public: /*! \brief We need to check if there was an error in the Wallpaper/Widgets. - For this we ping it every 1s. + For this we ping it every 3s. */ static const int contentPingAliveIntervalMS = 3000; diff --git a/ScreenPlay/src/installedlistmodel.cpp b/ScreenPlay/src/installedlistmodel.cpp index 3b541e85..5c8c29bd 100644 --- a/ScreenPlay/src/installedlistmodel.cpp +++ b/ScreenPlay/src/installedlistmodel.cpp @@ -161,8 +161,12 @@ void InstalledListModel::loadInstalledContent() int counter = 0; for (const auto& item : list) { + const QString absoluteFilePath = m_globalVariables->localStoragePath().toLocalFile() + "/" + item.baseName() + "/project.json"; - if (auto obj = ScreenPlayUtil::openJsonFileToObject(m_globalVariables->localStoragePath().toLocalFile() + "/" + item.baseName() + "/project.json")) { + if (!QFile::exists(absoluteFilePath)) + continue; + + if (auto obj = ScreenPlayUtil::openJsonFileToObject(absoluteFilePath)) { if (obj->isEmpty()) continue; diff --git a/ScreenPlay/src/screenplaymanager.cpp b/ScreenPlay/src/screenplaymanager.cpp index aa810a92..841b4a44 100644 --- a/ScreenPlay/src/screenplaymanager.cpp +++ b/ScreenPlay/src/screenplaymanager.cpp @@ -75,12 +75,10 @@ bool ScreenPlayManager::checkIsAnotherScreenPlayInstanceRunning() void ScreenPlayManager::init( const std::shared_ptr& globalVariables, const std::shared_ptr& mlm, - const std::shared_ptr& telemetry, const std::shared_ptr& settings) { m_globalVariables = globalVariables; m_monitorListModel = mlm; - m_telemetry = telemetry; m_settings = settings; if (m_settings->desktopEnvironment() == Settings::DesktopEnvironment::KDE) { @@ -120,10 +118,6 @@ bool ScreenPlayManager::createWallpaper( } }); - if (m_telemetry) { - m_telemetry->sendEvent("wallpaper", "start"); - } - QJsonArray monitors; for (const int index : monitorIndex) { monitors.append(index); diff --git a/ScreenPlay/src/screenplaymanager.h b/ScreenPlay/src/screenplaymanager.h index 4550d10b..6e76e86b 100644 --- a/ScreenPlay/src/screenplaymanager.h +++ b/ScreenPlay/src/screenplaymanager.h @@ -41,7 +41,6 @@ #include #include "ScreenPlayUtil/projectfile.h" -#include "ganalytics.h" #include "globalvariables.h" #include "installedlistmodel.h" #include "monitorlistmodel.h" @@ -69,7 +68,6 @@ public: void init( const std::shared_ptr& globalVariables, const std::shared_ptr& mlm, - const std::shared_ptr& telemetry, const std::shared_ptr& settings); int activeWallpaperCounter() const { return m_activeWallpaperCounter; } @@ -181,7 +179,6 @@ private: private: std::shared_ptr m_globalVariables; std::shared_ptr m_monitorListModel; - std::shared_ptr m_telemetry; std::shared_ptr m_settings; std::unique_ptr m_server; std::unique_ptr m_websocketServer; diff --git a/ScreenPlay/src/util.cpp b/ScreenPlay/src/util.cpp index fb0598bb..6188326f 100644 --- a/ScreenPlay/src/util.cpp +++ b/ScreenPlay/src/util.cpp @@ -70,27 +70,6 @@ bool Util::writeJsonObjectToFile(const QString& absoluteFilePath, const QJsonObj return true; } -void Util::appendToMetricsFile(const QString& key, const QVariant& value) -{ - if (!QGuiApplication::arguments().contains("--benchmark")) - return; - - const QString appDir = QGuiApplication::applicationDirPath(); - QFile metricsFile { appDir + "/metrics.txt" }; - - if (!metricsFile.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Append)) { - qWarning() << "Cannot open metrix file:" << appDir << metricsFile.fileName(); - return; - } - - QString text = key + "\t" + value.toString() + "\n"; - QTextStream out(&metricsFile); - out << text; - - metricsFile.flush(); - metricsFile.close(); -} - /*! \brief Opens a native folder window on the given path. Windows and Mac only for now! */ @@ -116,6 +95,11 @@ void Util::openFolderInExplorer(const QString& url) const explorer.startDetached(); } +QString Util::toLocal(const QString& url) +{ + return ScreenPlayUtil::toLocal(url); +} + /*! \brief Loads all content of the legal folder in the qrc into a property string of this class. allLicenseLoaded is emited when loading is finished. diff --git a/ScreenPlay/src/util.h b/ScreenPlay/src/util.h index 3fd4380d..e6406f51 100644 --- a/ScreenPlay/src/util.h +++ b/ScreenPlay/src/util.h @@ -54,6 +54,7 @@ #include #include "globalvariables.h" +#include "ScreenPlayUtil/util.h" #include #include @@ -101,11 +102,11 @@ signals: public slots: void copyToClipboard(const QString& text) const; void openFolderInExplorer(const QString& url) const; + QString toLocal(const QString& url); void requestAllLicenses(); void requestDataProtection(); - static void appendToMetricsFile(const QString& key, const QVariant& value); static void logToGui(QtMsgType type, const QMessageLogContext& context, const QString& msg); static bool writeJsonObjectToFile(const QString& absoluteFilePath, const QJsonObject& object, bool truncate = true); static bool writeSettings(const QJsonObject& obj, const QString& absolutePath); diff --git a/ScreenPlayUtil/src/util.cpp b/ScreenPlayUtil/src/util.cpp index cd8948b3..7bbf6e6b 100644 --- a/ScreenPlayUtil/src/util.cpp +++ b/ScreenPlayUtil/src/util.cpp @@ -65,6 +65,7 @@ std::optional openJsonFileToString(const QString& path) QFile file; file.setFileName(path); if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { + qWarning() << "Unable to open file: " << path << file.errorString(); return std::nullopt; } QString fileContent = file.readAll();