1
0
Kandrashin Denis 13 жил өмнө
parent
commit
25f8280552
1 өөрчлөгдсөн 7 нэмэгдсэн , 2 устгасан
  1. 7 2
      source/fb2main.cpp

+ 7 - 2
source/fb2main.cpp

@@ -315,17 +315,23 @@ void MainWindow::setCurrentFile(const QString &filename, QTextDocument * documen
 {
     static int sequenceNumber = 1;
 
+    QString title;
     isUntitled = filename.isEmpty();
     if (isUntitled) {
         curFile = tr("book%1.fb2").arg(sequenceNumber++);
+        title = curFile;
     } else {
-        curFile = QFileInfo(filename).canonicalFilePath();
+        QFileInfo info = filename;
+        curFile = info.canonicalFilePath();
+        title = info.fileName();
     }
+    title += QString(" - ") += qApp->applicationName();
 
     if (document) textEdit->setDocument(document); else textEdit->clear();
     textEdit->document()->setModified(false);
     setWindowModified(false);
     setWindowFilePath(curFile);
+    setWindowTitle(title);
 }
 
 QString MainWindow::strippedName(const QString &fullFileName)
@@ -344,4 +350,3 @@ MainWindow *MainWindow::findMainWindow(const QString &fileName)
     }
     return 0;
 }
-