From e0412f0249e5357c6ab7f6a10e2af8156725a767 Mon Sep 17 00:00:00 2001 From: John Fultz Date: Thu, 7 Jul 2016 01:54:31 -0500 Subject: Put filename in window title. --- quacker/quacker.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'quacker') diff --git a/quacker/quacker.cpp b/quacker/quacker.cpp index ffe6531..01e778a 100644 --- a/quacker/quacker.cpp +++ b/quacker/quacker.cpp @@ -788,7 +788,14 @@ void TopLevel::setCaption(const QString &text) if (!text.isNull()) m_ourCaption = text; - setWindowTitle(QString("%1[*] - Quackle").arg(m_ourCaption)); + if (m_filename.isEmpty()) + setWindowTitle(QString("%1 - Quackle").arg(m_ourCaption)); + else + { + QString filename = QDir::fromNativeSeparators(m_filename); + filename = filename.mid(filename.lastIndexOf('/') + 1); + setWindowTitle(QString("%1[*] - %2 - Quackle").arg(filename, m_ourCaption)); + } } void TopLevel::setModified(bool modified) -- cgit v1.2.3