Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from kaltsi/proxy-plugin
[ssu] separate connman dependency to a plugin library
- Loading branch information
Showing
16 changed files
with
83 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
include(libssunetworkproxy_dependencies.pri) | ||
LIBS *= -ldl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
TARGET = ssunetworkproxy | ||
include(../ssulibrary.pri) | ||
|
||
HEADERS = ssunetworkproxy.h | ||
|
||
SOURCES = ssunetworkproxy.cpp | ||
|
||
CONFIG += link_pkgconfig plugin | ||
|
||
QT += network | ||
|
||
PKGCONFIG += connman-qt5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# none yet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/** | ||
* @file ssunetworkproxy.cpp | ||
* @copyright 2014 Jolla Ltd. | ||
* @author Juha Kallioinen <juha.kallioinen@jolla.com> | ||
* @date 2014 | ||
*/ | ||
|
||
#include <connman-qt5/connmannetworkproxyfactory.h> | ||
|
||
extern "C" void initialize() | ||
{ | ||
QNetworkProxyFactory::setApplicationProxyFactory(new ConnmanNetworkProxyFactory); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/** | ||
* @file ssunetworkproxy.h | ||
* @copyright 2014 Jolla Ltd. | ||
* @author Juha Kallioinen <juha.kallioinen@jolla.com> | ||
* @date 2014 | ||
*/ | ||
|
||
#ifndef _LibSsuNetworkProxy_H | ||
#define _LibSsuNetworkProxy_H | ||
#include <dlfcn.h> | ||
|
||
/** | ||
* Set application proxy if the required library is found, otherwise | ||
* do nothing. | ||
*/ | ||
inline void set_application_proxy_factory() | ||
{ | ||
void *proxylib = dlopen("libssunetworkproxy.so", RTLD_LAZY); | ||
if (proxylib) { | ||
typedef void (*ssuproxyinit_t)(); | ||
dlerror(); | ||
ssuproxyinit_t proxy_init = (ssuproxyinit_t) dlsym(proxylib, "initialize"); | ||
const char *dlsym_err = dlerror(); | ||
if (!dlsym_err) { | ||
proxy_init(); | ||
} | ||
dlclose(proxylib); | ||
} | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
include(../libssu/libssu.pri) | ||
include(../libssunetworkproxy/libssunetworkproxy.pri) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
include(../libssu/libssu.pri) | ||
include(../libssunetworkproxy/libssunetworkproxy.pri) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
include(../libssu/libssu.pri) | ||
include(../libssunetworkproxy/libssunetworkproxy.pri) |