diff options
| author | Arjun AK <[email protected]> | 2014-12-01 17:31:39 +0530 |
|---|---|---|
| committer | Arjun AK <[email protected]> | 2014-12-01 17:31:39 +0530 |
| commit | 1d7b3b8df525d72126c716c9809c058f481e873e (patch) | |
| tree | 8e21bf2c05ba402afb5b961af3c8041c2fbdb3ed | |
| parent | de7eefeb7e61ad343ea5483b36a7a39518b48747 (diff) | |
Fix KUrl -> QUrl porting error
Trailing slashes should be removed before calling QUrl::filename(),
else it will return an empty string.
BUG: 341411
REVIEW: 121293
| -rw-r--r-- | src/dolphinmainwindow.cpp | 6 | ||||
| -rw-r--r-- | src/dolphintabwidget.cpp | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 81aa1e810..526f80474 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -969,7 +969,11 @@ void DolphinMainWindow::setUrlAsCaption(const QUrl& url) } } - const QString fileName = url.fileName().isEmpty() ? "/" : url.fileName(); + QString fileName = url.adjusted(QUrl::StripTrailingSlash).fileName(); + if (fileName.isEmpty()) { + fileName = '/'; + } + caption.append(fileName); setCaption(caption); diff --git a/src/dolphintabwidget.cpp b/src/dolphintabwidget.cpp index b38cd5146..a0c9b9d81 100644 --- a/src/dolphintabwidget.cpp +++ b/src/dolphintabwidget.cpp @@ -348,7 +348,7 @@ QString DolphinTabWidget::tabName(const QUrl& url) const if (url == QUrl("file:///")) { name = '/'; } else { - name = url.fileName(); + name = url.adjusted(QUrl::StripTrailingSlash).fileName(); if (name.isEmpty()) { name = url.scheme(); } else { |
