cherry-pick #18: document-origin tracking in window title (015df38328)
This commit is contained in:
@@ -44,7 +44,9 @@
|
||||
#include "Application.h"
|
||||
#include "Document.h"
|
||||
#include "FileDialog.h"
|
||||
#include "FileOrigin.h"
|
||||
#include "MainWindow.h"
|
||||
#include "OriginManager.h"
|
||||
#include "ViewProviderDocumentObject.h"
|
||||
|
||||
|
||||
@@ -522,6 +524,13 @@ QString MDIView::buildWindowTitle() const
|
||||
QString windowTitle;
|
||||
if (auto document = getAppDocument()) {
|
||||
windowTitle.append(QString::fromStdString(document->Label.getStrValue()));
|
||||
|
||||
// Append origin suffix for non-local origins
|
||||
FileOrigin* origin = OriginManager::instance()->originForDocument(document);
|
||||
if (origin && origin->type() != OriginType::Local) {
|
||||
windowTitle.append(QStringLiteral(" [%1]")
|
||||
.arg(QString::fromStdString(origin->nickname())));
|
||||
}
|
||||
}
|
||||
|
||||
return windowTitle;
|
||||
|
||||
Reference in New Issue
Block a user