remove last pieces of remote plasmoids

This commit is contained in:
Marco Martin 2013-02-12 12:51:03 +01:00
parent f28d7c7220
commit e0e61ca3f5
18 changed files with 0 additions and 433 deletions

View File

@ -28,9 +28,6 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${KDE4_INCLUDE_DIR}
${KDE4_INCLUDE_DIR}/KDE
${CMAKE_SOURCE_DIR}/plasma/private/qtjolie-branch/qtjolie
${CMAKE_SOURCE_DIR}/plasma/private/qtjolie-branch
${CMAKE_SOURCE_DIR}/plasma/private/qtjolie-branch/includes
${ki18n_SOURCE_DIR}/src
${ki18n_BINARY_DIR}/src
${KDE4_INCLUDE_DIR}/threadweaver

View File

@ -1,5 +1,3 @@
#cmakedefine01 ENABLE_REMOTE_WIDGETS
#cmakedefine01 PLASMA_NO_KDEWEBKIT
#cmakedefine01 PLASMA_NO_SOLID
#cmakedefine01 PLASMA_NO_KIO

View File

@ -1,54 +0,0 @@
/*
* Copyright 2009 by Rob Scheepmaker <r.scheepmaker@student.utwente.nl>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301 USA
*/
#ifndef ACCESSMANAGER_P_H
#define ACCESSMANAGER_P_H
#include <dnssd/remoteservice.h>
#include "../remote/accessmanager.h"
class KJob;
namespace DNSSD
{
class ServiceBrowser;
}
namespace Plasma
{
class AccessManagerPrivate
{
public:
AccessManagerPrivate(AccessManager *manager);
~AccessManagerPrivate();
void slotJobFinished(KJob *job);
void slotAddService(DNSSD::RemoteService::Ptr service);
void slotRemoveService(DNSSD::RemoteService::Ptr service);
AccessManager *q;
DNSSD::ServiceBrowser *browser;
QMap<QString, RemoteObjectDescription> services;
QMap<QString, DNSSD::RemoteService::Ptr> zeroconfServices;
};
}
#endif

View File

@ -52,7 +52,6 @@ namespace Plasma
AppletPrivate::AppletPrivate(KService::Ptr service, const KPluginInfo *info, int uniqueID, Applet *applet)
: appletId(uniqueID),
q(applet),
remotingService(0),
immutability(Mutable),
appletDescription(info ? *info : KPluginInfo(service)),
mainConfig(0),

View File

@ -130,7 +130,6 @@ public:
Applet *q;
// applet attributes
Service *remotingService;
ImmutabilityType immutability;
// applet info we keep around in case its needed
@ -155,7 +154,6 @@ public:
QWeakPointer<KKeySequenceWidget> shortcutEditor; //TODO: subclass KConfigDialog and encapsulate this in there
ItemStatus itemStatus;
KUrl remoteLocation;
// the applet can change size policy by itself, so save the old one for eventual restore
QSizePolicy preferredSizePolicy;

View File

@ -1,122 +0,0 @@
/*
* Copyright © 2009 Rob Scheepmaker <r.scheepmaker@student.utwente.nl>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License version 2 as
* published by the Free Software Foundation
*
* 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 JOLIEMESSAGEHELPER_H
#define JOLIEMESSAGEHELPER_H
#include <QByteArray>
#include <QtJolie/Message>
#include <QtJolie/Value>
#include <kdebug.h>
#include <klocalizedstring.h>
namespace JolieMessage {
namespace Field {
static const QByteArray DESTINATION = "Destination";
static const QByteArray ENABLEDOPERATIONS
= "EnabledOperations";
static const QByteArray IDENTITY = "Credentials";
static const QByteArray IDENTITYID = "CredentialsID";
static const QByteArray PARAMETERS = "Parameters";
static const QByteArray PIN = "PIN";
static const QByteArray RESULT = "Result";
static const QByteArray SIGNATURE = "Signature";
static const QByteArray TOKEN = "Token";
static const QByteArray UUID = "UUID";
static const QByteArray OPERATION = "Operation";
static const QByteArray OPERATIONSDESCRIPTION
= "OperationsDescription";
}
namespace Error {
static const QByteArray INVALIDTOKEN = "InvalidToken";
static const QByteArray REQUIREPIN = "RequirePIN";
static const QByteArray ACCESSDENIED = "AccessDenied";
}
inline QString errorMessage(const QByteArray &error)
{
if (error == Error::INVALIDTOKEN) {
return i18nc("Error message, access to a remote service failed.",
"Invalid token.");
} else if (error == Error::REQUIREPIN) {
return i18nc("Error message, access to a remote service failed.",
"Matching password required.");
} else if (error == Error::ACCESSDENIED) {
return i18nc("Error message, access to a remote service failed.",
"Access denied.");
}
return i18n("Unknown error.");
}
inline QByteArray field(const QByteArray &fieldName, const Jolie::Message &message)
{
if (!message.data().children(fieldName).isEmpty()) {
return message.data().children(fieldName).first().toByteArray();
} else {
return QByteArray();
}
}
inline QByteArray payload(const Jolie::Message &message)
{
QByteArray result;
//result = "payload!";
result.append(message.operationName());
result.append(field(Field::PARAMETERS, message));
result.append(field(Field::IDENTITY, message));
result.append(field(Field::IDENTITYID, message));
result.append(field(Field::OPERATION, message));
result.append(field(Field::OPERATIONSDESCRIPTION, message));
result.append(field(Field::PIN, message));
result.append(field(Field::TOKEN, message));
return result;
}
inline QString print(const Jolie::Message &message)
{
QString result;
result =
QString("\n=== JOLIE MESSAGE ===\nId = %1\nOperation = %2\nResource = %3\nData= %4\n")
.arg(QString::number(message.id()))
.arg(QString(message.operationName()))
.arg(QString(message.resourcePath()))
.arg(QString(message.data().toByteArray()));
result += "=====================\n";
foreach (const QByteArray &child, message.data().childrenNames()) {
result += "\n******" + child + "******\n";
foreach (const Jolie::Value &value, message.data().children(child)) {
if (child == Field::TOKEN || child == Field::PARAMETERS
|| child == Field::SIGNATURE) {
result += value.toByteArray().toBase64();
} else {
result += value.toByteArray();
}
}
}
result += "\n== END OF MESSAGE ==\n";
return result;
}
}
#endif

View File

@ -120,8 +120,6 @@ private:
Q_PRIVATE_SLOT(d, void preventAutoStart())
ServiceJobPrivate * const d;
friend class RemoteServiceJob;
};
} // namespace Plasma

View File

@ -20,7 +20,6 @@ PLASMA_UNIT_TESTS(
packagestructuretest
plasmoidpackagetest
runnercontexttest
#signingtest TODO re-enable
)
kde4_add_unit_test(storagetest TESTNAME plasma-storage storagetest.cpp ../private/storage.cpp ../private/storagethread.cpp)

Binary file not shown.

Binary file not shown.

View File

@ -1 +0,0 @@
5fd34038c612b9ee59ba9b8199594a370009f7ff

View File

@ -1,45 +0,0 @@
// because we put the following line in the metadata.desktop file, we have access
// to the HTTP extension in this Plasmoid.
//
// X-Plasma-RequiredExtensions=http
//
// More documentation can be found here:
//
// http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API#Extensions
output = new TextEdit
output.readOnly = true
layout = new LinearLayout
layout.orientation = QtVertical
layout.addItem(output)
// in case our request for HTTP urls in the metadata.desktop was rejected (e.g. due
// to security restrictions) we won't have a plasmoid.get, so let's check for it
// before using it!
if (plasmoid.getUrl) {
var getJob = plasmoid.getUrl("http://dot.kde.org/rss.xml");
function recv(job, data)
{
if (job == getJob) {
print("we have our job")
if (data.length) {
output.append(data.toUtf8())
}
}
}
function fini(job)
{
if (job == getJob) {
print("our job is finished")
} else {
print("some other job is finished?")
}
}
getJob.data.connect(recv)
getJob.finished.connect(fini)
} else {
output.text = i18n("HTTP access denied!")
}

View File

@ -1,36 +0,0 @@
[Desktop Entry]
Name=JavaScript File Operations
Name[de]=JavaScript-Datei-Aktionen
Name[nl]=Bestandsbewerkingen in JavaScript
Name[pt]=Operações do Ficheiro de JavaScript
Name[pt_BR]=Operações com arquivos JavaScript
Name[sk]=JavaScriptové súborové operácie
Name[uk]=Дії з файлами за допомогою JavaScript
Name[x-test]=xxJavaScript File Operationsxx
Comment=Demonstrates accessing data via HTTP in JavaScript
Comment[de]=Demonstriert den Zugriff auf Daten über HTTP in JavaScript
Comment[nl]=Demonstreert toegang tot gegevens via HTTP in JavaScript
Comment[pt]=Demonstra o acesso aos dados por HTTP em JavaScript
Comment[pt_BR]=Demonstra o acesso a dados por HTTP em JavaScript
Comment[sk]=Demonštruje prístup k údajom cez HTTP v JavaScripte
Comment[uk]=Демонстрації доступу до даних за допомогою HTTP мовою JavaScript
Comment[x-test]=xxDemonstrates accessing data via HTTP in JavaScriptxx
Icon=text-x-generic
Type=Service
X-KDE-ServiceTypes=Plasma/Applet
X-Plasma-API=javascript
X-Plasma-MainScript=code/main.js
X-KDE-PluginInfo-Author=Aaron Seigo
X-KDE-PluginInfo-Email=aseigo@kde.org
X-KDE-PluginInfo-Name=org.kde.plasma.simpified-javascript-http-example
X-KDE-PluginInfo-Version=0.1
X-KDE-PluginInfo-Website=
X-KDE-PluginInfo-Category=Examples
X-KDE-PluginInfo-Depends=
X-KDE-PluginInfo-License=GPL
X-Plasma-OptionalExtensions=http
X-Plasma-MainScript=code/main.js

View File

@ -1,104 +0,0 @@
/********************************************************************************
* Copyright 2011 by Aaron Seigo <aseigo@kde.org> *
* *
* This library 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 of the License, or (at your option) any later version. *
* *
* This library 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 *
* Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public License *
* along with this library; see the file COPYING.LIB. If not, write to *
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, *
* Boston, MA 02110-1301, USA. *
*********************************************************************************/
#include "signingtest.h"
#include <QTime>
#include <kdebug.h>
#include "applet.h"
#include "remote/signing.h"
#include "pluginloader.h"
#include <QStandardPaths>
static const QString fingerprint("8B8B22090C6F7C47B1EAEE75D6B72EB1A7F1DB43");
static const QString shortFingerprint("D6B72EB1A7F1DB43");
SigningTest::SigningTest(QObject *parent)
: QObject(parent),
m_signing(0),
m_package(Plasma::PluginLoader::self()->loadPackage("Plasma/Applet"))
{
m_package.setPath(QString::fromLatin1(KDESRCDIR) + "signedPackage");
const QString prefix = QString::fromLatin1(KDESRCDIR);
m_path = prefix + "signed.plasmoid";
m_sig = prefix + "signed.plasmoid.sig";
m_invalidSig = prefix + "signed.plasmoid.invalid.sig";
}
void SigningTest::initTestCase()
{
QStandardPaths::enableTestMode(true);
}
void SigningTest::confirmCtorPerformance()
{
QTime t;
t.start();
m_signing = new Plasma::Signing;
QVERIFY(t.elapsed() < 50);
}
void SigningTest::missingFiles()
{
QVERIFY(m_signing->signerOf(KUrl("/nonexistantpackage"), KUrl("/noneexistantsignature")).isEmpty());
QVERIFY(m_signing->signerOf(KUrl(m_path), KUrl("/noneexistantsignature")).isEmpty());
QVERIFY(m_signing->signerOf(KUrl("/nonexistantpackage"), KUrl(m_sig)).isEmpty());
}
void SigningTest::invalidSignature()
{
QCOMPARE(m_signing->signerOf(m_path, m_invalidSig), QString());
}
void SigningTest::validSignature()
{
QCOMPARE(m_signing->signerOf(m_path, m_sig), fingerprint);
}
void SigningTest::validSignatureWithoutDefinedSigFile()
{
QCOMPARE(m_signing->signerOf(m_path), fingerprint);
}
void SigningTest::validPackage()
{
const QString sig = m_signing->signerOf(m_package);
QVERIFY(sig == fingerprint || sig == shortFingerprint);
}
void SigningTest::trustLevel()
{
QCOMPARE(m_signing->trustLevelOf(QString()), Plasma::UnverifiableTrust);
QCOMPARE(m_signing->trustLevelOf(fingerprint), Plasma::SelfTrusted);
//FIXME: need to test other TrustLevel values
}
void SigningTest::confirmDtorPerformance()
{
QTime t;
t.start();
delete m_signing;
m_signing = 0;
QVERIFY(t.elapsed() < 50);
}
QTEST_MAIN(SigningTest)

View File

@ -1,60 +0,0 @@
/********************************************************************************
* Copyright 2011 by Aaron Seigo <aseigo@kde.org> *
* *
* This library 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 of the License, or (at your option) any later version. *
* *
* This library 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 *
* Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public License *
* along with this library; see the file COPYING.LIB. If not, write to *
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, *
* Boston, MA 02110-1301, USA. *
*********************************************************************************/
#ifndef SIGNINGTEST_H
#include <QtTest/QtTest>
#include "plasma/package.h"
namespace Plasma
{
class Signing;
}
class SigningTest : public QObject
{
Q_OBJECT
public:
explicit SigningTest(QObject *parent = 0);
public Q_SLOTS:
void initTestCase();
private Q_SLOTS:
void confirmCtorPerformance();
void missingFiles();
void invalidSignature();
void validSignature();
void validSignatureWithoutDefinedSigFile();
void validPackage();
void trustLevel();
void confirmDtorPerformance();
private:
Plasma::Signing *m_signing;
Plasma::Package m_package;
QString m_path;
QString m_sig;
QString m_invalidSig;
};
#endif