Merge branch 'rcorre-undo_crash'
This commit is contained in:
commit
3b23bfbeea
@ -156,9 +156,9 @@ Contributors, sorted by the number of commits in descending order:
|
|||||||
* Felix Van der Jeugt
|
* Felix Van der Jeugt
|
||||||
* Raphael Pierzina
|
* Raphael Pierzina
|
||||||
* Joel Torstensson
|
* Joel Torstensson
|
||||||
|
* Ryan Roden-Corrent
|
||||||
* Patric Schmitz
|
* Patric Schmitz
|
||||||
* Claude
|
* Claude
|
||||||
* Ryan Roden-Corrent
|
|
||||||
* meles5
|
* meles5
|
||||||
* Tarcisio Fedrizzi
|
* Tarcisio Fedrizzi
|
||||||
* Artur Shaik
|
* Artur Shaik
|
||||||
|
@ -310,6 +310,7 @@ class TabbedBrowser(tabwidget.TabWidget):
|
|||||||
"""Undo removing of a tab."""
|
"""Undo removing of a tab."""
|
||||||
# Remove unused tab which may be created after the last tab is closed
|
# Remove unused tab which may be created after the last tab is closed
|
||||||
last_close = config.get('tabs', 'last-close')
|
last_close = config.get('tabs', 'last-close')
|
||||||
|
use_current_tab = False
|
||||||
if last_close in ['blank', 'startpage', 'default-page']:
|
if last_close in ['blank', 'startpage', 'default-page']:
|
||||||
only_one_tab_open = self.count() == 1
|
only_one_tab_open = self.count() == 1
|
||||||
no_history = self.widget(0).history().count() == 1
|
no_history = self.widget(0).history().count() == 1
|
||||||
@ -322,12 +323,17 @@ class TabbedBrowser(tabwidget.TabWidget):
|
|||||||
last_close_urlstr = urls[last_close].toString().rstrip('/')
|
last_close_urlstr = urls[last_close].toString().rstrip('/')
|
||||||
first_tab_urlstr = first_tab_url.toString().rstrip('/')
|
first_tab_urlstr = first_tab_url.toString().rstrip('/')
|
||||||
last_close_url_used = first_tab_urlstr == last_close_urlstr
|
last_close_url_used = first_tab_urlstr == last_close_urlstr
|
||||||
|
use_current_tab = (only_one_tab_open and no_history and
|
||||||
if only_one_tab_open and no_history and last_close_url_used:
|
last_close_url_used)
|
||||||
self.removeTab(0)
|
|
||||||
|
|
||||||
url, history_data = self._undo_stack.pop()
|
url, history_data = self._undo_stack.pop()
|
||||||
newtab = self.tabopen(url, background=False)
|
|
||||||
|
if use_current_tab:
|
||||||
|
self.openurl(url, newtab=False)
|
||||||
|
newtab = self.widget(0)
|
||||||
|
else:
|
||||||
|
newtab = self.tabopen(url, background=False)
|
||||||
|
|
||||||
qtutils.deserialize(history_data, newtab.history())
|
qtutils.deserialize(history_data, newtab.history())
|
||||||
|
|
||||||
@pyqtSlot('QUrl', bool)
|
@pyqtSlot('QUrl', bool)
|
||||||
|
@ -635,6 +635,16 @@ Feature: Tab management
|
|||||||
Then the following tabs should be open:
|
Then the following tabs should be open:
|
||||||
- data/hello.txt (active)
|
- data/hello.txt (active)
|
||||||
|
|
||||||
|
Scenario: Double-undo with single tab on last-close default page
|
||||||
|
Given I have a fresh instance
|
||||||
|
When I open about:blank
|
||||||
|
And I set tabs -> last-close to default-page
|
||||||
|
And I set general -> default-page to about:blank
|
||||||
|
And I run :undo
|
||||||
|
And I run :undo
|
||||||
|
Then the error "Nothing to undo!" should be shown
|
||||||
|
And the error "Nothing to undo!" should be shown
|
||||||
|
|
||||||
# last-close
|
# last-close
|
||||||
|
|
||||||
Scenario: last-close = blank
|
Scenario: last-close = blank
|
||||||
|
Loading…
Reference in New Issue
Block a user