diff options
author | John Fultz <jfultz@wolfram.com> | 2016-07-07 01:54:31 -0500 |
---|---|---|
committer | John Fultz <jfultz@wolfram.com> | 2016-07-07 01:54:31 -0500 |
commit | e0412f0249e5357c6ab7f6a10e2af8156725a767 (patch) | |
tree | 9315a449dde11a6d7e0f772f67148f59e5bef9d4 | |
parent | b7ef6d7b81191e123e0ad8a35ae561c962e77945 (diff) |
Put filename in window title.
-rw-r--r-- | quacker/quacker.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
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) |