From 82e366f024cb47106f0195e53f97c5beea2e798a Mon Sep 17 00:00:00 2001 From: Elvis Angelaccio Date: Sun, 24 Nov 2019 14:56:53 +0100 Subject: Fix accessibility regression on the Dolphin Control button 9cd042a86c removed the text from the Control button without setting an accessibleName property, which is a regression for screen-reader users. This breaks the 19.12 string freeze, but since it's the same string we were translating before 9cd042a86c, hopefully it's not going to be too much of a burden for translators. CCBUG: 414271 CCMAIL: kde-i18n-doc@kde.org --- src/dolphinmainwindow.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index e28b18cd3..56ea93e10 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -1880,6 +1880,7 @@ void DolphinMainWindow::createControlButton() Q_ASSERT(!m_controlButton); m_controlButton = new QToolButton(this); + m_controlButton->setAccessibleName(i18nc("@action:intoolbar", "Control")); m_controlButton->setIcon(QIcon::fromTheme(QStringLiteral("application-menu"))); m_controlButton->setToolTip(i18nc("@action", "Show menu")); m_controlButton->setAttribute(Qt::WidgetAttribute::WA_CustomWhatsThis); -- cgit v1.3 From 089a05b4edfd7a70e50ed7d8b158cbcc50538d36 Mon Sep 17 00:00:00 2001 From: Elvis Angelaccio Date: Sun, 24 Nov 2019 19:18:41 +0100 Subject: Force dbus introspection on the Dolphin_1 object Summary: QtDBus caches known interfaces when passing a non-empty interface name to the QDbusInterface constructor. This is an issue when calling the FileManager1 methods more than once, because `preferred` could be a valid interface from the cache, but it would later fail to call the `openFiles`/`openDirectories` methods on the main window. By passing an empty interface name, we prevent QtDBus from using the cache so that we always get an invalid interface when calling the FileManager1 methods on a daemonized dolphin process (that doesn't have the Dolphin_1 dbus object). BUG: 414402 FIXED-IN: 19.12.0 Test Plan: 1. dolphin --daemon 2. qdbus org.freedesktop.FileManager1 /org/freedesktop/FileManager1 ShowFolders "/tmp" "" 3. Close the dolphin window that was just opened. 4. Start a normal dolphin process 5. qdbus org.freedesktop.FileManager1 /org/freedesktop/FileManager1 ShowFolders "/tmp" "" 6. Close again the dolphin window 7. qdbus org.freedesktop.FileManager1 /org/freedesktop/FileManager1 ShowFolders "/tmp" "" Subscribers: kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D25510 --- src/global.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/global.cpp b/src/global.cpp index 48e78e9ea..3b81c536a 100644 --- a/src/global.cpp +++ b/src/global.cpp @@ -82,7 +82,7 @@ bool Dolphin::attachToExistingInstance(const QList& inputUrls, bool openFi QSharedPointer preferred( new QDBusInterface(preferredService, QStringLiteral("/dolphin/Dolphin_1"), - QStringLiteral("org.kde.dolphin.MainWindow")) + QString()) // #414402: use empty interface name to prevent QtDBus from caching the interface. ); if (preferred->isValid() && !preferred->lastError().isValid()) { dolphinServices.append(qMakePair(preferred, QStringList())); -- cgit v1.3 From 6776fbc94760188daeca0ab30e49f645f225f008 Mon Sep 17 00:00:00 2001 From: Ismael Asensio Date: Fri, 15 Nov 2019 23:34:13 +0100 Subject: fix(search): Fix baloo searchString parsing Summary: Fix the parsing of Baloo query `searchString` to represent its parameters properly in the search box: # Baloo terms (`rating`, `modified`) are added to the user search text: {F7575590} # Extra quotes are added to the search text: https://bugs.kde.org/show_bug.cgi?id=412952 This revision supersedes D24422, by making the fixes on the new dolphin query model, instead of directly on the UI. BUG: 412952 FIXED IN: 19.11.90 Test Plan: - `bin/dolphinquerytest` passes without `XFAIL`s - Dolphin search box is not garbled by search terms or quotes Reviewers: elvisangelaccio, bruns, ngraham, #dolphin Reviewed By: elvisangelaccio Subscribers: kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D25260 --- src/search/dolphinquery.cpp | 26 ++++++++++++++++++++++---- src/tests/dolphinquerytest.cpp | 18 ------------------ 2 files changed, 22 insertions(+), 22 deletions(-) (limited to 'src') diff --git a/src/search/dolphinquery.cpp b/src/search/dolphinquery.cpp index 09a841859..8f8cb09ec 100644 --- a/src/search/dolphinquery.cpp +++ b/src/search/dolphinquery.cpp @@ -54,20 +54,38 @@ DolphinQuery DolphinQuery::fromBalooSearchUrl(const QUrl& searchUrl) model.m_includeFolder = query.includeFolder(); - model.m_searchText = query.searchString(); - const QStringList types = query.types(); model.m_fileType = types.isEmpty() ? QString() : types.first(); + QStringList textParts; + const QStringList subTerms = query.searchString().split(' ', QString::SkipEmptyParts); foreach (const QString& subTerm, subTerms) { + QString value; if (subTerm.startsWith(QLatin1String("filename:"))) { - const QString value = subTerm.mid(9); - model.m_searchText = value; + value = subTerm.mid(9); } else if (isSearchTerm(subTerm)) { model.m_searchTerms << subTerm; + continue; + } else if (subTerm == QLatin1String("AND") && subTerm != subTerms.at(0) && subTerm != subTerms.back()) { + continue; + } else { + value = subTerm; + } + + if (!value.isEmpty() && value.at(0) == QLatin1Char('"')) { + value = value.mid(1); + } + if (!value.isEmpty() && value.back() == QLatin1Char('"')) { + value = value.mid(0, value.size() - 1); + } + if (!value.isEmpty()) { + textParts << value; } } + + model.m_searchText = textParts.join(QLatin1Char(' ')); + #endif return model; } diff --git a/src/tests/dolphinquerytest.cpp b/src/tests/dolphinquerytest.cpp index 14eb03620..1c6b39e26 100644 --- a/src/tests/dolphinquerytest.cpp +++ b/src/tests/dolphinquerytest.cpp @@ -114,24 +114,6 @@ void DolphinSearchBoxTest::testBalooSearchParsing() QStringList searchTerms = query.searchTerms(); searchTerms.sort(); - // FIXME: Current parsing bugs - QEXPECT_FAIL("content/singleQuote", "Quotes around text are shown", Continue); - QEXPECT_FAIL("content/doubleQuote", "Quotes around text are shown", Continue); - - QEXPECT_FAIL("filename", "Quotes around text are shown", Continue); - QEXPECT_FAIL("filename/singleQuote", "Quotes around text are shown", Continue); - QEXPECT_FAIL("filename/doubleQuote", "Quotes around text are shown", Continue); - - QEXPECT_FAIL("rating" , "Text includes also search terms", Continue); - QEXPECT_FAIL("rating+content" , "Text includes also search terms", Continue); - QEXPECT_FAIL("rating+filename" , "Text includes also search terms", Continue); - QEXPECT_FAIL("modified" , "Text includes also search terms", Continue); - QEXPECT_FAIL("modified+content" , "Text includes also search terms", Continue); - QEXPECT_FAIL("modified+filename" , "Text includes also search terms", Continue); - QEXPECT_FAIL("rating+modified" , "Text includes also search terms", Continue); - QEXPECT_FAIL("rating+modified+content" , "Text includes also search terms", Continue); - QEXPECT_FAIL("rating+modified+filename", "Text includes also search terms", Continue); - // Check for parsed text (would be displayed on the input search bar) QCOMPARE(query.text(), expectedText); -- cgit v1.3