Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
J
jami-daemon
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
146
Issues
146
List
Boards
Labels
Service Desk
Milestones
Iterations
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Analytics
Analytics
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
savoirfairelinux
jami-daemon
Commits
c7720293
Commit
c7720293
authored
Aug 31, 2010
by
Emmanuel Milou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[#2402] Client code indentation
parent
a713ae92
Changes
84
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
84 changed files
with
15241 additions
and
15339 deletions
+15241
-15339
astylerc
astylerc
+1
-1
sflphone-client-gnome/src/accountlist.c
sflphone-client-gnome/src/accountlist.c
+254
-245
sflphone-client-gnome/src/accountlist.h
sflphone-client-gnome/src/accountlist.h
+83
-84
sflphone-client-gnome/src/actions.c
sflphone-client-gnome/src/actions.c
+643
-657
sflphone-client-gnome/src/actions.h
sflphone-client-gnome/src/actions.h
+43
-43
sflphone-client-gnome/src/callable_obj.c
sflphone-client-gnome/src/callable_obj.c
+114
-115
sflphone-client-gnome/src/callable_obj.h
sflphone-client-gnome/src/callable_obj.h
+40
-43
sflphone-client-gnome/src/codeclist.c
sflphone-client-gnome/src/codeclist.c
+228
-205
sflphone-client-gnome/src/codeclist.h
sflphone-client-gnome/src/codeclist.h
+40
-40
sflphone-client-gnome/src/conference_obj.c
sflphone-client-gnome/src/conference_obj.c
+27
-29
sflphone-client-gnome/src/conference_obj.h
sflphone-client-gnome/src/conference_obj.h
+13
-14
sflphone-client-gnome/src/config/accountconfigdialog.c
sflphone-client-gnome/src/config/accountconfigdialog.c
+1133
-1119
sflphone-client-gnome/src/config/accountconfigdialog.h
sflphone-client-gnome/src/config/accountconfigdialog.h
+8
-8
sflphone-client-gnome/src/config/accountlistconfigdialog.c
sflphone-client-gnome/src/config/accountlistconfigdialog.c
+467
-455
sflphone-client-gnome/src/config/accountlistconfigdialog.h
sflphone-client-gnome/src/config/accountlistconfigdialog.h
+6
-6
sflphone-client-gnome/src/config/addressbook-config.c
sflphone-client-gnome/src/config/addressbook-config.c
+190
-199
sflphone-client-gnome/src/config/addressbook-config.h
sflphone-client-gnome/src/config/addressbook-config.h
+6
-7
sflphone-client-gnome/src/config/assistant.c
sflphone-client-gnome/src/config/assistant.c
+495
-460
sflphone-client-gnome/src/config/assistant.h
sflphone-client-gnome/src/config/assistant.h
+55
-56
sflphone-client-gnome/src/config/audioconf.c
sflphone-client-gnome/src/config/audioconf.c
+812
-808
sflphone-client-gnome/src/config/audioconf.h
sflphone-client-gnome/src/config/audioconf.h
+4
-4
sflphone-client-gnome/src/config/hooks-config.c
sflphone-client-gnome/src/config/hooks-config.c
+83
-75
sflphone-client-gnome/src/config/hooks-config.h
sflphone-client-gnome/src/config/hooks-config.h
+5
-5
sflphone-client-gnome/src/config/preferencesdialog.c
sflphone-client-gnome/src/config/preferencesdialog.c
+199
-197
sflphone-client-gnome/src/config/preferencesdialog.h
sflphone-client-gnome/src/config/preferencesdialog.h
+6
-6
sflphone-client-gnome/src/config/shortcuts-config.c
sflphone-client-gnome/src/config/shortcuts-config.c
+85
-85
sflphone-client-gnome/src/config/shortcuts-config.h
sflphone-client-gnome/src/config/shortcuts-config.h
+4
-5
sflphone-client-gnome/src/config/tlsadvanceddialog.c
sflphone-client-gnome/src/config/tlsadvanceddialog.c
+253
-255
sflphone-client-gnome/src/config/tlsadvanceddialog.h
sflphone-client-gnome/src/config/tlsadvanceddialog.h
+8
-8
sflphone-client-gnome/src/config/utils.c
sflphone-client-gnome/src/config/utils.c
+24
-24
sflphone-client-gnome/src/config/zrtpadvanceddialog.c
sflphone-client-gnome/src/config/zrtpadvanceddialog.c
+116
-115
sflphone-client-gnome/src/config/zrtpadvanceddialog.h
sflphone-client-gnome/src/config/zrtpadvanceddialog.h
+9
-9
sflphone-client-gnome/src/contacts/addressbook.c
sflphone-client-gnome/src/contacts/addressbook.c
+91
-86
sflphone-client-gnome/src/contacts/addressbook.h
sflphone-client-gnome/src/contacts/addressbook.h
+1
-1
sflphone-client-gnome/src/contacts/addressbook/eds.c
sflphone-client-gnome/src/contacts/addressbook/eds.c
+333
-353
sflphone-client-gnome/src/contacts/addressbook/eds.h
sflphone-client-gnome/src/contacts/addressbook/eds.h
+21
-23
sflphone-client-gnome/src/contacts/calllist.c
sflphone-client-gnome/src/contacts/calllist.c
+61
-66
sflphone-client-gnome/src/contacts/calllist.h
sflphone-client-gnome/src/contacts/calllist.h
+17
-17
sflphone-client-gnome/src/contacts/calltab.c
sflphone-client-gnome/src/contacts/calltab.c
+17
-17
sflphone-client-gnome/src/contacts/calltab.h
sflphone-client-gnome/src/contacts/calltab.h
+1
-1
sflphone-client-gnome/src/contacts/calltree.c
sflphone-client-gnome/src/contacts/calltree.c
+1322
-1320
sflphone-client-gnome/src/contacts/calltree.h
sflphone-client-gnome/src/contacts/calltree.h
+3
-3
sflphone-client-gnome/src/contacts/conferencelist.c
sflphone-client-gnome/src/contacts/conferencelist.c
+27
-31
sflphone-client-gnome/src/contacts/conferencelist.h
sflphone-client-gnome/src/contacts/conferencelist.h
+1
-1
sflphone-client-gnome/src/contacts/history.c
sflphone-client-gnome/src/contacts/history.c
+24
-25
sflphone-client-gnome/src/contacts/history.h
sflphone-client-gnome/src/contacts/history.h
+1
-1
sflphone-client-gnome/src/contacts/searchbar.c
sflphone-client-gnome/src/contacts/searchbar.c
+59
-59
sflphone-client-gnome/src/contacts/searchbar.h
sflphone-client-gnome/src/contacts/searchbar.h
+1
-1
sflphone-client-gnome/src/dbus/dbus.c
sflphone-client-gnome/src/dbus/dbus.c
+1880
-1954
sflphone-client-gnome/src/dbus/dbus.h
sflphone-client-gnome/src/dbus/dbus.h
+64
-64
sflphone-client-gnome/src/dialpad.c
sflphone-client-gnome/src/dialpad.c
+72
-72
sflphone-client-gnome/src/dialpad.h
sflphone-client-gnome/src/dialpad.h
+5
-5
sflphone-client-gnome/src/eel-gconf-extensions.c
sflphone-client-gnome/src/eel-gconf-extensions.c
+316
-313
sflphone-client-gnome/src/eel-gconf-extensions.h
sflphone-client-gnome/src/eel-gconf-extensions.h
+42
-42
sflphone-client-gnome/src/errors.c
sflphone-client-gnome/src/errors.c
+22
-20
sflphone-client-gnome/src/errors.h
sflphone-client-gnome/src/errors.h
+6
-6
sflphone-client-gnome/src/icons/icon_factory.c
sflphone-client-gnome/src/icons/icon_factory.c
+37
-38
sflphone-client-gnome/src/icons/pixmap_data.h
sflphone-client-gnome/src/icons/pixmap_data.h
+2022
-2009
sflphone-client-gnome/src/imwindow.c
sflphone-client-gnome/src/imwindow.c
+136
-131
sflphone-client-gnome/src/imwindow.h
sflphone-client-gnome/src/imwindow.h
+1
-1
sflphone-client-gnome/src/main.c
sflphone-client-gnome/src/main.c
+62
-64
sflphone-client-gnome/src/mainwindow.c
sflphone-client-gnome/src/mainwindow.c
+327
-341
sflphone-client-gnome/src/mainwindow.h
sflphone-client-gnome/src/mainwindow.h
+11
-11
sflphone-client-gnome/src/reqaccount.c
sflphone-client-gnome/src/reqaccount.c
+96
-84
sflphone-client-gnome/src/reqaccount.h
sflphone-client-gnome/src/reqaccount.h
+5
-5
sflphone-client-gnome/src/sflnotify.c
sflphone-client-gnome/src/sflnotify.c
+117
-117
sflphone-client-gnome/src/sflnotify.h
sflphone-client-gnome/src/sflnotify.h
+7
-7
sflphone-client-gnome/src/sflphone_const.h
sflphone-client-gnome/src/sflphone_const.h
+7
-7
sflphone-client-gnome/src/shortcuts.c
sflphone-client-gnome/src/shortcuts.c
+251
-264
sflphone-client-gnome/src/shortcuts.h
sflphone-client-gnome/src/shortcuts.h
+6
-7
sflphone-client-gnome/src/sliders.c
sflphone-client-gnome/src/sliders.c
+115
-113
sflphone-client-gnome/src/sliders.h
sflphone-client-gnome/src/sliders.h
+8
-8
sflphone-client-gnome/src/statusicon.c
sflphone-client-gnome/src/statusicon.c
+106
-110
sflphone-client-gnome/src/statusicon.h
sflphone-client-gnome/src/statusicon.h
+12
-12
sflphone-client-gnome/src/toolbar.c
sflphone-client-gnome/src/toolbar.c
+25
-29
sflphone-client-gnome/src/uimanager.c
sflphone-client-gnome/src/uimanager.c
+1259
-1325
sflphone-client-gnome/src/widget/gtkscrollbook.c
sflphone-client-gnome/src/widget/gtkscrollbook.c
+199
-193
sflphone-client-gnome/src/widget/gtkscrollbook.h
sflphone-client-gnome/src/widget/gtkscrollbook.h
+23
-25
sflphone-client-gnome/src/widget/imwidget.c
sflphone-client-gnome/src/widget/imwidget.c
+227
-229
sflphone-client-gnome/src/widget/imwidget.h
sflphone-client-gnome/src/widget/imwidget.h
+17
-17
sflphone-client-gnome/src/widget/minidialog.c
sflphone-client-gnome/src/widget/minidialog.c
+262
-267
sflphone-client-gnome/src/widget/minidialog.h
sflphone-client-gnome/src/widget/minidialog.h
+24
-24
sflphone-client-gnome/src/widget/webwidget.c
sflphone-client-gnome/src/widget/webwidget.c
+30
-30
sflphone-client-gnome/src/widget/webwidget.h
sflphone-client-gnome/src/widget/webwidget.h
+8
-8
No files found.
astylerc
View file @
c7720293
...
...
@@ -5,7 +5,7 @@
# Savoir-faire Linux Inc
# http://www.sflphone.org
style=kr # Kernighan & Ritchie style formatting/indenting uses linux bracket
style=k
&
r # Kernighan & Ritchie style formatting/indenting uses linux bracket
indent=spaces=4 # Use spaces instead of tabs for indentation
indent-classes # Indent 'class' and 'struct' blocks so that the blocks 'public:', 'protected:' and 'private:' are indented
indent-switches # Indent 'switch' blocks so that the 'case X:' statements are indented in the switch block
...
...
sflphone-client-gnome/src/accountlist.c
View file @
c7720293
...
...
@@ -36,357 +36,366 @@
GQueue
*
accountQueue
;
/* GCompareFunc to compare a accountID (gchar* and a account_t) */
gint
is_accountID_struct
(
gconstpointer
a
,
gconstpointer
b
)
{
account_t
*
c
=
(
account_t
*
)
a
;
if
(
strcmp
(
c
->
accountID
,
(
gchar
*
)
b
)
==
0
)
{
return
0
;
}
else
{
return
1
;
}
gint
is_accountID_struct
(
gconstpointer
a
,
gconstpointer
b
)
{
account_t
*
c
=
(
account_t
*
)
a
;
if
(
strcmp
(
c
->
accountID
,
(
gchar
*
)
b
)
==
0
)
{
return
0
;
}
else
{
return
1
;
}
}
/* GCompareFunc to get current call (gchar* and a account_t) */
gint
get_state_struct
(
gconstpointer
a
,
gconstpointer
b
)
{
account_t
*
c
=
(
account_t
*
)
a
;
if
(
c
->
state
==
*
((
account_state_t
*
)
b
))
{
return
0
;
}
else
{
return
1
;
}
gint
get_state_struct
(
gconstpointer
a
,
gconstpointer
b
)
{
account_t
*
c
=
(
account_t
*
)
a
;
if
(
c
->
state
==
*
(
(
account_state_t
*
)
b
))
{
return
0
;
}
else
{
return
1
;
}
}
void
account_list_init
()
{
void
account_list_init
()
{
accountQueue
=
g_queue_new
();
accountQueue
=
g_queue_new
();
}
void
void
account_list_clean
()
{
g_queue_free
(
accountQueue
);
g_queue_free
(
accountQueue
);
}
void
void
account_list_add
(
account_t
*
c
)
{
g_queue_push_tail
(
accountQueue
,
(
gpointer
*
)
c
);
g_queue_push_tail
(
accountQueue
,
(
gpointer
*
)
c
);
}
void
void
account_list_add_at_nth
(
account_t
*
c
,
guint
pos
)
{
g_queue_push_nth
(
accountQueue
,
(
gpointer
*
)
c
,
pos
);
g_queue_push_nth
(
accountQueue
,
(
gpointer
*
)
c
,
pos
);
}
void
void
account_list_remove
(
const
gchar
*
accountID
)
{
GList
*
c
=
g_queue_find_custom
(
accountQueue
,
accountID
,
is_accountID_struct
);
if
(
c
)
{
g_queue_remove
(
accountQueue
,
c
->
data
);
}
GList
*
c
=
g_queue_find_custom
(
accountQueue
,
accountID
,
is_accountID_struct
);
if
(
c
)
{
g_queue_remove
(
accountQueue
,
c
->
data
);
}
}
account_t
*
account_list_get_by_state
(
account_state_t
state
)
account_t
*
account_list_get_by_state
(
account_state_t
state
)
{
GList
*
c
=
g_queue_find_custom
(
accountQueue
,
&
state
,
get_state_struct
);
if
(
c
)
{
return
(
account_t
*
)
c
->
data
;
}
else
{
return
NULL
;
}
GList
*
c
=
g_queue_find_custom
(
accountQueue
,
&
state
,
get_state_struct
);
if
(
c
)
{
return
(
account_t
*
)
c
->
data
;
}
else
{
return
NULL
;
}
}
account_t
*
account_list_get_by_id
(
gchar
*
accountID
)
account_t
*
account_list_get_by_id
(
gchar
*
accountID
)
{
GList
*
c
=
g_queue_find_custom
(
accountQueue
,
accountID
,
is_accountID_struct
);
if
(
c
)
{
return
(
account_t
*
)
c
->
data
;
}
else
{
return
NULL
;
}
GList
*
c
=
g_queue_find_custom
(
accountQueue
,
accountID
,
is_accountID_struct
);
if
(
c
)
{
return
(
account_t
*
)
c
->
data
;
}
else
{
return
NULL
;
}
}
guint
account_list_get_size
(
void
)
{
return
g_queue_get_length
(
accountQueue
);
guint
account_list_get_size
(
void
)
{
return
g_queue_get_length
(
accountQueue
);
}
account_t
*
account_list_get_nth
(
guint
n
)
{
account_t
*
account_list_get_nth
(
guint
n
)
{
return
g_queue_peek_nth
(
accountQueue
,
n
);
return
g_queue_peek_nth
(
accountQueue
,
n
);
}
account_t
*
account_list_get_current
(
)
account_t
*
account_list_get_current
()
{
account_t
*
current
;
account_t
*
current
;
// No account registered
if
(
account_list_get_registered_accounts
()
==
0
)
return
NULL
;
// No account registered
if
(
account_list_get_registered_accounts
()
==
0
)
return
NULL
;
// if we are here, it means that we have at least one registered account in the list
// So we get the first one
current
=
account_list_get_by_state
(
ACCOUNT_STATE_REGISTERED
);
if
(
!
current
)
return
NULL
;
// if we are here, it means that we have at least one registered account in the list
// So we get the first one
current
=
account_list_get_by_state
(
ACCOUNT_STATE_REGISTERED
);
return
current
;
if
(
!
current
)
return
NULL
;
return
current
;
}
void
account_list_set_current
(
account_t
*
current
)
{
gpointer
acc
;
guint
pos
;
// 2 steps:
// 1 - retrieve the index of the current account in the Queue
// 2 - then set it as first
pos
=
account_list_get_position
(
current
);
if
(
pos
>
0
)
{
acc
=
g_queue_pop_nth
(
accountQueue
,
pos
);
g_queue_push_nth
(
accountQueue
,
acc
,
0
);
}
gpointer
acc
;
guint
pos
;
// 2 steps:
// 1 - retrieve the index of the current account in the Queue
// 2 - then set it as first
pos
=
account_list_get_position
(
current
);
if
(
pos
>
0
)
{
acc
=
g_queue_pop_nth
(
accountQueue
,
pos
);
g_queue_push_nth
(
accountQueue
,
acc
,
0
);
}
}
const
gchar
*
account_state_name
(
account_state_t
s
)
{
gchar
*
state
;
switch
(
s
)
{
case
ACCOUNT_STATE_REGISTERED
:
state
=
_
(
"Registered"
);
break
;
case
ACCOUNT_STATE_UNREGISTERED
:
state
=
_
(
"Not Registered"
);
break
;
case
ACCOUNT_STATE_TRYING
:
state
=
_
(
"Trying..."
);
break
;
case
ACCOUNT_STATE_ERROR
:
state
=
_
(
"Error"
);
break
;
case
ACCOUNT_STATE_ERROR_AUTH
:
state
=
_
(
"Authentication Failed"
);
break
;
case
ACCOUNT_STATE_ERROR_NETWORK
:
state
=
_
(
"Network unreachable"
);
break
;
case
ACCOUNT_STATE_ERROR_HOST
:
state
=
_
(
"Host unreachable"
);
break
;
case
ACCOUNT_STATE_ERROR_CONF_STUN
:
state
=
_
(
"Stun configuration error"
);
break
;
case
ACCOUNT_STATE_ERROR_EXIST_STUN
:
state
=
_
(
"Stun server invalid"
);
break
;
case
IP2IP_PROFILE_STATUS
:
state
=
_
(
"Ready"
);
break
;
default:
state
=
_
(
"Invalid"
);
break
;
}
return
state
;
gchar
*
state
;
switch
(
s
)
{
case
ACCOUNT_STATE_REGISTERED
:
state
=
_
(
"Registered"
);
break
;
case
ACCOUNT_STATE_UNREGISTERED
:
state
=
_
(
"Not Registered"
);
break
;
case
ACCOUNT_STATE_TRYING
:
state
=
_
(
"Trying..."
);
break
;
case
ACCOUNT_STATE_ERROR
:
state
=
_
(
"Error"
);
break
;
case
ACCOUNT_STATE_ERROR_AUTH
:
state
=
_
(
"Authentication Failed"
);
break
;
case
ACCOUNT_STATE_ERROR_NETWORK
:
state
=
_
(
"Network unreachable"
);
break
;
case
ACCOUNT_STATE_ERROR_HOST
:
state
=
_
(
"Host unreachable"
);
break
;
case
ACCOUNT_STATE_ERROR_CONF_STUN
:
state
=
_
(
"Stun configuration error"
);
break
;
case
ACCOUNT_STATE_ERROR_EXIST_STUN
:
state
=
_
(
"Stun server invalid"
);
break
;
case
IP2IP_PROFILE_STATUS
:
state
=
_
(
"Ready"
);
break
;
default:
state
=
_
(
"Invalid"
);
break
;
}
return
state
;
}
void
account_list_clear
(
)
void
account_list_clear
()
{
g_queue_free
(
accountQueue
);
accountQueue
=
g_queue_new
();
g_queue_free
(
accountQueue
);
accountQueue
=
g_queue_new
();
}
void
account_list_move_up
(
guint
index
)
void
account_list_move_up
(
guint
index
)
{
DEBUG
(
"index = %i
\n
"
,
index
);
DEBUG
(
"index = %i
\n
"
,
index
);
if
(
index
!=
0
)
{
gpointer
acc
=
g_queue_pop_nth
(
accountQueue
,
index
);
g_queue_push_nth
(
accountQueue
,
acc
,
index
-
1
);
}
if
(
index
!=
0
)
{
gpointer
acc
=
g_queue_pop_nth
(
accountQueue
,
index
);
g_queue_push_nth
(
accountQueue
,
acc
,
index
-
1
);
}
}
void
account_list_move_down
(
guint
index
)
void
account_list_move_down
(
guint
index
)
{
if
(
index
!=
accountQueue
->
length
)
{
gpointer
acc
=
g_queue_pop_nth
(
accountQueue
,
index
);
g_queue_push_nth
(
accountQueue
,
acc
,
index
+
1
);
}
if
(
index
!=
accountQueue
->
length
)
{
gpointer
acc
=
g_queue_pop_nth
(
accountQueue
,
index
);
g_queue_push_nth
(
accountQueue
,
acc
,
index
+
1
);
}
}
guint
account_list_get_registered_accounts
(
void
)
guint
account_list_get_registered_accounts
(
void
)
{
guint
res
=
0
;
unsigned
int
i
;
for
(
i
=
0
;
i
<
account_list_get_size
();
i
++
)
{
if
(
account_list_get_nth
(
i
)
->
state
==
(
ACCOUNT_STATE_REGISTERED
))
res
++
;
}
DEBUG
(
" %d registered accounts"
,
res
);
return
res
;
guint
res
=
0
;
unsigned
int
i
;
for
(
i
=
0
;
i
<
account_list_get_size
();
i
++
)
{
if
(
account_list_get_nth
(
i
)
->
state
==
(
ACCOUNT_STATE_REGISTERED
))
res
++
;
}
DEBUG
(
" %d registered accounts"
,
res
);
return
res
;
}
gchar
*
account_list_get_current_id
(
void
){
gchar
*
account_list_get_current_id
(
void
)
{
account_t
*
current
;
account_t
*
current
;
current
=
account_list_get_current
()
;
current
=
account_list_get_current
();
if
(
current
)
return
current
->
accountID
;
else
return
""
;
if
(
current
)
return
current
->
accountID
;
else
return
""
;
}
int
account_list_get_sip_account_number
(
void
){
int
account_list_get_sip_account_number
(
void
)
{
int
n
;
guint
size
,
i
;
account_t
*
current
;
size
=
account_list_get_size
();
n
=
0
;
int
n
;
guint
size
,
i
;
account_t
*
current
;
for
(
i
=
0
;
i
<
size
;
i
++
)
{
current
=
account_list_get_nth
(
i
);
size
=
account_list_get_size
();
n
=
0
;
for
(
i
=
0
;
i
<
size
;
i
++
){
current
=
account_list_get_nth
(
i
);
if
(
strcmp
(
g_hash_table_lookup
(
current
->
properties
,
ACCOUNT_TYPE
),
"SIP"
)
==
0
)
n
++
;
}
if
(
strcmp
(
g_hash_table_lookup
(
current
->
properties
,
ACCOUNT_TYPE
),
"SIP"
)
==
0
)
n
++
;
}
return
n
;
return
n
;
}
int
account_list_get_iax_account_number
(
void
){
int
account_list_get_iax_account_number
(
void
)
{
int
n
;
guint
size
,
i
;
account_t
*
current
;
size
=
account_list_get_size
();
n
=
0
;
int
n
;
guint
size
,
i
;
account_t
*
current
;
for
(
i
=
0
;
i
<
size
;
i
++
)
{
current
=
account_list_get_nth
(
i
);
size
=
account_list_get_size
();
n
=
0
;
for
(
i
=
0
;
i
<
size
;
i
++
){
current
=
account_list_get_nth
(
i
);
if
(
strcmp
(
g_hash_table_lookup
(
current
->
properties
,
ACCOUNT_TYPE
),
"IAX"
)
==
0
)
n
++
;
}
if
(
strcmp
(
g_hash_table_lookup
(
current
->
properties
,
ACCOUNT_TYPE
),
"IAX"
)
==
0
)
n
++
;
}
return
n
;
return
n
;
}
gchar
*
account_list_get_ordered_list
(
void
)
{
gchar
*
account_list_get_ordered_list
(
void
)
{
gchar
*
order
=
""
;
guint
i
;
for
(
i
=
0
;
i
<
account_list_get_size
();
i
++
)
{
account_t
*
account
=
NULL
;
account
=
account_list_get_nth
(
i
);
gchar
*
order
=
""
;
guint
i
;
if
(
account
!=
NULL
)
{
order
=
g_strconcat
(
order
,
account
->
accountID
,
"/"
,
NULL
);
}
}
for
(
i
=
0
;
i
<
account_list_get_size
();
i
++
)
{
account_t
*
account
=
NULL
;
account
=
account_list_get_nth
(
i
);
if
(
account
!=
NULL
)
{
order
=
g_strconcat
(
order
,
account
->
accountID
,
"/"
,
NULL
);
}
}
return
order
;
return
order
;
}
guint
account_list_get_position
(
account_t
*
account
)
guint
account_list_get_position
(
account_t
*
account
)
{
guint
size
,
i
;
account_t
*
tmp
;
size
=
account_list_get_size
();
for
(
i
=
0
;
i
<
size
;
i
++
)
{
tmp
=
account_list_get_nth
(
i
);
if
(
g_strcasecmp
(
tmp
->
accountID
,
account
->
accountID
)
==
0
)
{
return
i
;
}
}
// Not found
return
-
1
;
guint
size
,
i
;
account_t
*
tmp
;
size
=
account_list_get_size
();
for
(
i
=
0
;
i
<
size
;
i
++
)
{
tmp
=
account_list_get_nth
(
i
);
if
(
g_strcasecmp
(
tmp
->
accountID
,
account
->
accountID
)
==
0
)
{
return
i
;
}
}
// Not found
return
-
1
;
}
gboolean
current_account_has_mailbox
(
void
)
{
account_t
*
current
;
account_t
*
current
;
// Check if the current account has a voicemail number configured
// Check if the current account has a voicemail number configured
current
=
account_list_get_current
();
current
=
account_list_get_current
();
if
(
current
)
{
if
(
g_strcasecmp
(
g_hash_table_lookup
(
current
->
properties
,
ACCOUNT_MAILBOX
),
""
)
!=
0
)
return
TRUE
;
}
if
(
current
)
{
if
(
g_strcasecmp
(
g_hash_table_lookup
(
current
->
properties
,
ACCOUNT_MAILBOX
),
""
)
!=
0
)
return
TRUE
;
}
return
FALSE
;
return
FALSE
;
}
void
current_account_set_message_number
(
guint
nb
)
{
account_t
*
current
;
account_t
*
current
;
current
=
account_list_get_current
();
if
(
current
)
{
current
->
_messages_number
=
nb
;
}
current
=
account_list_get_current
();
if
(
current
)
{
current
->
_messages_number
=
nb
;
}
}
guint
current_account_get_message_number
(
void
)
{
account_t
*
current
;
current
=
account_list_get_current
();
if
(
current
)
{
return
current
->
_messages_number
;
}
else
return
0
;
account_t
*
current
;
current
=
account_list_get_current
();
if
(
current
)
{
return
current
->
_messages_number
;
}
else
return
0
;
}