Skip to content

Basic Planning

Program edited this page Aug 28, 2024 · 1 revision

Basic Planning

Development Environment

  • C++ 17
  • Qt 6

Third-Party Libraries

  • HTTP: cpr / asio, with plans to support various download protocols later: aria2
  • JSON: nlohmann
  • Logging: spdlog
  • Installer: NSIS, with the option to use dulib for UI customization and incremental updates in the future

Structure

  • Separation of Logic and Widget layers
  • HTTP client class can be used as a standalone library
  • Download service or features involving download URL parsing
  • Version detection and update functionality with customizable protocols, utilizing the HTTP client class for network requests and downloads
  • Optional analytics library for tracking software usage frequency (for learning purposes)

Development Challenges

  • Multithreaded file downloading (considering thread pool management)
  • Resumable downloads
  • Handling cookies and anti-hotlinking issues
  • Browser extension development

Multithreaded File Downloading

  • Downloads different segments of a file using multiple threads, where each thread downloads a specific byte range.
  • Updates the overall progress by fetching the number of bytes downloaded in each thread.

Resumable Downloads

  • Implemented through the Range request header, allowing downloads to resume from a specific byte offset.

Code Naming Conventions

#pragma once
#include <QWidget>

enum class EnumDemo { One, Two, Three };

class MainWindow : public QWidget {
    Q_OBJECT
public:
    explicit MainWindow(QWidget* parent = nullptr);
    ~MainWindow() override;
    void funcOne();

private:
    Ui::MainWindow* ui;
    QString name;
};

Git Development Process

  • Clone the repository and develop in your own fork
  • Branch naming conventions:
    • feature: for new feature development
    • bugfix: for bug fixing
    • hotfix: for urgent bug fixes
  • Once development is complete, submit a pull request (PR) for review and merge
  • Reviewers conduct code review, and upon approval, the changes are merged into the main repository

Constraints

  • Avoid writing to the registry as it hinders cross-platform compatibility and increases user burden, possibly leading to residual files during uninstallation

Future Plans

  • Support for downloading FTP, BT, and magnet links
  • Tracker support
  • Consideration of utilizing scripting languages (Python, Lua) for certain tasks
Clone this wiki locally