Enable -DQT_NO_URL_CAST_FROM_STRING globally, and fix the code.

This commit is contained in:
David Faure 2012-05-02 15:08:30 +02:00
parent 11bec3095d
commit 4ce1afaa9f
6 changed files with 9 additions and 14 deletions

View File

@ -26,9 +26,9 @@
#include <QXmlContentHandler>
#include <QXmlInputSource>
#include <QXmlSimpleReader>
#include <QUrl>
#include <kdebug.h>
#include <kurl.h>
namespace Plasma
{
@ -250,7 +250,7 @@ void ConfigLoaderHandler::addItem()
KConfigSkeleton::ItemUrl *urlItem =
new KConfigSkeleton::ItemUrl(m_config->currentGroup(),
m_key, *d->newUrl(),
m_default);
QUrl::fromUserInput(m_default));
m_config->addItem(urlItem, m_name);
item = urlItem;
} else if (m_type == "double") {

View File

@ -861,7 +861,7 @@ bool PackagePrivate::installPackage(const QString &package, const QString &packa
QString service = KStandardDirs::locateLocal("services", serviceName);
#ifndef PLASMA_NO_KIO
KIO::FileCopyJob *job = KIO::file_copy(metaPath, service, -1, KIO::HideProgressInfo);
KIO::FileCopyJob *job = KIO::file_copy(QUrl::fromLocalFile(metaPath), QUrl::fromLocalFile(service), -1, KIO::HideProgressInfo);
const bool ok = job->exec();
const QString errorString = job->errorString();
#else

View File

@ -58,7 +58,7 @@ void ServiceMonitor::slotJobFinished(Plasma::ServiceJob *job)
kDebug() << "engine does not exist yet!";
#endif
} else {
QUrlPathInfo engineLocation(location);
QUrlPathInfo engineLocation = QUrlPathInfo(QUrl(location));
engineLocation.setFileName(job->result().toString());
#ifndef NDEBUG
kDebug() << "setting location : " << engineLocation.url();

View File

@ -61,7 +61,7 @@ public:
QString subText;
QPixmap image;
QList<WId> windowsToPreview;
QHash<QString, ToolTipResource> resources;
QHash<QUrl, ToolTipResource> resources;
QWeakPointer<QGraphicsWidget> graphicsWidget;
bool autohide : 1;
bool instantPopup : 1;
@ -199,7 +199,7 @@ bool ToolTipContent::isInstantPopup() const
void ToolTipContent::addResource(ResourceType type, const QUrl &path, const QVariant &resource)
{
d->resources.insert(path.toString(), ToolTipResource(type, resource));
d->resources.insert(path, ToolTipResource(type, resource));
}
void ToolTipContent::registerResources(QTextDocument *document) const
@ -208,7 +208,7 @@ void ToolTipContent::registerResources(QTextDocument *document) const
return;
}
QHashIterator<QString, ToolTipResource> it(d->resources);
QHashIterator<QUrl, ToolTipResource> it(d->resources);
while (it.hasNext()) {
it.next();
const ToolTipResource &r = it.value();

View File

@ -615,12 +615,7 @@ void Wallpaper::insertIntoCache(const QString& key, const QImage &image)
if (d->cacheRendering) {
if (image.isNull()) {
#ifndef PLASMA_NO_KIO
KIO::file_delete(d->cachePath(key));
#else
QFile f(d->cachePath(key));
f.remove();
#endif
QFile::remove(d->cachePath(key));
} else {
QThreadPool::globalInstance()->start(new SaveImageThread(image, d->cachePath(key)));
}

View File

@ -102,7 +102,7 @@ void DeclarativeWidgetPrivate::execute(const QString &fileName)
//binds things like kconfig and icons
kdeclarative.setupBindings();
component->loadUrl(fileName);
component->loadUrl(QUrl::fromLocalFile(fileName));
scriptEngine = kdeclarative.scriptEngine();
registerDataEngineMetaTypes(scriptEngine);