Changeset View
Changeset View
Standalone View
Standalone View
krita/sketch/MainWindow.cpp
Show First 20 Lines • Show All 147 Lines • ▼ Show 20 Line(s) | 145 | if (view->errors().count() > 0) { | |||
---|---|---|---|---|---|
148 | } | 148 | } | ||
149 | } | 149 | } | ||
150 | 150 | | |||
151 | setCentralWidget(view); | 151 | setCentralWidget(view); | ||
152 | } | 152 | } | ||
153 | 153 | | |||
154 | void MainWindow::resetWindowTitle() | 154 | void MainWindow::resetWindowTitle() | ||
155 | { | 155 | { | ||
156 | const QString currentFile = DocumentManager::instance()->settingsManager()->currentFile(); | 156 | QUrl url(DocumentManager::instance()->settingsManager()->currentFile()); | ||
157 | const QString fileName = | 157 | QString fileName = url.fileName(); | ||
158 | currentFile.startsWith(QLatin1String("temp://")) ? i18n("Untitled") : QFileInfo(currentFile).fileName(); | 158 | if(url.scheme() == "temp") | ||
159 | fileName = i18n("Untitled"); | ||||
159 | 160 | | |||
160 | KoDialog::CaptionFlags flags = KoDialog::HIGCompliantCaption; | 161 | KoDialog::CaptionFlags flags = KoDialog::HIGCompliantCaption; | ||
161 | KisDocument* document = DocumentManager::instance()->document(); | 162 | KisDocument* document = DocumentManager::instance()->document(); | ||
162 | if (document && document->isModified() ) { | 163 | if (document && document->isModified() ) { | ||
163 | flags |= KoDialog::ModifiedCaption; | 164 | flags |= KoDialog::ModifiedCaption; | ||
164 | } | 165 | } | ||
165 | 166 | | |||
166 | setWindowTitle( KoDialog::makeStandardCaption(fileName, this, flags) ); | 167 | setWindowTitle( KoDialog::makeStandardCaption(fileName, this, flags) ); | ||
▲ Show 20 Lines • Show All 87 Lines • Show Last 20 Lines |