-
Notifications
You must be signed in to change notification settings - Fork 24
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
Suppress Qt warnings for invalid QRegularExpression #292
Conversation
Previously when entering math and other expressions that were not valid QRegularExpression's, lxqt-runner would spam hundreds of Qt warnings that could be seen from the command line or journalctl.
To see the warnings, open |
That's not the case for all, especially with
It's better to be more specific; you mean the new warnings like Do these cover all instances inside the code? |
|
What about lxqt-runner/commanditemmodel.cpp Lines 98 to 103 in 412a1ca
I'm not talking about adding a check there; I just want to know whether you see a warning about it, because if you do, Qt has a new, annoying problem. |
I added checks before I can't figure out how to link Qt6 with pkg-config to make a small test, but I suspect there is no warning. |
OK. Thanks. Please use your patch for a while to make sure that all such warnings are covered by it. I'll merge it later. |
On second thought, this is what I mean: What about doing the following, instead of handling individual instances? diff -ruNp lxqt-runner-orig/dialog.cpp lxqt-runner/dialog.cpp
--- lxqt-runner-orig/dialog.cpp
+++ lxqt-runner/dialog.cpp
@@ -546,7 +546,8 @@ void Dialog::setFilter(const QString &te
QString trimmedText = text.simplified();
mCommandItemModel->setCommand(trimmedText);
mCommandItemModel->showOnlyHistory(onlyHistory);
- mCommandItemModel->setFilterRegularExpression(trimmedText);
+ QRegularExpression r(trimmedText);
+ mCommandItemModel->setFilterRegularExpression(r.isValid() ? r : QRegularExpression());
mCommandItemModel->invalidate();
// tidy up layout and select first item
|
Tested briefly, that seems to be simpler and more robust. |
Is the calculator OK too? |
It appears to be identical to mine. I thought, for some reason, that |
OK. Let's merge it. Thanks again for finding and removing this Qt annoyance. |
Previously when entering math and other expressions that were not valid QRegularExpression's, lxqt-runner would spam hundreds of Qt warnings that could be seen from the command line or journalctl.