Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
4662df8a
Kaydet (Commit)
4662df8a
authored
Agu 16, 2012
tarafından
Matúš Kukan
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
tubes: simplify and make more readable, I believe
Change-Id: I83a4332d9947d03382b10ea050f26bf3ed544299
üst
27861421
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
64 deletions
+32
-64
manager.hxx
tubes/inc/tubes/manager.hxx
+0
-5
manager.cxx
tubes/source/manager.cxx
+32
-59
No files found.
tubes/inc/tubes/manager.hxx
Dosyayı görüntüle @
4662df8a
...
@@ -132,11 +132,6 @@ public:
...
@@ -132,11 +132,6 @@ public:
// Only for callbacks.
// Only for callbacks.
static
void
addConference
(
TeleConference
*
pConference
);
static
void
addConference
(
TeleConference
*
pConference
);
static
void
setChannelReadyHandlerInvoked
(
bool
b
);
static
bool
isChannelReadyHandlerInvoked
();
static
void
setAccountManagerReady
(
bool
bPrepared
);
static
void
setAccountManagerReadyHandlerInvoked
(
bool
b
);
static
bool
isAccountManagerReadyHandlerInvoked
();
/// "LibreOfficeWhatEver"
/// "LibreOfficeWhatEver"
static
rtl
::
OString
getFullClientName
();
static
rtl
::
OString
getFullClientName
();
...
...
tubes/source/manager.cxx
Dosyayı görüntüle @
4662df8a
...
@@ -87,9 +87,9 @@ public:
...
@@ -87,9 +87,9 @@ public:
TpBaseClient
*
mpClient
;
TpBaseClient
*
mpClient
;
TpBaseClient
*
mpFileTransferClient
;
TpBaseClient
*
mpFileTransferClient
;
TpAccountManager
*
mpAccountManager
;
TpAccountManager
*
mpAccountManager
;
bool
mbAccountManagerReady
:
1
;
static
bool
mbAccountManagerReady
;
bool
mbAccountManagerReadyHandlerInvoked
:
1
;
static
bool
mbAccountManagerReadyHandlerInvoked
;
bool
mbChannelReadyHandlerInvoked
:
1
;
static
bool
mbChannelReadyHandlerInvoked
;
ContactList
*
mpContactList
;
ContactList
*
mpContactList
;
OString
msCurrentUUID
;
OString
msCurrentUUID
;
OString
msNameSuffix
;
OString
msNameSuffix
;
...
@@ -102,9 +102,14 @@ public:
...
@@ -102,9 +102,14 @@ public:
TeleManagerImpl
();
TeleManagerImpl
();
~
TeleManagerImpl
();
~
TeleManagerImpl
();
static
void
AccountManagerReadyHandler
(
GObject
*
pSourceObject
,
GAsyncResult
*
pResult
,
gpointer
pUserData
);
static
void
ChannelReadyHandler
(
GObject
*
pSourceObject
,
GAsyncResult
*
pResult
,
gpointer
pUserData
);
};
};
TeleManagerImpl
*
TeleManager
::
pImpl
=
new
TeleManagerImpl
();
TeleManagerImpl
*
TeleManager
::
pImpl
=
new
TeleManagerImpl
();
bool
TeleManagerImpl
::
mbAccountManagerReady
;
bool
TeleManagerImpl
::
mbAccountManagerReadyHandlerInvoked
;
bool
TeleManagerImpl
::
mbChannelReadyHandlerInvoked
;
static
void
TeleManager_DBusChannelHandler
(
static
void
TeleManager_DBusChannelHandler
(
TpSimpleHandler
*
/*handler*/
,
TpSimpleHandler
*
/*handler*/
,
...
@@ -307,14 +312,6 @@ static void TeleManager_TransferError( EmpathyFTHandler *handler, const GError *
...
@@ -307,14 +312,6 @@ static void TeleManager_TransferError( EmpathyFTHandler *handler, const GError *
g_object_unref
(
handler
);
g_object_unref
(
handler
);
}
}
static
void
lcl_iterateLoop
(
bool
(
*
pFunc
)()
)
{
while
(
!
(
*
pFunc
)())
{
g_main_context_iteration
(
NULL
,
TRUE
);
}
}
static
void
lcl_IncomingHandlerReady
(
static
void
lcl_IncomingHandlerReady
(
EmpathyFTHandler
*
pHandler
,
EmpathyFTHandler
*
pHandler
,
GError
*
pError
,
GError
*
pError
,
...
@@ -389,20 +386,20 @@ static void TeleManager_FileTransferHandler(
...
@@ -389,20 +386,20 @@ static void TeleManager_FileTransferHandler(
}
}
}
}
static
void
TeleManager_
ChannelReadyHandler
(
void
TeleManagerImpl
::
ChannelReadyHandler
(
GObject
*
pSourceObject
,
GObject
*
pSourceObject
,
GAsyncResult
*
pResult
,
GAsyncResult
*
pResult
,
gpointer
pUserData
gpointer
pUserData
)
)
{
{
INFO_LOGGER_F
(
"TeleManager
_
ChannelReadyHandler"
);
INFO_LOGGER_F
(
"TeleManager
Impl::
ChannelReadyHandler"
);
TeleConference
*
pConference
=
reinterpret_cast
<
TeleConference
*>
(
pUserData
);
TeleConference
*
pConference
=
reinterpret_cast
<
TeleConference
*>
(
pUserData
);
SAL_WARN_IF
(
!
pConference
,
"tubes"
,
"TeleManager
_
ChannelReadyHandler: no conference"
);
SAL_WARN_IF
(
!
pConference
,
"tubes"
,
"TeleManager
Impl::
ChannelReadyHandler: no conference"
);
if
(
!
pConference
)
if
(
!
pConference
)
return
;
return
;
TeleManager
::
setChannelReadyHandlerInvoked
(
true
)
;
mbChannelReadyHandlerInvoked
=
true
;
TpAccountChannelRequest
*
pChannelRequest
=
TP_ACCOUNT_CHANNEL_REQUEST
(
pSourceObject
);
TpAccountChannelRequest
*
pChannelRequest
=
TP_ACCOUNT_CHANNEL_REQUEST
(
pSourceObject
);
GError
*
pError
=
NULL
;
GError
*
pError
=
NULL
;
...
@@ -412,7 +409,7 @@ static void TeleManager_ChannelReadyHandler(
...
@@ -412,7 +409,7 @@ static void TeleManager_ChannelReadyHandler(
{
{
// "account isn't Enabled" means just that..
// "account isn't Enabled" means just that..
/* FIXME: detect and handle, domain=132, code=3 */
/* FIXME: detect and handle, domain=132, code=3 */
SAL_WARN
(
"tubes"
,
"TeleManager
_
ChannelReadyHandler: no channel: "
<<
pError
->
message
);
SAL_WARN
(
"tubes"
,
"TeleManager
Impl::
ChannelReadyHandler: no channel: "
<<
pError
->
message
);
g_error_free
(
pError
);
g_error_free
(
pError
);
return
;
return
;
}
}
...
@@ -421,25 +418,25 @@ static void TeleManager_ChannelReadyHandler(
...
@@ -421,25 +418,25 @@ static void TeleManager_ChannelReadyHandler(
pConference
->
offerTube
();
pConference
->
offerTube
();
}
}
static
void
TeleManager_
AccountManagerReadyHandler
(
void
TeleManagerImpl
::
AccountManagerReadyHandler
(
GObject
*
pSourceObject
,
GObject
*
pSourceObject
,
GAsyncResult
*
pResult
,
GAsyncResult
*
pResult
,
gpointer
/*pUserData*/
gpointer
/*pUserData*/
)
)
{
{
INFO_LOGGER_F
(
"TeleManager
_
AccountManagerReadyHandler"
);
INFO_LOGGER_F
(
"TeleManager
Impl::
AccountManagerReadyHandler"
);
GError
*
pError
=
NULL
;
GError
*
pError
=
NULL
;
gboolean
bPrepared
=
tp_proxy_prepare_finish
(
pSourceObject
,
pResult
,
&
pError
);
gboolean
bPrepared
=
tp_proxy_prepare_finish
(
pSourceObject
,
pResult
,
&
pError
);
SAL_WARN_IF
(
!
bPrepared
,
"tubes"
,
"TeleManager
_
AccountManagerReadyHandler: not prepared"
);
SAL_WARN_IF
(
!
bPrepared
,
"tubes"
,
"TeleManager
Impl::
AccountManagerReadyHandler: not prepared"
);
if
(
!
bPrepared
||
pError
)
if
(
!
bPrepared
||
pError
)
{
{
SAL_WARN_IF
(
pError
,
"tubes"
,
"TeleManager
_
AccountManagerReadyHandler: error: "
<<
pError
->
message
);
SAL_WARN_IF
(
pError
,
"tubes"
,
"TeleManager
Impl::
AccountManagerReadyHandler: error: "
<<
pError
->
message
);
g_error_free
(
pError
);
g_error_free
(
pError
);
}
}
TeleManager
::
setAccountManagerReady
(
bPrepared
)
;
mbAccountManagerReady
=
bPrepared
;
TeleManager
::
setAccountManagerReadyHandlerInvoked
(
true
)
;
mbAccountManagerReadyHandlerInvoked
=
true
;
}
}
bool
TeleManager
::
init
(
bool
bListen
)
bool
TeleManager
::
init
(
bool
bListen
)
...
@@ -513,9 +510,11 @@ bool TeleManager::createAccountManager()
...
@@ -513,9 +510,11 @@ bool TeleManager::createAccountManager()
pImpl
->
mpAccountManager
=
tp_account_manager_new_with_factory
(
pImpl
->
mpFactory
);
pImpl
->
mpAccountManager
=
tp_account_manager_new_with_factory
(
pImpl
->
mpFactory
);
tp_account_manager_set_default
(
pImpl
->
mpAccountManager
);
tp_account_manager_set_default
(
pImpl
->
mpAccountManager
);
setAccountManagerReadyHandlerInvoked
(
false
);
pImpl
->
mbAccountManagerReadyHandlerInvoked
=
false
;
tp_proxy_prepare_async
(
pImpl
->
mpAccountManager
,
NULL
,
TeleManager_AccountManagerReadyHandler
,
NULL
);
tp_proxy_prepare_async
(
pImpl
->
mpAccountManager
,
NULL
,
TeleManagerImpl
::
AccountManagerReadyHandler
,
NULL
);
lcl_iterateLoop
(
&
TeleManager
::
isAccountManagerReadyHandlerInvoked
);
while
(
!
pImpl
->
mbAccountManagerReadyHandlerInvoked
)
g_main_context_iteration
(
NULL
,
TRUE
);
return
pImpl
->
mbAccountManagerReady
;
return
pImpl
->
mbAccountManagerReady
;
}
}
...
@@ -661,14 +660,15 @@ TeleConference* TeleManager::startGroupSession( TpAccount *pAccount,
...
@@ -661,14 +660,15 @@ TeleConference* TeleManager::startGroupSession( TpAccount *pAccount,
return
NULL
;
return
NULL
;
}
}
setChannelReadyHandlerInvoked
(
false
)
;
pImpl
->
mbChannelReadyHandlerInvoked
=
false
;
TeleConference
*
pConference
=
new
TeleConference
(
NULL
,
NULL
,
aSessionId
);
TeleConference
*
pConference
=
new
TeleConference
(
NULL
,
NULL
,
aSessionId
);
tp_account_channel_request_create_and_handle_channel_async
(
tp_account_channel_request_create_and_handle_channel_async
(
pChannelRequest
,
NULL
,
TeleManager
_
ChannelReadyHandler
,
pConference
);
pChannelRequest
,
NULL
,
TeleManager
Impl
::
ChannelReadyHandler
,
pConference
);
lcl_iterateLoop
(
&
TeleManager
::
isChannelReadyHandlerInvoked
);
while
(
!
pImpl
->
mbChannelReadyHandlerInvoked
)
g_main_context_iteration
(
NULL
,
TRUE
);
g_object_unref
(
pChannelRequest
);
g_object_unref
(
pChannelRequest
);
g_hash_table_unref
(
pRequest
);
g_hash_table_unref
(
pRequest
);
...
@@ -736,14 +736,15 @@ TeleConference* TeleManager::startBuddySession( TpAccount *pAccount, TpContact *
...
@@ -736,14 +736,15 @@ TeleConference* TeleManager::startBuddySession( TpAccount *pAccount, TpContact *
return
NULL
;
return
NULL
;
}
}
setChannelReadyHandlerInvoked
(
false
)
;
pImpl
->
mbChannelReadyHandlerInvoked
=
false
;
TeleConference
*
pConference
=
new
TeleConference
(
NULL
,
NULL
,
createUuid
(),
true
);
TeleConference
*
pConference
=
new
TeleConference
(
NULL
,
NULL
,
createUuid
(),
true
);
tp_account_channel_request_create_and_handle_channel_async
(
tp_account_channel_request_create_and_handle_channel_async
(
pChannelRequest
,
NULL
,
TeleManager
_
ChannelReadyHandler
,
pConference
);
pChannelRequest
,
NULL
,
TeleManager
Impl
::
ChannelReadyHandler
,
pConference
);
lcl_iterateLoop
(
&
TeleManager
::
isChannelReadyHandlerInvoked
);
while
(
!
pImpl
->
mbChannelReadyHandlerInvoked
)
g_main_context_iteration
(
NULL
,
TRUE
);
g_object_unref
(
pChannelRequest
);
g_object_unref
(
pChannelRequest
);
g_hash_table_unref
(
pRequest
);
g_hash_table_unref
(
pRequest
);
...
@@ -754,26 +755,6 @@ TeleConference* TeleManager::startBuddySession( TpAccount *pAccount, TpContact *
...
@@ -754,26 +755,6 @@ TeleConference* TeleManager::startBuddySession( TpAccount *pAccount, TpContact *
return
pConference
;
return
pConference
;
}
}
void
TeleManager
::
setAccountManagerReadyHandlerInvoked
(
bool
b
)
{
pImpl
->
mbAccountManagerReadyHandlerInvoked
=
b
;
}
bool
TeleManager
::
isAccountManagerReadyHandlerInvoked
()
{
return
pImpl
->
mbAccountManagerReadyHandlerInvoked
;
}
void
TeleManager
::
setChannelReadyHandlerInvoked
(
bool
b
)
{
pImpl
->
mbChannelReadyHandlerInvoked
=
b
;
}
bool
TeleManager
::
isChannelReadyHandlerInvoked
()
{
return
pImpl
->
mbChannelReadyHandlerInvoked
;
}
ContactList
*
TeleManager
::
getContactList
()
ContactList
*
TeleManager
::
getContactList
()
{
{
if
(
!
pImpl
->
mpContactList
)
if
(
!
pImpl
->
mpContactList
)
...
@@ -782,11 +763,6 @@ ContactList* TeleManager::getContactList()
...
@@ -782,11 +763,6 @@ ContactList* TeleManager::getContactList()
return
pImpl
->
mpContactList
;
return
pImpl
->
mpContactList
;
}
}
void
TeleManager
::
setAccountManagerReady
(
bool
bPrepared
)
{
pImpl
->
mbAccountManagerReady
=
bPrepared
;
}
rtl
::
OString
TeleManager
::
getFullClientName
()
rtl
::
OString
TeleManager
::
getFullClientName
()
{
{
OStringBuffer
aBuf
(
64
);
OStringBuffer
aBuf
(
64
);
...
@@ -847,9 +823,6 @@ TeleManagerImpl::TeleManagerImpl()
...
@@ -847,9 +823,6 @@ TeleManagerImpl::TeleManagerImpl()
mpClient
(
NULL
),
mpClient
(
NULL
),
mpFileTransferClient
(
NULL
),
mpFileTransferClient
(
NULL
),
mpAccountManager
(
NULL
),
mpAccountManager
(
NULL
),
mbAccountManagerReady
(
false
),
mbAccountManagerReadyHandlerInvoked
(
false
),
mbChannelReadyHandlerInvoked
(
false
),
mpContactList
(
NULL
)
mpContactList
(
NULL
)
{
{
g_type_init
();
g_type_init
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment