mirror of
https://github.com/KDE/krfb
synced 2026-07-01 07:41:17 -07:00
Get rid of module-wide config.h mess, use per-directory equivalents (although config-kopete.h is still quite a mess in itself)
Many configuration-related cleanups. svn path=/trunk/KDE/kdenetwork/krfb/; revision=627480
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
check_symbol_exists(getifaddrs "sys/socket.h;netdb.h;ifaddrs.h" HAVE_GETIFADDRS)
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config-krfb.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-krfb.h )
|
||||
|
||||
set(vncserver_SRCS
|
||||
${CMAKE_SOURCE_DIR}/krfb/libvncserver/main.c
|
||||
${CMAKE_SOURCE_DIR}/krfb/libvncserver/rfbserver.c
|
||||
|
||||
5
config-krfb.h.cmake
Normal file
5
config-krfb.h.cmake
Normal file
@@ -0,0 +1,5 @@
|
||||
/* Define to 1 if you have the `getifaddrs' function. */
|
||||
#cmakedefine HAVE_GETIFADDRS 1
|
||||
|
||||
/* Define if SLP is available */
|
||||
#cmakedefine HAVE_SLP 1
|
||||
@@ -15,10 +15,6 @@
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Contains keyboard & pointer handling from libvncserver's x11vnc.c
|
||||
*/
|
||||
@@ -36,6 +32,7 @@
|
||||
#include <strings.h>
|
||||
#endif
|
||||
|
||||
#include <kdefakes.h> // gethostname
|
||||
#include <kapplication.h>
|
||||
#include <KNotification>
|
||||
#include <kdebug.h>
|
||||
|
||||
@@ -23,11 +23,10 @@
|
||||
* removed glibc dependencies
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "getifaddrs.h"
|
||||
|
||||
#ifndef HAVE_GETIFADDRS
|
||||
|
||||
#include "getifaddrs.h"
|
||||
#include <net/if.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
@@ -22,11 +22,9 @@
|
||||
* removed glibs dependencies
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "config-krfb.h"
|
||||
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#include <sys/socket.h>
|
||||
#include <net/if.h>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
* TODO: see below..
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "config-krfb.h"
|
||||
#include "kserviceregistry.h"
|
||||
#include <kdebug.h>
|
||||
|
||||
@@ -36,19 +36,19 @@ public:
|
||||
m_lang(lang) {
|
||||
}
|
||||
bool ensureOpen();
|
||||
|
||||
|
||||
bool m_opened;
|
||||
QString m_lang;
|
||||
|
||||
SLPHandle m_handle;
|
||||
friend void KServiceRegistryRegReport(SLPHandle slp,
|
||||
SLPError errcode,
|
||||
friend void KServiceRegistryRegReport(SLPHandle slp,
|
||||
SLPError errcode,
|
||||
void* cookie);
|
||||
bool m_cbSuccess;
|
||||
};
|
||||
|
||||
void KServiceRegistryRegReport(SLPHandle,
|
||||
SLPError errcode,
|
||||
void KServiceRegistryRegReport(SLPHandle,
|
||||
SLPError errcode,
|
||||
void* cookie) {
|
||||
KServiceRegistryPrivate *s = (KServiceRegistryPrivate*) cookie;
|
||||
s->m_cbSuccess = (errcode == SLP_OK);
|
||||
@@ -86,8 +86,8 @@ bool KServiceRegistry::available() {
|
||||
return d->ensureOpen();
|
||||
}
|
||||
|
||||
bool KServiceRegistry::registerService(const QString &serviceURL,
|
||||
QString attributes,
|
||||
bool KServiceRegistry::registerService(const QString &serviceURL,
|
||||
QString attributes,
|
||||
unsigned short lifetime) {
|
||||
if (!d->ensureOpen())
|
||||
return false;
|
||||
@@ -108,8 +108,8 @@ bool KServiceRegistry::registerService(const QString &serviceURL,
|
||||
return d->m_cbSuccess;
|
||||
}
|
||||
|
||||
bool KServiceRegistry::registerService(const QString &serviceURL,
|
||||
QMap<QString,QString> attributes,
|
||||
bool KServiceRegistry::registerService(const QString &serviceURL,
|
||||
QMap<QString,QString> attributes,
|
||||
unsigned short lifetime) {
|
||||
if (!d->ensureOpen())
|
||||
return false;
|
||||
@@ -128,9 +128,9 @@ bool KServiceRegistry::registerService(const QString &serviceURL,
|
||||
void KServiceRegistry::unregisterService(const QString &serviceURL) {
|
||||
if (!d->m_opened)
|
||||
return;
|
||||
SLPDereg(d->m_handle, serviceURL.latin1(),
|
||||
SLPDereg(d->m_handle, serviceURL.latin1(),
|
||||
KServiceRegistryRegReport,
|
||||
d);
|
||||
d);
|
||||
}
|
||||
|
||||
QString KServiceRegistry::encodeAttributeValue(const QString &value) {
|
||||
|
||||
Reference in New Issue
Block a user