42 #include <QtCore/qglobal.h> 43 #include <QtCore/qlibrary.h> 44 #include <QtCore/qmutex.h> 45 #include <private/qmutexpool_p.h> 53 #if !defined QT_LINKED_LIBDBUS 65 static volatile bool triedToLoadLibrary =
false;
70 if (triedToLoadLibrary)
74 triedToLoadLibrary =
true;
76 static int majorversions[] = { 3, 2, -1 };
80 for (
uint i = 0; i <
sizeof(majorversions) /
sizeof(majorversions[0]); ++i) {
82 if (lib->
load() && lib->
resolve(
"dbus_connection_open_private"))
96 return qdbus_libdbus->
resolve(name);
104 qFatal(
"Cannot find libdbus-1 in your system to resolve symbol '%s'.", name);
106 ptr = qdbus_libdbus->
resolve(name);
108 qFatal(
"Cannot resolve '%s' in your libdbus-1.", name);
115 #endif // QT_LINKED_LIBDBUS QString fileName
the file name of the library
void qdbus_unloadLibDBus()
void setFileNameAndVersion(const QString &fileName, int verNum)
Sets the fileName property and major version number to fileName and versionNumber respectively...
void * qdbus_resolve_me(const char *name)
#define QT_END_NAMESPACE
This macro expands to.
bool unload()
Unloads the library and returns true if the library could be unloaded; otherwise returns false...
void * qdbus_resolve_conditionally(const char *name)
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
void * resolve(const char *symbol)
Returns the address of the exported symbol symbol.
bool isLoaded() const
Returns true if the library is loaded; otherwise returns false.
#define Q_DESTRUCTOR_FUNCTION(AFUNC)
void setFileName(const QString &fileName)
#define QT_BEGIN_NAMESPACE
This macro expands to.
const T * ptr(const T &t)
static QLibrary * qdbus_libdbus
Q_CORE_EXPORT void qFatal(const char *,...)
The QMutexLocker class is a convenience class that simplifies locking and unlocking mutexes...
bool load()
Loads the library and returns true if the library was loaded successfully; otherwise returns false...
void setLoadHints(LoadHints hints)
static QMutex * globalInstanceGet(const void *address)
Returns a QMutex from the global mutex pool.
The QLibrary class loads shared libraries at runtime.