Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Launching via custom desktop files has become case-sensitive. #296

Closed
Chiitoo opened this issue Jan 16, 2025 · 3 comments · Fixed by #297
Closed

Launching via custom desktop files has become case-sensitive. #296

Chiitoo opened this issue Jan 16, 2025 · 3 comments · Fixed by #297

Comments

@Chiitoo
Copy link

Chiitoo commented Jan 16, 2025

After fd53e27 [1], some desktop files seem to have become case-sensitive.

Test file named as runtest.desktop:

[Desktop Entry]
Comment=This is a Test
Name=Runtest
NoDisplay=false
StartupNotify=false
Terminal=0
Type=Application
Categories=Game

Before the aforementioned commit, runner would find this via both, runt and Runt, but with the commit, only via Runt.

Perhaps this is even more correct behaviour, as non-custom desktop files seem to work okay still, but my custom ones similar to this test file are affected as described.

Comparing to some of those that seem to work still, I don't quite see what is making the difference.

Thank you!

  1. fd53e27
@tsujan
Copy link
Member

tsujan commented Jan 16, 2025

Thanks for reporting!

That shows Qt uses case insensitive patterns by default, and so, we should do:

QRegularExpression regExp(trimmedText, QRegularExpression::CaseInsensitiveOption);

Could you please test that?

@Chiitoo
Copy link
Author

Chiitoo commented Jan 16, 2025

Indeed, the following seems to restore previous behaviour:

--- dialog.cpp
+++ dialog.cpp
@@ -563,7 +563,7 @@
     QString trimmedText = text.simplified();
     mCommandItemModel->setCommand(trimmedText);
     mCommandItemModel->showOnlyHistory(onlyHistory);
-    QRegularExpression regExp(trimmedText);
+    QRegularExpression regExp(trimmedText, QRegularExpression::CaseInsensitiveOption);
     mCommandItemModel->setFilterRegularExpression(regExp.isValid() ? regExp : QRegularExpression());
     mCommandItemModel->invalidate();

Many thanks!

@tsujan
Copy link
Member

tsujan commented Jan 16, 2025

Thanks for testing! I'll make a PR.

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 a pull request may close this issue.

2 participants