mirror of
https://github.com/nextcloud/desktop.git
synced 2024-12-16 02:31:37 +03:00
23 lines
522 B
C++
23 lines
522 B
C++
|
|
||
|
#include "socketclient.h"
|
||
|
|
||
|
SocketClient::SocketClient(QObject *parent) :
|
||
|
QObject(parent)
|
||
|
, sock(new QLocalSocket(this))
|
||
|
{
|
||
|
QString sockAddr;
|
||
|
#ifdef Q_OS_UNIX
|
||
|
sockAddr = QDir::homePath() + QLatin1String("/.local/share/data/ownCloud/");
|
||
|
#else
|
||
|
sockAddr = QLatin1String("\\\\.\\pipe\\ownCloud");
|
||
|
#endif
|
||
|
sock->connectToServer(sockAddr);
|
||
|
sock->open(QIODevice::ReadWrite);
|
||
|
connect(sock, SIGNAL(readyRead()), SLOT(writeData()));
|
||
|
}
|
||
|
|
||
|
void SocketClient::writeData()
|
||
|
{
|
||
|
qDebug() << sock->readAll();
|
||
|
}
|