Changeset View
Standalone View
src/dolphinmainwindow.cpp
Show First 20 Lines • Show All 994 Lines • ▼ Show 20 Line(s) | 994 | if (!matchedPlaces.isEmpty()) { | |||
---|---|---|---|---|---|
995 | setWindowTitle(s_placesModel.text(matchedPlaces.first())); | 995 | setWindowTitle(s_placesModel.text(matchedPlaces.first())); | ||
996 | return; | 996 | return; | ||
997 | } | 997 | } | ||
998 | 998 | | |||
999 | QString fileName = url.adjusted(QUrl::StripTrailingSlash).fileName(); | 999 | QString fileName = url.adjusted(QUrl::StripTrailingSlash).fileName(); | ||
1000 | if (fileName.isEmpty()) { | 1000 | if (fileName.isEmpty()) { | ||
1001 | fileName = '/'; | 1001 | fileName = '/'; | ||
1002 | } | 1002 | } | ||
1003 | 1003 | | |||
emmanuelp: This will lead to some tricky corner cases producing wrong window titles (like `baloosearch… | |||||
1004 | if (m_activeViewContainer->isSearchModeEnabled()) { | ||||
anthonyfieroni: ```
if[space]( and )[space]{
```
in every place. | |||||
Old patch was using if (m_activeViewContainer->isSearchModeEnabled()), why did you change it? (should be faster as it doesn't perform a substring match). elvisangelaccio: Old patch was using `if (m_activeViewContainer->isSearchModeEnabled())`, why did you change it? | |||||
I thought your earlier comment implied that isSearchModeEnabled() will not work in some corner cases, but apparently I misunderstood that. xyquadrat: I thought your earlier comment implied that `isSearchModeEnabled()` will not work in some… | |||||
1005 | if(m_activeViewContainer->currentSearchText().isEmpty()){ | ||||
Please add a check if the search query is empty. Currently it will show "Search for " which doesn't look good. elvisangelaccio: Please add a check if the search query is empty. Currently it will show "Search for " which… | |||||
I can easily add a check for that, but what should it show instead? "Starting search"? xyquadrat: I can easily add a check for that, but what should it show instead? "Starting search"? | |||||
1006 | setWindowTitle(i18n("Empty Search")); | ||||
anthonyfieroni: Always use isEmpty do not compare with empty null-terminated string. | |||||
Please use title capitalization ("Empty Search") Btw the local variable is not needed, we could just do setWindowTitle(i18n(...)) elvisangelaccio: Please use title capitalization ("Empty Search")
Btw the local variable is not needed, we… | |||||
What I meant is "Empty Search" rather than "Empty search". See https://community.kde.org/KDE_Visual_Design_Group/HIG/Capitalization elvisangelaccio: What I meant is "Empty Search" rather than "Empty search". See https://community.kde. | |||||
1007 | } else { | ||||
I'm not sure it's worth putting the facets in the title. Currently I see the following issues:
elvisangelaccio: I'm not sure it's worth putting the facets in the title. Currently I see the following issues… | |||||
1008 | const auto searchText = i18n("Search for %1", m_activeViewContainer->currentSearchText()); | ||||
1009 | setWindowTitle(searchText); | ||||
You cannot construct translated text in this way. Translated strings should be whole sentence. anthonyfieroni: You cannot construct translated text in this way. Translated strings should be whole sentence. | |||||
elvisangelaccio: Same here, use `%1` as placeholder for `text`. | |||||
1010 | } | ||||
1011 | return; | ||||
1012 | } | ||||
1013 | | ||||
1004 | setWindowTitle(schemePrefix + fileName); | 1014 | setWindowTitle(schemePrefix + fileName); | ||
1005 | } | 1015 | } | ||
1006 | 1016 | | |||
1007 | void DolphinMainWindow::slotStorageTearDownFromPlacesRequested(const QString& mountPath) | 1017 | void DolphinMainWindow::slotStorageTearDownFromPlacesRequested(const QString& mountPath) | ||
1008 | { | 1018 | { | ||
1009 | #ifndef Q_OS_WIN | 1019 | #ifndef Q_OS_WIN | ||
1010 | if (m_terminalPanel->currentWorkingDirectory().startsWith(mountPath)) { | 1020 | if (m_terminalPanel->currentWorkingDirectory().startsWith(mountPath)) { | ||
1011 | m_tearDownFromPlacesRequested = true; | 1021 | m_tearDownFromPlacesRequested = true; | ||
▲ Show 20 Lines • Show All 580 Lines • Show Last 20 Lines |
This will lead to some tricky corner cases producing wrong window titles (like baloosearch - /), when the URL is a search URL but the state of the search box doesn't reflect it at this point (depends on the ordering of the method calls).
Better use the information available in the url, e.g.: