Skip to content
This repository has been archived by the owner on Sep 16, 2022. It is now read-only.

Commit

Permalink
initial github klippr commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mborho committed Sep 1, 2012
1 parent 3c351f5 commit f72edb3
Show file tree
Hide file tree
Showing 53 changed files with 3,562 additions and 1 deletion.
674 changes: 674 additions & 0 deletions License.txt

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion README.md
@@ -1,2 +1,4 @@
klippr
======
======

meego client for kippt.com
34 changes: 34 additions & 0 deletions kipptconnector.h
@@ -0,0 +1,34 @@
#include <QObject>
#include <QNetworkReply>
#include <QNetworkAccessManager>

#ifndef KIPPTCONNECTOR_H
#define KIPPTCONNECTOR_H


class KipptConnector : public QObject
{
Q_OBJECT

public:
KipptConnector(QObject *parent = 0);

Q_INVOKABLE QString deleteCall(QString ressource, QString sURL, QByteArray username, QByteArray apiToken);

signals:

void clipDeleted(QVariant statusCode);
void listDeleted(QVariant statusCode);

private slots:

void deletedClip(QNetworkReply* apiReply);
void deletedList(QNetworkReply* apiReply);

private:

QNetworkAccessManager m_NetCtrl;

};

#endif // KIPPTCONNECTOR_H
43 changes: 43 additions & 0 deletions kiptconnector.cpp
@@ -0,0 +1,43 @@
#include "kipptconnector.h"
#include <QObject>
#include <QString>
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QSignalMapper>

KipptConnector::KipptConnector(QObject *parent) : QObject(parent)
{
}

QString KipptConnector::deleteCall(QString ressource,QString path, QByteArray username, QByteArray apiToken )
{

QNetworkRequest request;
request.setUrl(QUrl(path));
request.setRawHeader("X-Kippt-Client", "Klipper for Meego");
request.setRawHeader("X-Kippt-Username", username);
request.setRawHeader("X-Kippt-API-Token", apiToken);

m_NetCtrl.deleteResource(request);

if(ressource == "clip") {
connect(&m_NetCtrl, SIGNAL(finished(QNetworkReply*)), SLOT(deletedClip(QNetworkReply*)));
} else if(ressource == "list") {
connect(&m_NetCtrl, SIGNAL(finished(QNetworkReply*)), SLOT(deletedList(QNetworkReply*)));
}

return path;
}

void KipptConnector::deletedClip(QNetworkReply* apiReply)
{
QVariant statusCode = apiReply->attribute( QNetworkRequest::HttpStatusCodeAttribute );
emit clipDeleted(statusCode);
}

void KipptConnector::deletedList(QNetworkReply* apiReply)
{
QVariant statusCode = apiReply->attribute( QNetworkRequest::HttpStatusCodeAttribute );
emit listDeleted(statusCode);
}
11 changes: 11 additions & 0 deletions klippr.desktop
@@ -0,0 +1,11 @@
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Terminal=false
Name=klippr
Exec=/opt/klippr/bin/klippr
Icon=klippr64
X-Window-Icon=
X-HildonDesk-ShowInToolbar=true
X-Osso-Type=application/x-executable
52 changes: 52 additions & 0 deletions klippr.pro
@@ -0,0 +1,52 @@
# Add more folders to ship with the application, here
folder_01.source = qml/klippr
folder_01.target = qml
DEPLOYMENTFOLDERS = folder_01

QT += network

# Additional import path used to resolve QML modules in Creator's code model
QML_IMPORT_PATH =

# symbian:TARGET.UID3 = 0xE715C771

# Smart Installer package's UID
# This UID is from the protected range and therefore the package will
# fail to install if self-signed. By default qmake uses the unprotected
# range value if unprotected UID is defined for the application and
# 0x2002CCCF value if protected UID is given to the application
#symbian:DEPLOYMENT.installer_header = 0x2002CCCF

# Allow network access on Symbian
# symbian:TARGET.CAPABILITY += NetworkServices

# If your application uses the Qt Mobility libraries, uncomment the following
# lines and add the respective components to the MOBILITY variable.
# CONFIG += mobility
# MOBILITY +=

# Speed up launching on MeeGo/Harmattan when using applauncherd daemon
CONFIG += qdeclarative-boostable

# Add dependency to Symbian components
# CONFIG += qt-components

# The .cpp file which was generated for your project. Feel free to hack it.
SOURCES += main.cpp \
kiptconnector.cpp

# Please do not modify the following two lines. Required for deployment.
include(qmlapplicationviewer/qmlapplicationviewer.pri)
qtcAddDeployment()

OTHER_FILES += \
qtc_packaging/debian_harmattan/rules \
qtc_packaging/debian_harmattan/README \
qtc_packaging/debian_harmattan/manifest.aegis \
qtc_packaging/debian_harmattan/copyright \
qtc_packaging/debian_harmattan/control \
qtc_packaging/debian_harmattan/compat \
qtc_packaging/debian_harmattan/changelog

HEADERS += \
kipptconnector.h
93 changes: 93 additions & 0 deletions klippr.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added klippr64.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added klippr80.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions klippr_harmattan.desktop
@@ -0,0 +1,11 @@
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Terminal=false
Name=Klippr
Exec=/usr/bin/invoker --type=d --splash=/opt/klippr/qml/klippr/gfx/klippr-splash.jpg --splash-landscape=/opt/klippr/qml/klippr/gfx/klippr-splash-landscape.jpg -s /opt/klippr/bin/klippr
Icon=/usr/share/icons/hicolor/80x80/apps/klippr80.png
X-Window-Icon=
X-HildonDesk-ShowInToolbar=true
X-Osso-Type=application/x-executable
19 changes: 19 additions & 0 deletions main.cpp
@@ -0,0 +1,19 @@
#include <QtGui/QApplication>
#include "qmlapplicationviewer.h"
#include <QDeclarativeContext>
#include "kipptconnector.h"

Q_DECL_EXPORT int main(int argc, char *argv[])
{
QScopedPointer<QApplication> app(createApplication(argc, argv));

QmlApplicationViewer viewer;
QDeclarativeContext *ctxt = viewer.rootContext();
ctxt->setContextProperty("KipptConnector", new KipptConnector());

viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
viewer.setMainQmlFile(QLatin1String("qml/klippr/main.qml"));
viewer.showExpanded();

return app->exec();
}

0 comments on commit f72edb3

Please sign in to comment.