mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
Use local socket (named pipe) connection also on Windows
This commit is contained in:
parent
c4f96c2fba
commit
3ebe3b1196
@ -60,10 +60,6 @@ CSYNC_EXCLUDE_TYPE csync_excluded_no_ctx(c_strlist_t *excludes, const char *path
|
||||
int csync_exclude_load(const char *fname, c_strlist_t **list);
|
||||
}
|
||||
|
||||
namespace {
|
||||
const int PORT = 34001;
|
||||
}
|
||||
|
||||
namespace Mirall {
|
||||
|
||||
#define DEBUG qDebug() << "SocketApi: "
|
||||
@ -225,17 +221,6 @@ SocketApi::SocketApi(QObject* parent)
|
||||
: QObject(parent)
|
||||
, _excludes(0)
|
||||
{
|
||||
|
||||
qDebug() << "Hello";
|
||||
qWarning() << "gello";
|
||||
|
||||
#ifdef SOCKETAPI_TCP
|
||||
// setup socket
|
||||
DEBUG << "Establishing SocketAPI server at" << PORT;
|
||||
if (!_localServer.listen(QHostAddress::LocalHost, PORT)) {
|
||||
DEBUG << "Failed to bind to port" << PORT;
|
||||
}
|
||||
#else
|
||||
QString socketPath;
|
||||
|
||||
if (Utility::isWindows()) {
|
||||
@ -277,7 +262,6 @@ SocketApi::SocketApi(QObject* parent)
|
||||
DEBUG << "server started, listening at " << socketPath;
|
||||
}
|
||||
|
||||
#endif
|
||||
connect(&_localServer, SIGNAL(newConnection()), this, SLOT(slotNewConnection()));
|
||||
|
||||
// folder watcher
|
||||
|
||||
@ -33,19 +33,7 @@ class QStringList;
|
||||
|
||||
namespace Mirall {
|
||||
|
||||
//Define this to use the old school TCP API. Maybe we should offer both APIs
|
||||
// and have the old TCP one be enableable via command line switch?
|
||||
//#define SOCKETAPI_TCP
|
||||
#if defined(Q_OS_WIN)
|
||||
// Windows plugin has not been ported
|
||||
#define SOCKETAPI_TCP
|
||||
#endif
|
||||
|
||||
#ifdef SOCKETAPI_TCP
|
||||
typedef QTcpSocket SocketType;
|
||||
#else
|
||||
typedef QLocalSocket SocketType;
|
||||
#endif
|
||||
|
||||
class SocketApi : public QObject
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user