Fix set the title of the thread.

This commit is contained in:
Abhilash Raj 2021-05-31 21:53:54 -07:00
parent b8a96ada1f
commit eedb06f0ed
No known key found for this signature in database
GPG Key ID: 9D9B2BA061D0A67C

View File

@ -19,6 +19,7 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with QWeeChat. If not, see <http://www.gnu.org/licenses/>. # along with QWeeChat. If not, see <http://www.gnu.org/licenses/>.
# #
import traceback
from pkg_resources import resource_filename from pkg_resources import resource_filename
from qweechat.chat import ChatTextEdit from qweechat.chat import ChatTextEdit
@ -167,15 +168,17 @@ class Buffer(QtCore.QObject):
"""Update title.""" """Update title."""
try: try:
self.widget.set_title( self.widget.set_title(
color.remove(self.data['title'].decode('utf-8'))) color.remove(self.data['title']))
except: # noqa: E722 except Exception as e: # noqa: E722
# TODO: Debug print the exception to be fixed.
# traceback.print_exc()
self.widget.set_title(None) self.widget.set_title(None)
def update_prompt(self): def update_prompt(self):
"""Update prompt.""" """Update prompt."""
try: try:
self.widget.set_prompt(self.data['local_variables']['nick']) self.widget.set_prompt(self.data['local_variables']['nick'])
except: # noqa: E722 except Exception as e: # noqa: E722
self.widget.set_prompt(None) self.widget.set_prompt(None)
def input_text_sent(self, text): def input_text_sent(self, text):