Windows: Use better name for SocketAPI socket #6983

This commit is contained in:
Markus Goetz 2019-01-31 12:47:44 +01:00
parent 116cd7c167
commit 08aef4f407
2 changed files with 6 additions and 2 deletions

View File

@ -18,6 +18,8 @@
#include "UtilConstants.h"
#include "StringUtil.h"
#include "config.h"
#include <iostream>
#include <vector>
#include <array>
@ -45,7 +47,8 @@ std::wstring getUserName() {
std::wstring CommunicationSocket::DefaultPipePath()
{
auto pipename = std::wstring(L"\\\\.\\pipe\\");
pipename += L"ownCloud-";
pipename += APPLICATION_SHORTNAME;
pipename += L"-"
pipename += getUserName();
return pipename;
}

View File

@ -180,7 +180,8 @@ SocketApi::SocketApi(QObject *parent)
if (Utility::isWindows()) {
socketPath = QLatin1String("\\\\.\\pipe\\")
+ QLatin1String("ownCloud-")
+ QLatin1String(APPLICATION_SHORTNAME)
+ QLatin1String("-")
+ QString::fromLocal8Bit(qgetenv("USERNAME"));
// TODO: once the windows extension supports multiple
// client connections, switch back to the theme name