mirror of
https://github.com/nextcloud/desktop.git
synced 2024-12-16 02:31:37 +03:00
27 lines
769 B
C++
27 lines
769 B
C++
#include <QApplication>
|
|
#include <QLocalSocket>
|
|
#include <QDir>
|
|
|
|
#include "window.h"
|
|
|
|
int main(int argc, char *argv[])
|
|
{
|
|
QApplication app(argc, argv);
|
|
QLocalSocket sock;
|
|
QString sockAddr;
|
|
#ifdef Q_OS_UNIX
|
|
sockAddr = QDir::homePath() + QLatin1String("/.local/share/data/ownCloud/socket");
|
|
#else
|
|
sockAddr = QLatin1String("\\\\.\\pipe\\ownCloud");
|
|
#endif
|
|
Window win(&sock);
|
|
QObject::connect(&sock, SIGNAL(readyRead()), &win, SLOT(receive()));
|
|
QObject::connect(&sock, SIGNAL(error(QLocalSocket::LocalSocketError)),
|
|
&win, SLOT(receiveError(QLocalSocket::LocalSocketError)));
|
|
|
|
win.show();
|
|
sock.connectToServer(sockAddr, QIODevice::ReadWrite);
|
|
qDebug() << "Connecting to" << sockAddr;
|
|
|
|
return app.exec();
|
|
}
|