summaryrefslogtreecommitdiffstats
path: root/tools/linguist
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-11-26 12:02:44 (GMT)
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-11-26 12:41:48 (GMT)
commit2b6af778f3b5bd32e95332f95b9eda7c26e63635 (patch)
treeff4ebc5c7e544f36122d57de204f7b066cfa31a6 /tools/linguist
parenta78e7a6e7a7d5725467d0538bf8e0ea50c2506cc (diff)
downloadQt-2b6af778f3b5bd32e95332f95b9eda7c26e63635.zip
Qt-2b6af778f3b5bd32e95332f95b9eda7c26e63635.tar.gz
Qt-2b6af778f3b5bd32e95332f95b9eda7c26e63635.tar.bz2
ignore Alt+Space acelerators - useless and too many false positives
Task-number: QTBUG-4429
Diffstat (limited to 'tools/linguist')
-rw-r--r--tools/linguist/linguist/mainwindow.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/tools/linguist/linguist/mainwindow.cpp b/tools/linguist/linguist/mainwindow.cpp
index 5c3aaa1..f56c966 100644
--- a/tools/linguist/linguist/mainwindow.cpp
+++ b/tools/linguist/linguist/mainwindow.cpp
@@ -2348,6 +2348,17 @@ void MainWindow::updatePhraseDicts()
m_phraseView->update();
}
+static bool haveMnemonic(const QString &str)
+{
+ 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;
+ }
+ return !mnemonic.isEmpty();
+}
+
void MainWindow::updateDanger(const MultiDataIndex &index, bool verbose)
{
MultiDataIndex curIdx = index;
@@ -2379,10 +2390,10 @@ void MainWindow::updateDanger(const MultiDataIndex &index, bool verbose)
}
if (m_ui.actionAccelerators->isChecked()) {
- bool sk = !QKeySequence::mnemonic(source).isEmpty();
+ bool sk = haveMnemonic(source);
bool tk = true;
for (int i = 0; i < translations.count() && tk; ++i) {
- tk &= !QKeySequence::mnemonic(translations[i]).isEmpty();
+ tk &= haveMnemonic(translations[i]);
}
if (!sk && tk) {