Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-daemon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
6c664591
Commit
6c664591
authored
May 29, 2012
by
Tristan Matthews
Browse files
Options
Downloads
Patches
Plain Diff
* #10304: historyitem: file_exists need not be a member method
parent
9c53f080
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
daemon/src/history/historyitem.cpp
+11
-10
11 additions, 10 deletions
daemon/src/history/historyitem.cpp
daemon/src/history/historyitem.h
+0
-1
0 additions, 1 deletion
daemon/src/history/historyitem.h
with
11 additions
and
11 deletions
daemon/src/history/historyitem.cpp
+
11
−
10
View file @
6c664591
...
@@ -51,6 +51,13 @@ const char * const HistoryItem::OUTGOING_STRING = "outgoing";
...
@@ -51,6 +51,13 @@ const char * const HistoryItem::OUTGOING_STRING = "outgoing";
using
std
::
map
;
using
std
::
map
;
using
std
::
string
;
using
std
::
string
;
namespace
{
bool
file_exists
(
const
std
::
string
&
str
)
{
return
access
(
str
.
c_str
(),
F_OK
)
!=
-
1
;
}
}
HistoryItem
::
HistoryItem
(
const
map
<
string
,
string
>
&
args
)
:
entryMap_
(
args
),
HistoryItem
::
HistoryItem
(
const
map
<
string
,
string
>
&
args
)
:
entryMap_
(
args
),
timestampStart_
(
std
::
atol
(
entryMap_
[
TIMESTAMP_START_KEY
].
c_str
()))
timestampStart_
(
std
::
atol
(
entryMap_
[
TIMESTAMP_START_KEY
].
c_str
()))
{}
{}
...
@@ -65,9 +72,8 @@ HistoryItem::HistoryItem(std::istream &entry) : entryMap_(), timestampStart_(0)
...
@@ -65,9 +72,8 @@ HistoryItem::HistoryItem(std::istream &entry) : entryMap_(), timestampStart_(0)
else
if
(
pos
<
tmp
.
length
()
-
1
)
{
else
if
(
pos
<
tmp
.
length
()
-
1
)
{
string
key
(
tmp
.
substr
(
0
,
pos
));
string
key
(
tmp
.
substr
(
0
,
pos
));
string
val
(
tmp
.
substr
(
pos
+
1
,
tmp
.
length
()
-
pos
-
1
));
string
val
(
tmp
.
substr
(
pos
+
1
,
tmp
.
length
()
-
pos
-
1
));
if
(
key
==
RECORDING_PATH_KEY
&&
!
fexist
(
val
))
if
(
key
==
RECORDING_PATH_KEY
and
not
file_exists
(
val
))
entryMap_
[
key
]
=
""
;
val
=
""
;
else
entryMap_
[
key
]
=
val
;
entryMap_
[
key
]
=
val
;
}
}
}
}
...
@@ -89,18 +95,13 @@ bool HistoryItem::hasPeerNumber() const
...
@@ -89,18 +95,13 @@ bool HistoryItem::hasPeerNumber() const
return
entryMap_
.
find
(
PEER_NUMBER_KEY
)
!=
entryMap_
.
end
();
return
entryMap_
.
find
(
PEER_NUMBER_KEY
)
!=
entryMap_
.
end
();
}
}
bool
HistoryItem
::
fexist
(
const
std
::
string
&
str
)
const
{
return
access
(
str
.
c_str
(),
F_OK
)
!=
-
1
;
}
void
HistoryItem
::
print
(
std
::
ostream
&
o
)
const
void
HistoryItem
::
print
(
std
::
ostream
&
o
)
const
{
{
// every entry starts with "[" + random integer = "]"
// every entry starts with "[" + random integer = "]"
for
(
map
<
string
,
string
>::
const_iterator
iter
=
entryMap_
.
begin
();
for
(
map
<
string
,
string
>::
const_iterator
iter
=
entryMap_
.
begin
();
iter
!=
entryMap_
.
end
();
++
iter
)
{
iter
!=
entryMap_
.
end
();
++
iter
)
{
// if the file does not exist anymore, we do not save it
// if the file does not exist anymore, we do not save it
if
(
iter
->
first
==
RECORDING_PATH_KEY
&&
!
f
exist
(
iter
->
second
))
if
(
iter
->
first
==
RECORDING_PATH_KEY
and
not
file_
exist
s
(
iter
->
second
))
o
<<
iter
->
first
<<
"="
<<
""
<<
std
::
endl
;
o
<<
iter
->
first
<<
"="
<<
""
<<
std
::
endl
;
else
else
o
<<
iter
->
first
<<
"="
<<
iter
->
second
<<
std
::
endl
;
o
<<
iter
->
first
<<
"="
<<
iter
->
second
<<
std
::
endl
;
...
...
This diff is collapsed.
Click to expand it.
daemon/src/history/historyitem.h
+
0
−
1
View file @
6c664591
...
@@ -59,7 +59,6 @@ class HistoryItem {
...
@@ -59,7 +59,6 @@ class HistoryItem {
bool
youngerThan
(
unsigned
long
otherTime
)
const
;
bool
youngerThan
(
unsigned
long
otherTime
)
const
;
std
::
map
<
std
::
string
,
std
::
string
>
toMap
()
const
;
std
::
map
<
std
::
string
,
std
::
string
>
toMap
()
const
;
bool
fexist
(
const
std
::
string
&
str
)
const
;
void
print
(
std
::
ostream
&
o
)
const
;
void
print
(
std
::
ostream
&
o
)
const
;
bool
operator
<
(
const
HistoryItem
&
other
)
const
{
bool
operator
<
(
const
HistoryItem
&
other
)
const
{
return
timestampStart_
>
other
.
timestampStart_
;
return
timestampStart_
>
other
.
timestampStart_
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment