Fix calculator gui failing with "This application can not open files" #37

Open
Smithy-bot wants to merge 1 commit from feature/36-gui-cannot-open-files into release/0.1.0
Member

Description

calculator gui failed with GLib's "This application can not open files" because Application::run() forwarded the clap gui subcommand to GApplication, which treated it as a file path. Plain calculator worked because there were no leftover args.

Only the program name is now passed to GTK via run_with_args.

Fixes #36

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Ran ./target/debug/calculator-app gui — GUI launches without the GLib critical
  • Ran ./target/debug/calculator-app (default) — still launches
  • cargo test — all 4 unit tests pass

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
# Description `calculator gui` failed with GLib's "This application can not open files" because `Application::run()` forwarded the clap `gui` subcommand to GApplication, which treated it as a file path. Plain `calculator` worked because there were no leftover args. Only the program name is now passed to GTK via `run_with_args`. Fixes #36 ## Type of change - [x] Bug fix (non-breaking change which fixes an issue) # How Has This Been Tested? - Ran `./target/debug/calculator-app gui` — GUI launches without the GLib critical - Ran `./target/debug/calculator-app` (default) — still launches - `cargo test` — all 4 unit tests pass # Checklist - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged and published in downstream modules
Vylpes 2026-07-23 18:46:51 +01:00
Vylpes self-assigned this 2026-07-23 18:47:07 +01:00
Vylpes requested reviews from Vylpes and removed review requests for VylpesTester 2026-07-23 18:47:10 +01:00
This pull request doesn't have enough approvals yet. 0 of 1 approvals granted.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin feature/36-gui-cannot-open-files:feature/36-gui-cannot-open-files
git switch feature/36-gui-cannot-open-files
Sign in to join this conversation.
No description provided.