[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE_3_3_BRANCH: kdelibs/kdecore/network
From: Thiago Macieira <thiago.macieira () kdemail ! net>
Date: 2004-08-30 1:19:42
Message-ID: 20040830011942.8C06F1773 () office ! kde ! org
[Download RAW message or body]
CVS commit by thiago:
Backporting the fix: KSocksSocketDevice::initSocks() is necessary.
M +28 -0 ksockssocketdevice.cpp 1.4.2.1
M +4 -0 ksockssocketdevice.h 1.1.2.1
--- kdelibs/kdecore/network/ksockssocketdevice.h #1.1:1.1.2.1
@@ -119,4 +119,8 @@ public:
virtual bool poll(bool* input, bool* output, bool* exception = 0L,
int timeout = -1, bool* timedout = 0L);
+
+private:
+ static void initSocks();
+ friend class KSocketDevice;
};
--- kdelibs/kdecore/network/ksockssocketdevice.cpp #1.4:1.4.2.1
@@ -28,4 +28,6 @@
#endif
+#include "kapplication.h"
+
#include "ksocks.h"
#include "ksocketaddress.h"
@@ -437,2 +439,28 @@ bool KSocksSocketDevice::poll(bool *inpu
return true;
}
+
+void KSocksSocketDevice::initSocks()
+{
+ static bool init = false;
+
+ if (init)
+ return;
+
+ if (kapp == 0L)
+ return; // no KApplication, so don't initialise
+ // this should, however, test for KInstance
+
+ init = true;
+
+ if (KSocks::self()->hasSocks())
+ delete KSocketDevice::setDefaultImpl(new KSocketDeviceFactory<KSocksSocketDevice>);
+}
+
+#if 0
+static bool register()
+{
+ KSocketDevice::addNewImpl(new KSocketDeviceFactory<KSocksSocketDevice>, 0);
+}
+
+static bool register = registered();
+#endif
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic