Don't try to show an empty filename in the window title

This commit is contained in:
Thorbjørn Lindeijer
2009-06-12 12:57:30 +02:00
parent 7348779297
commit 7907e447b0

View File

@@ -890,7 +890,9 @@ void SessionManager::updateWindowTitle()
} }
if (m_core->editorManager()->currentEditor()) { if (m_core->editorManager()->currentEditor()) {
QFileInfo fi(m_core->editorManager()->currentEditor()->file()->fileName()); QFileInfo fi(m_core->editorManager()->currentEditor()->file()->fileName());
windowTitle.prepend(fi.fileName() + " - "); QString fileName = fi.fileName();
if (!fileName.isEmpty())
windowTitle.prepend(fileName + " - ");
m_core->mainWindow()->setWindowFilePath(fi.absoluteFilePath()); m_core->mainWindow()->setWindowFilePath(fi.absoluteFilePath());
} else { } else {
m_core->mainWindow()->setWindowFilePath(QString()); m_core->mainWindow()->setWindowFilePath(QString());