2 minor bug fixes

This commit is contained in:
ingvar1995 2017-01-22 00:19:56 +03:00
parent 9b4965d591
commit 889d3d8f9c
2 changed files with 12 additions and 3 deletions

View file

@ -690,6 +690,10 @@ class MainWindow(QtGui.QMainWindow, Singleton):
else: else:
super(MainWindow, self).mouseReleaseEvent(event) super(MainWindow, self).mouseReleaseEvent(event)
def show(self):
super().show()
self.profile.update()
def filtering(self): def filtering(self):
ind = self.online_contacts.currentIndex() ind = self.online_contacts.currentIndex()
d = {0: 0, 1: 1, 2: 2, 3: 4, 4: 1 | 4, 5: 2 | 4} d = {0: 0, 1: 1, 2: 2, 3: 4, 4: 1 | 4, 5: 2 | 4}

View file

@ -37,7 +37,7 @@ def remove(folder):
def convert_time(t): def convert_time(t):
offset = time.timezone + time_offset() * 3600 offset = time.timezone + time_offset() * 60
sec = int(t) - offset sec = int(t) - offset
m, s = divmod(sec, 60) m, s = divmod(sec, 60)
h, m = divmod(m, 60) h, m = divmod(m, 60)
@ -46,12 +46,17 @@ def convert_time(t):
def time_offset(): def time_offset():
hours = time.strftime('%H') if hasattr(time_offset, 'offset'):
return time_offset.offset
hours = int(time.strftime('%H'))
minutes = int(time.strftime('%M'))
sec = int(time.time()) - time.timezone sec = int(time.time()) - time.timezone
m, s = divmod(sec, 60) m, s = divmod(sec, 60)
h, m = divmod(m, 60) h, m = divmod(m, 60)
d, h = divmod(h, 24) d, h = divmod(h, 24)
return int(hours) - h result = hours * 60 + minutes - h * 60 - m
time_offset.offset = result
return result
def append_slash(s): def append_slash(s):