X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/01f577fda1b2ee522a0e87edab7c079c8b553860..ba6f7b0232b030b2b3eda4fc126cbc3aba05e5d2:/src/urlnavigator.cpp diff --git a/src/urlnavigator.cpp b/src/urlnavigator.cpp index 6ab73976a..1545a4907 100644 --- a/src/urlnavigator.cpp +++ b/src/urlnavigator.cpp @@ -136,7 +136,7 @@ void UrlNavigator::setUrl(const KUrl& url) { QString urlStr(url.pathOrUrl()); //kDebug() << "setUrl(" << url << ")" << endl; - if (urlStr.at(0) == '~') { + if ( urlStr.length() > 0 && urlStr.at(0) == '~') { // replace '~' by the home directory urlStr.remove(0, 1); urlStr.insert(0, QDir::home().path()); @@ -203,7 +203,7 @@ KUrl UrlNavigator::url(int index) const QString path(url().pathOrUrl()); path = path.section('/', 0, index); - if (path.at(path.length()-1) != '/') + if ( path.length() >= 1 && path.at(path.length()-1) != '/') { path.append('/'); } @@ -470,7 +470,7 @@ void UrlNavigator::updateContent() m_toggleButton->setToolTip(QString()); QString path(url().pathOrUrl()); - const KAction* action = dolphinView()->mainWindow()->actionCollection()->action("editable_location"); + const QAction* action = dolphinView()->mainWindow()->actionCollection()->action("editable_location"); // TODO: registry of default shortcuts QString shortcut = action? action->shortcut().toString() : "Ctrl+L"; if (m_toggleButton->isChecked()) {