From b2181f0bab3a2f1a3b165171ad0886752573b78d Mon Sep 17 00:00:00 2001 From: nowrep Date: Sun, 2 Sep 2012 11:42:41 +0200 Subject: [PATCH] Coding style: Use empty QString() constructor instead of "" everywhere --- src/lib/3rdparty/ecwin7.cpp | 2 +- src/lib/3rdparty/qtsingleapplication.cpp | 2 +- src/lib/adblock/adblockrule.cpp | 4 +-- src/lib/app/mainapplication.cpp | 4 +-- src/lib/app/qupzilla.cpp | 2 +- src/lib/app/qupzilla.h | 2 +- src/lib/autofill/autofillmodel.cpp | 2 +- src/lib/autofill/autofillnotification.ui | 3 -- src/lib/bookmarks/bookmarksmanager.cpp | 2 +- src/lib/bookmarks/bookmarksmodel.h | 2 +- .../desktopnotification.ui | 3 -- .../desktopnotificationsfactory.cpp | 2 +- src/lib/downloads/downloaditem.ui | 6 ---- src/lib/downloads/downloadmanager.cpp | 6 ++-- .../completer/locationcompleterdelegate.cpp | 8 ++++-- src/lib/network/networkproxyfactory.cpp | 12 ++++---- .../schemehandlers/fileschemehandler.cpp | 2 +- .../schemehandlers/qupzillaschemehandler.cpp | 2 +- src/lib/opensearch/searchenginesmanager.cpp | 2 +- src/lib/other/statusbarmessage.cpp | 2 +- src/lib/plugins/speeddial.cpp | 6 ++-- src/lib/popupwindow/popupstatusbarmessage.cpp | 2 +- src/lib/preferences/autofillmanager.ui | 3 -- src/lib/preferences/pluginslist.ui | 3 -- src/lib/rss/rssnotification.ui | 3 -- src/lib/rss/rsswidget.ui | 3 -- src/lib/sidebar/sidebar.cpp | 2 +- src/lib/tools/certificateinfowidget.cpp | 4 +-- src/lib/tools/docktitlebarwidget.ui | 6 +--- src/lib/webview/jsalert.ui | 3 -- src/lib/webview/jsconfirm.ui | 3 -- src/lib/webview/jsprompt.ui | 3 -- src/lib/webview/siteinfowidget.ui | 3 -- src/lib/webview/tabbedwebview.cpp | 6 ++-- src/lib/webview/tabwidget.cpp | 6 ++-- src/lib/webview/webtab.cpp | 2 +- src/lib/webview/webview.cpp | 4 +-- src/plugins/PIM/PIM_handler.cpp | 28 +++++++++---------- src/plugins/PIM/PIM_settings.cpp | 28 +++++++++---------- 39 files changed, 75 insertions(+), 113 deletions(-) diff --git a/src/lib/3rdparty/ecwin7.cpp b/src/lib/3rdparty/ecwin7.cpp index 379bfc931..2d124082e 100644 --- a/src/lib/3rdparty/ecwin7.cpp +++ b/src/lib/3rdparty/ecwin7.cpp @@ -75,7 +75,7 @@ void EcWin7::setOverlayIcon(QString iconName, QString description) if (mOverlayIcon != NULL) { oldIcon = mOverlayIcon; } - if (iconName == "") { + if (iconName.isEmpty()) { mTaskbar->SetOverlayIcon(mWindowId, NULL, NULL); mOverlayIcon = NULL; } diff --git a/src/lib/3rdparty/qtsingleapplication.cpp b/src/lib/3rdparty/qtsingleapplication.cpp index 81d75dc42..76043da73 100644 --- a/src/lib/3rdparty/qtsingleapplication.cpp +++ b/src/lib/3rdparty/qtsingleapplication.cpp @@ -295,7 +295,7 @@ bool QtSingleApplication::sendMessage(const QString &message, int timeout) */ QString QtSingleApplication::id() const { - return (peer ? peer->applicationId() : ""); + return (peer ? peer->applicationId() : QString()); } diff --git a/src/lib/adblock/adblockrule.cpp b/src/lib/adblock/adblockrule.cpp index d0b895e53..fb561f527 100644 --- a/src/lib/adblock/adblockrule.cpp +++ b/src/lib/adblock/adblockrule.cpp @@ -481,8 +481,8 @@ void AdBlockRule::parseFilter() if (parsedLine.contains('*') || parsedLine.contains('^') || parsedLine.contains('|')) { parsedLine.replace(QRegExp(QLatin1String("\\*+")), QLatin1String("*")) // remove multiple wildcards .replace(QRegExp(QLatin1String("\\^\\|$")), QLatin1String("^")) // remove anchors following separator placeholder - .replace(QRegExp(QLatin1String("^(\\*)")), QLatin1String("")) // remove leading wildcards - .replace(QRegExp(QLatin1String("(\\*)$")), QLatin1String("")) + .replace(QRegExp(QLatin1String("^(\\*)")), QString()) // remove leading wildcards + .replace(QRegExp(QLatin1String("(\\*)$")), QString()) .replace(QRegExp(QLatin1String("(\\W)")), QLatin1String("\\\\1")) // escape special symbols .replace(QRegExp(QLatin1String("^\\\\\\|\\\\\\|")), QLatin1String("^[\\w\\-]+:\\/+(?!\\/)(?:[^\\/]+\\.)?")) // process extended anchor at expression start diff --git a/src/lib/app/mainapplication.cpp b/src/lib/app/mainapplication.cpp index fa292f7e2..3dc86fb65 100644 --- a/src/lib/app/mainapplication.cpp +++ b/src/lib/app/mainapplication.cpp @@ -372,7 +372,7 @@ void MainApplication::loadSettings() #endif setWheelScrollLines(settings.value("wheelScrollLines", wheelScrollLines()).toInt()); - m_websettings->setUserStyleSheetUrl(userStyleSheet(settings.value("userStyleSheet", "").toString())); + m_websettings->setUserStyleSheetUrl(userStyleSheet(settings.value("userStyleSheet", QString()).toString())); settings.endGroup(); settings.beginGroup("Browser-Fonts"); @@ -803,7 +803,7 @@ void MainApplication::reloadUserStyleSheet() { Settings settings; settings.beginGroup("Web-Browser-Settings"); - m_websettings->setUserStyleSheetUrl(userStyleSheet(settings.value("userStyleSheet", "").toString())); + m_websettings->setUserStyleSheetUrl(userStyleSheet(settings.value("userStyleSheet", QString()).toString())); settings.endGroup(); } diff --git a/src/lib/app/qupzilla.cpp b/src/lib/app/qupzilla.cpp index 6ba8f90a1..eaaa517d2 100644 --- a/src/lib/app/qupzilla.cpp +++ b/src/lib/app/qupzilla.cpp @@ -145,7 +145,7 @@ void QupZilla::postLaunch() switch (afterLaunch) { case 0: - startUrl = QUrl(""); + startUrl = QUrl(); break; case 2: diff --git a/src/lib/app/qupzilla.h b/src/lib/app/qupzilla.h index 85ef0a872..1f1498682 100644 --- a/src/lib/app/qupzilla.h +++ b/src/lib/app/qupzilla.h @@ -117,7 +117,7 @@ public slots: void bookmarkPage(); void loadAddress(const QUrl &url); - void showSource(QWebFrame* frame = 0, const QString &selectedHtml = ""); + void showSource(QWebFrame* frame = 0, const QString &selectedHtml = QString()); void printPage(QWebFrame* frame = 0); void showPageInfo(); void receiveMessage(Qz::AppMessageType mes, bool state); diff --git a/src/lib/autofill/autofillmodel.cpp b/src/lib/autofill/autofillmodel.cpp index 9f2ad3e62..7b402a219 100644 --- a/src/lib/autofill/autofillmodel.cpp +++ b/src/lib/autofill/autofillmodel.cpp @@ -238,7 +238,7 @@ void AutoFillModel::completePage(WebPage* page) for (int i = 0; i < inputs.count(); i++) { QWebElement element = inputs.at(i); - if (element.attribute("type") != "text" && element.attribute("type") != "password" && element.attribute("type") != "") { + if (element.attribute("type") != "text" && element.attribute("type") != "password" && !element.attribute("type").isEmpty()) { continue; } diff --git a/src/lib/autofill/autofillnotification.ui b/src/lib/autofill/autofillnotification.ui index 180c0c291..d61738912 100644 --- a/src/lib/autofill/autofillnotification.ui +++ b/src/lib/autofill/autofillnotification.ui @@ -16,9 +16,6 @@ 0 - - Form - 3 diff --git a/src/lib/bookmarks/bookmarksmanager.cpp b/src/lib/bookmarks/bookmarksmanager.cpp index 05d82f1bb..ba3261756 100644 --- a/src/lib/bookmarks/bookmarksmanager.cpp +++ b/src/lib/bookmarks/bookmarksmanager.cpp @@ -181,7 +181,7 @@ void BookmarksManager::itemChanged(QTreeWidgetItem* item) int id = item->data(0, Qt::UserRole + 10).toInt(); ui->bookmarksTree->deleteItem(item); - m_bookmarksModel->editBookmark(id, name, url, ""); + m_bookmarksModel->editBookmark(id, name, url, QString()); } void BookmarksManager::itemControlClicked(QTreeWidgetItem* item) diff --git a/src/lib/bookmarks/bookmarksmodel.h b/src/lib/bookmarks/bookmarksmodel.h index 13098853c..02fdea897 100644 --- a/src/lib/bookmarks/bookmarksmodel.h +++ b/src/lib/bookmarks/bookmarksmodel.h @@ -85,7 +85,7 @@ public: void removeBookmark(int id); void removeBookmark(const QList list); - bool editBookmark(int id, const QString &title = "", const QUrl &url = QUrl(), const QString &folder = ""); + bool editBookmark(int id, const QString &title = QString(), const QUrl &url = QUrl(), const QString &folder = QString()); bool changeIcon(int id, const QIcon &icon); bool createFolder(const QString &name); diff --git a/src/lib/desktopnotifications/desktopnotification.ui b/src/lib/desktopnotifications/desktopnotification.ui index 280a65f9b..61d55ecb0 100644 --- a/src/lib/desktopnotifications/desktopnotification.ui +++ b/src/lib/desktopnotifications/desktopnotification.ui @@ -10,9 +10,6 @@ 74 - - - 0 diff --git a/src/lib/desktopnotifications/desktopnotificationsfactory.cpp b/src/lib/desktopnotifications/desktopnotificationsfactory.cpp index 58a9b21d8..4070f446b 100644 --- a/src/lib/desktopnotifications/desktopnotificationsfactory.cpp +++ b/src/lib/desktopnotifications/desktopnotificationsfactory.cpp @@ -115,7 +115,7 @@ void DesktopNotificationsFactory::nativeNotificationPreview() args.append(m_uint); args.append(tmp.fileName()); args.append(QObject::tr("Native System Notification")); - args.append(""); + args.append(QString()); args.append(QStringList()); args.append(QVariantMap()); args.append(m_timeout); diff --git a/src/lib/downloads/downloaditem.ui b/src/lib/downloads/downloaditem.ui index c91827706..a0a32b7e1 100644 --- a/src/lib/downloads/downloaditem.ui +++ b/src/lib/downloads/downloaditem.ui @@ -10,9 +10,6 @@ 73 - - - 2 @@ -73,9 +70,6 @@ false - - - diff --git a/src/lib/downloads/downloadmanager.cpp b/src/lib/downloads/downloadmanager.cpp index 70425e0be..789cac5f1 100644 --- a/src/lib/downloads/downloadmanager.cpp +++ b/src/lib/downloads/downloadmanager.cpp @@ -67,14 +67,14 @@ void DownloadManager::loadSettings() { Settings settings; settings.beginGroup("DownloadManager"); - m_downloadPath = settings.value("defaultDownloadPath", "").toString(); + m_downloadPath = settings.value("defaultDownloadPath", QString()).toString(); m_lastDownloadPath = settings.value("lastDownloadPath", QDir::homePath().append("/")).toString(); m_closeOnFinish = settings.value("CloseManagerOnFinish", false).toBool(); m_useNativeDialog = settings.value("useNativeDialog", DEFAULT_DOWNLOAD_USE_NATIVE_DIALOG).toBool(); m_useExternalManager = settings.value("UseExternalManager", false).toBool(); - m_externalExecutable = settings.value("ExternalManagerExecutable", "").toString(); - m_externalArguments = settings.value("ExternalManagerArguments", "").toString(); + m_externalExecutable = settings.value("ExternalManagerExecutable", QString()).toString(); + m_externalArguments = settings.value("ExternalManagerArguments", QString()).toString(); settings.endGroup(); } diff --git a/src/lib/navigation/completer/locationcompleterdelegate.cpp b/src/lib/navigation/completer/locationcompleterdelegate.cpp index a41bd564b..c5d48ab35 100644 --- a/src/lib/navigation/completer/locationcompleterdelegate.cpp +++ b/src/lib/navigation/completer/locationcompleterdelegate.cpp @@ -112,9 +112,11 @@ void LocationCompleterDelegate::paint(QPainter* painter, const QStyleOptionViewI drawHighlightedTextLine(linkRect, link, searchText, painter, style, opt, colorLinkRole); - // Draw line at the very bottom of item - QRect lineRect(opt.rect.left(), opt.rect.bottom(), opt.rect.width(), 1); - painter->fillRect(lineRect, opt.palette.color(QPalette::AlternateBase)); + // Draw line at the very bottom of item if the item is not highlighted + if (!(opt.state & QStyle::State_Selected)) { + QRect lineRect(opt.rect.left(), opt.rect.bottom(), opt.rect.width(), 1); + painter->fillRect(lineRect, opt.palette.color(QPalette::AlternateBase)); + } } bool sizeBiggerThan(const QString &s1, const QString &s2) diff --git a/src/lib/network/networkproxyfactory.cpp b/src/lib/network/networkproxyfactory.cpp index 87e5e4028..dedab22f6 100644 --- a/src/lib/network/networkproxyfactory.cpp +++ b/src/lib/network/networkproxyfactory.cpp @@ -33,15 +33,15 @@ void NetworkProxyFactory::loadSettings() m_proxyType = QNetworkProxy::ProxyType(settings.value("ProxyType", QNetworkProxy::HttpProxy).toInt()); m_useDifferentProxyForHttps = settings.value("UseDifferentProxyForHttps", false).toBool(); - m_hostName = settings.value("HostName", "").toString(); + m_hostName = settings.value("HostName", QString()).toString(); m_port = settings.value("Port", 8080).toInt(); - m_username = settings.value("Username", "").toString(); - m_password = settings.value("Password", "").toString(); + m_username = settings.value("Username", QString()).toString(); + m_password = settings.value("Password", QString()).toString(); - m_httpsHostName = settings.value("HttpsHostName", "").toString(); + m_httpsHostName = settings.value("HttpsHostName", QString()).toString(); m_httpsPort = settings.value("HttpsPort", 8080).toInt(); - m_httpsUsername = settings.value("HttpsUsername", "").toString(); - m_httpsPassword = settings.value("HttpsPassword", "").toString(); + m_httpsUsername = settings.value("HttpsUsername", QString()).toString(); + m_httpsPassword = settings.value("HttpsPassword", QString()).toString(); m_proxyExceptions = settings.value("ProxyExceptions", QStringList() << "localhost" << "127.0.0.1").toStringList(); settings.endGroup(); diff --git a/src/lib/network/schemehandlers/fileschemehandler.cpp b/src/lib/network/schemehandlers/fileschemehandler.cpp index 7c2f3fedc..70d6d7486 100644 --- a/src/lib/network/schemehandlers/fileschemehandler.cpp +++ b/src/lib/network/schemehandlers/fileschemehandler.cpp @@ -188,7 +188,7 @@ QString FileSchemeReply::loadDirectory() line += "\">"; line += info.fileName(); line += ""; - line += info.isDir() ? "" : qz_fileSizeToString(info.size()); + line += info.isDir() ? QString() : qz_fileSizeToString(info.size()); line += ""; line += info.lastModified().toString("dd.MM.yyyy"); line += ""; diff --git a/src/lib/network/schemehandlers/qupzillaschemehandler.cpp b/src/lib/network/schemehandlers/qupzillaschemehandler.cpp index e76496500..582e27b2d 100644 --- a/src/lib/network/schemehandlers/qupzillaschemehandler.cpp +++ b/src/lib/network/schemehandlers/qupzillaschemehandler.cpp @@ -176,7 +176,7 @@ QString QupZillaSchemeReply::startPage() sPage.replace("%SEARCH-BY%", tr("Search results provided by DuckDuckGo")); sPage.replace("%WWW%", QupZilla::WIKIADDRESS); sPage.replace("%ABOUT-QUPZILLA%", tr("About QupZilla")); - sPage.replace("%PRIVATE-BROWSING%", mApp->isPrivateSession() ? tr("

Private Browsing

") : ""); + sPage.replace("%PRIVATE-BROWSING%", mApp->isPrivateSession() ? tr("

Private Browsing

") : QString()); sPage = qz_applyDirectionToPage(sPage); return sPage; diff --git a/src/lib/opensearch/searchenginesmanager.cpp b/src/lib/opensearch/searchenginesmanager.cpp index 30866394d..6659ac7df 100644 --- a/src/lib/opensearch/searchenginesmanager.cpp +++ b/src/lib/opensearch/searchenginesmanager.cpp @@ -264,7 +264,7 @@ void SearchEnginesManager::addEngine(OpenSearchEngine* engine) en.name = engine->name(); en.url = engine->searchUrl("searchstring").toString().replace("searchstring", "%s"); if (engine->image().isNull()) { - en.icon = iconForSearchEngine(engine->searchUrl("")); + en.icon = iconForSearchEngine(engine->searchUrl(QString())); } else { en.icon = QIcon(QPixmap::fromImage(engine->image())); diff --git a/src/lib/other/statusbarmessage.cpp b/src/lib/other/statusbarmessage.cpp index 549a64336..e7bd0ffc0 100644 --- a/src/lib/other/statusbarmessage.cpp +++ b/src/lib/other/statusbarmessage.cpp @@ -138,7 +138,7 @@ void StatusBarMessage::showMessage(const QString &message) void StatusBarMessage::clearMessage() { if (p_QupZilla->statusBar()->isVisible()) { - p_QupZilla->statusBar()->showMessage(""); + p_QupZilla->statusBar()->showMessage(QString()); } else { m_statusBarText->hideDelayed(); diff --git a/src/lib/plugins/speeddial.cpp b/src/lib/plugins/speeddial.cpp index f04b8d719..8707a84f5 100644 --- a/src/lib/plugins/speeddial.cpp +++ b/src/lib/plugins/speeddial.cpp @@ -45,8 +45,8 @@ void SpeedDial::loadSettings() Settings settings; settings.beginGroup("SpeedDial"); - QString allPages = settings.value("pages", "").toString(); - m_backgroundImage = settings.value("background", "").toString(); + QString allPages = settings.value("pages", QString()).toString(); + m_backgroundImage = settings.value("background", QString()).toString(); m_backgroundImageSize = settings.value("backsize", "auto").toString(); m_maxPagesInRow = settings.value("pagesrow", 4).toInt(); m_sizeOfSpeedDials = settings.value("sdsize", 231).toInt(); @@ -217,7 +217,7 @@ QString SpeedDial::initialScript() imgSource = "qrc:html/loading.gif"; if (page.url.isEmpty()) { - imgSource = ""; + imgSource.clear(); } } else { diff --git a/src/lib/popupwindow/popupstatusbarmessage.cpp b/src/lib/popupwindow/popupstatusbarmessage.cpp index 8141c35d1..17d854529 100644 --- a/src/lib/popupwindow/popupstatusbarmessage.cpp +++ b/src/lib/popupwindow/popupstatusbarmessage.cpp @@ -77,7 +77,7 @@ void PopupStatusBarMessage::showMessage(const QString &message) void PopupStatusBarMessage::clearMessage() { if (m_popupWindow->statusBar()->isVisible()) { - m_popupWindow->statusBar()->showMessage(""); + m_popupWindow->statusBar()->showMessage(QString()); } else { m_statusBarText->hideDelayed(); diff --git a/src/lib/preferences/autofillmanager.ui b/src/lib/preferences/autofillmanager.ui index 5aa0ca745..298ac3853 100644 --- a/src/lib/preferences/autofillmanager.ui +++ b/src/lib/preferences/autofillmanager.ui @@ -10,9 +10,6 @@ 348
- - - diff --git a/src/lib/preferences/pluginslist.ui b/src/lib/preferences/pluginslist.ui index 76a865092..2e9648938 100644 --- a/src/lib/preferences/pluginslist.ui +++ b/src/lib/preferences/pluginslist.ui @@ -10,9 +10,6 @@ 462 - - - 0 diff --git a/src/lib/rss/rssnotification.ui b/src/lib/rss/rssnotification.ui index ffd737100..f0ef9620e 100644 --- a/src/lib/rss/rssnotification.ui +++ b/src/lib/rss/rssnotification.ui @@ -10,9 +10,6 @@ 36 - - - 2 diff --git a/src/lib/rss/rsswidget.ui b/src/lib/rss/rsswidget.ui index 2bd9fd28f..425f77650 100644 --- a/src/lib/rss/rsswidget.ui +++ b/src/lib/rss/rsswidget.ui @@ -10,9 +10,6 @@ 70 - - - 0 diff --git a/src/lib/sidebar/sidebar.cpp b/src/lib/sidebar/sidebar.cpp index c9ee47e40..b0b0087f3 100644 --- a/src/lib/sidebar/sidebar.cpp +++ b/src/lib/sidebar/sidebar.cpp @@ -41,7 +41,7 @@ SideBar::SideBar(SideBarManager* manager, QupZilla* mainClass) m_layout->setSpacing(0); setLayout(m_layout); - m_titleBar = new DockTitleBarWidget("", this); + m_titleBar = new DockTitleBarWidget(QString(), this); m_layout->addWidget(m_titleBar); } diff --git a/src/lib/tools/certificateinfowidget.cpp b/src/lib/tools/certificateinfowidget.cpp index e5773b8df..c8eeda8c5 100644 --- a/src/lib/tools/certificateinfowidget.cpp +++ b/src/lib/tools/certificateinfowidget.cpp @@ -279,8 +279,8 @@ QString CertificateInfoWidget::clearCertSpecialSymbols(const QString &string) n.replace("\\xC2\\xBD", "1/2"); // one half n.replace("\\xC2\\xBE", "3/4"); // three quarters n.replace("\\xCA\\xBF", "\\x27"); // c-single quote - n.replace("\\xCC\\xA8", ""); // modifier - under curve - n.replace("\\xCC\\xB1", ""); // modifier - under line + n.replace("\\xCC\\xA8", QChar()); // modifier - under curve + n.replace("\\xCC\\xB1", QChar()); // modifier - under line return n; } diff --git a/src/lib/tools/docktitlebarwidget.ui b/src/lib/tools/docktitlebarwidget.ui index 57446347a..05d74d713 100644 --- a/src/lib/tools/docktitlebarwidget.ui +++ b/src/lib/tools/docktitlebarwidget.ui @@ -27,11 +27,7 @@ 0 - - - - - + diff --git a/src/lib/webview/jsalert.ui b/src/lib/webview/jsalert.ui index 9e23ecb70..82c69ae17 100644 --- a/src/lib/webview/jsalert.ui +++ b/src/lib/webview/jsalert.ui @@ -10,9 +10,6 @@ 374 - - - 0 diff --git a/src/lib/webview/jsconfirm.ui b/src/lib/webview/jsconfirm.ui index d12535cdd..3bf9a9825 100644 --- a/src/lib/webview/jsconfirm.ui +++ b/src/lib/webview/jsconfirm.ui @@ -10,9 +10,6 @@ 344 - - - 0 diff --git a/src/lib/webview/jsprompt.ui b/src/lib/webview/jsprompt.ui index 4d8b7ffde..465af2046 100644 --- a/src/lib/webview/jsprompt.ui +++ b/src/lib/webview/jsprompt.ui @@ -10,9 +10,6 @@ 300 - - - 0 diff --git a/src/lib/webview/siteinfowidget.ui b/src/lib/webview/siteinfowidget.ui index 88aa8aa7c..6c9a66247 100644 --- a/src/lib/webview/siteinfowidget.ui +++ b/src/lib/webview/siteinfowidget.ui @@ -16,9 +16,6 @@ 0 - - - 0 diff --git a/src/lib/webview/tabbedwebview.cpp b/src/lib/webview/tabbedwebview.cpp index 0b9a7d90d..728424860 100644 --- a/src/lib/webview/tabbedwebview.cpp +++ b/src/lib/webview/tabbedwebview.cpp @@ -218,11 +218,11 @@ void TabbedWebView::linkHovered(const QString &link, const QString &title, const Q_UNUSED(content) if (isCurrent()) { - if (link != "") { - p_QupZilla->statusBarMessage()->showMessage(link); + if (link.isEmpty()) { + p_QupZilla->statusBarMessage()->clearMessage(); } else { - p_QupZilla->statusBarMessage()->clearMessage(); + p_QupZilla->statusBarMessage()->showMessage(link); } } } diff --git a/src/lib/webview/tabwidget.cpp b/src/lib/webview/tabwidget.cpp index 576ba9f1f..21dd46be2 100644 --- a/src/lib/webview/tabwidget.cpp +++ b/src/lib/webview/tabwidget.cpp @@ -303,10 +303,10 @@ int TabWidget::addView(QNetworkRequest req, const QString &title, const Qz::NewT int index; if (position == -1) { - index = addTab(new WebTab(p_QupZilla, locBar), ""); + index = addTab(new WebTab(p_QupZilla, locBar), QString()); } else { - index = insertTab(position, new WebTab(p_QupZilla, locBar), ""); + index = insertTab(position, new WebTab(p_QupZilla, locBar), QString()); } TabbedWebView* webView = weTab(index)->view(); @@ -505,7 +505,7 @@ void TabWidget::setTabText(int index, const QString &text) if (WebTab* webTab = weTab(index)) { if (webTab->isPinned()) { - newtext = ""; + newtext.clear(); } } diff --git a/src/lib/webview/webtab.cpp b/src/lib/webview/webtab.cpp index 7c513702a..843c9c663 100644 --- a/src/lib/webview/webtab.cpp +++ b/src/lib/webview/webtab.cpp @@ -307,7 +307,7 @@ void WebTab::pinTab(int index) m_pinned = true; tabWidget->setCurrentIndex(0); // <<-- those 2 lines fixes tabWidget->getTabBar()->moveTab(index, 0); // | weird behavior with bad - tabWidget->setTabText(0, ""); // | tabwidget update if we + tabWidget->setTabText(0, QString()); // | tabwidget update if we tabWidget->setCurrentIndex(0); // <<-- are moving current tab tabWidget->getTabBar()->updateCloseButton(0); } diff --git a/src/lib/webview/webview.cpp b/src/lib/webview/webview.cpp index 9e110ced7..322515a6d 100644 --- a/src/lib/webview/webview.cpp +++ b/src/lib/webview/webview.cpp @@ -821,7 +821,7 @@ void WebView::createLinkContextMenu(QMenu* menu, const QWebHitTestResult &hitTes { // Workaround for QtWebKit <= 2.0 when selecting link text on right click if (page()->selectedText() == hitTest.linkText()) { - findText(""); + findText(QString()); } menu->addSeparator(); @@ -882,7 +882,7 @@ void WebView::createSelectedTextContextMenu(QMenu* menu, const QWebHitTestResult connect(gtwact, SIGNAL(middleClicked()), this, SLOT(openUrlInBackgroundTab())); menu->addAction(gtwact); Action* dictact = new Action(QIcon::fromTheme("accessories-dictionary"), tr("Dictionary")); - dictact->setData(QUrl("http://" + (langCode != "" ? langCode + "." : langCode) + "wiktionary.org/wiki/Special:Search?search=" + selectedText)); + dictact->setData(QUrl("http://" + (!langCode.isEmpty() ? langCode + "." : langCode) + "wiktionary.org/wiki/Special:Search?search=" + selectedText)); connect(dictact, SIGNAL(triggered()), this, SLOT(openUrlInSelectedTab())); connect(dictact, SIGNAL(middleClicked()), this, SLOT(openUrlInBackgroundTab())); menu->addAction(dictact); diff --git a/src/plugins/PIM/PIM_handler.cpp b/src/plugins/PIM/PIM_handler.cpp index bd97f89bb..10b7bb348 100644 --- a/src/plugins/PIM/PIM_handler.cpp +++ b/src/plugins/PIM/PIM_handler.cpp @@ -41,20 +41,20 @@ void PIM_Handler::loadSettings() QSettings settings(m_settingsFile, QSettings::IniFormat); settings.beginGroup("PIM"); - m_allInfo[PI_LastName] = settings.value("LastName", "").toString(); - m_allInfo[PI_FirstName] = settings.value("FirstName", "").toString(); - m_allInfo[PI_Email] = settings.value("Email", "").toString(); - m_allInfo[PI_Mobile] = settings.value("Mobile", "").toString(); - m_allInfo[PI_Phone] = settings.value("Phone", "").toString(); - m_allInfo[PI_Address] = settings.value("Address", "").toString(); - m_allInfo[PI_City] = settings.value("City", "").toString(); - m_allInfo[PI_Zip] = settings.value("Zip", "").toString(); - m_allInfo[PI_State] = settings.value("State", "").toString(); - m_allInfo[PI_Country] = settings.value("Country", "").toString(); - m_allInfo[PI_HomePage] = settings.value("HomePage", "").toString(); - m_allInfo[PI_Special1] = settings.value("Special1", "").toString(); - m_allInfo[PI_Special2] = settings.value("Special2", "").toString(); - m_allInfo[PI_Special3] = settings.value("Special3", "").toString(); + m_allInfo[PI_LastName] = settings.value("LastName", QString()).toString(); + m_allInfo[PI_FirstName] = settings.value("FirstName", QString()).toString(); + m_allInfo[PI_Email] = settings.value("Email", QString()).toString(); + m_allInfo[PI_Mobile] = settings.value("Mobile", QString()).toString(); + m_allInfo[PI_Phone] = settings.value("Phone", QString()).toString(); + m_allInfo[PI_Address] = settings.value("Address", QString()).toString(); + m_allInfo[PI_City] = settings.value("City", QString()).toString(); + m_allInfo[PI_Zip] = settings.value("Zip", QString()).toString(); + m_allInfo[PI_State] = settings.value("State", QString()).toString(); + m_allInfo[PI_Country] = settings.value("Country", QString()).toString(); + m_allInfo[PI_HomePage] = settings.value("HomePage", QString()).toString(); + m_allInfo[PI_Special1] = settings.value("Special1", QString()).toString(); + m_allInfo[PI_Special2] = settings.value("Special2", QString()).toString(); + m_allInfo[PI_Special3] = settings.value("Special3", QString()).toString(); settings.endGroup(); m_translations[PI_LastName] = tr("Last Name"); diff --git a/src/plugins/PIM/PIM_settings.cpp b/src/plugins/PIM/PIM_settings.cpp index 4af7d8cb8..cb77f55e2 100644 --- a/src/plugins/PIM/PIM_settings.cpp +++ b/src/plugins/PIM/PIM_settings.cpp @@ -33,20 +33,20 @@ PIM_Settings::PIM_Settings(const QString &settingsFile, QWidget* parent) QSettings settings(m_settingsFile, QSettings::IniFormat); settings.beginGroup("PIM"); - ui->pim_firstname->setText(settings.value("FirstName", "").toString()); - ui->pim_lastname->setText(settings.value("LastName", "").toString()); - ui->pim_email->setText(settings.value("Email", "").toString()); - ui->pim_phone->setText(settings.value("Phone", "").toString()); - ui->pim_mobile->setText(settings.value("Mobile", "").toString()); - ui->pim_address->setText(settings.value("Address", "").toString()); - ui->pim_city->setText(settings.value("City", "").toString()); - ui->pim_zip->setText(settings.value("Zip", "").toString()); - ui->pim_state->setText(settings.value("State", "").toString()); - ui->pim_country->setText(settings.value("Country", "").toString()); - ui->pim_homepage->setText(settings.value("HomePage", "").toString()); - ui->pim_special1->setText(settings.value("Special1", "").toString()); - ui->pim_special2->setText(settings.value("Special2", "").toString()); - ui->pim_special3->setText(settings.value("Special3", "").toString()); + ui->pim_firstname->setText(settings.value("FirstName", QString()).toString()); + ui->pim_lastname->setText(settings.value("LastName", QString()).toString()); + ui->pim_email->setText(settings.value("Email", QString()).toString()); + ui->pim_phone->setText(settings.value("Phone", QString()).toString()); + ui->pim_mobile->setText(settings.value("Mobile", QString()).toString()); + ui->pim_address->setText(settings.value("Address", QString()).toString()); + ui->pim_city->setText(settings.value("City", QString()).toString()); + ui->pim_zip->setText(settings.value("Zip", QString()).toString()); + ui->pim_state->setText(settings.value("State", QString()).toString()); + ui->pim_country->setText(settings.value("Country", QString()).toString()); + ui->pim_homepage->setText(settings.value("HomePage", QString()).toString()); + ui->pim_special1->setText(settings.value("Special1", QString()).toString()); + ui->pim_special2->setText(settings.value("Special2", QString()).toString()); + ui->pim_special3->setText(settings.value("Special3", QString()).toString()); settings.endGroup(); connect(this, SIGNAL(accepted()), this, SLOT(dialogAccepted()));