- navigator->setUrlEditable(true);
- navigator->setFocus();
-
- // select the whole text of the combo box editor
- QLineEdit* lineEdit = navigator->editor()->lineEdit(); // krazy:exclude=qclasses
- lineEdit->selectAll();
+ QLineEdit* lineEdit = navigator->editor()->lineEdit();
+
+ // If the text field currently has focus and everything is selected,
+ // pressing the keyboard shortcut returns the whole thing to breadcrumb mode
+ if (navigator->isUrlEditable()
+ && lineEdit->hasFocus()
+ && lineEdit->selectedText() == lineEdit->text() ) {
+ navigator->setUrlEditable(false);
+ } else {
+ navigator->setUrlEditable(true);
+ navigator->setFocus();
+ lineEdit->selectAll();
+ }