From 3e1ea4e6b0b09c8c2ccbfdbabd50c5069c029707 Mon Sep 17 00:00:00 2001 From: Jonathan Thomas Date: Thu, 27 May 2010 10:41:57 -0400 Subject: Encapsulate single characters in single quotes, since passing a char to QString is more efficient than passing a one-character string. --- src/bookmarks/bookmarkcontextmenu.cpp | 6 +++--- src/bookmarks/bookmarksmanager.cpp | 2 +- src/mainview.cpp | 2 +- src/newtabpage.cpp | 2 +- src/urlbar/urlresolver.cpp | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/bookmarks/bookmarkcontextmenu.cpp b/src/bookmarks/bookmarkcontextmenu.cpp index c96fa7bf..78d64aa5 100644 --- a/src/bookmarks/bookmarkcontextmenu.cpp +++ b/src/bookmarks/bookmarkcontextmenu.cpp @@ -234,10 +234,10 @@ void BookmarkContextMenu::deleteBookmark() void BookmarkContextMenu::editBookmark() { KBookmark selected = bookmark(); - selected.setFullText(selected.text().replace("&&", "&")); + selected.setFullText(selected.text().replace("&&", '&')); KBookmarkDialog *dialog = owner()->bookmarkDialog(manager(), QApplication::activeWindow()); dialog->editBookmark(selected); - selected.setFullText(selected.text().replace("&", "&&")); + selected.setFullText(selected.text().replace('&', "&&")); delete dialog; } @@ -319,7 +319,7 @@ void BookmarkContextMenu::bookmarkCurrentPage() if (selected.isGroup()) parent = selected.toGroup(); - KBookmark newBk = parent.addBookmark(owner()->currentTitle().replace("&", "&&"), KUrl(owner()->currentUrl()), "text-html"); + KBookmark newBk = parent.addBookmark(owner()->currentTitle().replace('&', "&&"), KUrl(owner()->currentUrl()), "text-html"); parent.moveBookmark(newBk, selected.parentGroup().previous(selected)); } diff --git a/src/bookmarks/bookmarksmanager.cpp b/src/bookmarks/bookmarksmanager.cpp index c06375b5..bac45b61 100644 --- a/src/bookmarks/bookmarksmanager.cpp +++ b/src/bookmarks/bookmarksmanager.cpp @@ -412,7 +412,7 @@ void BookmarkProvider::fillBookmarkBar(KToolBar *toolBar) else { KBookmarkAction* a = new KBookmarkAction(bookmark, m_owner, this); - a->setIconText(a->iconText().replace("&", "&&")); + a->setIconText(a->iconText().replace('&', "&&")); toolBar->addAction(a); } } diff --git a/src/mainview.cpp b/src/mainview.cpp index 0bc6fbde..84dc70af 100644 --- a/src/mainview.cpp +++ b/src/mainview.cpp @@ -596,7 +596,7 @@ void MainView::webViewTitleChanged(const QString &title) { QString viewTitle = title.isEmpty()? i18n("(Untitled)") : title; QString tabTitle = viewTitle; - tabTitle.replace("&", "&&"); + tabTitle.replace('&', "&&"); WebView *view = qobject_cast(sender()); int index = indexOf(view->parentWidget()); diff --git a/src/newtabpage.cpp b/src/newtabpage.cpp index 015e655b..2ab52c50 100644 --- a/src/newtabpage.cpp +++ b/src/newtabpage.cpp @@ -582,7 +582,7 @@ void NewTabPage::downloadsPage() div.appendInside("" + date + ""); div.appendInside("
"); - div.appendInside("" + item.srcUrlString + ""); + div.appendInside(""); div.appendInside("
"); div.appendInside(markup("a")); diff --git a/src/urlbar/urlresolver.cpp b/src/urlbar/urlresolver.cpp index 494c8145..7333e305 100644 --- a/src/urlbar/urlresolver.cpp +++ b/src/urlbar/urlresolver.cpp @@ -91,7 +91,7 @@ UrlResolver::UrlResolver(const QString &typedUrl) "y[etu]|z[amw]|aero|arpa|biz|com|coop|edu|info|int|gov|mil|museum|name|net|org|"\ "pro)"; - _browseRegexp = QRegExp("(" + protocol + ")|(" + local + ")|(" + address + ")|(" + ipv6 + ")|(" + ipv4 +")"); + _browseRegexp = QRegExp('(' + protocol + ")|(" + local + ")|(" + address + ")|(" + ipv6 + ")|(" + ipv4 +')'); } } -- cgit v1.2.1