Merge branch 'acogneau-launch_time'

This commit is contained in:
Florian Bruhin 2015-08-07 22:32:30 +02:00
commit 0acbd77ada
4 changed files with 12 additions and 3 deletions

View File

@ -147,13 +147,13 @@ Contributors, sorted by the number of commits in descending order:
* Peter Vilim
* John ShaggyTwoDope Jenkins
* Jimmy
* Alexander Cogneau
* Zach-Button
* rikn00
* Patric Schmitz
* Martin Zimmermann
* Error 800
* Brian Jackson
* Alexander Cogneau
* sbinix
* Tobias Patzl
* Johannes Altmanninger

View File

@ -29,6 +29,7 @@ import time
import shutil
import tempfile
import atexit
import datetime
from PyQt5.QtWidgets import QApplication
from PyQt5.QtGui import QDesktopServices, QPixmap, QIcon, QCursor, QWindow
@ -712,6 +713,8 @@ class Application(QApplication):
objreg.register('args', args)
objreg.register('app', self)
self.launch_time = datetime.datetime.now()
def __repr__(self):
return utils.get_repr(self)

View File

@ -348,7 +348,7 @@ class ConfigManager(QObject):
CHANGED_OPTIONS = {
('content', 'cookies-accept'):
_get_value_transformer('default', 'no-3rdparty'),
('tabbar', 'position'): _transform_position,
('tabs', 'position'): _transform_position,
('ui', 'downloads-position'): _transform_position,
}

View File

@ -29,7 +29,7 @@ import pkg_resources
from PyQt5.QtCore import pyqtSlot, Qt, QSize, qVersion
from PyQt5.QtWidgets import (QDialog, QLabel, QTextEdit, QPushButton,
QVBoxLayout, QHBoxLayout, QCheckBox,
QDialogButtonBox, QMessageBox)
QDialogButtonBox, QMessageBox, QApplication)
import qutebrowser
from qutebrowser.utils import version, log, utils, objreg, qtutils
@ -219,6 +219,12 @@ class _CrashDialog(QDialog):
cmdhist: A list with the command history (as strings)
exc: An exception tuple (type, value, traceback)
"""
try:
application = QApplication.instance()
launch_time = application.launch_time.ctime()
self._crash_info.append(('Launch time', launch_time))
except Exception:
self._crash_info.append(("Launch time", traceback.format_exc()))
try:
self._crash_info.append(("Version info", version.version()))
except Exception: