Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-daemon
Commits
319d3b01
Commit
319d3b01
authored
Oct 24, 2011
by
Tristan Matthews
Browse files
* #7258: Cleanup in historyitem
parent
f08e3518
Changes
2
Hide whitespace changes
Inline
Side-by-side
daemon/src/history/historyitem.cpp
View file @
319d3b01
...
...
@@ -30,14 +30,20 @@
* as that of the covered work.
*/
#include
<
historyitem.h
>
#include
"
historyitem.h
"
#include
<sstream>
#include
"stdlib.h"
#include
<manager.h>
#define ITEM_SEPARATOR "|"
HistoryItem
::
HistoryItem
(
std
::
string
timestamp_start
,
CallType
call_type
,
std
::
string
timestamp_stop
,
std
::
string
name
,
std
::
string
number
,
std
::
string
id
,
std
::
string
account_id
,
std
::
string
recording
,
std
::
string
confID
,
std
::
string
timeAdded
)
#include
<cstdlib>
#include
"manager.h"
static
const
char
*
const
ITEM_SEPARATOR
=
"|"
;
HistoryItem
::
HistoryItem
(
const
std
::
string
&
timestamp_start
,
CallType
call_type
,
const
std
::
string
&
timestamp_stop
,
const
std
::
string
&
name
,
const
std
::
string
&
number
,
const
std
::
string
&
id
,
const
std
::
string
&
account_id
,
const
std
::
string
&
recording
,
const
std
::
string
&
confID
,
const
std
::
string
&
timeAdded
)
:
timestamp_start_
(
timestamp_start
),
timestamp_stop_
(
timestamp_stop
),
call_type_
(
call_type
),
...
...
@@ -53,11 +59,9 @@ HistoryItem::HistoryItem(std::string timestamp_start, CallType call_type, std::s
HistoryItem
::
HistoryItem
(
std
::
string
serialized_form
)
{
int
index
=
0
;
while
(
serialized_form
.
find
(
ITEM_SEPARATOR
,
0
)
!=
std
::
string
::
npos
)
{
for
(
int
index
=
0
;
serialized_form
.
find
(
ITEM_SEPARATOR
,
0
)
!=
std
::
string
::
npos
;
++
index
)
{
size_t
pos
=
serialized_form
.
find
(
ITEM_SEPARATOR
,
0
);
std
::
string
tmp
=
serialized_form
.
substr
(
0
,
pos
);
std
::
string
tmp
(
serialized_form
.
substr
(
0
,
pos
)
)
;
serialized_form
.
erase
(
0
,
pos
+
1
);
switch
(
index
)
{
...
...
@@ -98,8 +102,6 @@ HistoryItem::HistoryItem(std::string serialized_form)
ERROR
(
"Unserialized form %d not recognized
\n
"
,
index
);
break
;
}
++
index
;
}
}
...
...
daemon/src/history/historyitem.h
View file @
319d3b01
...
...
@@ -59,7 +59,10 @@ class HistoryItem {
* @param Configuration ID
* @param time added
*/
HistoryItem
(
std
::
string
,
CallType
,
std
::
string
,
std
::
string
,
std
::
string
,
std
::
string
,
std
::
string
,
std
::
string
,
std
::
string
,
std
::
string
);
HistoryItem
(
const
std
::
string
&
,
CallType
,
const
std
::
string
&
,
const
std
::
string
&
,
const
std
::
string
&
,
const
std
::
string
&
,
const
std
::
string
&
,
const
std
::
string
&
,
const
std
::
string
&
,
const
std
::
string
&
);
/*
* Constructor from a serialized form
...
...
Write
Preview
Supports
Markdown
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