mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-13 00:33:09 -07:00
Compilation fix on Windows (getuid missing)
This commit is contained in:
parent
fb874695c9
commit
a98a002d57
2 changed files with 24 additions and 3 deletions
14
src/GUI.cpp
14
src/GUI.cpp
|
@ -66,6 +66,10 @@
|
|||
#include "propertieswidget.h"
|
||||
#include "statusbar.h"
|
||||
|
||||
#ifdef W_WS_WIN
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
using namespace libtorrent;
|
||||
|
||||
#define TIME_TRAY_BALLOON 5000
|
||||
|
@ -161,7 +165,15 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), dis
|
|||
processParams(torrentCmdLine);
|
||||
// Use a tcp server to allow only one instance of qBittorrent
|
||||
localServer = new QLocalServer();
|
||||
QString uid = QString::number(getuid());
|
||||
QString uid = "";
|
||||
#ifdef Q_WS_WIN
|
||||
char buffer[255] = {0};
|
||||
DWORD buffer_len;
|
||||
if (!GetUserName(buffer, &buffer_len))
|
||||
uid = QString(buffer)
|
||||
#else
|
||||
uid = QString::number(getuid());
|
||||
#endif
|
||||
#ifdef Q_WS_X11
|
||||
if(QFile::exists(QDir::tempPath()+QDir::separator()+QString("qBittorrent-")+uid)) {
|
||||
// Socket was not closed cleanly
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue