Code chages for compatibility with MSVC compiler
Thanks to Xiluembo
This commit is contained in:
parent
1bc4fcfa23
commit
d782060b39
3 changed files with 13 additions and 4 deletions
|
@ -35,17 +35,23 @@
|
|||
void LanLinkProvider::configureSocket(QTcpSocket* socket)
|
||||
{
|
||||
int fd = socket->socketDescriptor();
|
||||
int enableKeepAlive = 1;
|
||||
char enableKeepAlive = 1;
|
||||
setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &enableKeepAlive, sizeof(enableKeepAlive));
|
||||
|
||||
#ifdef TCP_KEEPIDLE
|
||||
int maxIdle = 60; /* seconds */
|
||||
setsockopt(fd, IPPROTO_TCP, TCP_KEEPIDLE, &maxIdle, sizeof(maxIdle));
|
||||
#endif
|
||||
|
||||
#ifdef TCP_KEEPCNT
|
||||
int count = 3; // send up to 3 keepalive packets out, then disconnect if no response
|
||||
setsockopt(fd, getprotobyname("TCP")->p_proto, TCP_KEEPCNT, &count, sizeof(count));
|
||||
#endif
|
||||
|
||||
#ifdef TCP_KEEPINTVL
|
||||
int interval = 5; // send a keepalive packet out every 2 seconds (after the 5 second idle period)
|
||||
setsockopt(fd, getprotobyname("TCP")->p_proto, TCP_KEEPINTVL, &interval, sizeof(interval));
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
#include "device.h"
|
||||
|
||||
#include <QDBusConnection>
|
||||
|
||||
#include <KSharedConfig>
|
||||
#include <KConfigGroup>
|
||||
#include <KStandardDirs>
|
||||
|
@ -17,6 +15,11 @@
|
|||
#include "backends/linkprovider.h"
|
||||
#include "networkpackage.h"
|
||||
|
||||
#ifdef interface // MSVC language extension, QDBusConnection uses this as a variable name
|
||||
#undef interface
|
||||
#endif
|
||||
#include <QDBusConnection>
|
||||
|
||||
Device::Device(const QString& id)
|
||||
: m_deviceId(id)
|
||||
, m_pairStatus(Device::Paired)
|
||||
|
|
|
@ -42,7 +42,7 @@ public Q_SLOTS:
|
|||
|
||||
private Q_SLOTS:
|
||||
void serviceOwnerChanged(const QString &name, const QString &oldOwner, const QString &newOwner);
|
||||
void propertiesChanged(const QString& interface, const QVariantMap& properties);
|
||||
void propertiesChanged(const QString& propertyInterface, const QVariantMap& properties);
|
||||
|
||||
private:
|
||||
void addPlayer(const QString& ifaceName);
|
||||
|
|
Loading…
Reference in a new issue