Core::Application
TheApplication class is the central hub of Zeal, implemented as a singleton that coordinates all major components.
Location: src/libs/core/application.h
Key Responsibilities
- Application lifecycle management
- Component initialization and coordination
- Network request handling
- Update checking
- Docset extraction orchestration
Public Interface
Member Components
Fromsrc/libs/core/application.h:79-91:
Core::Settings
Manages all application configuration with automatic persistence. Location:src/libs/core/settings.h
Configuration Categories
Startup Settings
System Tray
Search
Content Appearance
Font Configuration
Network Proxy
External Link Policy
Methods
Signals
QSettings mechanism and stored in platform-specific locations.
Core::HttpServer
Provides a local HTTP server for serving documentation files efficiently. Location:src/libs/core/httpserver.h
Purpose
The HTTP server enables:- Local serving of documentation files without file:// protocol limitations
- Proper handling of web resources and AJAX requests
- Support for JavaScript-heavy documentation
Interface
Implementation Details
Fromsrc/libs/core/httpserver.h:36-39:
httplib library and runs asynchronously using std::future to avoid blocking the main thread.
Core::FileManager
Simple utility for file system operations. Location:src/libs/core/filemanager.h
Core::Extractor
Handles archive extraction for docset installation. Location:src/libs/core/extractor.h
Interface
Threading
The extractor runs in a dedicated thread (seeApplication::m_extractorThread) to prevent UI blocking during large archive extraction. Progress is reported through Qt signals.
Archive Support
Useslibarchive (see struct archive at line 9) to support multiple archive formats including:
- tar.gz
- tar.bz2
- zip
- And other formats supported by libarchive
Component Initialization Flow
-
Applicationconstructor creates core services:Settings- loads configurationNetworkManager- sets up HTTP clientFileManager- prepares file operationsHttpServer- starts local serverExtractor- creates extraction thread
-
DocsetRegistryis initialized with storage path from settings -
MainWindowis created and connected to application signals -
Settings are applied through
applySettings()slot
See Also
- Registry Component - Docset management
- Browser Component - Documentation rendering
- Architecture Overview - Component interaction