PowerTuneDigital / PowerTuneDigitalOfficial

Official PowerTune Digital Repo
GNU General Public License v3.0
18 stars 7 forks source link

Refactor QProcess usage in restartDaemon for better clarity and safety #126

Closed pgrandin closed 5 months ago

pgrandin commented 5 months ago

Updated the restartDaemon function to use the modern QProcess::start method format and the new signal-slot connection syntax. This change is required for several reasons:

  1. Clarity and Safety: By separating the executable path and arguments, the start method now clearly distinguishes between the program being run and its parameters. This avoids common bugs related to command parsing and improves code readability.

  2. Type Safety: Transitioned to the newer signal-slot syntax which is type-safe and provides compile-time checking. This reduces the potential for runtime errors related to signal connections.

  3. Best Practices: Aligns with Qt 5 best practices for using QProcess, ensuring our codebase remains up-to-date and maintainable.

These updates ensure that the code is robust, easier to understand, and maintains compatibility with current and future versions of Qt.

Also, we had 3 separate instances of code implementing a reboot function, so i switched these to using the class's reboot() method.

github-actions[bot] commented 5 months ago

Here are the first 10 encountered errors:

connect.cpp(21): error cpplint: [build/include_subdir] Include the directory when naming header files [4]
connect.cpp(22): error cpplint: [build/include_subdir] Include the directory when naming header files [4]
connect.cpp(23): error cpplint: [build/include_subdir] Include the directory when naming header files [4]
connect.cpp(26): error cpplint: [build/include_subdir] Include the directory when naming header files [4]
connect.cpp(28): error cpplint: [build/include_subdir] Include the directory when naming header files [4]
connect.cpp(29): error cpplint: [build/include_subdir] Include the directory when naming header files [4]
connect.cpp(30): error cpplint: [build/include_subdir] Include the directory when naming header files [4]
connect.cpp(31): error cpplint: [build/include_subdir] Include the directory when naming header files [4]
connect.cpp(32): error cpplint: [build/include_subdir] Include the directory when naming header files [4]

Done processing connect.cpp Category 'build' errors found: 24 Category 'whitespace' errors found: 309 Total errors found: 333

github-actions[bot] commented 5 months ago

Here are the first 10 encountered errors:

Apexi.cpp(3): error cpplint: [build/include_subdir] Include the directory when naming header files [4]
Apexi.cpp(4): error cpplint: [build/include_order] Found C system header after other header. Should be: Apexi.h, c system, c++ system, other. [4]
Apexi.cpp(5): error cpplint: [build/include_order] Found C system header after other header. Should be: Apexi.h, c system, c++ system, other. [4]
Apexi.cpp(6): error cpplint: [build/include_order] Found C system header after other header. Should be: Apexi.h, c system, c++ system, other. [4]
Apexi.cpp(7): error cpplint: [build/include_order] Found C system header after other header. Should be: Apexi.h, c system, c++ system, other. [4]
Apexi.cpp(8): error cpplint: [build/include_order] Found C system header after other header. Should be: Apexi.h, c system, c++ system, other. [4]
Apexi.cpp(9): error cpplint: [build/include_order] Found C system header after other header. Should be: Apexi.h, c system, c++ system, other. [4]
Apexi.cpp(10): error cpplint: [build/include_order] Found C system header after other header. Should be: Apexi.h, c system, c++ system, other. [4]
Apexi.cpp(22): error cpplint: [whitespace/comments] Should have a space between // and comment [4]

Done processing Apexi.cpp Done processing Extender.cpp Done processing connect.cpp Done processing datalogger.cpp Done processing wifiscanner.cpp Category 'build' errors found: 54 Category 'readability' errors found: 6 Category 'whitespace' errors found: 715 Total errors found: 775