Public Member Functions | |
| TQT_DBusConnectionManager () | |
| ~TQT_DBusConnectionManager () | |
| void | bindToApplication () |
| TQT_DBusConnectionPrivate * | connection (const TQString &name) const |
| void | removeConnection (const TQString &name) |
| void | setConnection (const TQString &name, TQT_DBusConnectionPrivate *c) |
Static Public Member Functions | |
| static TQT_DBusConnectionManager * | instance () |
Private Types | |
| typedef TQMap< TQString, TQT_DBusConnectionPrivate * > | ConnectionHash |
Private Attributes | |
| TQT_DBusConnectionPrivate * | default_connection |
| ConnectionHash | connectionHash |
Static Private Attributes | |
| static TQT_DBusConnectionManager * | managerInstance = 0 |
Definition at line 36 of file tqdbusconnection.cpp.
typedef TQMap<TQString, TQT_DBusConnectionPrivate*> TQT_DBusConnectionManager::ConnectionHash [private] |
Definition at line 54 of file tqdbusconnection.cpp.
| TQT_DBusConnectionManager::TQT_DBusConnectionManager | ( | ) | [inline] |
Definition at line 39 of file tqdbusconnection.cpp.
00039 : default_connection(0) {}
| TQT_DBusConnectionManager::~TQT_DBusConnectionManager | ( | ) |
Definition at line 94 of file tqdbusconnection.cpp.
References connectionHash, and default_connection.
00095 { 00096 if (default_connection) { 00097 delete default_connection; 00098 default_connection = 0; 00099 } 00100 /* FIXME-QT4 00101 for (TQHash<TQString, TQT_DBusConnectionPrivate *>::const_iterator it = connectionHash.constBegin(); 00102 it != connectionHash.constEnd(); ++it) { 00103 delete it.value(); 00104 }*/ 00105 for (ConnectionHash::const_iterator it = connectionHash.constBegin(); 00106 it != connectionHash.constEnd(); ++it) 00107 { 00108 delete it.data(); 00109 } 00110 connectionHash.clear(); 00111 }
| void TQT_DBusConnectionManager::bindToApplication | ( | ) |
Definition at line 113 of file tqdbusconnection.cpp.
References TQT_DBusConnectionPrivate::bindToApplication(), connectionHash, and default_connection.
00114 { 00115 if (default_connection) { 00116 default_connection->bindToApplication(); 00117 } 00118 /* FIXME-QT4 00119 for (TQHash<TQString, TQT_DBusConnectionPrivate *>::const_iterator it = connectionHash.constBegin(); 00120 it != connectionHash.constEnd(); ++it) { 00121 (*it)->bindToApplication(); 00122 }*/ 00123 for (ConnectionHash::const_iterator it = connectionHash.constBegin(); 00124 it != connectionHash.constEnd(); ++it) 00125 { 00126 it.data()->bindToApplication(); 00127 } 00128 }
| TQT_DBusConnectionPrivate * TQT_DBusConnectionManager::connection | ( | const TQString & | name | ) | const |
Definition at line 66 of file tqdbusconnection.cpp.
References connectionHash, default_connection, and TQT_DBusConnection::default_connection_name.
00067 { 00068 if (name == TQString::fromLatin1(TQT_DBusConnection::default_connection_name)) 00069 return default_connection; 00070 00071 ConnectionHash::const_iterator it = connectionHash.find(name); 00072 00073 return (it != connectionHash.end() ? it.data() : 0); 00074 }
| static TQT_DBusConnectionManager* TQT_DBusConnectionManager::instance | ( | ) | [inline, static] |
Definition at line 46 of file tqdbusconnection.cpp.
References managerInstance, and TQT_DBusConnectionManager().
00046 { 00047 if (managerInstance == 0) managerInstance = new TQT_DBusConnectionManager(); 00048 return managerInstance; 00049 }
| void TQT_DBusConnectionManager::removeConnection | ( | const TQString & | name | ) |
Definition at line 76 of file tqdbusconnection.cpp.
References connectionHash, default_connection, TQT_DBusConnection::default_connection_name, Atomic::deref(), and TQT_DBusConnectionPrivate::ref.
00077 { 00078 TQT_DBusConnectionPrivate *d = 0; 00079 if (name == TQString::fromLatin1(TQT_DBusConnection::default_connection_name)) { 00080 d = default_connection; 00081 default_connection = 0; 00082 } else { 00083 ConnectionHash::iterator it = connectionHash.find(name); 00084 if (it == connectionHash.end()) 00085 return; 00086 00087 d = it.data(); 00088 connectionHash.erase(it); 00089 } 00090 if (!d->ref.deref()) 00091 delete d; 00092 }
| void TQT_DBusConnectionManager::setConnection | ( | const TQString & | name, | |
| TQT_DBusConnectionPrivate * | c | |||
| ) |
Definition at line 135 of file tqdbusconnection.cpp.
References connectionHash, default_connection, and TQT_DBusConnection::default_connection_name.
00136 { 00137 if (name == TQString::fromLatin1(TQT_DBusConnection::default_connection_name)) 00138 default_connection = c; 00139 else 00140 connectionHash[name] = c; 00141 }
Definition at line 55 of file tqdbusconnection.cpp.
Definition at line 52 of file tqdbusconnection.cpp.
TQT_DBusConnectionManager * TQT_DBusConnectionManager::managerInstance = 0 [static, private] |
Definition at line 57 of file tqdbusconnection.cpp.
1.6.3