Fix initial tab opening

This commit is contained in:
Florian Bruhin 2014-02-21 20:06:42 +01:00
parent 5d32df1d54
commit e47d13d725
2 changed files with 10 additions and 4 deletions

View File

@ -196,7 +196,6 @@ class QuteBrowser(QApplication):
# we make sure the GUI is refreshed here, so the start seems faster.
self.processEvents(QEventLoop.ExcludeUserInputEvents |
QEventLoop.ExcludeSocketNotifiers)
opened_urls = False
for e in self._args.command:
if e.startswith(':'):
@ -204,10 +203,9 @@ class QuteBrowser(QApplication):
self.commandparser.run(e.lstrip(':'))
else:
logging.debug('Startup url {}'.format(e))
opened_urls = True
self.mainwindow.tabs.tabopen(e)
if not opened_urls:
if self.mainwindow.tabs.count() == 0:
logging.debug('Opening startpage')
for url in config.config.get('general', 'startpage').split(','):
self.mainwindow.tabs.tabopen(url)

View File

@ -365,7 +365,15 @@ class TabbedBrowser(TabWidget):
"""
tab = self._widget(count)
if tab is not None:
if tab is None:
if count is None:
# We want to open an URL in the current tab, but none exists
# yet.
self.tabopen(url)
else:
# Explicit count with a tab that doesn't exist.
return
else:
tab.openurl(url)
def cur_reload(self, count=None):