This repository has been archived by the owner on Sep 16, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
53 changed files
with
3,562 additions
and
1 deletion.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
klippr | ||
====== | ||
====== | ||
|
||
meego client for kippt.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(); | ||
} |
Oops, something went wrong.