[code] Using QVariant::fromValue instead of obsolted qVariantFromValue.

remotes/origin/falkon
nowrep 13 years ago
parent 0a7773bec1
commit 67a08d237d
  1. 6
      src/lib/adblock/adblockicon.cpp
  2. 4
      src/lib/bookmarks/bookmarkstoolbar.cpp
  3. 4
      src/lib/bookmarksimport/bookmarksimportdialog.cpp
  4. 4
      src/lib/bookmarksimport/bookmarksimporticonfetcher.cpp
  5. 2
      src/lib/cookies/cookiemanager.cpp
  6. 8
      src/lib/preferences/pluginsmanager.cpp
  7. 2
      src/lib/webview/webpage.cpp
  8. 2
      src/lib/webview/webview.cpp
  9. 2
      src/plugins/GreaseMonkey/settings/gm_settings.cpp

@ -1,6 +1,6 @@
/* ============================================================ /* ============================================================
* QupZilla - WebKit based browser * QupZilla - WebKit based browser
* Copyright (C) 2010-2012 David Rosca <nowrep@gmail.com> * Copyright (C) 2010-2013 David Rosca <nowrep@gmail.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -140,7 +140,7 @@ void AdBlockIcon::createMenu(QMenu* menu)
QString actionText = tr("%1 with (%2)").arg(address, pair.first.filter()).replace(QLatin1Char('&'), QLatin1String("&&")); QString actionText = tr("%1 with (%2)").arg(address, pair.first.filter()).replace(QLatin1Char('&'), QLatin1String("&&"));
QAction* action = menu->addAction(actionText, manager, SLOT(showRule())); QAction* action = menu->addAction(actionText, manager, SLOT(showRule()));
action->setData(qVariantFromValue((void*)&pair.first)); action->setData(QVariant::fromValue((void*)&pair.first));
} }
} }
@ -156,7 +156,7 @@ void AdBlockIcon::createMenu(QMenu* menu)
QString actionText = tr("%1 with (%2)").arg(address, entry.rule->filter()).replace(QLatin1Char('&'), QLatin1String("&&")); QString actionText = tr("%1 with (%2)").arg(address, entry.rule->filter()).replace(QLatin1Char('&'), QLatin1String("&&"));
QAction* action = menu->addAction(actionText, manager, SLOT(showRule())); QAction* action = menu->addAction(actionText, manager, SLOT(showRule()));
action->setData(qVariantFromValue((void*)entry.rule)); action->setData(QVariant::fromValue((void*)entry.rule));
} }
} }
} }

@ -1,6 +1,6 @@
/* ============================================================ /* ============================================================
* QupZilla - WebKit based browser * QupZilla - WebKit based browser
* Copyright (C) 2010-2012 David Rosca <nowrep@gmail.com> * Copyright (C) 2010-2013 David Rosca <nowrep@gmail.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -106,7 +106,7 @@ void BookmarksToolbar::showBookmarkContextMenu(const QPoint &pos)
return; return;
} }
QVariant buttonPointer = qVariantFromValue((void*) button); QVariant buttonPointer = QVariant::fromValue((void*) button);
QMenu menu; QMenu menu;
menu.addAction(tr("Open bookmark"), this, SLOT(loadClickedBookmark()))->setData(buttonPointer); menu.addAction(tr("Open bookmark"), this, SLOT(loadClickedBookmark()))->setData(buttonPointer);

@ -1,6 +1,6 @@
/* ============================================================ /* ============================================================
* QupZilla - WebKit based browser * QupZilla - WebKit based browser
* Copyright (C) 2010-2012 David Rosca <nowrep@gmail.com> * Copyright (C) 2010-2013 David Rosca <nowrep@gmail.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -123,7 +123,7 @@ void BookmarksImportDialog::startFetchingIcons()
item = new QTreeWidgetItem(newParent); item = new QTreeWidgetItem(newParent);
} }
QVariant bookmarkVariant = qVariantFromValue(b); QVariant bookmarkVariant = QVariant::fromValue(b);
item->setText(0, b.title); item->setText(0, b.title);
if (b.image.isNull()) { if (b.image.isNull()) {
item->setIcon(0, defaultIcon); item->setIcon(0, defaultIcon);

@ -1,6 +1,6 @@
/* ============================================================ /* ============================================================
* QupZilla - WebKit based browser * QupZilla - WebKit based browser
* Copyright (C) 2010-2012 David Rosca <nowrep@gmail.com> * Copyright (C) 2010-2013 David Rosca <nowrep@gmail.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -69,7 +69,7 @@ void BookmarksImportIconFetcher::slotStartFetching()
QNetworkAccessManager* manager = new QNetworkAccessManager(this); QNetworkAccessManager* manager = new QNetworkAccessManager(this);
foreach(const Pair & pair, m_pairs) { foreach(const Pair & pair, m_pairs) {
QVariant itemPointer = qVariantFromValue((void*) pair.item); QVariant itemPointer = QVariant::fromValue((void*) pair.item);
IconFetcher* fetcher = new IconFetcher(this); IconFetcher* fetcher = new IconFetcher(this);
fetcher->setNetworkAccessManager(manager); fetcher->setNetworkAccessManager(manager);

@ -198,7 +198,7 @@ void CookieManager::slotRefreshTable()
item->setText(0, "." + cookieDomain); item->setText(0, "." + cookieDomain);
item->setText(1, cookie.name()); item->setText(1, cookie.name());
item->setData(0, Qt::UserRole + 10, qVariantFromValue(cookie)); item->setData(0, Qt::UserRole + 10, QVariant::fromValue(cookie));
ui->cookieTree->addTopLevelItem(item); ui->cookieTree->addTopLevelItem(item);
++counter; ++counter;

@ -1,6 +1,6 @@
/* ============================================================ /* ============================================================
* QupZilla - WebKit based browser * QupZilla - WebKit based browser
* Copyright (C) 2010-2012 David Rosca <nowrep@gmail.com> * Copyright (C) 2010-2013 David Rosca <nowrep@gmail.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -187,7 +187,7 @@ void PluginsManager::refresh()
item->setFlags(item->flags() | Qt::ItemIsUserCheckable); item->setFlags(item->flags() | Qt::ItemIsUserCheckable);
item->setCheckState(plugin.isLoaded() ? Qt::Checked : Qt::Unchecked); item->setCheckState(plugin.isLoaded() ? Qt::Checked : Qt::Unchecked);
item->setData(Qt::UserRole + 10, qVariantFromValue(plugin)); item->setData(Qt::UserRole + 10, QVariant::fromValue(plugin));
ui->list->addItem(item); ui->list->addItem(item);
} }
@ -259,7 +259,7 @@ void PluginsManager::itemChanged(QListWidgetItem* item)
QMessageBox::critical(this, tr("Error!"), tr("Cannot load extension!")); QMessageBox::critical(this, tr("Error!"), tr("Cannot load extension!"));
} }
item->setData(Qt::UserRole + 10, qVariantFromValue(plugin)); item->setData(Qt::UserRole + 10, QVariant::fromValue(plugin));
connect(ui->list, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(itemChanged(QListWidgetItem*))); connect(ui->list, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(itemChanged(QListWidgetItem*)));
@ -279,7 +279,7 @@ void PluginsManager::settingsClicked()
if (!plugin.isLoaded()) { if (!plugin.isLoaded()) {
mApp->plugins()->loadPlugin(&plugin); mApp->plugins()->loadPlugin(&plugin);
item->setData(Qt::UserRole + 10, qVariantFromValue(plugin)); item->setData(Qt::UserRole + 10, QVariant::fromValue(plugin));
} }
if (plugin.isLoaded() && plugin.pluginSpec.hasSettings) { if (plugin.isLoaded() && plugin.pluginSpec.hasSettings) {

@ -527,7 +527,7 @@ void WebPage::populateNetworkRequest(QNetworkRequest &request)
{ {
WebPage* pagePointer = this; WebPage* pagePointer = this;
QVariant variant = qVariantFromValue((void*) pagePointer); QVariant variant = QVariant::fromValue((void*) pagePointer);
request.setAttribute((QNetworkRequest::Attribute)(QNetworkRequest::User + 100), variant); request.setAttribute((QNetworkRequest::Attribute)(QNetworkRequest::User + 100), variant);
if (m_lastRequestUrl == request.url()) { if (m_lastRequestUrl == request.url()) {

@ -1001,7 +1001,7 @@ void WebView::createSelectedTextContextMenu(QMenu* menu, const QWebHitTestResult
SearchEnginesManager* searchManager = mApp->searchEnginesManager(); SearchEnginesManager* searchManager = mApp->searchEnginesManager();
foreach(const SearchEngine & en, searchManager->allEngines()) { foreach(const SearchEngine & en, searchManager->allEngines()) {
Action* act = new Action(en.icon, en.name); Action* act = new Action(en.icon, en.name);
act->setData(qVariantFromValue(en)); act->setData(QVariant::fromValue(en));
connect(act, SIGNAL(triggered()), this, SLOT(searchSelectedText())); connect(act, SIGNAL(triggered()), this, SLOT(searchSelectedText()));
connect(act, SIGNAL(middleClicked()), this, SLOT(searchSelectedTextInBackgroundTab())); connect(act, SIGNAL(middleClicked()), this, SLOT(searchSelectedTextInBackgroundTab()));

@ -119,7 +119,7 @@ void GM_Settings::loadScripts()
item->setFlags(item->flags() | Qt::ItemIsUserCheckable); item->setFlags(item->flags() | Qt::ItemIsUserCheckable);
item->setCheckState(script->isEnabled() ? Qt::Checked : Qt::Unchecked); item->setCheckState(script->isEnabled() ? Qt::Checked : Qt::Unchecked);
item->setData(Qt::UserRole + 10, qVariantFromValue((void*)script)); item->setData(Qt::UserRole + 10, QVariant::fromValue((void*)script));
ui->listWidget->addItem(item); ui->listWidget->addItem(item);
} }

Loading…
Cancel
Save