Skip to content

Add Archive Utility-style native file handling#12

Merged
yani- merged 8 commits intomasterfrom
feature/archive-utility-native-handling
Mar 28, 2026
Merged

Add Archive Utility-style native file handling#12
yani- merged 8 commits intomasterfrom
feature/archive-utility-native-handling

Conversation

@yani-
Copy link
Copy Markdown
Member

@yani- yani- commented Mar 27, 2026

Summary

  • Double-clicking a .wpress file now extracts silently next to the source, opens the result folder, and quits — Archive Utility style
  • Streaming CryptoUtils eliminates full-entry memory loading for large archives (500MB+ SQL dumps now process in 512KB chunks)
  • QThread-based ExtractionWorker replaces the processEvents() hack — both GUI and auto-extract use the same worker
  • Single-instance IPC via QLocalServer prevents multiple Traktor processes on Windows/Linux
  • QSettings persistence for file dialog paths and window geometry across sessions
  • macOS Dock badge progress, Windows context menu registry verb, Linux MIME type + .desktop file association
  • 35 QTest cases covering BackupFile, streaming CryptoUtils, ExtractionWorker, and QSettings

New files

File Purpose
extractionworker.h/cpp QThread worker for extraction
autoextractor.h/cpp Headless auto-extract coordinator (queue, IPC, progress, notifications)
dockprogress.h/mm macOS Dock tile badge via NSDockTile
dockprogress_stub.cpp No-op stub for non-macOS
wpress.xml Linux MIME type definition
tests/ QTest suite + .wpress fixtures

Test plan

  • Build on macOS: qmake Qtraktor.pro && make
  • Run tests: cd tests && qmake tests.pro && make && ./tst_qtraktor (35 pass)
  • GUI mode: open Traktor, open .wpress via button, verify extraction with progress bar
  • Auto-extract: ./Traktor.app/Contents/MacOS/Traktor /path/to/test.wpress
  • QSettings: open a file, close app, reopen — file dialog should remember last path
  • Verify CI builds DMG/EXE/AppImage on GitHub Actions

Closes #1

yani- added 6 commits March 28, 2026 01:41
Double-clicking a .wpress file now extracts silently next to the source,
opens the result folder, and quits. The existing GUI workflow is preserved.

Core changes:
- Streaming CryptoUtils: new QIODevice-based API eliminates full-entry
  memory loading for large archives (e.g., 500MB SQL dumps)
- QThread extraction: BackupFile::extract() runs on a worker thread,
  replacing the processEvents() hack. Both GUI and auto-extract use
  the same ExtractionWorker class
- Static BackupFile::checkConfig() consolidates the duplicated config
  detection pattern across CLI, GUI, and auto-extract paths
- AutoExtractor class: handles extraction queue (FIFO), single-instance
  IPC via QLocalServer, delayed progress window (2s), password dialog,
  QSystemTrayIcon notifications, and quit-on-completion
- QSettings persistence for lastOpenPath, lastExtractPath, windowGeometry
- macOS Dock badge progress via NSDockTile
- Windows context menu registry verb in Qt IFW installer
- Linux MIME type XML and .desktop file association with Actions

Closes #1
Covers BackupFile (validation, extraction, abort), CryptoUtils streaming
(plain copy, config passthrough, empty content, large files),
ExtractionWorker (success, multifile, empty, corrupted, nonexistent,
abort, phase signals), and QSettings persistence.

Includes fixture generator and 4 .wpress test files (plain, empty,
corrupted, multifile).
The qmake variable ${ASSETCATALOG_COMPILER_APPICON_NAME} resolved to
"Traktor.icns" (matching the TARGET name) but the actual icon file is
"traktor.icns" (lowercase). On case-insensitive filesystems this works
locally but can cause icon cache misses. Hardcode the correct filename.
…ype claim

- Defer GUI/AutoExtractor decision on macOS: double-clicking a .wpress
  file sends QEvent::FileOpen after launch (no CLI args). A StartupFilter
  collects FileOpen events during a 300ms window, then picks auto-extract
  or GUI mode accordingly.
- Fix progress bar invisible on Qt 5 + macOS 26: native QProgressBar
  rendering is broken. Use stylesheet with palette colors as workaround
  on macOS, native rendering on Windows/Linux.
- Fix progress not updating: cross-thread signal relay from BackupFile
  to ExtractionWorker was unreliable due to QThread affinity. Progress
  is now stored in an atomic int by the worker and polled from the main
  thread via a 50ms QTimer.
- Claim .wpress file type on launch via LSSetDefaultRoleHandlerForContentType
  so Traktor becomes the default handler even if another app (e.g. Keka)
  was previously associated.
- Replace QProgressDialog with explicit QDialog + QProgressBar for
  reliable cross-platform rendering.
Instead of showing a generic error dialog when decryption fails,
show the password dialog again so the user can retry. The user
can cancel to skip the file.
@yani- yani- requested review from arminkardovic and developeritsme and removed request for arminkardovic March 27, 2026 20:53
yani- added 2 commits March 28, 2026 08:43
The version placeholder replacement used github.ref_name (branch name
with slashes) instead of env.VERSION, causing binarycreator to fail
with "cannot find path" on branches like feature/foo.
The RegisterFileType operation references file.ico in the install
directory but it was never copied there. Without it, .wpress files
show a blank icon in Explorer.
@yani- yani- merged commit ca18000 into master Mar 28, 2026
4 of 5 checks passed
@yani- yani- deleted the feature/archive-utility-native-handling branch March 28, 2026 02:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improvements for Mac regarding file opening + chooser

1 participant