Skip to content

Refactor: Replace custom environmentVariable with native qEnvironmentVariable - #477

Closed
rajuan34 wants to merge 1 commit into
OpenBangla:masterfrom
rajuan34:master
Closed

rajuan34 wants to merge 1 commit into
OpenBangla:masterfrom
rajuan34:master

Conversation

@rajuan34

Copy link
Copy Markdown

Description

This PR resolves an old TODO in the codebase regarding environment variable fetching.

Previously, the project used a custom environmentVariable function as a fallback to qgetenv. There was a comment in src/shared/FileSystem.h stating:
// TODO: Use qEnvironmentVariable function when we are able to use Qt 5.10 version.

Since the project now uses a modern Qt version that fully supports qEnvironmentVariable(), this custom implementation is no longer necessary. This PR removes the legacy tech debt and switches to the native Qt function.

Changes Made

  • Removed the custom environmentVariable function definition and declaration from src/shared/FileSystem.cpp and src/shared/FileSystem.h.
  • Updated UserFolders() in src/shared/FileSystem.h to use qEnvironmentVariable().
  • Updated TopBar::DataMigration() in src/frontend/TopBar.cpp to use qEnvironmentVariable().
  • Removed the associated TODO comment.

Testing

This is a safe refactor. qEnvironmentVariable() is the standard, cross-platform Qt method for fetching environment variables and behaves identically to the custom qgetenv wrapper it replaces.

@codayon

codayon commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

I suggest checking the develop or new-design branches first to see whether this patch is still needed.

@mominul

mominul commented Aug 25, 2026

Copy link
Copy Markdown
Member

@rajuan34 Hi, thanks for your contribution! But unfortunately, this has been already implemented in the develop branch

@rajuan34 rajuan34 closed this Sep 13, 2026
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.

3 participants