1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-24 04:36:34 +01:00

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

This commit is contained in:
nowrep 2013-02-05 22:33:54 +01:00
parent 0a7773bec1
commit 67a08d237d
9 changed files with 17 additions and 17 deletions

View File

@ -1,6 +1,6 @@
/* ============================================================
* 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
* 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("&&"));
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("&&"));
QAction* action = menu->addAction(actionText, manager, SLOT(showRule()));
action->setData(qVariantFromValue((void*)entry.rule));
action->setData(QVariant::fromValue((void*)entry.rule));
}
}
}

View File

@ -1,6 +1,6 @@
/* ============================================================
* 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
* it under the terms of the GNU General Public License as published by
@ -106,7 +106,7 @@ void BookmarksToolbar::showBookmarkContextMenu(const QPoint &pos)
return;
}
QVariant buttonPointer = qVariantFromValue((void*) button);
QVariant buttonPointer = QVariant::fromValue((void*) button);
QMenu menu;
menu.addAction(tr("Open bookmark"), this, SLOT(loadClickedBookmark()))->setData(buttonPointer);

View File

@ -1,6 +1,6 @@
/* ============================================================
* 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
* it under the terms of the GNU General Public License as published by
@ -123,7 +123,7 @@ void BookmarksImportDialog::startFetchingIcons()
item = new QTreeWidgetItem(newParent);
}
QVariant bookmarkVariant = qVariantFromValue(b);
QVariant bookmarkVariant = QVariant::fromValue(b);
item->setText(0, b.title);
if (b.image.isNull()) {
item->setIcon(0, defaultIcon);

View File

@ -1,6 +1,6 @@
/* ============================================================
* 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
* 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);
foreach(const Pair & pair, m_pairs) {
QVariant itemPointer = qVariantFromValue((void*) pair.item);
QVariant itemPointer = QVariant::fromValue((void*) pair.item);
IconFetcher* fetcher = new IconFetcher(this);
fetcher->setNetworkAccessManager(manager);

View File

@ -198,7 +198,7 @@ void CookieManager::slotRefreshTable()
item->setText(0, "." + cookieDomain);
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);
++counter;

View File

@ -1,6 +1,6 @@
/* ============================================================
* 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
* 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->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);
}
@ -259,7 +259,7 @@ void PluginsManager::itemChanged(QListWidgetItem* item)
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*)));
@ -279,7 +279,7 @@ void PluginsManager::settingsClicked()
if (!plugin.isLoaded()) {
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) {

View File

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

View File

@ -1001,7 +1001,7 @@ void WebView::createSelectedTextContextMenu(QMenu* menu, const QWebHitTestResult
SearchEnginesManager* searchManager = mApp->searchEnginesManager();
foreach(const SearchEngine & en, searchManager->allEngines()) {
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(middleClicked()), this, SLOT(searchSelectedTextInBackgroundTab()));

View File

@ -119,7 +119,7 @@ void GM_Settings::loadScripts()
item->setFlags(item->flags() | Qt::ItemIsUserCheckable);
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);
}