Added a few checks before removing buffers in local database

This commit is contained in:
Manuel Cortez 2017-03-24 05:25:02 -06:00
parent d9e972115b
commit 66774174ae

View File

@ -363,6 +363,7 @@ class baseBufferController(bufferController):
if self.name[:-9] in self.session.settings["other_buffers"]["timelines"]: if self.name[:-9] in self.session.settings["other_buffers"]["timelines"]:
self.session.settings["other_buffers"]["timelines"].remove(self.name[:-9]) self.session.settings["other_buffers"]["timelines"].remove(self.name[:-9])
self.session.settings.write() self.session.settings.write()
if self.session.db.has_key(self.name):
self.session.db.pop(self.name) self.session.db.pop(self.name)
return True return True
elif dlg == widgetUtils.NO: elif dlg == widgetUtils.NO:
@ -375,6 +376,7 @@ class baseBufferController(bufferController):
if dlg == widgetUtils.YES: if dlg == widgetUtils.YES:
if self.name[:-9] in self.session.settings["other_buffers"]["favourites_timelines"]: if self.name[:-9] in self.session.settings["other_buffers"]["favourites_timelines"]:
self.session.settings["other_buffers"]["favourites_timelines"].remove(self.name[:-9]) self.session.settings["other_buffers"]["favourites_timelines"].remove(self.name[:-9])
if self.session.db.has_key(self.name):
self.session.db.pop(self.name) self.session.db.pop(self.name)
self.session.settings.write() self.session.settings.write()
return True return True
@ -734,6 +736,7 @@ class listBufferController(baseBufferController):
if dlg == widgetUtils.YES: if dlg == widgetUtils.YES:
if self.name[:-5] in self.session.settings["other_buffers"]["lists"]: if self.name[:-5] in self.session.settings["other_buffers"]["lists"]:
self.session.settings["other_buffers"]["lists"].remove(self.name[:-5]) self.session.settings["other_buffers"]["lists"].remove(self.name[:-5])
if self.session.db.has_key(self.name):
self.session.db.pop(self.name) self.session.db.pop(self.name)
self.session.settings.write() self.session.settings.write()
return True return True
@ -820,6 +823,7 @@ class peopleBufferController(baseBufferController):
if dlg == widgetUtils.YES: if dlg == widgetUtils.YES:
if self.name[:-10] in self.session.settings["other_buffers"]["followers_timelines"]: if self.name[:-10] in self.session.settings["other_buffers"]["followers_timelines"]:
self.session.settings["other_buffers"]["followers_timelines"].remove(self.name[:-10]) self.session.settings["other_buffers"]["followers_timelines"].remove(self.name[:-10])
if self.session.db.has_key(self.name):
self.session.db.pop(self.name) self.session.db.pop(self.name)
self.session.settings.write() self.session.settings.write()
return True return True
@ -833,6 +837,7 @@ class peopleBufferController(baseBufferController):
if dlg == widgetUtils.YES: if dlg == widgetUtils.YES:
if self.name[:-8] in self.session.settings["other_buffers"]["friends_timelines"]: if self.name[:-8] in self.session.settings["other_buffers"]["friends_timelines"]:
self.session.settings["other_buffers"]["friends_timelines"].remove(self.name[:-8]) self.session.settings["other_buffers"]["friends_timelines"].remove(self.name[:-8])
if self.session.db.has_key(self.name):
self.session.db.pop(self.name) self.session.db.pop(self.name)
self.session.settings.write() self.session.settings.write()
return True return True
@ -991,6 +996,7 @@ class searchBufferController(baseBufferController):
self.session.settings["other_buffers"]["tweet_searches"].remove(self.name[:-11]) self.session.settings["other_buffers"]["tweet_searches"].remove(self.name[:-11])
self.session.settings.write() self.session.settings.write()
self.timer.cancel() self.timer.cancel()
if self.session.db.has_key(self.name):
self.session.db.pop(self.name) self.session.db.pop(self.name)
return True return True
elif dlg == widgetUtils.NO: elif dlg == widgetUtils.NO:
@ -1036,6 +1042,7 @@ class searchPeopleBufferController(peopleBufferController):
self.session.settings["other_buffers"]["tweet_searches"].remove(self.name[:-11]) self.session.settings["other_buffers"]["tweet_searches"].remove(self.name[:-11])
self.session.settings.write() self.session.settings.write()
self.timer.cancel() self.timer.cancel()
if self.session.db.has_key(self.name):
self.session.db.pop(self.name) self.session.db.pop(self.name)
return True return True
elif dlg == widgetUtils.NO: elif dlg == widgetUtils.NO:
@ -1108,6 +1115,7 @@ class trendsBufferController(bufferController):
self.session.settings["other_buffers"]["trending_topic_buffers"].remove(self.name[:-3]) self.session.settings["other_buffers"]["trending_topic_buffers"].remove(self.name[:-3])
self.session.settings.write() self.session.settings.write()
self.timer.cancel() self.timer.cancel()
if self.session.db.has_key(self.name):
self.session.db.pop(self.name) self.session.db.pop(self.name)
return True return True
elif dlg == widgetUtils.NO: elif dlg == widgetUtils.NO: