Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Cleanup ¶
func Cleanup(reg *RegistryManager, version, arch, expectedRoot string) error
Cleanup removes an installed Qt version directory and updates the registry. expectedRoot is the Qt install root directory (e.g. C:\Qt); only paths under this root will be removed.
func InstallDir ¶
InstallDir returns the directory where a Qt SDK should be installed. root is the Qt install root (e.g. C:\Qt), version e.g. "6.10.0", arch e.g. "msvc2022_64".
Types ¶
type InstalledExtras ¶
type InstalledExtras struct {
Docs bool `json:"docs,omitempty"`
Examples bool `json:"examples,omitempty"`
Sources bool `json:"sources,omitempty"`
DebugInfo bool `json:"debug_info,omitempty"`
}
InstalledExtras holds extra content installed alongside a Qt version.
type InstalledQt ¶
type InstalledQt struct {
Version string `json:"version"`
Arch string `json:"arch"`
InstallDir string `json:"install_dir"`
Modules []string `json:"modules,omitempty"`
Extras InstalledExtras `json:"extras,omitzero"`
InstalledAt time.Time `json:"installed_at"`
SizeBytes int64 `json:"size_bytes,omitempty"`
}
InstalledQt describes a single installed Qt SDK target.
type Registry ¶
type Registry struct {
Version int `json:"version"`
Qt []InstalledQt `json:"qt,omitempty"`
}
Registry is the root of the registry file.
type RegistryManager ¶
type RegistryManager struct {
// contains filtered or unexported fields
}
RegistryManager manages loading and saving the qvm registry.
func NewRegistryManager ¶
func NewRegistryManager() (*RegistryManager, error)
NewRegistryManager creates a RegistryManager using the XDG state directory. On Linux this is ~/.local/state/qvm/; on Windows %LOCALAPPDATA%\qvm\.
func NewRegistryManagerAt ¶
func NewRegistryManagerAt(path string) *RegistryManager
NewRegistryManagerAt creates a RegistryManager at a specific path (for testing).
func (*RegistryManager) AddQt ¶
func (m *RegistryManager) AddQt(entry InstalledQt) error
AddQt adds or replaces a Qt installation record.
func (*RegistryManager) Load ¶
func (m *RegistryManager) Load() (*Registry, error)
Load reads the registry from disk. Returns an empty registry if the file doesn't exist.
func (*RegistryManager) Path ¶
func (m *RegistryManager) Path() string
Path returns the registry file path.
func (*RegistryManager) RemoveQt ¶
func (m *RegistryManager) RemoveQt(version, arch string) error
RemoveQt removes a Qt installation record.
func (*RegistryManager) Save ¶
func (m *RegistryManager) Save(r *Registry) error
Save atomically writes the registry to disk.