Some KUrl-QUrl porting.
This commit is contained in:
parent
13d5508112
commit
2365f2c657
@ -1594,7 +1594,7 @@ void ContainmentPrivate::mimeTypeRetrieved(KIO::Job *job, const QString &mimeTyp
|
|||||||
|
|
||||||
if (wallpaper) {
|
if (wallpaper) {
|
||||||
//kDebug() << "Wallpaper dropped:" << tjob->url();
|
//kDebug() << "Wallpaper dropped:" << tjob->url();
|
||||||
wallpaper->addUrls(KUrl::List() << tjob->url());
|
wallpaper->addUrls(QList<QUrl>() << tjob->url());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
addApplet(actionsToApplets[choice], args, QRectF(posi, QSize()));
|
addApplet(actionsToApplets[choice], args, QRectF(posi, QSize()));
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
#include "plasma/dataenginemanager.h"
|
#include "plasma/dataenginemanager.h"
|
||||||
#include "plasma/private/remotedataengine_p.h"
|
#include "plasma/private/remotedataengine_p.h"
|
||||||
#include <servicejob.h>
|
#include <servicejob.h>
|
||||||
|
#include <qurlpathinfo.h>
|
||||||
|
|
||||||
namespace Plasma
|
namespace Plasma
|
||||||
{
|
{
|
||||||
@ -57,12 +58,12 @@ void ServiceMonitor::slotJobFinished(Plasma::ServiceJob *job)
|
|||||||
kDebug() << "engine does not exist yet!";
|
kDebug() << "engine does not exist yet!";
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
KUrl engineLocation(location);
|
QUrlPathInfo engineLocation(location);
|
||||||
engineLocation.setFileName(job->result().toString());
|
engineLocation.setFileName(job->result().toString());
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
kDebug() << "setting location : " << engineLocation.prettyUrl();
|
kDebug() << "setting location : " << engineLocation.url();
|
||||||
#endif
|
#endif
|
||||||
m_consumer->m_remoteEngines[pair]->setLocation(engineLocation);
|
m_consumer->m_remoteEngines[pair]->setLocation(engineLocation.url());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -127,9 +128,9 @@ DataEngine *DataEngineConsumer::dataEngine(const QString &name)
|
|||||||
return engine;
|
return engine;
|
||||||
}
|
}
|
||||||
|
|
||||||
DataEngine *DataEngineConsumer::remoteDataEngine(const KUrl &location, const QString &name)
|
DataEngine *DataEngineConsumer::remoteDataEngine(const QUrl &location, const QString &name)
|
||||||
{
|
{
|
||||||
QPair<QString, QString> pair(location.prettyUrl(), name);
|
QPair<QString, QString> pair(location.toString(), name);
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
kDebug() << "pair = " << pair;
|
kDebug() << "pair = " << pair;
|
||||||
#endif
|
#endif
|
||||||
@ -143,10 +144,10 @@ DataEngine *DataEngineConsumer::remoteDataEngine(const KUrl &location, const QSt
|
|||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
kDebug() << "new remote dataengine at " << location;
|
kDebug() << "new remote dataengine at " << location;
|
||||||
#endif
|
#endif
|
||||||
RemoteDataEngine *engine = new RemoteDataEngine(KUrl());
|
RemoteDataEngine *engine = new RemoteDataEngine(QUrl());
|
||||||
m_remoteEngines[pair] = engine;
|
m_remoteEngines[pair] = engine;
|
||||||
Service *plasmoidService = Service::access(location);
|
Service *plasmoidService = Service::access(location);
|
||||||
plasmoidService->setDestination(location.prettyUrl());
|
plasmoidService->setDestination(location.toString());
|
||||||
m_engineNameForService[plasmoidService] = name;
|
m_engineNameForService[plasmoidService] = name;
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
kDebug() << "name = " << name;
|
kDebug() << "name = " << name;
|
||||||
|
@ -56,7 +56,7 @@ public:
|
|||||||
DataEngineConsumer();
|
DataEngineConsumer();
|
||||||
~DataEngineConsumer();
|
~DataEngineConsumer();
|
||||||
DataEngine *dataEngine(const QString &name);
|
DataEngine *dataEngine(const QString &name);
|
||||||
DataEngine *remoteDataEngine(const KUrl &location, const QString &name);
|
DataEngine *remoteDataEngine(const QUrl &location, const QString &name);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QSet<QString> m_loadedEngines;
|
QSet<QString> m_loadedEngines;
|
||||||
|
@ -28,12 +28,13 @@
|
|||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QUuid>
|
#include <QUuid>
|
||||||
|
|
||||||
#include <kurl.h>
|
#include <qurl.h>
|
||||||
|
#include <qurlpathinfo.h>
|
||||||
|
|
||||||
namespace Plasma
|
namespace Plasma
|
||||||
{
|
{
|
||||||
|
|
||||||
RemoteDataEngine::RemoteDataEngine(KUrl location, QObject* parent, const QVariantList& args)
|
RemoteDataEngine::RemoteDataEngine(const QUrl &location, QObject* parent, const QVariantList& args)
|
||||||
: Plasma::DataEngine(parent, args),
|
: Plasma::DataEngine(parent, args),
|
||||||
m_service(0),
|
m_service(0),
|
||||||
m_location(location),
|
m_location(location),
|
||||||
@ -52,7 +53,7 @@ RemoteDataEngine::~RemoteDataEngine()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void RemoteDataEngine::setLocation(KUrl location)
|
void RemoteDataEngine::setLocation(const QUrl &location)
|
||||||
{
|
{
|
||||||
m_location = location;
|
m_location = location;
|
||||||
setMinimumPollingInterval(1000);
|
setMinimumPollingInterval(1000);
|
||||||
@ -186,11 +187,11 @@ void RemoteDataEngine::remoteCallFinished(Plasma::ServiceJob *job)
|
|||||||
kDebug() << "setting serviceForSource for " << source;
|
kDebug() << "setting serviceForSource for " << source;
|
||||||
#endif
|
#endif
|
||||||
QString resource = job->result().toString();
|
QString resource = job->result().toString();
|
||||||
KUrl loc = m_location;
|
QUrlPathInfo loc(m_location);
|
||||||
loc.setFileName(resource);
|
loc.setFileName(resource);
|
||||||
RemoteService *rs = m_serviceForSource.value(source);
|
RemoteService *rs = m_serviceForSource.value(source);
|
||||||
if (rs) {
|
if (rs) {
|
||||||
rs->setLocation(loc);
|
rs->setLocation(loc.url());
|
||||||
} else {
|
} else {
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
kDebug() << "no such service?" << source;
|
kDebug() << "no such service?" << source;
|
||||||
|
@ -36,10 +36,10 @@ class RemoteDataEngine : public Plasma::DataEngine
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
RemoteDataEngine(KUrl location, QObject* parent = 0, const QVariantList &args = QVariantList());
|
RemoteDataEngine(const QUrl &location, QObject* parent = 0, const QVariantList &args = QVariantList());
|
||||||
~RemoteDataEngine();
|
~RemoteDataEngine();
|
||||||
Plasma::Service* serviceForSource(const QString& source);
|
Plasma::Service* serviceForSource(const QString& source);
|
||||||
void setLocation(KUrl location);
|
void setLocation(const QUrl &location);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QStringList sources() const;
|
QStringList sources() const;
|
||||||
@ -59,7 +59,7 @@ private:
|
|||||||
QHash<QString, RemoteService *> m_serviceForSource;
|
QHash<QString, RemoteService *> m_serviceForSource;
|
||||||
QHash<QString, RemoteService *> m_pendingServices;
|
QHash<QString, RemoteService *> m_pendingServices;
|
||||||
QStringList m_pendingSources;
|
QStringList m_pendingSources;
|
||||||
KUrl m_location;
|
QUrl m_location;
|
||||||
QString m_uuid;
|
QString m_uuid;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -42,7 +42,8 @@
|
|||||||
#include <QtJolie/Value>
|
#include <QtJolie/Value>
|
||||||
|
|
||||||
#include <kdebug.h>
|
#include <kdebug.h>
|
||||||
#include <kurl.h>
|
#include <qurl.h>
|
||||||
|
#include <qurlpathinfo.h>
|
||||||
|
|
||||||
namespace Plasma
|
namespace Plasma
|
||||||
{
|
{
|
||||||
@ -55,7 +56,7 @@ RemoteService::RemoteService(QObject* parent)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
RemoteService::RemoteService(QObject* parent, KUrl location)
|
RemoteService::RemoteService(QObject* parent, const QUrl &location)
|
||||||
: Service(parent),
|
: Service(parent),
|
||||||
m_location(location),
|
m_location(location),
|
||||||
m_client(0),
|
m_client(0),
|
||||||
@ -83,10 +84,16 @@ void RemoteService::slotReadyForRemoteAccess()
|
|||||||
setLocation(m_location);
|
setLocation(m_location);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RemoteService::setLocation(const KUrl &location)
|
static QByteArray resourcePathFromUrl(const QUrl& location)
|
||||||
|
{
|
||||||
|
QUrlPathInfo pi(location);
|
||||||
|
return pi.path(QUrlPathInfo::StripTrailingSlash).remove(0, 1).toUtf8();
|
||||||
|
}
|
||||||
|
|
||||||
|
void RemoteService::setLocation(const QUrl &location)
|
||||||
{
|
{
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
kDebug() << "Setting RemoteService location to " << location.prettyUrl();
|
kDebug() << "Setting RemoteService location to " << location;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
m_uuid = QUuid::createUuid().toString();
|
m_uuid = QUuid::createUuid().toString();
|
||||||
@ -113,8 +120,7 @@ void RemoteService::setLocation(const KUrl &location)
|
|||||||
QDataStream stream(&identityByteArray, QIODevice::WriteOnly);
|
QDataStream stream(&identityByteArray, QIODevice::WriteOnly);
|
||||||
stream << identity.toPublicCredentials();
|
stream << identity.toPublicCredentials();
|
||||||
|
|
||||||
Jolie::Message getOpDesc(location.path(KUrl::RemoveTrailingSlash).remove(0, 1).toUtf8(),
|
Jolie::Message getOpDesc(resourcePathFromUrl(location), "startConnection");
|
||||||
"startConnection");
|
|
||||||
Jolie::Value data;
|
Jolie::Value data;
|
||||||
data.children(JolieMessage::Field::IDENTITY) << Jolie::Value(identityByteArray);
|
data.children(JolieMessage::Field::IDENTITY) << Jolie::Value(identityByteArray);
|
||||||
data.children(JolieMessage::Field::UUID) << Jolie::Value(m_uuid.toAscii());
|
data.children(JolieMessage::Field::UUID) << Jolie::Value(m_uuid.toAscii());
|
||||||
@ -128,7 +134,11 @@ void RemoteService::setLocation(const KUrl &location)
|
|||||||
|
|
||||||
QString RemoteService::location() const
|
QString RemoteService::location() const
|
||||||
{
|
{
|
||||||
return m_location.prettyUrl();
|
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
|
||||||
|
return m_location.toString();
|
||||||
|
#else
|
||||||
|
return m_location.toDisplayString();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RemoteService::isReady() const
|
bool RemoteService::isReady() const
|
||||||
@ -151,8 +161,7 @@ void RemoteService::callCompleted(Jolie::PendingCallWatcher *watcher)
|
|||||||
kDebug() << "Started connection: fetching .operations";
|
kDebug() << "Started connection: fetching .operations";
|
||||||
#endif
|
#endif
|
||||||
m_token = JolieMessage::field(JolieMessage::Field::TOKEN, response);
|
m_token = JolieMessage::field(JolieMessage::Field::TOKEN, response);
|
||||||
Jolie::Message getOpDesc(m_location.path(KUrl::RemoveTrailingSlash).remove(0, 1).toUtf8(),
|
Jolie::Message getOpDesc(resourcePathFromUrl(m_location), "getOperations");
|
||||||
"getOperations");
|
|
||||||
//TODO: async
|
//TODO: async
|
||||||
Jolie::PendingCall pendingReply = m_client->asyncCall(signMessage(getOpDesc));
|
Jolie::PendingCall pendingReply = m_client->asyncCall(signMessage(getOpDesc));
|
||||||
Jolie::PendingCallWatcher *watcher = new Jolie::PendingCallWatcher(pendingReply, this);
|
Jolie::PendingCallWatcher *watcher = new Jolie::PendingCallWatcher(pendingReply, this);
|
||||||
@ -174,7 +183,7 @@ void RemoteService::callCompleted(Jolie::PendingCallWatcher *watcher)
|
|||||||
m_operationsScheme = JolieMessage::field(JolieMessage::Field::OPERATIONSDESCRIPTION, response);
|
m_operationsScheme = JolieMessage::field(JolieMessage::Field::OPERATIONSDESCRIPTION, response);
|
||||||
m_token = JolieMessage::field(JolieMessage::Field::TOKEN, response);
|
m_token = JolieMessage::field(JolieMessage::Field::TOKEN, response);
|
||||||
m_ready = true;
|
m_ready = true;
|
||||||
setName(m_location.prettyUrl());
|
setName(location());
|
||||||
//if there's stuff in the queue, let it continue.
|
//if there's stuff in the queue, let it continue.
|
||||||
slotFinished();
|
slotFinished();
|
||||||
}
|
}
|
||||||
@ -212,8 +221,7 @@ void RemoteService::callCompleted(Jolie::PendingCallWatcher *watcher)
|
|||||||
|
|
||||||
void RemoteService::slotGotPin(Plasma::ClientPinRequest *request)
|
void RemoteService::slotGotPin(Plasma::ClientPinRequest *request)
|
||||||
{
|
{
|
||||||
Jolie::Message getOpDesc(m_location.path(KUrl::RemoveTrailingSlash).remove(0, 1).toUtf8(),
|
Jolie::Message getOpDesc(resourcePathFromUrl(m_location), "getOperations");
|
||||||
"getOperations");
|
|
||||||
Jolie::Value value;
|
Jolie::Value value;
|
||||||
value.children(JolieMessage::Field::PARAMETERS) << Jolie::Value(QByteArray());
|
value.children(JolieMessage::Field::PARAMETERS) << Jolie::Value(QByteArray());
|
||||||
if (!request->pin().isEmpty()) {
|
if (!request->pin().isEmpty()) {
|
||||||
@ -243,8 +251,7 @@ void RemoteService::slotUpdateEnabledOperations()
|
|||||||
//TODO: maybe push the get enabled operations also on the queue?
|
//TODO: maybe push the get enabled operations also on the queue?
|
||||||
if (!m_busy) {
|
if (!m_busy) {
|
||||||
m_busy = true;
|
m_busy = true;
|
||||||
Jolie::Message getOpDesc(m_location.path(KUrl::RemoveTrailingSlash).remove(0, 1).toUtf8(),
|
Jolie::Message getOpDesc(resourcePathFromUrl(m_location), "getEnabledOperations");
|
||||||
"getEnabledOperations");
|
|
||||||
|
|
||||||
Jolie::PendingCall pendingReply = m_client->asyncCall(signMessage(getOpDesc));
|
Jolie::PendingCall pendingReply = m_client->asyncCall(signMessage(getOpDesc));
|
||||||
Jolie::PendingCallWatcher *watcher = new Jolie::PendingCallWatcher(pendingReply, this);
|
Jolie::PendingCallWatcher *watcher = new Jolie::PendingCallWatcher(pendingReply, this);
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
|
|
||||||
#include <QtCore/QQueue>
|
#include <QtCore/QQueue>
|
||||||
#include <QtJolie/Message>
|
#include <QtJolie/Message>
|
||||||
|
#include <QtCore/QUrl>
|
||||||
|
|
||||||
#include "../service.h"
|
#include "../service.h"
|
||||||
|
|
||||||
@ -42,10 +43,10 @@ class RemoteService : public Plasma::Service
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
RemoteService(QObject* parent);
|
RemoteService(QObject* parent);
|
||||||
RemoteService(QObject* parent, KUrl location);
|
RemoteService(QObject* parent, const QUrl &location);
|
||||||
~RemoteService();
|
~RemoteService();
|
||||||
|
|
||||||
void setLocation(const KUrl &location);
|
void setLocation(const QUrl &location);
|
||||||
QString location() const;
|
QString location() const;
|
||||||
|
|
||||||
bool isReady() const;
|
bool isReady() const;
|
||||||
@ -67,7 +68,7 @@ class RemoteService : public Plasma::Service
|
|||||||
Jolie::Message signMessage(const Jolie::Message &message) const;
|
Jolie::Message signMessage(const Jolie::Message &message) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
KUrl m_location;
|
QUrl m_location;
|
||||||
Jolie::Client *m_client;
|
Jolie::Client *m_client;
|
||||||
QByteArray m_token;
|
QByteArray m_token;
|
||||||
QByteArray m_operationsScheme;
|
QByteArray m_operationsScheme;
|
||||||
|
@ -43,7 +43,7 @@ namespace Plasma
|
|||||||
class AccessAppletJobPrivate
|
class AccessAppletJobPrivate
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AccessAppletJobPrivate(const KUrl &location, AccessAppletJob *owner)
|
AccessAppletJobPrivate(const QUrl &location, AccessAppletJob *owner)
|
||||||
: q(owner),
|
: q(owner),
|
||||||
location(location),
|
location(location),
|
||||||
applet(0)
|
applet(0)
|
||||||
@ -166,11 +166,11 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
AccessAppletJob *q;
|
AccessAppletJob *q;
|
||||||
KUrl location;
|
QUrl location;
|
||||||
Applet *applet;
|
Applet *applet;
|
||||||
};
|
};
|
||||||
|
|
||||||
AccessAppletJob::AccessAppletJob(const KUrl &location, QObject *parent)
|
AccessAppletJob::AccessAppletJob(const QUrl &location, QObject *parent)
|
||||||
: KJob(parent),
|
: KJob(parent),
|
||||||
d(new AccessAppletJobPrivate(location, this))
|
d(new AccessAppletJobPrivate(location, this))
|
||||||
{
|
{
|
||||||
@ -191,7 +191,7 @@ void AccessAppletJob::start()
|
|||||||
{
|
{
|
||||||
#ifdef ENABLE_REMOTE_WIDGETS
|
#ifdef ENABLE_REMOTE_WIDGETS
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
kDebug() << "fetching a plasmoid from location = " << d->location.prettyUrl();
|
kDebug() << "fetching a plasmoid from location = " << d->location;
|
||||||
#endif
|
#endif
|
||||||
Service *service = Service::access(d->location);
|
Service *service = Service::access(d->location);
|
||||||
connect(service, SIGNAL(serviceReady(Plasma::Service*)),
|
connect(service, SIGNAL(serviceReady(Plasma::Service*)),
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
#include <plasma/plasma_export.h>
|
#include <plasma/plasma_export.h>
|
||||||
|
|
||||||
class KUrl;
|
class QUrl;
|
||||||
|
|
||||||
namespace Plasma
|
namespace Plasma
|
||||||
{
|
{
|
||||||
@ -55,7 +55,7 @@ protected:
|
|||||||
* @param location the location of the service
|
* @param location the location of the service
|
||||||
* @param parent the parent object for this service
|
* @param parent the parent object for this service
|
||||||
*/
|
*/
|
||||||
AccessAppletJob(const KUrl &location, QObject *parent = 0);
|
AccessAppletJob(const QUrl &location, QObject *parent = 0);
|
||||||
|
|
||||||
void start();
|
void start();
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
#include <kdebug.h>
|
#include <kdebug.h>
|
||||||
#include <kglobal.h>
|
#include <kglobal.h>
|
||||||
#include <kstandarddirs.h>
|
#include <kstandarddirs.h>
|
||||||
#include <kurl.h>
|
#include <qurl.h>
|
||||||
|
|
||||||
#include <QtJolie/Message>
|
#include <QtJolie/Message>
|
||||||
|
|
||||||
@ -48,7 +48,7 @@ public:
|
|||||||
QString name;
|
QString name;
|
||||||
QString description;
|
QString description;
|
||||||
QString icon;
|
QString icon;
|
||||||
KUrl url;
|
QUrl url;
|
||||||
};
|
};
|
||||||
|
|
||||||
RemoteObjectDescription::RemoteObjectDescription()
|
RemoteObjectDescription::RemoteObjectDescription()
|
||||||
@ -79,12 +79,12 @@ QString RemoteObjectDescription::name() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void RemoteObjectDescription::setUrl(const KUrl &url)
|
void RemoteObjectDescription::setUrl(const QUrl &url)
|
||||||
{
|
{
|
||||||
d->url = url;
|
d->url = url;
|
||||||
}
|
}
|
||||||
|
|
||||||
KUrl RemoteObjectDescription::url() const
|
QUrl RemoteObjectDescription::url() const
|
||||||
{
|
{
|
||||||
return d->url;
|
return d->url;
|
||||||
}
|
}
|
||||||
@ -136,11 +136,11 @@ AccessManager::~AccessManager()
|
|||||||
delete d;
|
delete d;
|
||||||
}
|
}
|
||||||
|
|
||||||
AccessAppletJob *AccessManager::accessRemoteApplet(const KUrl &location) const
|
AccessAppletJob *AccessManager::accessRemoteApplet(const QUrl &location) const
|
||||||
{
|
{
|
||||||
AuthorizationManager::self()->d->prepareForServiceAccess();
|
AuthorizationManager::self()->d->prepareForServiceAccess();
|
||||||
|
|
||||||
KUrl resolvedLocation;
|
QUrl resolvedLocation;
|
||||||
if (location.scheme() == "plasma+zeroconf") {
|
if (location.scheme() == "plasma+zeroconf") {
|
||||||
if (d->zeroconfServices.contains(location.host())) {
|
if (d->zeroconfServices.contains(location.host())) {
|
||||||
resolvedLocation = d->services[location.host()].url();
|
resolvedLocation = d->services[location.host()].url();
|
||||||
@ -222,7 +222,7 @@ void AccessManagerPrivate::slotAddService(DNSSD::RemoteService::Ptr service)
|
|||||||
kDebug() << "result for resolve = " << ip;
|
kDebug() << "result for resolve = " << ip;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
KUrl url(QString("plasma://%1:%2/%3").arg(ip)
|
QUrl url(QString("plasma://%1:%2/%3").arg(ip)
|
||||||
.arg(service->port())
|
.arg(service->port())
|
||||||
.arg(service->serviceName()));
|
.arg(service->serviceName()));
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
#include <kdebug.h>
|
#include <kdebug.h>
|
||||||
|
|
||||||
class QString;
|
class QString;
|
||||||
class KUrl;
|
class QUrl;
|
||||||
|
|
||||||
namespace Plasma
|
namespace Plasma
|
||||||
{
|
{
|
||||||
@ -59,8 +59,8 @@ public:
|
|||||||
void setName(const QString &name);
|
void setName(const QString &name);
|
||||||
QString name() const;
|
QString name() const;
|
||||||
|
|
||||||
void setUrl(const KUrl &url);
|
void setUrl(const QUrl &url);
|
||||||
KUrl url() const;
|
QUrl url() const;
|
||||||
|
|
||||||
void setDescription(const QString &description);
|
void setDescription(const QString &description);
|
||||||
QString description() const;
|
QString description() const;
|
||||||
@ -91,7 +91,7 @@ class PLASMA_EXPORT AccessManager : public QObject
|
|||||||
* @returns a job that can be used to track when a remote plasmoid is ready for use, and to
|
* @returns a job that can be used to track when a remote plasmoid is ready for use, and to
|
||||||
* obtain the applet when the package is sent over.
|
* obtain the applet when the package is sent over.
|
||||||
*/
|
*/
|
||||||
AccessAppletJob *accessRemoteApplet(const KUrl &location) const;
|
AccessAppletJob *accessRemoteApplet(const QUrl &location) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @returns a list of applets that are announced on the network through zeroconf. Use the
|
* @returns a list of applets that are announced on the network through zeroconf. Use the
|
||||||
|
@ -25,7 +25,6 @@
|
|||||||
#include <QtCore/QObject>
|
#include <QtCore/QObject>
|
||||||
|
|
||||||
class QString;
|
class QString;
|
||||||
class KUrl;
|
|
||||||
|
|
||||||
namespace Plasma
|
namespace Plasma
|
||||||
{
|
{
|
||||||
|
@ -25,7 +25,6 @@
|
|||||||
#include <QtCore/QObject>
|
#include <QtCore/QObject>
|
||||||
|
|
||||||
class QString;
|
class QString;
|
||||||
class KUrl;
|
|
||||||
|
|
||||||
namespace Plasma
|
namespace Plasma
|
||||||
{
|
{
|
||||||
|
@ -25,7 +25,6 @@
|
|||||||
#include <QtCore/QObject>
|
#include <QtCore/QObject>
|
||||||
|
|
||||||
class QString;
|
class QString;
|
||||||
class KUrl;
|
|
||||||
|
|
||||||
namespace QCA
|
namespace QCA
|
||||||
{
|
{
|
||||||
|
@ -25,7 +25,6 @@
|
|||||||
#include <QtCore/QObject>
|
#include <QtCore/QObject>
|
||||||
|
|
||||||
class QString;
|
class QString;
|
||||||
class KUrl;
|
|
||||||
|
|
||||||
namespace Plasma
|
namespace Plasma
|
||||||
{
|
{
|
||||||
|
@ -26,7 +26,7 @@ namespace Plasma
|
|||||||
class ServiceAccessJobPrivate
|
class ServiceAccessJobPrivate
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ServiceAccessJobPrivate(ServiceAccessJob *owner, KUrl location)
|
ServiceAccessJobPrivate(ServiceAccessJob *owner, const QUrl& location)
|
||||||
: q(owner),
|
: q(owner),
|
||||||
service(0),
|
service(0),
|
||||||
location(location)
|
location(location)
|
||||||
@ -45,10 +45,10 @@ public:
|
|||||||
|
|
||||||
ServiceAccessJob *q;
|
ServiceAccessJob *q;
|
||||||
Service *service;
|
Service *service;
|
||||||
KUrl location;
|
QUrl location;
|
||||||
};
|
};
|
||||||
|
|
||||||
ServiceAccessJob::ServiceAccessJob(KUrl location, QObject *parent)
|
ServiceAccessJob::ServiceAccessJob(const QUrl& location, QObject *parent)
|
||||||
: KJob(parent),
|
: KJob(parent),
|
||||||
d(new ServiceAccessJobPrivate(this, location))
|
d(new ServiceAccessJobPrivate(this, location))
|
||||||
{
|
{
|
||||||
|
@ -25,8 +25,6 @@
|
|||||||
|
|
||||||
#include <plasma/plasma_export.h>
|
#include <plasma/plasma_export.h>
|
||||||
|
|
||||||
class KUrl;
|
|
||||||
|
|
||||||
namespace Plasma
|
namespace Plasma
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -55,7 +53,7 @@ protected:
|
|||||||
* @param location the location of the service
|
* @param location the location of the service
|
||||||
* @param parent the parent object for this service
|
* @param parent the parent object for this service
|
||||||
*/
|
*/
|
||||||
ServiceAccessJob(KUrl location, QObject *parent = 0);
|
ServiceAccessJob(const QUrl& location, QObject *parent = 0);
|
||||||
|
|
||||||
void start();
|
void start();
|
||||||
|
|
||||||
|
@ -551,13 +551,13 @@ QString Signing::signerOf(const Package &package) const
|
|||||||
return d->verifySignature(contents, QString());
|
return d->verifySignature(contents, QString());
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Signing::signerOf(const KUrl &package, const KUrl &signature) const
|
QString Signing::signerOf(const QUrl &package, const QUrl &signature) const
|
||||||
{
|
{
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
kDebug() << "Checking existence of " << package.pathOrUrl();
|
kDebug() << "Checking existence of " << package;
|
||||||
#endif
|
#endif
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
kDebug() << "Checking existence of " << signature.pathOrUrl();
|
kDebug() << "Checking existence of " << signature;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!package.isLocalFile() || (!signature.isEmpty() && !signature.isLocalFile())) {
|
if (!package.isLocalFile() || (!signature.isEmpty() && !signature.isLocalFile())) {
|
||||||
|
@ -146,7 +146,7 @@ public:
|
|||||||
* On success, this information can then be used with trustLevelOf and/or
|
* On success, this information can then be used with trustLevelOf and/or
|
||||||
* descriptiveString to get more information on the key.
|
* descriptiveString to get more information on the key.
|
||||||
*/
|
*/
|
||||||
QString signerOf(const KUrl &package, const KUrl &signature = KUrl()) const ;
|
QString signerOf(const QUrl &package, const QUrl &signature = QUrl()) const ;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the QString path of the keystore being used.
|
* @return the QString path of the keystore being used.
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
#include <kmimetype.h>
|
#include <kmimetype.h>
|
||||||
#include <kshell.h>
|
#include <kshell.h>
|
||||||
#include <kstandarddirs.h>
|
#include <kstandarddirs.h>
|
||||||
#include <kurl.h>
|
#include <qurl.h>
|
||||||
#include <kprotocolinfo.h>
|
#include <kprotocolinfo.h>
|
||||||
|
|
||||||
#include "abstractrunner.h"
|
#include "abstractrunner.h"
|
||||||
@ -198,14 +198,14 @@ class RunnerContextPrivate : public QSharedData
|
|||||||
type = (space > 0) ? RunnerContext::ShellCommand :
|
type = (space > 0) ? RunnerContext::ShellCommand :
|
||||||
RunnerContext::Executable;
|
RunnerContext::Executable;
|
||||||
} else {
|
} else {
|
||||||
KUrl url(term);
|
QUrl url = QUrl::fromUserInput(term);
|
||||||
// check for a normal URL first
|
// check for a normal URL first
|
||||||
//kDebug() << url << KProtocolInfo::protocolClass(url.scheme()) << url.hasHost() <<
|
//kDebug() << url << KProtocolInfo::protocolClass(url.scheme()) << url.hasHost() <<
|
||||||
// url.host() << url.isLocalFile() << path << path.indexOf('/');
|
// url.host() << url.isLocalFile() << path << path.indexOf('/');
|
||||||
const bool hasProtocol = !url.scheme().isEmpty();
|
const bool hasProtocol = !url.scheme().isEmpty();
|
||||||
const bool isLocalProtocol = KProtocolInfo::protocolClass(url.scheme()) == ":local";
|
const bool isLocalProtocol = KProtocolInfo::protocolClass(url.scheme()) == ":local";
|
||||||
if (hasProtocol &&
|
if (hasProtocol &&
|
||||||
((!isLocalProtocol && url.hasHost()) ||
|
((!isLocalProtocol && !url.host().isEmpty()) ||
|
||||||
(isLocalProtocol && url.scheme() != "file"))) {
|
(isLocalProtocol && url.scheme() != "file"))) {
|
||||||
// we either have a network protocol with a host, so we can show matches for it
|
// we either have a network protocol with a host, so we can show matches for it
|
||||||
// or we have a non-file url that may be local so a host isn't required
|
// or we have a non-file url that may be local so a host isn't required
|
||||||
|
@ -114,7 +114,7 @@ void WallpaperScript::wheelEvent(QGraphicsSceneWheelEvent *event)
|
|||||||
Q_UNUSED(event)
|
Q_UNUSED(event)
|
||||||
}
|
}
|
||||||
|
|
||||||
void WallpaperScript::addUrls(const KUrl::List urls)
|
void WallpaperScript::addUrls(const QList<QUrl> & urls)
|
||||||
{
|
{
|
||||||
Q_UNUSED(urls)
|
Q_UNUSED(urls)
|
||||||
}
|
}
|
||||||
|
@ -139,7 +139,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Adds urls (e.g. from a drop)
|
* Adds urls (e.g. from a drop)
|
||||||
*/
|
*/
|
||||||
virtual void addUrls(const KUrl::List urls);
|
virtual void addUrls(const QList<QUrl>& urls);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/**
|
/**
|
||||||
|
@ -64,7 +64,7 @@ Service::~Service()
|
|||||||
delete d;
|
delete d;
|
||||||
}
|
}
|
||||||
|
|
||||||
Service *Service::access(const KUrl &url, QObject *parent)
|
Service *Service::access(const QUrl &url, QObject *parent)
|
||||||
{
|
{
|
||||||
return new RemoteService(parent, url);
|
return new RemoteService(parent, url);
|
||||||
}
|
}
|
||||||
|
@ -32,6 +32,7 @@
|
|||||||
class QGraphicsWidget;
|
class QGraphicsWidget;
|
||||||
class QIODevice;
|
class QIODevice;
|
||||||
class QWidget;
|
class QWidget;
|
||||||
|
class QUrl;
|
||||||
|
|
||||||
namespace Plasma
|
namespace Plasma
|
||||||
{
|
{
|
||||||
@ -105,7 +106,7 @@ public:
|
|||||||
* Used to access a service from an url. Always check for the signal serviceReady() that fires
|
* Used to access a service from an url. Always check for the signal serviceReady() that fires
|
||||||
* when this service is actually ready for use.
|
* when this service is actually ready for use.
|
||||||
*/
|
*/
|
||||||
static Service *access(const KUrl &url, QObject *parent = 0);
|
static Service *access(const QUrl &url, QObject *parent = 0);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the destination for this Service to operate on
|
* Sets the destination for this Service to operate on
|
||||||
|
@ -124,7 +124,7 @@ Wallpaper::~Wallpaper()
|
|||||||
delete d;
|
delete d;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Wallpaper::addUrls(const KUrl::List &urls)
|
void Wallpaper::addUrls(const QList<QUrl> &urls)
|
||||||
{
|
{
|
||||||
if (d->script) {
|
if (d->script) {
|
||||||
d->script->addUrls(urls);
|
d->script->addUrls(urls);
|
||||||
|
@ -202,7 +202,7 @@ class PLASMA_EXPORT Wallpaper : public QObject
|
|||||||
* This is triggered by events in the user interface such as
|
* This is triggered by events in the user interface such as
|
||||||
* drag and drop of files.
|
* drag and drop of files.
|
||||||
*/
|
*/
|
||||||
virtual void addUrls(const KUrl::List &urls);
|
virtual void addUrls(const QList<QUrl> &urls);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is called when the wallpaper should be painted.
|
* This method is called when the wallpaper should be painted.
|
||||||
|
Loading…
Reference in New Issue
Block a user