diff --git a/CMakeLists.txt b/CMakeLists.txt index 922af58b..d311ec6e 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,13 +36,13 @@ if (${CMAKE_BUILD_TYPE} MATCHES "Debug") # a lot easier, as it removes the need to recompile for each tweak. # CAUTION: Although convenient, this does add a limitation; the debug build can only be run on the same machine # that compiled it. Or a machine that has the Bloom source located in the same place. - # See Paths::compiledResourcesPath() for more. + # See Services::PathService::compiledResourcesPath() for more. add_compile_definitions(BLOOM_COMPILED_RESOURCES_PATH_OVERRIDE="${CMAKE_CURRENT_SOURCE_DIR}") # BLOOM_HOME_DOMAIN_NAME_OVERRIDE can be used to override the domain name used in URLs to the Bloom website. # I (Nav) use this in debug builds, so I can test local changes that involve the Bloom website as well as Bloom # itself. Other users can comment out this override if they don't have a copy of the Bloom website running on their - # local machine. See Paths::homeDomainName() for more. + # local machine. See Services::PathService::homeDomainName() for more. add_compile_definitions(BLOOM_HOME_DOMAIN_NAME_OVERRIDE="http://bloom.local") # CMAKE_BUILD_RPATH needs to point to the local Qt installation, to use Gammaray during development. diff --git a/src/Application.cpp b/src/Application.cpp index 74ad513c..ef3e0e92 100644 --- a/src/Application.cpp +++ b/src/Application.cpp @@ -10,7 +10,7 @@ #include "src/Services/ProcessService.hpp" #include "src/Logger/Logger.hpp" -#include "src/Helpers/Paths.hpp" +#include "src/Services/PathService.hpp" #include "src/Exceptions/InvalidConfig.hpp" @@ -178,7 +178,7 @@ namespace Bloom } void Application::loadProjectSettings() { - const auto projectSettingsPath = Paths::projectSettingsPath(); + const auto projectSettingsPath = Services::PathService::projectSettingsPath(); auto jsonSettingsFile = QFile(QString::fromStdString(projectSettingsPath)); if (jsonSettingsFile.exists()) { @@ -209,12 +209,12 @@ namespace Bloom return; } - const auto projectSettingsPath = Paths::projectSettingsPath(); + const auto projectSettingsPath = Services::PathService::projectSettingsPath(); auto jsonSettingsFile = QFile(QString::fromStdString(projectSettingsPath)); Logger::debug("Saving project settings to " + projectSettingsPath); - QDir().mkpath(QString::fromStdString(Paths::projectSettingsDirPath())); + QDir().mkpath(QString::fromStdString(Services::PathService::projectSettingsDirPath())); try { const auto jsonDocument = QJsonDocument(this->projectSettings->toJson()); @@ -236,11 +236,11 @@ namespace Bloom } void Application::loadProjectConfiguration() { - auto configFile = QFile(QString::fromStdString(Paths::projectConfigPath())); + auto configFile = QFile(QString::fromStdString(Services::PathService::projectConfigPath())); if (!configFile.exists()) { // Try looking for the old bloom.json config file - configFile.setFileName(QString::fromStdString(Paths::projectDirPath()) + "/bloom.json"); + configFile.setFileName(QString::fromStdString(Services::PathService::projectDirPath()) + "/bloom.json"); if (configFile.exists()) { Logger::warning( @@ -252,14 +252,14 @@ namespace Bloom } else { throw InvalidConfig( - "Bloom configuration file (bloom.yaml) not found. Working directory: " + Paths::projectDirPath() + "Bloom configuration file (bloom.yaml) not found. Working directory: " + Services::PathService::projectDirPath() ); } } if (!configFile.open(QIODevice::ReadOnly | QIODevice::Text)) { throw InvalidConfig( - "Failed to open Bloom configuration file. Working directory: " + Paths::projectDirPath() + "Failed to open Bloom configuration file. Working directory: " + Services::PathService::projectDirPath() ); } @@ -312,12 +312,12 @@ namespace Bloom Logger::silence(); // The file help.txt is included in Bloom's binary, as a resource. See the root-level CMakeLists.txt for more. - auto helpFile = QFile(QString::fromStdString(Paths::compiledResourcesPath() + "/resources/help.txt")); + auto helpFile = QFile(QString::fromStdString(Services::PathService::compiledResourcesPath() + "/resources/help.txt")); if (!helpFile.open(QIODevice::ReadOnly)) { // This should never happen - if it does, something has gone very wrong throw Exception( - "Failed to open help file - please report this issue at " + Paths::homeDomainName() + "Failed to open help file - please report this issue at " + Services::PathService::homeDomainName() + "/report-issue" ); } @@ -336,7 +336,7 @@ namespace Bloom std::cout << "DEBUG BUILD - Compilation timestamp: " << __DATE__ << " " << __TIME__ << "\n"; #endif - std::cout << Paths::homeDomainName() + "/\n"; + std::cout << Services::PathService::homeDomainName() + "/\n"; std::cout << "Nav Mohammed\n"; return EXIT_SUCCESS; } @@ -357,7 +357,7 @@ namespace Bloom } int Application::initProject() { - auto configFile = QFile(QString::fromStdString(Paths::projectConfigPath())); + auto configFile = QFile(QString::fromStdString(Services::PathService::projectConfigPath())); if (configFile.exists()) { throw Exception("Bloom configuration file (bloom.yaml) already exists in working directory."); @@ -370,13 +370,13 @@ namespace Bloom * We simply copy the template file into the user's working directory. */ auto templateConfigFile = QFile( - QString::fromStdString(Paths::compiledResourcesPath()+ "/resources/bloom.template.yaml") + QString::fromStdString(Services::PathService::compiledResourcesPath()+ "/resources/bloom.template.yaml") ); if (!templateConfigFile.open(QIODevice::ReadOnly)) { throw Exception( "Failed to open template configuration file - please report this issue at " - + Paths::homeDomainName() + "/report-issue" + + Services::PathService::homeDomainName() + "/report-issue" ); } diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a299bb78..06549cfa 100755 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -6,11 +6,11 @@ target_sources( # Services ${CMAKE_CURRENT_SOURCE_DIR}/Services/TargetControllerService.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/Services/PathService.cpp ${CMAKE_CURRENT_SOURCE_DIR}/Services/ProcessService.cpp # Helpers & other ${CMAKE_CURRENT_SOURCE_DIR}/Logger/Logger.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/Helpers/Paths.cpp ${CMAKE_CURRENT_SOURCE_DIR}/Helpers/String.cpp ${CMAKE_CURRENT_SOURCE_DIR}/Helpers/EpollInstance.cpp ${CMAKE_CURRENT_SOURCE_DIR}/Helpers/EventFdNotifier.cpp diff --git a/src/DebugServer/Gdb/CommandPackets/BloomVersion.cpp b/src/DebugServer/Gdb/CommandPackets/BloomVersion.cpp index b7463538..9325bcc2 100644 --- a/src/DebugServer/Gdb/CommandPackets/BloomVersion.cpp +++ b/src/DebugServer/Gdb/CommandPackets/BloomVersion.cpp @@ -7,7 +7,7 @@ #include "src/Application.hpp" -#include "src/Helpers/Paths.hpp" +#include "src/Services/PathService.hpp" #include "src/Helpers/String.hpp" #include "src/Logger/Logger.hpp" @@ -32,7 +32,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets debugSession.connection.writePacket(ResponsePacket(String::toHex( std::string( "Bloom v" + Application::VERSION.toString() + "\n" - + Paths::homeDomainName() + "\n" + + Services::PathService::homeDomainName() + "\n" + "Nav Mohammed\n" ) ))); diff --git a/src/DebugServer/Gdb/CommandPackets/GenerateSvd.cpp b/src/DebugServer/Gdb/CommandPackets/GenerateSvd.cpp index d2ec5fc9..034b0041 100644 --- a/src/DebugServer/Gdb/CommandPackets/GenerateSvd.cpp +++ b/src/DebugServer/Gdb/CommandPackets/GenerateSvd.cpp @@ -9,7 +9,7 @@ #include "src/Targets/TargetMemory.hpp" #include "src/Application.hpp" -#include "src/Helpers/Paths.hpp" +#include "src/Services/PathService.hpp" #include "src/Helpers/String.hpp" #include "src/Logger/Logger.hpp" @@ -46,7 +46,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets return; } - const auto svdOutputFilePath = Paths::projectDirPath() + "/" + targetDescriptor.name + ".svd"; + const auto svdOutputFilePath = Services::PathService::projectDirPath() + "/" + targetDescriptor.name + ".svd"; auto outputFile = QFile(QString::fromStdString(svdOutputFilePath)); if (!outputFile.open(QIODevice::ReadWrite | QIODevice::Truncate | QIODevice::Text)) { @@ -102,7 +102,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets deviceElement.setAttribute("xmlns:xs", "http://www.w3.org/2001/XMLSchema-instance"); deviceElement.setAttribute( "xs:noNamespaceSchemaLocation", - QString::fromStdString(Paths::homeDomainName() + "/assets/svd-schema.xsd") + QString::fromStdString(Services::PathService::homeDomainName() + "/assets/svd-schema.xsd") ); deviceElement.appendChild(createElement("vendor", QString::fromStdString(targetDescriptor.vendorName))); diff --git a/src/DebugServer/Gdb/CommandPackets/HelpMonitorInfo.cpp b/src/DebugServer/Gdb/CommandPackets/HelpMonitorInfo.cpp index fd16c901..a65c437f 100644 --- a/src/DebugServer/Gdb/CommandPackets/HelpMonitorInfo.cpp +++ b/src/DebugServer/Gdb/CommandPackets/HelpMonitorInfo.cpp @@ -6,7 +6,7 @@ #include "src/DebugServer/Gdb/ResponsePackets/ErrorResponsePacket.hpp" #include "src/DebugServer/Gdb/ResponsePackets/ResponsePacket.hpp" -#include "src/Helpers/Paths.hpp" +#include "src/Services/PathService.hpp" #include "src/Helpers/String.hpp" #include "src/Logger/Logger.hpp" @@ -35,13 +35,13 @@ namespace Bloom::DebugServer::Gdb::CommandPackets */ auto helpFile = QFile( QString::fromStdString( - Paths::compiledResourcesPath() + "/src/DebugServer/Gdb/Resources/GdbHelpMonitorInfo.txt" + Services::PathService::compiledResourcesPath() + "/src/DebugServer/Gdb/Resources/GdbHelpMonitorInfo.txt" ) ); if (!helpFile.open(QIODevice::ReadOnly)) { throw Exception( - "Failed to open GDB monitor info help file - please report this issue at " + Paths::homeDomainName() + "Failed to open GDB monitor info help file - please report this issue at " + Services::PathService::homeDomainName() + "/report-issue" ); } diff --git a/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.cpp b/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.cpp index 8133bbe5..dee968ea 100644 --- a/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.cpp +++ b/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.cpp @@ -3,9 +3,9 @@ #include #include -#include "src/Logger/Logger.hpp" -#include "src/Helpers/Paths.hpp" +#include "src/Services/PathService.hpp" #include "src/Helpers/String.hpp" +#include "src/Logger/Logger.hpp" #include "src/Exceptions/InvalidConfig.hpp" #include "src/TargetController/Exceptions/DeviceInitializationFailure.hpp" @@ -272,7 +272,7 @@ namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr throw DebugWirePhysicalInterfaceError( "Failed to activate the debugWire physical interface - check target connection. " "If the target was recently programmed via ISP, try cycling the target power. See " - + Paths::homeDomainName() + "/docs/debugging-avr-debugwire for more information." + + Services::PathService::homeDomainName() + "/docs/debugging-avr-debugwire for more information." ); } diff --git a/src/Insight/CMakeLists.txt b/src/Insight/CMakeLists.txt index 26d9f0b7..a9f4f991 100755 --- a/src/Insight/CMakeLists.txt +++ b/src/Insight/CMakeLists.txt @@ -85,6 +85,7 @@ target_sources( ${CMAKE_CURRENT_SOURCE_DIR}/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/SnapshotManager/SnapshotManager.cpp ${CMAKE_CURRENT_SOURCE_DIR}/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/SnapshotManager/MemorySnapshotItem.cpp ${CMAKE_CURRENT_SOURCE_DIR}/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/SnapshotManager/CreateSnapshotWindow/CreateSnapshotWindow.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/SnapshotManager/SnapshotViewer/SnapshotViewer.cpp # Memory region manager window ${CMAKE_CURRENT_SOURCE_DIR}/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemoryRegionManager/MemoryRegionManagerWindow.cpp @@ -110,6 +111,7 @@ qt_add_resources( "./UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/UiFiles/HexViewerWidget.ui" "./UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/SnapshotManager/UiFiles/SnapshotManager.ui" "./UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/SnapshotManager/CreateSnapshotWindow/UiFiles/CreateSnapshotWindow.ui" + "./UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/SnapshotManager/SnapshotViewer/UiFiles/SnapshotViewer.ui" "./UserInterfaces/InsightWindow/Images/bloom-icon.svg" "./UserInterfaces/InsightWindow/Images/RAM.svg" "./UserInterfaces/InsightWindow/Images/refresh.svg" diff --git a/src/Insight/Insight.cpp b/src/Insight/Insight.cpp index 0e737a73..49b5c664 100644 --- a/src/Insight/Insight.cpp +++ b/src/Insight/Insight.cpp @@ -9,7 +9,7 @@ #include #include -#include "src/Helpers/Paths.hpp" +#include "src/Services/PathService.hpp" #include "src/Logger/Logger.hpp" #include "UserInterfaces/InsightWindow/BloomProxyStyle.hpp" @@ -39,7 +39,11 @@ namespace Bloom ( QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts, true), #ifndef BLOOM_DEBUG_BUILD +<<<<<<< HEAD QCoreApplication::addLibraryPath(QString::fromStdString(Paths::applicationDirPath() + "/../plugins")), +======= + QCoreApplication::addLibraryPath(QString::fromStdString(Services::PathService::applicationDirPath() + "/plugins")), +>>>>>>> 0fea8bc1 (Moved Paths helper functions to service class) #endif QApplication(this->qtApplicationArgc, this->qtApplicationArgv.data()) ) @@ -107,7 +111,7 @@ namespace Bloom auto globalStylesheet = QFile( QString::fromStdString( - Paths::compiledResourcesPath() + "/src/Insight/UserInterfaces/InsightWindow/Stylesheets/Global.qss" + Services::PathService::compiledResourcesPath() + "/src/Insight/UserInterfaces/InsightWindow/Stylesheets/Global.qss" ) ); @@ -125,46 +129,46 @@ namespace Bloom // Load Ubuntu fonts QFontDatabase::addApplicationFont( - QString::fromStdString(Paths::resourcesDirPath() + "/fonts/Ubuntu/Ubuntu-B.ttf") + QString::fromStdString(Services::PathService::resourcesDirPath() + "/fonts/Ubuntu/Ubuntu-B.ttf") ); QFontDatabase::addApplicationFont( - QString::fromStdString(Paths::resourcesDirPath() + "/fonts/Ubuntu/Ubuntu-BI.ttf") + QString::fromStdString(Services::PathService::resourcesDirPath() + "/fonts/Ubuntu/Ubuntu-BI.ttf") ); QFontDatabase::addApplicationFont( - QString::fromStdString(Paths::resourcesDirPath() + "/fonts/Ubuntu/Ubuntu-C.ttf") + QString::fromStdString(Services::PathService::resourcesDirPath() + "/fonts/Ubuntu/Ubuntu-C.ttf") ); QFontDatabase::addApplicationFont( - QString::fromStdString(Paths::resourcesDirPath() + "/fonts/Ubuntu/Ubuntu-L.ttf") + QString::fromStdString(Services::PathService::resourcesDirPath() + "/fonts/Ubuntu/Ubuntu-L.ttf") ); QFontDatabase::addApplicationFont( - QString::fromStdString(Paths::resourcesDirPath() + "/fonts/Ubuntu/Ubuntu-LI.ttf") + QString::fromStdString(Services::PathService::resourcesDirPath() + "/fonts/Ubuntu/Ubuntu-LI.ttf") ); QFontDatabase::addApplicationFont( - QString::fromStdString(Paths::resourcesDirPath() + "/fonts/Ubuntu/Ubuntu-M.ttf") + QString::fromStdString(Services::PathService::resourcesDirPath() + "/fonts/Ubuntu/Ubuntu-M.ttf") ); QFontDatabase::addApplicationFont( - QString::fromStdString(Paths::resourcesDirPath() + "/fonts/Ubuntu/Ubuntu-MI.ttf") + QString::fromStdString(Services::PathService::resourcesDirPath() + "/fonts/Ubuntu/Ubuntu-MI.ttf") ); QFontDatabase::addApplicationFont( - QString::fromStdString(Paths::resourcesDirPath() + "/fonts/Ubuntu/UbuntuMono-B.ttf") + QString::fromStdString(Services::PathService::resourcesDirPath() + "/fonts/Ubuntu/UbuntuMono-B.ttf") ); QFontDatabase::addApplicationFont( - QString::fromStdString(Paths::resourcesDirPath() + "/fonts/Ubuntu/UbuntuMono-BI.ttf") + QString::fromStdString(Services::PathService::resourcesDirPath() + "/fonts/Ubuntu/UbuntuMono-BI.ttf") ); QFontDatabase::addApplicationFont( - QString::fromStdString(Paths::resourcesDirPath() + "/fonts/Ubuntu/UbuntuMono-R.ttf") + QString::fromStdString(Services::PathService::resourcesDirPath() + "/fonts/Ubuntu/UbuntuMono-R.ttf") ); QFontDatabase::addApplicationFont( - QString::fromStdString(Paths::resourcesDirPath() + "/fonts/Ubuntu/UbuntuMono-RI.ttf") + QString::fromStdString(Services::PathService::resourcesDirPath() + "/fonts/Ubuntu/UbuntuMono-RI.ttf") ); QFontDatabase::addApplicationFont( - QString::fromStdString(Paths::resourcesDirPath() + "/fonts/Ubuntu/Ubuntu-R.ttf") + QString::fromStdString(Services::PathService::resourcesDirPath() + "/fonts/Ubuntu/Ubuntu-R.ttf") ); QFontDatabase::addApplicationFont( - QString::fromStdString(Paths::resourcesDirPath() + "/fonts/Ubuntu/Ubuntu-RI.ttf") + QString::fromStdString(Services::PathService::resourcesDirPath() + "/fonts/Ubuntu/Ubuntu-RI.ttf") ); QFontDatabase::addApplicationFont( - QString::fromStdString(Paths::resourcesDirPath() + "/fonts/Ubuntu/Ubuntu-Th.ttf") + QString::fromStdString(Services::PathService::resourcesDirPath() + "/fonts/Ubuntu/Ubuntu-Th.ttf") ); /* @@ -238,7 +242,7 @@ namespace Bloom const auto currentVersionNumber = Application::VERSION; auto* networkAccessManager = new QNetworkAccessManager(this); - auto queryVersionEndpointUrl = QUrl(QString::fromStdString(Paths::homeDomainName() + "/latest-version")); + auto queryVersionEndpointUrl = QUrl(QString::fromStdString(Services::PathService::homeDomainName() + "/latest-version")); queryVersionEndpointUrl.setScheme("http"); queryVersionEndpointUrl.setQuery(QUrlQuery({ {"currentVersionNumber", QString::fromStdString(currentVersionNumber.toString())} @@ -255,7 +259,7 @@ namespace Bloom if (latestVersionNumber > currentVersionNumber) { Logger::warning( "Bloom v" + latestVersionNumber.toString() - + " is available to download - upgrade via " + Paths::homeDomainName() + + " is available to download - upgrade via " + Services::PathService::homeDomainName() ); } } diff --git a/src/Insight/Insight.hpp b/src/Insight/Insight.hpp index f1ab531e..2298319a 100644 --- a/src/Insight/Insight.hpp +++ b/src/Insight/Insight.hpp @@ -9,7 +9,7 @@ #include #include "src/Helpers/Thread.hpp" -#include "src/Helpers/Paths.hpp" +#include "src/Services/PathService.hpp" #include "src/ProjectConfig.hpp" #include "src/ProjectSettings.hpp" diff --git a/src/Insight/InsightWorker/Tasks/CaptureMemorySnapshot.cpp b/src/Insight/InsightWorker/Tasks/CaptureMemorySnapshot.cpp index ad6b4a03..c8498cb7 100644 --- a/src/Insight/InsightWorker/Tasks/CaptureMemorySnapshot.cpp +++ b/src/Insight/InsightWorker/Tasks/CaptureMemorySnapshot.cpp @@ -4,7 +4,7 @@ #include #include -#include "src/Helpers/Paths.hpp" +#include "src/Services/PathService.hpp" #include "src/Helpers/EnumToStringMappings.hpp" #include "src/Logger/Logger.hpp" @@ -83,7 +83,7 @@ namespace Bloom std::move(this->excludedRegions) ); - const auto snapshotDirPath = QString::fromStdString(Paths::projectSettingsDirPath()) + const auto snapshotDirPath = QString::fromStdString(Services::PathService::projectSettingsDirPath()) + "/memory_snapshots/" + EnumToStringMappings::targetMemoryTypes.at(snapshot.memoryType); QDir().mkpath(snapshotDirPath); diff --git a/src/Insight/InsightWorker/Tasks/RetrieveMemorySnapshots.cpp b/src/Insight/InsightWorker/Tasks/RetrieveMemorySnapshots.cpp index 8399f680..6a9347e4 100644 --- a/src/Insight/InsightWorker/Tasks/RetrieveMemorySnapshots.cpp +++ b/src/Insight/InsightWorker/Tasks/RetrieveMemorySnapshots.cpp @@ -5,7 +5,7 @@ #include #include -#include "src/Helpers/Paths.hpp" +#include "src/Services/PathService.hpp" #include "src/Helpers/EnumToStringMappings.hpp" #include "src/Exceptions/Exception.hpp" #include "src/Logger/Logger.hpp" @@ -23,7 +23,7 @@ namespace Bloom } std::vector RetrieveMemorySnapshots::getSnapshots(Targets::TargetMemoryType memoryType) { - auto snapshotDir = QDir(QString::fromStdString(Paths::projectSettingsDirPath()) + auto snapshotDir = QDir(QString::fromStdString(Services::PathService::projectSettingsDirPath()) + "/memory_snapshots/" + EnumToStringMappings::targetMemoryTypes.at(memoryType)); if (!snapshotDir.exists()) { diff --git a/src/Insight/UserInterfaces/InsightWindow/AboutWindow.cpp b/src/Insight/UserInterfaces/InsightWindow/AboutWindow.cpp index 2a2f4186..ce445b78 100644 --- a/src/Insight/UserInterfaces/InsightWindow/AboutWindow.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/AboutWindow.cpp @@ -5,7 +5,7 @@ #include "src/Insight/UserInterfaces/InsightWindow/Widgets/Label.hpp" #include "src/Exceptions/Exception.hpp" -#include "src/Helpers/Paths.hpp" +#include "src/Services/PathService.hpp" #include "src/Application.hpp" namespace Bloom @@ -14,12 +14,12 @@ namespace Bloom AboutWindow::AboutWindow(QWidget* parent): QObject(parent) { auto aboutWindowUiFile = QFile(QString::fromStdString( - Paths::compiledResourcesPath() + Services::PathService::compiledResourcesPath() + "/src/Insight/UserInterfaces/InsightWindow/UiFiles/AboutWindow.ui" ) ); auto aboutWindowStylesheet = QFile(QString::fromStdString( - Paths::compiledResourcesPath() + Services::PathService::compiledResourcesPath() + "/src/Insight/UserInterfaces/InsightWindow/Stylesheets/AboutWindow.qss" ) ); diff --git a/src/Insight/UserInterfaces/InsightWindow/InsightWindow.cpp b/src/Insight/UserInterfaces/InsightWindow/InsightWindow.cpp index dd3aab5a..4b6a7b5e 100644 --- a/src/Insight/UserInterfaces/InsightWindow/InsightWindow.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/InsightWindow.cpp @@ -12,7 +12,7 @@ #include "src/Logger/Logger.hpp" #include "src/Exceptions/Exception.hpp" -#include "src/Helpers/Paths.hpp" +#include "src/Services/PathService.hpp" #include "src/Targets/TargetMemory.hpp" @@ -60,12 +60,12 @@ namespace Bloom } auto mainWindowUiFile = QFile( - QString::fromStdString(Paths::compiledResourcesPath() + QString::fromStdString(Services::PathService::compiledResourcesPath() + "/src/Insight/UserInterfaces/InsightWindow/UiFiles/InsightWindow.ui" ) ); auto mainWindowStylesheet = QFile( - QString::fromStdString(Paths::compiledResourcesPath() + QString::fromStdString(Services::PathService::compiledResourcesPath() + "/src/Insight/UserInterfaces/InsightWindow/Stylesheets/InsightWindow.qss" ) ); @@ -86,7 +86,7 @@ namespace Bloom mainWindowStylesheet.close(); QApplication::setWindowIcon(QIcon( - QString::fromStdString(Paths::compiledResourcesPath() + QString::fromStdString(Services::PathService::compiledResourcesPath() + "/src/Insight/UserInterfaces/InsightWindow/Images/bloom-icon.svg" ) )); @@ -937,7 +937,7 @@ namespace Bloom } void InsightWindow::openReportIssuesUrl() { - auto url = QUrl(QString::fromStdString(Paths::homeDomainName() + "/report-issue")); + auto url = QUrl(QString::fromStdString(Services::PathService::homeDomainName() + "/report-issue")); /* * The https://bloom.oscillate.io/report-issue URL just redirects to the Bloom GitHub issue page. * @@ -963,7 +963,7 @@ namespace Bloom void InsightWindow::openGettingStartedUrl() { QDesktopServices::openUrl( - QUrl(QString::fromStdString(Paths::homeDomainName() + "/docs/getting-started")) + QUrl(QString::fromStdString(Services::PathService::homeDomainName() + "/docs/getting-started")) ); } diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/ErrorDialogue/ErrorDialogue.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/ErrorDialogue/ErrorDialogue.cpp index 716843e0..fe5dfd59 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/ErrorDialogue/ErrorDialogue.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/ErrorDialogue/ErrorDialogue.cpp @@ -4,7 +4,7 @@ #include #include "src/Insight/UserInterfaces/InsightWindow/UiLoader.hpp" -#include "src/Helpers/Paths.hpp" +#include "src/Services/PathService.hpp" #include "src/Exceptions/Exception.hpp" namespace Bloom::Widgets @@ -23,13 +23,13 @@ namespace Bloom::Widgets this->setWindowTitle(windowTitle); auto dialogueUiFile = QFile( - QString::fromStdString(Paths::compiledResourcesPath() + QString::fromStdString(Services::PathService::compiledResourcesPath() + "/src/Insight/UserInterfaces/InsightWindow/Widgets/ErrorDialogue/UiFiles/ErrorDialogue.ui" ) ); auto dialogueStylesheet = QFile( - QString::fromStdString(Paths::compiledResourcesPath() + QString::fromStdString(Services::PathService::compiledResourcesPath() + "/src/Insight/UserInterfaces/InsightWindow/Widgets/ErrorDialogue/Stylesheets/ErrorDialogue.qss" ) ); diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/HexViewerWidget.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/HexViewerWidget.cpp index fdaea9ee..113c8244 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/HexViewerWidget.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/HexViewerWidget.cpp @@ -5,7 +5,7 @@ #include "src/Insight/UserInterfaces/InsightWindow/UiLoader.hpp" #include "src/Insight/InsightSignals.hpp" -#include "src/Helpers/Paths.hpp" +#include "src/Services/PathService.hpp" #include "src/Exceptions/Exception.hpp" namespace Bloom::Widgets @@ -31,7 +31,7 @@ namespace Bloom::Widgets this->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); auto widgetUiFile = QFile( - QString::fromStdString(Paths::compiledResourcesPath() + QString::fromStdString(Services::PathService::compiledResourcesPath() + "/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget" + "/UiFiles/HexViewerWidget.ui" ) diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemoryRegionManager/ExcludedRegionItem.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemoryRegionManager/ExcludedRegionItem.cpp index 54780228..c8d7e385 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemoryRegionManager/ExcludedRegionItem.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemoryRegionManager/ExcludedRegionItem.cpp @@ -2,7 +2,7 @@ #include -#include "src/Helpers/Paths.hpp" +#include "src/Services/PathService.hpp" #include "src/Exceptions/Exception.hpp" #include "src/Insight/UserInterfaces/InsightWindow/UiLoader.hpp" @@ -16,7 +16,7 @@ namespace Bloom::Widgets : memoryRegion(region), RegionItem(region, memoryDescriptor, parent) { auto formUiFile = QFile( - QString::fromStdString(Paths::compiledResourcesPath() + QString::fromStdString(Services::PathService::compiledResourcesPath() + "/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane" + "/MemoryRegionManager/UiFiles/ExcludedMemoryRegionForm.ui" ) diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemoryRegionManager/FocusedRegionItem.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemoryRegionManager/FocusedRegionItem.cpp index 860dc118..34d11a38 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemoryRegionManager/FocusedRegionItem.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemoryRegionManager/FocusedRegionItem.cpp @@ -2,7 +2,7 @@ #include -#include "src/Helpers/Paths.hpp" +#include "src/Services/PathService.hpp" #include "src/Exceptions/Exception.hpp" #include "src/Insight/UserInterfaces/InsightWindow/UiLoader.hpp" @@ -18,7 +18,7 @@ namespace Bloom::Widgets : memoryRegion(region), RegionItem(region, memoryDescriptor, parent) { auto formUiFile = QFile( - QString::fromStdString(Paths::compiledResourcesPath() + QString::fromStdString(Services::PathService::compiledResourcesPath() + "/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane" + "/MemoryRegionManager/UiFiles/FocusedMemoryRegionForm.ui" ) diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemoryRegionManager/MemoryRegionManagerWindow.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemoryRegionManager/MemoryRegionManagerWindow.cpp index ec9d8b51..73012e24 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemoryRegionManager/MemoryRegionManagerWindow.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemoryRegionManager/MemoryRegionManagerWindow.cpp @@ -7,7 +7,7 @@ #include "src/Insight/UserInterfaces/InsightWindow/UiLoader.hpp" #include "src/Insight/UserInterfaces/InsightWindow/Widgets/ErrorDialogue/ErrorDialogue.hpp" -#include "src/Helpers/Paths.hpp" +#include "src/Services/PathService.hpp" #include "src/Exceptions/Exception.hpp" namespace Bloom::Widgets @@ -33,14 +33,14 @@ namespace Bloom::Widgets ); auto windowUiFile = QFile( - QString::fromStdString(Paths::compiledResourcesPath() + QString::fromStdString(Services::PathService::compiledResourcesPath() + "/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane" + "/MemoryRegionManager/UiFiles/MemoryRegionManagerWindow.ui" ) ); auto windowStylesheet = QFile( - QString::fromStdString(Paths::compiledResourcesPath() + QString::fromStdString(Services::PathService::compiledResourcesPath() + "/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane" + "/MemoryRegionManager/Stylesheets/MemoryRegionManagerWindow.qss" ) @@ -406,7 +406,7 @@ namespace Bloom::Widgets void MemoryRegionManagerWindow::openHelpPage() { QDesktopServices::openUrl( - QUrl(QString::fromStdString(Paths::homeDomainName() + "/docs/manage-memory-regions")) + QUrl(QString::fromStdString(Services::PathService::homeDomainName() + "/docs/manage-memory-regions")) ); } } diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/SnapshotManager/CreateSnapshotWindow/CreateSnapshotWindow.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/SnapshotManager/CreateSnapshotWindow/CreateSnapshotWindow.cpp index e91743de..b8c467a9 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/SnapshotManager/CreateSnapshotWindow/CreateSnapshotWindow.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/SnapshotManager/CreateSnapshotWindow/CreateSnapshotWindow.cpp @@ -8,7 +8,7 @@ #include "src/Insight/InsightSignals.hpp" -#include "src/Helpers/Paths.hpp" +#include "src/Services/PathService.hpp" #include "src/Exceptions/Exception.hpp" namespace Bloom::Widgets @@ -32,7 +32,7 @@ namespace Bloom::Widgets ); auto windowUiFile = QFile( - QString::fromStdString(Paths::compiledResourcesPath() + QString::fromStdString(Services::PathService::compiledResourcesPath() + "/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane" + "/SnapshotManager/CreateSnapshotWindow/UiFiles/CreateSnapshotWindow.ui" ) diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/SnapshotManager/SnapshotManager.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/SnapshotManager/SnapshotManager.cpp index 2e60e2e9..c44c8323 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/SnapshotManager/SnapshotManager.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/SnapshotManager/SnapshotManager.cpp @@ -9,7 +9,7 @@ #include "src/Insight/InsightWorker/Tasks/CaptureMemorySnapshot.hpp" #include "src/Insight/InsightWorker/InsightWorker.hpp" -#include "src/Helpers/Paths.hpp" +#include "src/Services/PathService.hpp" #include "src/Helpers/EnumToStringMappings.hpp" #include "src/Exceptions/Exception.hpp" #include "src/Logger/Logger.hpp" @@ -34,7 +34,7 @@ namespace Bloom::Widgets this->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); auto widgetUiFile = QFile( - QString::fromStdString(Paths::compiledResourcesPath() + QString::fromStdString(Services::PathService::compiledResourcesPath() + "/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane" + "/SnapshotManager/UiFiles/SnapshotManager.ui" ) diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.cpp index 679e0b50..b3c7a5f6 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.cpp @@ -12,7 +12,7 @@ #include "src/Insight/InsightWorker/Tasks/ReadTargetMemory.hpp" #include "src/Insight/InsightWorker/Tasks/ReadStackPointer.hpp" -#include "src/Helpers/Paths.hpp" +#include "src/Services/PathService.hpp" #include "src/Exceptions/Exception.hpp" #include "src/Logger/Logger.hpp" @@ -46,13 +46,13 @@ namespace Bloom::Widgets this->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); auto uiFile = QFile( - QString::fromStdString(Paths::compiledResourcesPath() + QString::fromStdString(Services::PathService::compiledResourcesPath() + "/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/UiFiles/TargetMemoryInspectionPane.ui" ) ); auto stylesheetFile = QFile( - QString::fromStdString(Paths::compiledResourcesPath() + QString::fromStdString(Services::PathService::compiledResourcesPath() + "/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/Stylesheets/TargetMemoryInspectionPane.qss" ) ); diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegisterInspector/RegisterHistoryWidget/RegisterHistoryWidget.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegisterInspector/RegisterHistoryWidget/RegisterHistoryWidget.cpp index c55be9c0..e5de79f9 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegisterInspector/RegisterHistoryWidget/RegisterHistoryWidget.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegisterInspector/RegisterHistoryWidget/RegisterHistoryWidget.cpp @@ -11,7 +11,7 @@ #include "src/Insight/InsightSignals.hpp" #include "src/Insight/UserInterfaces/InsightWindow/Widgets/Label.hpp" -#include "src/Helpers/Paths.hpp" +#include "src/Services/PathService.hpp" #include "src/Helpers/DateTime.hpp" #include "src/Exceptions/Exception.hpp" @@ -37,7 +37,7 @@ namespace Bloom::Widgets this->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); auto widgetUiFile = QFile( - QString::fromStdString(Paths::compiledResourcesPath() + QString::fromStdString(Services::PathService::compiledResourcesPath() + "/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegisterInspector/RegisterHistoryWidget" + "/UiFiles/RegisterHistoryWidget.ui" ) diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegisterInspector/TargetRegisterInspectorWindow.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegisterInspector/TargetRegisterInspectorWindow.cpp index d3ad13ed..b0b47853 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegisterInspector/TargetRegisterInspectorWindow.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegisterInspector/TargetRegisterInspectorWindow.cpp @@ -10,7 +10,7 @@ #include "src/Insight/InsightWorker/InsightWorker.hpp" #include "src/Insight/UserInterfaces/InsightWindow/Widgets/ErrorDialogue/ErrorDialogue.hpp" -#include "src/Helpers/Paths.hpp" +#include "src/Services/PathService.hpp" #include "src/Exceptions/Exception.hpp" #include "src/Insight/InsightWorker/Tasks/ReadTargetRegisters.hpp" @@ -40,14 +40,14 @@ namespace Bloom::Widgets this->setWindowTitle("Inspect Register"); auto windowUiFile = QFile( - QString::fromStdString(Paths::compiledResourcesPath() + QString::fromStdString(Services::PathService::compiledResourcesPath() + "/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegisterInspector/UiFiles/" "TargetRegisterInspectorWindow.ui" ) ); auto windowStylesheet = QFile( - QString::fromStdString(Paths::compiledResourcesPath() + QString::fromStdString(Services::PathService::compiledResourcesPath() + "/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegisterInspector/Stylesheets/" "TargetRegisterInspectorWindow.qss" ) @@ -378,7 +378,7 @@ namespace Bloom::Widgets void TargetRegisterInspectorWindow::openHelpPage() { QDesktopServices::openUrl( - QUrl(QString::fromStdString(Paths::homeDomainName() + "/docs/register-inspection")) + QUrl(QString::fromStdString(Services::PathService::homeDomainName() + "/docs/register-inspection")) ); } } diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegistersPane/RegisterGroupWidget.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegistersPane/RegisterGroupWidget.cpp index 65645cb4..253a3970 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegistersPane/RegisterGroupWidget.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegistersPane/RegisterGroupWidget.cpp @@ -6,7 +6,7 @@ #include "RegisterWidget.hpp" -#include "src/Helpers/Paths.hpp" +#include "src/Services/PathService.hpp" namespace Bloom::Widgets { @@ -31,7 +31,7 @@ namespace Bloom::Widgets this->arrowIcon->setObjectName("arrow-icon"); auto static arrowIconPath = QString::fromStdString( - Paths::compiledResourcesPath() + Services::PathService::compiledResourcesPath() + "/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegistersPane/Images/arrow.svg" ); this->arrowIcon->setSvgFilePath(arrowIconPath); @@ -40,7 +40,7 @@ namespace Bloom::Widgets this->registerGroupIcon->setObjectName("register-group-icon"); auto static registerIconPath = QString::fromStdString( - Paths::compiledResourcesPath() + Services::PathService::compiledResourcesPath() + "/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegistersPane/Images/register-group.svg" ); this->registerGroupIcon->setSvgFilePath(registerIconPath); diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegistersPane/RegisterWidget.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegistersPane/RegisterWidget.cpp index 6db2139f..b995c6dc 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegistersPane/RegisterWidget.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegistersPane/RegisterWidget.cpp @@ -5,7 +5,7 @@ #include #include -#include "src/Helpers/Paths.hpp" +#include "src/Services/PathService.hpp" #include "src/Insight/InsightSignals.hpp" #include "src/Insight/InsightWorker/InsightWorker.hpp" @@ -35,7 +35,7 @@ namespace Bloom::Widgets this->registerIcon->setObjectName("register-icon"); auto static registerIconPath = QString::fromStdString( - Paths::compiledResourcesPath() + Services::PathService::compiledResourcesPath() + "/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegistersPane/Images/register.svg" ); this->registerIcon->setSvgFilePath(registerIconPath); diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegistersPane/TargetRegistersPaneWidget.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegistersPane/TargetRegistersPaneWidget.cpp index c411d7c5..222a0556 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegistersPane/TargetRegistersPaneWidget.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegistersPane/TargetRegistersPaneWidget.cpp @@ -9,7 +9,7 @@ #include "RegisterGroupWidget.hpp" #include "RegisterWidget.hpp" -#include "src/Helpers/Paths.hpp" +#include "src/Services/PathService.hpp" #include "src/Exceptions/Exception.hpp" #include "src/Insight/InsightWorker/Tasks/ReadTargetRegisters.hpp" @@ -34,7 +34,7 @@ namespace Bloom::Widgets this->setObjectName("target-registers-side-pane"); auto targetRegistersPaneUiFile = QFile( - QString::fromStdString(Paths::compiledResourcesPath() + QString::fromStdString(Services::PathService::compiledResourcesPath() + "/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegistersPane/UiFiles/" "TargetRegistersSidePane.ui" ) diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/DIP/DualInlinePackageWidget.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/DIP/DualInlinePackageWidget.cpp index a6ce7be4..f297783f 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/DIP/DualInlinePackageWidget.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/DIP/DualInlinePackageWidget.cpp @@ -6,7 +6,7 @@ #include #include -#include "src/Helpers/Paths.hpp" +#include "src/Services/PathService.hpp" namespace Bloom::Widgets::InsightTargetWidgets::Dip { @@ -19,7 +19,7 @@ namespace Bloom::Widgets::InsightTargetWidgets::Dip : TargetPackageWidget(targetVariant, parent) { auto stylesheetFile = QFile(QString::fromStdString( - Paths::compiledResourcesPath() + Services::PathService::compiledResourcesPath() + "/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/DIP/Stylesheets/" "DualInlinePackage.qss" ) diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/QFP/QuadFlatPackageWidget.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/QFP/QuadFlatPackageWidget.cpp index 03d731d7..0c916888 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/QFP/QuadFlatPackageWidget.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/QFP/QuadFlatPackageWidget.cpp @@ -7,7 +7,7 @@ #include #include -#include "src/Helpers/Paths.hpp" +#include "src/Services/PathService.hpp" #include "PinWidget.hpp" #include "BodyWidget.hpp" @@ -22,7 +22,7 @@ namespace Bloom::Widgets::InsightTargetWidgets::Qfp assert((targetVariant.pinDescriptorsByNumber.size() % 4) == 0); auto stylesheetFile = QFile(QString::fromStdString( - Paths::compiledResourcesPath() + Services::PathService::compiledResourcesPath() + "/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/QFP/Stylesheets/QuadFlatPackage.qss" ) ); diff --git a/src/Helpers/Paths.cpp b/src/Services/PathService.cpp similarity index 81% rename from src/Helpers/Paths.cpp rename to src/Services/PathService.cpp index bb648b4e..3f271aec 100644 --- a/src/Helpers/Paths.cpp +++ b/src/Services/PathService.cpp @@ -1,4 +1,4 @@ -#include "Paths.hpp" +#include "PathService.hpp" #include #include @@ -7,9 +7,9 @@ #include "src/Exceptions/Exception.hpp" -namespace Bloom +namespace Bloom::Services { - std::string Paths::applicationDirPath() { + std::string PathService::applicationDirPath() { auto pathCharArray = std::array(); if (readlink("/proc/self/exe", pathCharArray.data(), PATH_MAX) < 0) { diff --git a/src/Helpers/Paths.hpp b/src/Services/PathService.hpp similarity index 88% rename from src/Helpers/Paths.hpp rename to src/Services/PathService.hpp index ea796a26..62d4910c 100644 --- a/src/Helpers/Paths.hpp +++ b/src/Services/PathService.hpp @@ -3,9 +3,9 @@ #include #include -namespace Bloom +namespace Bloom::Services { - class Paths + class PathService { public: /** @@ -21,7 +21,7 @@ namespace Bloom * @return */ static std::string resourcesDirPath() { - return Paths::applicationDirPath() + "/../resources/"; + return PathService::applicationDirPath() + "/../resources/"; } /** @@ -39,7 +39,7 @@ namespace Bloom * @return */ static std::string projectConfigPath() { - return Paths::projectDirPath() + "/bloom.yaml"; + return PathService::projectDirPath() + "/bloom.yaml"; } /** @@ -48,7 +48,7 @@ namespace Bloom * @return */ static std::string projectSettingsDirPath() { - return Paths::projectDirPath() + "/.bloom"; + return PathService::projectDirPath() + "/.bloom"; } /** @@ -57,7 +57,7 @@ namespace Bloom * @return */ static std::string projectSettingsPath() { - return Paths::projectSettingsDirPath() + "/settings.json"; + return PathService::projectSettingsDirPath() + "/settings.json"; } /** diff --git a/src/TargetController/TargetControllerComponent.cpp b/src/TargetController/TargetControllerComponent.cpp index bd817ffb..7fd7efb4 100644 --- a/src/TargetController/TargetControllerComponent.cpp +++ b/src/TargetController/TargetControllerComponent.cpp @@ -443,7 +443,7 @@ namespace Bloom::TargetController ======= void TargetControllerComponent::checkUdevRules() { auto bloomRulesPath = std::string("/etc/udev/rules.d/99-bloom.rules"); - auto latestBloomRulesPath = Paths::resourcesDirPath() + "/UDevRules/99-bloom.rules"; + auto latestBloomRulesPath = Services::PathService::resourcesDirPath() + "/UDevRules/99-bloom.rules"; if (!std::filesystem::exists(bloomRulesPath)) { Logger::warning("Bloom udev rules missing - attempting installation"); @@ -453,7 +453,7 @@ namespace Bloom::TargetController Logger::error("Bloom udev rules missing - cannot install udev rules without root privileges.\n" "Running Bloom once with root privileges will allow it to automatically install the udev rules. " "Alternatively, instructions on manually installing the udev rules can be found " - "here: " + Paths::homeDomainName() + "/docs/getting-started\nBloom may fail to connect to some " + "here: " + Services::PathService::homeDomainName() + "/docs/getting-started\nBloom may fail to connect to some " "debug tools until this is resolved."); return; } diff --git a/src/Targets/Microchip/AVR/AVR8/Avr8.cpp b/src/Targets/Microchip/AVR/AVR8/Avr8.cpp index dcabff6a..ec806879 100644 --- a/src/Targets/Microchip/AVR/AVR8/Avr8.cpp +++ b/src/Targets/Microchip/AVR/AVR8/Avr8.cpp @@ -7,7 +7,7 @@ #include #include "src/Logger/Logger.hpp" -#include "src/Helpers/Paths.hpp" +#include "src/Services/PathService.hpp" #include "src/Exceptions/InvalidConfig.hpp" #include "Exceptions/DebugWirePhysicalInterfaceError.hpp" @@ -67,9 +67,9 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit + physicalInterfaceNames.at(this->targetConfig->physicalInterface) + "). Target activation " "will likely fail. The target supports the following physical interfaces: \n" + supportedPhysicalInterfaceList + "\n\nFor physical interface configuration values, see " - + Paths::homeDomainName() + "/docs/configuration/avr8-physical-interfaces. \n\nIf this " + + Services::PathService::homeDomainName() + "/docs/configuration/avr8-physical-interfaces. \n\nIf this " "information is incorrect, please report this to Bloom developers via " - + Paths::homeDomainName() + "/report-issue.\n" + + Services::PathService::homeDomainName() + "/report-issue.\n" ); } @@ -78,7 +78,7 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit throw InvalidConfig( "The JTAG physical interface cannot be used with an ambiguous target name" " - please specify the exact name of the target in your configuration file. " - "See " + Paths::homeDomainName() + "/docs/supported-targets" + "See " + Services::PathService::homeDomainName() + "/docs/supported-targets" ); } @@ -86,7 +86,7 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit throw InvalidConfig( "The UPDI physical interface cannot be used with an ambiguous target name" " - please specify the exact name of the target in your configuration file. " - "See " + Paths::homeDomainName() + "/docs/supported-targets" + "See " + Services::PathService::homeDomainName() + "/docs/supported-targets" ); } } @@ -163,7 +163,7 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit throw TargetOperationFailure( "Failed to activate debugWire physical interface - check target connection and DWEN fuse " "bit. Bloom can manage the DWEN fuse bit automatically. For instructions on enabling this " - "function, see " + Paths::homeDomainName() + "/docs/debugging-avr-debugwire" + "function, see " + Services::PathService::homeDomainName() + "/docs/debugging-avr-debugwire" ); } @@ -763,7 +763,7 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit if (this->avrIspInterface == nullptr) { throw Exception( "Debug tool or driver does not provide access to an ISP interface - please confirm that the " - "debug tool supports ISP and then report this issue via " + Paths::homeDomainName() + "debug tool supports ISP and then report this issue via " + Services::PathService::homeDomainName() + "/report-issue" ); } @@ -778,7 +778,7 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit if (!this->supportedPhysicalInterfaces.contains(PhysicalInterface::DEBUG_WIRE)) { throw Exception( "Target does not support debugWire physical interface - check target configuration or " - "report this issue via " + Paths::homeDomainName() + "/report-issue" + "report this issue via " + Services::PathService::homeDomainName() + "/report-issue" ); } @@ -842,7 +842,7 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit "Updating the DWEN fuse bit is a potentially dangerous operation. Bloom is provided \"AS IS\", " "without warranty of any kind. You are using Bloom at your own risk. In no event shall the copyright " "owner or contributors be liable for any damage caused as a result of using Bloom. For more details, " - "see the Bloom license at " + Paths::homeDomainName() + "/license" + "see the Bloom license at " + Services::PathService::homeDomainName() + "/license" ); try { @@ -882,7 +882,7 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit */ throw Exception( "Invalid SPIEN fuse bit value - suspected inaccuracies in TDF data. Please report this to " - "Bloom developers as a matter of urgency, via " + Paths::homeDomainName() + "/report-issue" + "Bloom developers as a matter of urgency, via " + Services::PathService::homeDomainName() + "/report-issue" ); } diff --git a/src/Targets/Microchip/AVR/AVR8/Avr8TargetConfig.cpp b/src/Targets/Microchip/AVR/AVR8/Avr8TargetConfig.cpp index 6154d592..7f58f669 100644 --- a/src/Targets/Microchip/AVR/AVR8/Avr8TargetConfig.cpp +++ b/src/Targets/Microchip/AVR/AVR8/Avr8TargetConfig.cpp @@ -1,7 +1,7 @@ #include "Avr8TargetConfig.hpp" #include "src/Helpers/String.hpp" -#include "src/Helpers/Paths.hpp" +#include "src/Services/PathService.hpp" #include "src/Exceptions/InvalidConfig.hpp" namespace Bloom::Targets::Microchip::Avr::Avr8Bit @@ -25,7 +25,7 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit if (physicalInterfaceIt == Avr8TargetConfig::debugPhysicalInterfacesByConfigName.end()) { throw InvalidConfig( "Invalid physical interface provided (\"" + physicalInterfaceName + "\") for AVR8 target. " - "See " + Paths::homeDomainName() + "/docs/configuration/avr8-physical-interfaces for valid physical " + "See " + Services::PathService::homeDomainName() + "/docs/configuration/avr8-physical-interfaces for valid physical " "interface configuration values." ); } diff --git a/src/Targets/Microchip/AVR/AVR8/TargetDescription/TargetDescriptionFile.cpp b/src/Targets/Microchip/AVR/AVR8/TargetDescription/TargetDescriptionFile.cpp index d8366b16..488260ff 100644 --- a/src/Targets/Microchip/AVR/AVR8/TargetDescription/TargetDescriptionFile.cpp +++ b/src/Targets/Microchip/AVR/AVR8/TargetDescription/TargetDescriptionFile.cpp @@ -4,7 +4,7 @@ #include #include -#include "src/Helpers/Paths.hpp" +#include "src/Services/PathService.hpp" #include "src/Logger/Logger.hpp" #include "src/Exceptions/Exception.hpp" @@ -73,7 +73,7 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit::TargetDescription continue; } - const auto descriptionFilePath = QString::fromStdString(Paths::applicationDirPath()) + "/" + const auto descriptionFilePath = QString::fromStdString(Services::PathService::applicationDirPath()) + "/" + mappingObject.find("targetDescriptionFilePath")->toString(); Logger::debug("Loading AVR8 target description file: " + descriptionFilePath.toStdString()); @@ -99,7 +99,7 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit::TargetDescription QJsonObject TargetDescriptionFile::getTargetDescriptionMapping() { auto mappingFile = QFile( - QString::fromStdString(Paths::resourcesDirPath() + "/TargetDescriptionFiles/AVR/Mapping.json") + QString::fromStdString(Services::PathService::resourcesDirPath() + "/TargetDescriptionFiles/AVR/Mapping.json") ); if (!mappingFile.exists()) { diff --git a/src/Targets/TargetDescription/TargetDescriptionFile.cpp b/src/Targets/TargetDescription/TargetDescriptionFile.cpp index 71e53766..f81b208b 100644 --- a/src/Targets/TargetDescription/TargetDescriptionFile.cpp +++ b/src/Targets/TargetDescription/TargetDescriptionFile.cpp @@ -5,7 +5,7 @@ #include "Exceptions/TargetDescriptionParsingFailureException.hpp" #include "src/Logger/Logger.hpp" -#include "src/Helpers/Paths.hpp" +#include "src/Services/PathService.hpp" namespace Bloom::Targets::TargetDescription { @@ -26,7 +26,7 @@ namespace Bloom::Targets::TargetDescription auto xml = QDomDocument(); if (!xml.setContent(file.readAll())) { throw Exception("Failed to parse target description file - please report this error " - "to Bloom developers via " + Paths::homeDomainName() + "/report-issue"); + "to Bloom developers via " + Services::PathService::homeDomainName() + "/report-issue"); } this->init(xml);