use KIO to access the remote imports

svn path=/trunk/KDE/kdelibs/; revision=1188124
This commit is contained in:
Marco Martin 2010-10-21 13:18:50 +00:00
parent 1163aad815
commit 22d9baccef
4 changed files with 64 additions and 2 deletions

View File

@ -140,6 +140,7 @@ set(plasma_LIB_SRCS
private/wallpaperrenderthread.cpp
private/windowpreview.cpp
private/kineticscroll.cpp
private/declarative/declarativenetworkaccessmanagerfactory.cpp
private/effects/halopainter.cpp
private/effects/ripple.cpp
querymatch.cpp

View File

@ -0,0 +1,29 @@
/*
* Copyright 2010 Marco Martin <notmart@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details
*
* You should have received a copy of the GNU Library General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "declarativenetworkaccessmanagerfactory_p.h"
#include <kio/accessmanager.h>
QNetworkAccessManager *DeclarativeNetworkAccessManagerFactory::create(QObject *parent)
{
return new KIO::AccessManager(parent);
}

View File

@ -0,0 +1,31 @@
/*
* Copyright 2010 Marco Martin <notmart@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details
*
* You should have received a copy of the GNU Library General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef DECLARATIVENETWORKACCESSMANAGERFACTORY_H
#define DECLARATIVENETWORKACCESSMANAGERFACTORY_H
#include <QDeclarativeNetworkAccessManagerFactory>
class DeclarativeNetworkAccessManagerFactory : public QDeclarativeNetworkAccessManagerFactory
{
public:
QNetworkAccessManager *create(QObject *parent);
};
#endif

View File

@ -32,11 +32,11 @@
#include <kglobal.h>
#include <kstandarddirs.h>
#include "private/declarative/declarativenetworkaccessmanagerfactory_p.h"
namespace Plasma
{
class DeclarativeWidgetPrivate
{
public:
@ -165,6 +165,7 @@ DeclarativeWidget::DeclarativeWidget(QGraphicsWidget *parent)
setFlag(QGraphicsItem::ItemHasNoContents);
d->engine = new QDeclarativeEngine(this);
d->engine->setNetworkAccessManagerFactory(new DeclarativeNetworkAccessManagerFactory);
foreach(const QString &importPath, KGlobal::dirs()->findDirs("module", "imports")) {
d->engine->addImportPath(importPath);
}