[Pkg-owncloud-commits] [owncloud-client] 14/219: Socket api: Add a VERSION command

Sandro Knauß hefee-guest at moszumanska.debian.org
Sat Oct 11 14:43:04 UTC 2014


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit 253d65727b6fa8b2d422f3f7aabab0727efcdcbe
Author: Olivier Goffart <ogoffart at woboq.com>
Date:   Wed Aug 27 12:02:47 2014 +0200

    Socket api:  Add a VERSION command
---
 src/mirall/socketapi.cpp | 12 ++++++++++++
 src/mirall/socketapi.h   |  2 ++
 2 files changed, 14 insertions(+)

diff --git a/src/mirall/socketapi.cpp b/src/mirall/socketapi.cpp
index f657cd4..0d2b5a0 100644
--- a/src/mirall/socketapi.cpp
+++ b/src/mirall/socketapi.cpp
@@ -22,6 +22,7 @@
 #include "mirall/theme.h"
 #include "mirall/syncjournalfilerecord.h"
 #include "mirall/syncfileitem.h"
+#include "version.h"
 
 #include <QDebug>
 #include <QUrl>
@@ -32,6 +33,11 @@
 #include <QDir>
 #include <QApplication>
 
+// This is the version that is returned when the client asks for the VERSION.
+// The first number should be changed if there is an incompatible change that breaks old clients.
+// The second number should be changed when there are new features.
+#define MIRALL_SOCKET_API_VERSION "1.0"
+
 extern "C" {
 
 enum csync_exclude_type_e {
@@ -400,4 +406,10 @@ void SocketApi::command_RETRIEVE_FILE_STATUS(const QString& argument, QTcpSocket
     sendMessage(socket, message);
 }
 
+void SocketApi::command_VERSION(const QString&, QTcpSocket* socket)
+{
+    sendMessage(socket, QLatin1String(MIRALL_VERSION_STRING ":" MIRALL_SOCKET_API_VERSION));
+}
+
+
 } // namespace Mirall
diff --git a/src/mirall/socketapi.h b/src/mirall/socketapi.h
index cfab53e..bfd3d12 100644
--- a/src/mirall/socketapi.h
+++ b/src/mirall/socketapi.h
@@ -59,6 +59,8 @@ private:
     Q_INVOKABLE void command_RETRIEVE_FOLDER_STATUS(const QString& argument, QTcpSocket* socket);
     Q_INVOKABLE void command_RETRIEVE_FILE_STATUS(const QString& argument, QTcpSocket* socket);
 
+    Q_INVOKABLE void command_VERSION(const QString& argument, QTcpSocket* socket);
+
 private:
     QTcpServer *_localServer;
     QList<QTcpSocket*> _listeners;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list