Commit cf14db1f16fffd7755d6200aaa6769a57a9da99d
don't use QKeySequence::mnemonic() after all
it wastes cpu cycles, and it started flooding the console with
irrelevant messages.
| |   |
| 94 | 94 | #include <QUrl> |
| 95 | 95 | #include <QWhatsThis> |
| 96 | 96 | |
| #include <ctype.h> |
|
| 97 | 99 | QT_BEGIN_NAMESPACE |
| 98 | 100 | |
| 99 | 101 | static const int MessageMS = 2500; |
| … | … | |
| 2358 | 2358 | |
| 2359 | 2359 | static bool haveMnemonic(const QString &str) |
| 2360 | 2360 | { |
| QString mnemonic = QKeySequence::mnemonic(str); |
| if (mnemonic == QLatin1String("Alt+Space")) { |
| // "Nobody" ever really uses these, and they are highly annoying |
| // because we get a lot of false positives. |
| return false; |
| for (const ushort *p = (ushort *)str.constData();; ) { // Assume null-termination |
| ushort c = *p++; |
| if (!c) |
| break; |
| if (c == '&') { |
| c = *p++; |
| if (!c) |
| return false; |
| // "Nobody" ever really uses these alt-space, and they are highly annoying |
| // because we get a lot of false positives. |
| if (c != '&' && c != ' ' && QChar(c).isPrint()) { |
| const ushort *pp = p; |
| for (; ::isalpha(*p); p++) ; |
| if (pp == p || *p != ';') |
| return true; |
| // This looks like a HTML &entity;, so ignore it. As a HTML string |
| // won't contain accels anyway, we can stop scanning here. |
| break; |
| } |
| } |
| 2366 | 2381 | } |
| return !mnemonic.isEmpty(); |
| return false; |
| 2368 | 2383 | } |
| 2369 | 2384 | |
| 2370 | 2385 | void MainWindow::updateDanger(const MultiDataIndex &index, bool verbose) |