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
130
Issues
130
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
6f1a61e2
Commit
6f1a61e2
authored
May 17, 2012
by
Alexandre Savard
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
git+ssh://git.sflphone.org/var/repos/sflphone/git/sflphone
parents
e6b846ed
670e2a2f
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
244 additions
and
107 deletions
+244
-107
daemon/src/account.cpp
daemon/src/account.cpp
+1
-1
daemon/src/iax/iaxaccount.cpp
daemon/src/iax/iaxaccount.cpp
+1
-1
daemon/src/managerimpl.cpp
daemon/src/managerimpl.cpp
+6
-7
daemon/src/managerimpl.h
daemon/src/managerimpl.h
+2
-2
daemon/src/sip/sipaccount.cpp
daemon/src/sip/sipaccount.cpp
+1
-1
daemon/test/resamplertest.cpp
daemon/test/resamplertest.cpp
+35
-49
daemon/test/resamplertest.h
daemon/test/resamplertest.h
+3
-7
gnome/src/contacts/calltab.c
gnome/src/contacts/calltab.c
+2
-2
gnome/src/contacts/conferencelist.c
gnome/src/contacts/conferencelist.c
+14
-14
kde/src/SFLPhoneView.cpp
kde/src/SFLPhoneView.cpp
+2
-2
kde/src/klib/HelperFunctions.cpp
kde/src/klib/HelperFunctions.cpp
+12
-1
kde/src/klib/dataengine/sflphonEngine.cpp
kde/src/klib/dataengine/sflphonEngine.cpp
+45
-16
kde/src/klib/dataengine/sflphonEngine.h
kde/src/klib/dataengine/sflphonEngine.h
+2
-0
kde/src/klib/dataengine/sflphone.operations
kde/src/klib/dataengine/sflphone.operations
+23
-0
kde/src/klib/dataengine/sflphoneService.cpp
kde/src/klib/dataengine/sflphoneService.cpp
+13
-1
kde/src/klib/dataengine/sflphoneService.h
kde/src/klib/dataengine/sflphoneService.h
+80
-1
kde/src/lib/Contact.cpp
kde/src/lib/Contact.cpp
+2
-2
No files found.
daemon/src/account.cpp
View file @
6f1a61e2
...
...
@@ -102,7 +102,7 @@ void Account::setActiveCodecs(const std::vector<std::string> &list)
}
// update the codec string according to new codec selection
codecStr_
=
ManagerImpl
::
serialize
(
list
);
codecStr_
=
ManagerImpl
::
join_string
(
list
);
}
std
::
string
Account
::
mapStateNumberToString
(
RegistrationState
state
)
...
...
daemon/src/iax/iaxaccount.cpp
View file @
6f1a61e2
...
...
@@ -93,7 +93,7 @@ void IAXAccount::unserialize(const Conf::MappingNode &map)
map
.
getValue
(
CODECS_KEY
,
&
codecStr_
);
// Update codec list which one is used for SDP offer
setActiveCodecs
(
ManagerImpl
::
unserialize
(
codecStr_
));
setActiveCodecs
(
ManagerImpl
::
split_string
(
codecStr_
));
map
.
getValue
(
DISPLAY_NAME_KEY
,
&
displayName_
);
}
...
...
daemon/src/managerimpl.cpp
View file @
6f1a61e2
...
...
@@ -1802,7 +1802,7 @@ std::string ManagerImpl::createConfigFile() const
return
configdir
+
DIR_SEPARATOR_STR
+
PROGNAME
+
".yml"
;
}
std
::
vector
<
std
::
string
>
ManagerImpl
::
unserialize
(
std
::
string
s
)
std
::
vector
<
std
::
string
>
ManagerImpl
::
split_string
(
std
::
string
s
)
{
std
::
vector
<
std
::
string
>
list
;
std
::
string
temp
;
...
...
@@ -1817,7 +1817,7 @@ std::vector<std::string> ManagerImpl::unserialize(std::string s)
return
list
;
}
std
::
string
ManagerImpl
::
serialize
(
const
std
::
vector
<
std
::
string
>
&
v
)
std
::
string
ManagerImpl
::
join_string
(
const
std
::
vector
<
std
::
string
>
&
v
)
{
std
::
ostringstream
os
;
std
::
copy
(
v
.
begin
(),
v
.
end
(),
std
::
ostream_iterator
<
std
::
string
>
(
os
,
"/"
));
...
...
@@ -2531,7 +2531,7 @@ std::string ManagerImpl::getNewCallID()
std
::
vector
<
std
::
string
>
ManagerImpl
::
loadAccountOrder
()
const
{
return
unserialize
(
preferences
.
getAccountOrder
());
return
split_string
(
preferences
.
getAccountOrder
());
}
void
ManagerImpl
::
loadDefaultAccountMap
()
...
...
@@ -2611,9 +2611,8 @@ void ManagerImpl::loadAccountMap(Conf::YamlParser &parser)
Sequence
::
const_iterator
ip2ip
=
std
::
find_if
(
seq
->
begin
(),
seq
->
end
(),
isIP2IP
);
if
(
ip2ip
!=
seq
->
end
())
{
MappingNode
*
node
=
dynamic_cast
<
MappingNode
*>
(
*
ip2ip
);
if
(
node
)
{
if
(
node
)
accountMap_
[
SIPAccount
::
IP2IP_PROFILE
]
->
unserialize
(
*
node
);
}
}
// Initialize default UDP transport according to
...
...
@@ -2734,13 +2733,13 @@ void ManagerImpl::setAddressbookSettings(const std::map<std::string, int32_t>& s
void
ManagerImpl
::
setAddressbookList
(
const
std
::
vector
<
std
::
string
>&
list
)
{
addressbookPreference
.
setList
(
ManagerImpl
::
serialize
(
list
));
addressbookPreference
.
setList
(
ManagerImpl
::
join_string
(
list
));
saveConfig
();
}
std
::
vector
<
std
::
string
>
ManagerImpl
::
getAddressbookList
()
const
{
return
unserialize
(
addressbookPreference
.
getList
());
return
split_string
(
addressbookPreference
.
getList
());
}
void
ManagerImpl
::
setIPToIPForCall
(
const
std
::
string
&
callID
,
bool
IPToIP
)
...
...
daemon/src/managerimpl.h
View file @
6f1a61e2
...
...
@@ -571,9 +571,9 @@ class ManagerImpl {
* Required format: payloads separated with one slash.
* @return std::string The serializabled string
*/
static
std
::
string
serialize
(
const
std
::
vector
<
std
::
string
>
&
v
);
static
std
::
string
join_string
(
const
std
::
vector
<
std
::
string
>
&
v
);
static
std
::
vector
<
std
::
string
>
unserialize
(
std
::
string
v
);
static
std
::
vector
<
std
::
string
>
split_string
(
std
::
string
v
);
/**
* Ringtone option.
...
...
daemon/src/sip/sipaccount.cpp
View file @
6f1a61e2
...
...
@@ -268,7 +268,7 @@ void SIPAccount::unserialize(const Conf::MappingNode &map)
map
.
getValue
(
MAILBOX_KEY
,
&
mailBox_
);
map
.
getValue
(
CODECS_KEY
,
&
codecStr_
);
// Update codec list which one is used for SDP offer
setActiveCodecs
(
ManagerImpl
::
unserialize
(
codecStr_
));
setActiveCodecs
(
ManagerImpl
::
split_string
(
codecStr_
));
map
.
getValue
(
RINGTONE_PATH_KEY
,
&
ringtonePath_
);
map
.
getValue
(
RINGTONE_ENABLED_KEY
,
&
ringtoneEnabled_
);
...
...
daemon/test/resamplertest.cpp
View file @
6f1a61e2
...
...
@@ -29,11 +29,16 @@
*/
#include <iostream>
#include <iterator>
#include <algorithm>
#include <math.h>
#include "resamplertest.h"
ResamplerTest
::
ResamplerTest
()
:
CppUnit
::
TestCase
(
"Resampler module test"
),
inputBuffer
(),
outputBuffer
()
{}
void
ResamplerTest
::
setUp
()
{
...
...
@@ -44,6 +49,16 @@ void ResamplerTest::tearDown()
}
namespace
{
template
<
typename
T
>
void
print_buffer
(
T
&
buffer
)
{
std
::
copy
(
buffer
.
begin
(),
buffer
.
end
(),
std
::
ostream_iterator
<
SFLDataFormat
>
(
std
::
cout
,
", "
));
std
::
cout
<<
std
::
endl
;
}
}
void
ResamplerTest
::
testUpsamplingRamp
()
{
// generate input samples and store them in inputBuffer
...
...
@@ -59,15 +74,11 @@ void ResamplerTest::testUpsamplingRamp()
std
::
copy
(
inputBuffer
.
begin
(),
inputBuffer
.
begin
()
+
tmpInputBuffer
.
size
(),
tmpInputBuffer
.
begin
());
std
::
cout
<<
"Input Buffer"
<<
std
::
endl
;
for
(
int
i
=
0
;
i
<
tmpInputBuffer
.
size
();
i
++
)
std
::
cout
<<
tmpInputBuffer
[
i
]
<<
", "
;
std
::
cout
<<
std
::
endl
;
print_buffer
(
tmpInputBuffer
);
std
::
copy
(
outputBuffer
.
begin
(),
outputBuffer
.
begin
()
+
tmpOutputBuffer
.
size
(),
tmpOutputBuffer
.
begin
());
std
::
cout
<<
"Output Buffer"
<<
std
::
endl
;
for
(
int
i
=
0
;
i
<
tmpOutputBuffer
.
size
();
i
++
)
std
::
cout
<<
tmpOutputBuffer
[
i
]
<<
", "
;
std
::
cout
<<
std
::
endl
;
print_buffer
(
tmpOutputBuffer
);
}
void
ResamplerTest
::
testDownsamplingRamp
()
...
...
@@ -84,15 +95,11 @@ void ResamplerTest::testDownsamplingRamp()
std
::
copy
(
inputBuffer
.
begin
(),
inputBuffer
.
begin
()
+
tmpInputBuffer
.
size
(),
tmpInputBuffer
.
begin
());
std
::
cout
<<
"Input Buffer"
<<
std
::
endl
;
for
(
int
i
=
0
;
i
<
tmpInputBuffer
.
size
();
i
++
)
std
::
cout
<<
tmpInputBuffer
[
i
]
<<
", "
;
std
::
cout
<<
std
::
endl
;
print_buffer
(
tmpInputBuffer
);
std
::
copy
(
outputBuffer
.
begin
(),
outputBuffer
.
begin
()
+
tmpOutputBuffer
.
size
(),
tmpOutputBuffer
.
begin
());
std
::
cout
<<
"Output Buffer"
<<
std
::
endl
;
for
(
int
i
=
0
;
i
<
tmpOutputBuffer
.
size
();
i
++
)
std
::
cout
<<
tmpOutputBuffer
[
i
]
<<
", "
;
std
::
cout
<<
std
::
endl
;
print_buffer
(
tmpOutputBuffer
);
}
void
ResamplerTest
::
testUpsamplingTriangle
()
...
...
@@ -109,15 +116,11 @@ void ResamplerTest::testUpsamplingTriangle()
std
::
copy
(
inputBuffer
.
begin
(),
inputBuffer
.
begin
()
+
tmpInputBuffer
.
size
(),
tmpInputBuffer
.
begin
());
std
::
cout
<<
"Input Buffer"
<<
std
::
endl
;
for
(
int
i
=
0
;
i
<
tmpInputBuffer
.
size
();
i
++
)
std
::
cout
<<
tmpInputBuffer
[
i
]
<<
", "
;
std
::
cout
<<
std
::
endl
;
print_buffer
(
tmpInputBuffer
);
std
::
copy
(
outputBuffer
.
begin
(),
outputBuffer
.
begin
()
+
tmpOutputBuffer
.
size
(),
tmpOutputBuffer
.
begin
());
std
::
cout
<<
"Output Buffer"
<<
std
::
endl
;
for
(
int
i
=
0
;
i
<
tmpOutputBuffer
.
size
();
i
++
)
std
::
cout
<<
tmpOutputBuffer
[
i
]
<<
", "
;
std
::
cout
<<
std
::
endl
;
print_buffer
(
tmpOutputBuffer
);
}
void
ResamplerTest
::
testDownsamplingTriangle
()
...
...
@@ -134,15 +137,11 @@ void ResamplerTest::testDownsamplingTriangle()
std
::
copy
(
inputBuffer
.
begin
(),
inputBuffer
.
begin
()
+
tmpInputBuffer
.
size
(),
tmpInputBuffer
.
begin
());
std
::
cout
<<
"Input Buffer"
<<
std
::
endl
;
for
(
int
i
=
0
;
i
<
tmpInputBuffer
.
size
();
i
++
)
std
::
cout
<<
tmpInputBuffer
[
i
]
<<
", "
;
std
::
cout
<<
std
::
endl
;
print_buffer
(
tmpInputBuffer
);
std
::
copy
(
outputBuffer
.
begin
(),
outputBuffer
.
begin
()
+
tmpOutputBuffer
.
size
(),
tmpOutputBuffer
.
begin
());
std
::
cout
<<
"Output Buffer"
<<
std
::
endl
;
for
(
int
i
=
0
;
i
<
tmpOutputBuffer
.
size
();
i
++
)
std
::
cout
<<
tmpOutputBuffer
[
i
]
<<
", "
;
std
::
cout
<<
std
::
endl
;
print_buffer
(
tmpOutputBuffer
);
}
void
ResamplerTest
::
testUpsamplingSine
()
{
...
...
@@ -159,15 +158,11 @@ void ResamplerTest::testUpsamplingSine()
std
::
copy
(
inputBuffer
.
begin
(),
inputBuffer
.
begin
()
+
tmpInputBuffer
.
size
(),
tmpInputBuffer
.
begin
());
std
::
cout
<<
"Input Buffer"
<<
std
::
endl
;
for
(
int
i
=
0
;
i
<
tmpInputBuffer
.
size
();
i
++
)
std
::
cout
<<
tmpInputBuffer
[
i
]
<<
", "
;
std
::
cout
<<
std
::
endl
;
print_buffer
(
tmpInputBuffer
);
std
::
copy
(
outputBuffer
.
begin
(),
outputBuffer
.
begin
()
+
tmpOutputBuffer
.
size
(),
tmpOutputBuffer
.
begin
());
std
::
cout
<<
"Output Buffer"
<<
std
::
endl
;
for
(
int
i
=
0
;
i
<
tmpOutputBuffer
.
size
();
i
++
)
std
::
cout
<<
tmpOutputBuffer
[
i
]
<<
", "
;
std
::
cout
<<
std
::
endl
;
print_buffer
(
tmpOutputBuffer
);
}
void
ResamplerTest
::
testDownsamplingSine
()
...
...
@@ -185,36 +180,29 @@ void ResamplerTest::testDownsamplingSine()
std
::
copy
(
inputBuffer
.
begin
(),
inputBuffer
.
begin
()
+
tmpInputBuffer
.
size
(),
tmpInputBuffer
.
begin
());
std
::
cout
<<
"Input Buffer"
<<
std
::
endl
;
for
(
int
i
=
0
;
i
<
tmpInputBuffer
.
size
();
i
++
)
std
::
cout
<<
tmpInputBuffer
[
i
]
<<
", "
;
std
::
cout
<<
std
::
endl
;
print_buffer
(
tmpInputBuffer
);
std
::
copy
(
outputBuffer
.
begin
(),
outputBuffer
.
begin
()
+
tmpOutputBuffer
.
size
(),
tmpOutputBuffer
.
begin
());
std
::
cout
<<
"Output Buffer"
<<
std
::
endl
;
for
(
int
i
=
0
;
i
<
tmpOutputBuffer
.
size
();
i
++
)
std
::
cout
<<
tmpOutputBuffer
[
i
]
<<
", "
;
std
::
cout
<<
std
::
endl
;
print_buffer
(
tmpOutputBuffer
);
}
void
ResamplerTest
::
generateRamp
()
{
for
(
int
i
=
0
;
i
<
inputBuffer
.
size
();
i
++
)
{
inputBuffer
[
i
]
=
(
SFLDataFormat
)
i
;
}
for
(
size_t
i
=
0
;
i
<
inputBuffer
.
size
();
++
i
)
inputBuffer
[
i
]
=
i
;
}
void
ResamplerTest
::
generateTriangularSignal
()
{
for
(
int
i
=
0
;
i
<
inputBuffer
.
size
();
i
++
)
{
inputBuffer
[
i
]
=
(
SFLDataFormat
)(
i
*
10
);
}
for
(
size_t
i
=
0
;
i
<
inputBuffer
.
size
();
++
i
)
inputBuffer
[
i
]
=
i
*
10
;
}
void
ResamplerTest
::
generateSineSignal
()
{
for
(
int
i
=
0
;
i
<
inputBuffer
.
size
();
i
++
)
{
inputBuffer
[
i
]
=
(
SFLDataFormat
)(
1000.0
*
sin
((
double
)
i
));
}
for
(
size_t
i
=
0
;
i
<
inputBuffer
.
size
();
++
i
)
inputBuffer
[
i
]
=
(
SFLDataFormat
)
(
1000.0
*
sin
(
i
));
}
void
ResamplerTest
::
performUpsampling
(
SamplerateConverter
&
converter
)
...
...
@@ -222,8 +210,7 @@ void ResamplerTest::performUpsampling(SamplerateConverter &converter)
LowSmplrBuffer
tmpInputBuffer
;
HighSmplrBuffer
tmpOutputBuffer
;
int
i
,
j
;
for
(
i
=
0
,
j
=
0
;
i
<
(
inputBuffer
.
size
()
/
2
);
i
+=
tmpInputBuffer
.
size
(),
j
+=
tmpOutputBuffer
.
size
())
{
for
(
size_t
i
=
0
,
j
=
0
;
i
<
(
inputBuffer
.
size
()
/
2
);
i
+=
tmpInputBuffer
.
size
(),
j
+=
tmpOutputBuffer
.
size
())
{
std
::
copy
(
inputBuffer
.
begin
()
+
i
,
inputBuffer
.
begin
()
+
tmpInputBuffer
.
size
()
+
i
,
tmpInputBuffer
.
begin
());
converter
.
resample
(
tmpInputBuffer
.
data
(),
tmpOutputBuffer
.
data
(),
tmpOutputBuffer
.
size
(),
8000
,
16000
,
tmpInputBuffer
.
size
());
std
::
copy
(
tmpOutputBuffer
.
begin
(),
tmpOutputBuffer
.
end
(),
outputBuffer
.
begin
()
+
j
);
...
...
@@ -235,8 +222,7 @@ void ResamplerTest::performDownsampling(SamplerateConverter &converter)
HighSmplrBuffer
tmpInputBuffer
;
LowSmplrBuffer
tmpOutputBuffer
;
int
i
,
j
;
for
(
i
=
0
,
j
=
0
;
i
<
inputBuffer
.
size
();
i
+=
tmpInputBuffer
.
size
(),
j
+=
tmpOutputBuffer
.
size
())
{
for
(
size_t
i
=
0
,
j
=
0
;
i
<
inputBuffer
.
size
();
i
+=
tmpInputBuffer
.
size
(),
j
+=
tmpOutputBuffer
.
size
())
{
std
::
copy
(
inputBuffer
.
begin
()
+
i
,
inputBuffer
.
begin
()
+
tmpInputBuffer
.
size
()
+
i
,
tmpInputBuffer
.
begin
());
converter
.
resample
(
tmpInputBuffer
.
data
(),
tmpOutputBuffer
.
data
(),
tmpOutputBuffer
.
size
(),
16000
,
8000
,
tmpInputBuffer
.
size
());
std
::
copy
(
tmpOutputBuffer
.
begin
(),
tmpOutputBuffer
.
end
(),
outputBuffer
.
begin
()
+
j
);
...
...
daemon/test/resamplertest.h
View file @
6f1a61e2
...
...
@@ -39,6 +39,7 @@
#include <tr1/array>
#include "audio/samplerateconverter.h"
#include "noncopyable.h"
#define MAX_BUFFER_LENGTH 40000
#define TMP_LOWSMPLR_BUFFER_LENGTH 160
...
...
@@ -62,7 +63,7 @@ class ResamplerTest : public CppUnit::TestCase {
CPPUNIT_TEST_SUITE_END
();
public:
ResamplerTest
()
:
CppUnit
::
TestCase
(
"Resampler module test"
)
{}
ResamplerTest
()
;
/*
* Code factoring - Common resources can be initialized here.
...
...
@@ -107,6 +108,7 @@ class ResamplerTest : public CppUnit::TestCase {
void
testDownsamplingSine
();
private:
NON_COPYABLE
(
ResamplerTest
);
/*
* Generate a ramp to be stored in inputBuffer
...
...
@@ -142,12 +144,6 @@ private:
* Used to receive output samples
*/
std
::
tr1
::
array
<
SFLDataFormat
,
MAX_BUFFER_LENGTH
>
outputBuffer
;
/**
* Pointer to samplerate converter, may be reinitialized during tests
* don't keep a statically declared instance.
*/
SamplerateConverter
*
converter
;
};
/* Register the test module */
...
...
gnome/src/contacts/calltab.c
View file @
6f1a61e2
...
...
@@ -53,7 +53,7 @@ void
calltab_select_call
(
calltab_t
*
tab
,
callable_obj_t
*
c
)
{
g_assert
(
tab
);
DEBUG
(
"
CallTab:
Select call %s"
,
c
?
c
->
_callID
:
""
);
DEBUG
(
"Select call %s"
,
c
?
c
->
_callID
:
""
);
tab
->
selectedType
=
A_CALL
;
tab
->
selectedCall
=
c
;
...
...
@@ -65,7 +65,7 @@ void
calltab_select_conf
(
calltab_t
*
tab
,
conference_obj_t
*
c
)
{
g_assert
(
tab
);
DEBUG
(
"
CallTab:
Selected conf %s"
,
c
?
c
->
_confID
:
""
);
DEBUG
(
"Selected conf %s"
,
c
?
c
->
_confID
:
""
);
tab
->
selectedType
=
A_CONFERENCE
;
tab
->
selectedConf
=
c
;
...
...
gnome/src/contacts/conferencelist.c
View file @
6f1a61e2
...
...
@@ -44,7 +44,7 @@ static gint is_confID_confstruct(gconstpointer a, gconstpointer b)
void
conferencelist_init
(
calltab_t
*
tab
)
{
if
(
tab
==
NULL
)
{
ERROR
(
"C
onferenceList: Error: C
all tab is NULL"
);
ERROR
(
"Call tab is NULL"
);
return
;
}
...
...
@@ -55,7 +55,7 @@ void conferencelist_init(calltab_t *tab)
void
conferencelist_clean
(
calltab_t
*
tab
)
{
if
(
tab
==
NULL
)
{
ERROR
(
"C
onferenceList: Error: C
alltab tab is NULL"
);
ERROR
(
"Calltab tab is NULL"
);
return
;
}
...
...
@@ -65,7 +65,7 @@ void conferencelist_clean(calltab_t *tab)
void
conferencelist_reset
(
calltab_t
*
tab
)
{
if
(
tab
==
NULL
)
{
ERROR
(
"C
onferenceList: Error: C
alltab tab is NULL"
);
ERROR
(
"Calltab tab is NULL"
);
return
;
}
...
...
@@ -77,12 +77,12 @@ void conferencelist_reset(calltab_t *tab)
void
conferencelist_add
(
calltab_t
*
tab
,
const
conference_obj_t
*
conf
)
{
if
(
conf
==
NULL
)
{
ERROR
(
"Conference
List: Error: Conference
is NULL"
);
ERROR
(
"Conference is NULL"
);
return
;
}
if
(
tab
==
NULL
)
{
ERROR
(
"
ConferenceList: Error:
Tab is NULL"
);
ERROR
(
"Tab is NULL"
);
return
;
}
...
...
@@ -96,15 +96,15 @@ void conferencelist_add(calltab_t *tab, const conference_obj_t* conf)
void
conferencelist_remove
(
calltab_t
*
tab
,
const
gchar
*
const
conf_id
)
{
DEBUG
(
"
ConferenceList:
Remove conference %s"
,
conf_id
);
DEBUG
(
"Remove conference %s"
,
conf_id
);
if
(
conf_id
==
NULL
)
{
ERROR
(
"Conf
erenceList: Error: Conf
id is NULL"
);
ERROR
(
"Conf id is NULL"
);
return
;
}
if
(
tab
==
NULL
)
{
ERROR
(
"C
onferenceList: Error: C
alltab is NULL"
);
ERROR
(
"Calltab is NULL"
);
return
;
}
...
...
@@ -118,10 +118,10 @@ void conferencelist_remove(calltab_t *tab, const gchar* const conf_id)
conference_obj_t
*
conferencelist_get
(
calltab_t
*
tab
,
const
gchar
*
const
conf_id
)
{
DEBUG
(
"Conference
List: Conference
list get %s"
,
conf_id
);
DEBUG
(
"Conference list get %s"
,
conf_id
);
if
(
tab
==
NULL
)
{
ERROR
(
"C
onferenceList: Error: C
alltab is NULL"
);
ERROR
(
"Calltab is NULL"
);
return
NULL
;
}
...
...
@@ -136,14 +136,14 @@ conference_obj_t* conferencelist_get(calltab_t *tab, const gchar* const conf_id)
conference_obj_t
*
conferencelist_get_nth
(
calltab_t
*
tab
,
guint
n
)
{
if
(
tab
==
NULL
)
{
ERROR
(
"C
onferenceList: Error: C
alltab is NULL"
);
ERROR
(
"Calltab is NULL"
);
return
NULL
;
}
conference_obj_t
*
c
=
g_queue_peek_nth
(
tab
->
conferenceQueue
,
n
);
if
(
c
==
NULL
)
{
ERROR
(
"Co
nferenceList: Error: Co
uld not fetch conference %d"
,
n
);
ERROR
(
"Could not fetch conference %d"
,
n
);
return
NULL
;
}
...
...
@@ -153,7 +153,7 @@ conference_obj_t* conferencelist_get_nth(calltab_t *tab, guint n)
conference_obj_t
*
conferencelist_pop_head
(
calltab_t
*
tab
)
{
if
(
tab
==
NULL
)
{
ERROR
(
"
ConferenceList: Error:
Tab is NULL"
);
ERROR
(
"Tab is NULL"
);
return
NULL
;
}
...
...
@@ -163,7 +163,7 @@ conference_obj_t *conferencelist_pop_head(calltab_t *tab)
guint
conferencelist_get_size
(
calltab_t
*
tab
)
{
if
(
tab
==
NULL
)
{
ERROR
(
"C
onferenceList: Error: C
alltab is NULL"
);
ERROR
(
"Calltab is NULL"
);
return
0
;
}
...
...
kde/src/SFLPhoneView.cpp
View file @
6f1a61e2
...
...
@@ -145,10 +145,10 @@ void SFLPhoneView::typeString(QString str)
}
foreach
(
Call
*
call2
,
SFLPhone
::
model
()
->
getCallList
())
{
if
(
currentCall
!=
call2
&&
call2
->
getState
()
==
CALL_STATE_CURRENT
)
{
if
(
dynamic_cast
<
Call
*>
(
call2
)
&&
currentCall
!=
call2
&&
call2
->
getState
()
==
CALL_STATE_CURRENT
)
{
action
(
call2
,
CALL_ACTION_HOLD
);
}
else
if
(
call2
->
getState
()
==
CALL_STATE_DIALING
)
{
else
if
(
dynamic_cast
<
Call
*>
(
call2
)
&&
call2
->
getState
()
==
CALL_STATE_DIALING
)
{
candidate
=
call2
;
}
}
...
...
kde/src/klib/HelperFunctions.cpp
View file @
6f1a61e2
...
...
@@ -10,7 +10,18 @@
ContactHash
HelperFunctions
::
toHash
(
QList
<
Contact
*>
contacts
)
{
QHash
<
QString
,
QHash
<
QString
,
QVariant
>
>
hash
;
for
(
int
i
=
0
;
i
<
contacts
.
size
();
i
++
)
{
hash
[
contacts
[
i
]
->
getUid
()]
=
contacts
[
i
]
->
toHash
();
Contact
*
cont
=
contacts
[
i
];
QHash
<
QString
,
QVariant
>
conth
=
cont
->
toHash
();
conth
[
"phoneCount"
]
=
cont
->
getPhoneNumbers
().
size
();
if
(
cont
->
getPhoneNumbers
().
size
()
==
1
)
{
conth
[
"phoneNumber"
]
=
cont
->
getPhoneNumbers
()[
0
]
->
getNumber
();
conth
[
"phoneType"
]
=
cont
->
getPhoneNumbers
()[
0
]
->
getType
();
}
else
{
conth
[
"phoneNumber"
]
=
QString
::
number
(
cont
->
getPhoneNumbers
().
size
())
+
" numbers"
;
conth
[
"phoneType"
]
=
""
;
}
hash
[
contacts
[
i
]
->
getUid
()]
=
conth
;
}
return
hash
;
}
\ No newline at end of file
kde/src/klib/dataengine/sflphonEngine.cpp
View file @
6f1a61e2
...
...
@@ -5,6 +5,7 @@
#include "../../lib/Call.h"
#include "../../lib/Account.h"
#include "../../lib/AccountList.h"
#include "../../lib/Contact.h"
#include "../../lib/dbus/metatypes.h"
#include "../../lib/instance_interface_singleton.h"
#include "../../lib/configurationmanager_interface_singleton.h"
...
...
@@ -29,6 +30,8 @@ SFLPhoneEngine::SFLPhoneEngine(QObject* parent, const QVariantList& args)
//CallManagerInterface& callManager = CallManagerInterfaceSingleton::getInstance();
connect
(
m_pModel
,
SIGNAL
(
callStateChanged
(
Call
*
))
,
this
,
SLOT
(
callStateChangedSignal
(
Call
*
)
));
connect
(
m_pModel
,
SIGNAL
(
callAdded
(
Call
*
))
,
this
,
SLOT
(
callStateChangedSignal
(
Call
*
)
));
connect
(
m_pModel
,
SIGNAL
(
callStateChanged
(
Call
*
))
,
this
,
SLOT
(
callStateChangedSignal
(
Call
*
)
));
//connect(&callManager , SIGNAL( incomingCall(Call*)) , this , SLOT(incomingCallSignal(Call*) ));
//connect(&callManager , SIGNAL( conferenceCreated(Call*)) , this , SLOT(conferenceCreatedSignal(Call*) ));
...
...
@@ -39,27 +42,30 @@ SFLPhoneEngine::SFLPhoneEngine(QObject* parent, const QVariantList& args)
bool
SFLPhoneEngine
::
sourceRequestEvent
(
const
QString
&
name
)
{
if
(
name
==
"history"
)
{
if
(
name
==
"history"
)
{
updateHistory
();
}
else
if
(
name
==
"calls"
)
{
else
if
(
name
==
"calls"
)
{
updateCallList
();
}
else
if
(
name
==
"conferences"
)
{
else
if
(
name
==
"conferences"
)
{
updateConferenceList
();
}
else
if
(
name
==
"info"
)
{
else
if
(
name
==
"info"
)
{
updateInfo
();
}
else
if
(
name
==
"accounts"
)
{
else
if
(
name
==
"accounts"
)
{
updateAccounts
();
}
else
if
(
name
==
"contacts"
)
{
else
if
(
name
==
"contacts"
)
{
updateContacts
();
}
else
if
(
name
==
"bookmark"
)
{
else
if
(
name
==
"bookmark"
)
{
updateBookmarkList
();
}
else
if
(
name
.
left
(
7
)
==
"Number:"
)
{
generateNumberList
(
name
);
}
return
true
;
//updateSourceEvent(name);
}
...
...
@@ -124,6 +130,7 @@ void SFLPhoneEngine::updateHistory()
historyCall
[
oldCall
->
getCallId
()][
"peerNumber"
]
=
oldCall
->
getPeerPhoneNumber
();
historyCall
[
oldCall
->
getCallId
()][
"length"
]
=
oldCall
->
getStopTimeStamp
().
toInt
()
-
oldCall
->
getStartTimeStamp
().
toInt
();
historyCall
[
oldCall
->
getCallId
()][
"date"
]
=
oldCall
->
getStopTimeStamp
();
historyCall
[
oldCall
->
getCallId
()][
"id"
]
=
oldCall
->
getCallId
();
if
(
oldCall
->
property
(
"section"
).
isValid
())
historyCall
[
oldCall
->
getCallId
()][
"section"
]
=
oldCall
->
property
(
"section"
);
setData
(
"history"
,
oldCall
->
getCallId
()
,
historyCall
[
oldCall
->
getCallId
()]);
...
...
@@ -132,12 +139,14 @@ void SFLPhoneEngine::updateHistory()
void
SFLPhoneEngine
::
updateCallList
()
{
removeAllData
(
"calls"
);
foreach
(
Call
*
call
,
m_pModel
->
getCalls
())
{
if
((
!
m_pModel
->
isConference
(
call
))
&&
(
call
->
getState
()
!=
CALL_STATE_OVER
))
{
currentCall
[
call
->
getCallId
()][
"peerName"
]
=
call
->
getPeerName
();
currentCall
[
call
->
getCallId
()][
"peerNumber"
]
=
call
->
getPeerPhoneNumber
();
currentCall
[
call
->
getCallId
()][
"stateName"
]
=
getCallStateName
(
call
->
getState
());
currentCall
[
call
->
getCallId
()][
"state"
]
=
call
->
getState
();
currentCall
[
call
->
getCallId
()][
"id"
]
=
call
->
getCallId
();
setData
(
"calls"
,
call
->
getCallId
(),
currentCall
[
call
->
getCallId
()]);
}
}
...
...
@@ -157,9 +166,10 @@ void SFLPhoneEngine::updateBookmarkList()
else
{
pop
[
"peerName"
]
=
cl
[
i
];
}
pop
[
"peerNumber"
]
=
cl
[
i
];
pop
[
"section"
]
=
"Popular"
;
pop
[
"listPriority"
]
=
1000
;
pop
[
"peerNumber"
]
=
cl
[
i
]
;
pop
[
"section"
]
=
"Popular"
;
pop
[
"listPriority"
]
=
1000
;
pop
[
"id"
]
=
i
;
setData
(
"bookmark"
,
QString
::
number
(
i
),
pop
);
}
...
...
@@ -167,10 +177,11 @@ void SFLPhoneEngine::updateBookmarkList()
foreach
(
QString
nb
,
ConfigurationSkeleton
::
bookmarkList
())
{
i
++
;
QHash
<
QString
,
QVariant
>
pop
;
pop
[
"peerName"
]
=
"TODO"
;
pop
[
"peerNumber"
]
=
nb
;
pop
[
"section"
]
=
"1"
;
pop
[
"listPriority"
]
=
0
;
pop
[
"peerName"
]
=
"TODO"
;
pop
[
"peerNumber"
]
=
nb
;
pop
[
"section"
]
=
"1"
;
pop
[
"listPriority"
]
=
0
;
pop
[
"id"
]
=
i
;
setData
(
"bookmark"
,
QString
::
number
(
i
),
pop
);
}
}
...
...
@@ -237,8 +248,26 @@ void SFLPhoneEngine::updateAccounts()
foreach
(
Account
*
a
,
list
)
{
QHash
<
QString
,
QVariant
>
acc
;
acc
[
"id"
]
=
a
->
getAccountId
();
acc
[
"alias"
]
=
a
->
getAccountDetail
(
ACCOUNT_ALIAS
)
setData
(
"accounts"
,
QString
::
number
(
rand
())
,
a
->
getAccountId
());
acc
[
"alias"
]
=
a
->
getAccountDetail
(
ACCOUNT_ALIAS
);
setData
(
"accounts"
,
QString
::
number
(
rand
())
,
acc
);
}
}
void
SFLPhoneEngine
::
generateNumberList
(
QString
name
)
{
QString
contactUid
=
name
.
right
(
name
.
size
()
-
7
);
qDebug
()
<<
"LOOKING FOR "
<<
contactUid
;
Contact
*
cont
=
AkonadiBackend
::
getInstance
()
->
getContactByUid
(
contactUid
);
if
(
cont
)
{
foreach
(
Contact
::
PhoneNumber
*
num
,
cont
->
getPhoneNumbers
())
{
QHash
<
QString
,
QVariant
>
hash
;
hash
[
"number"
]
=
num
->
getNumber
();
hash
[
"type"
]
=
num
->
getType
();
setData
(
name
,
QString
::
number
(
rand
())
,
hash
);
}
}
else
{
kDebug
()
<<
"Contact not found"
;
}
}
...
...
kde/src/klib/dataengine/sflphonEngine.h
View file @
6f1a61e2
...
...
@@ -63,6 +63,8 @@ class SFLPhoneEngine : public Plasma::DataEngine,public SortableDockCommon<>
void
updateContacts
();
void
updateBookmarkList
();
void
updateInfo
();
void
generateNumberList
(
QString
name
);
private
slots
:
void
updateCollection
();
void
callStateChangedSignal
(
Call
*
call
);
...
...
kde/src/klib/dataengine/sflphone.operations
View file @
6f1a61e2
...
...
@@ -10,4 +10,27 @@
<label>
Number to call
</label>