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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
c86edc0c
Commit
c86edc0c
authored
13 years ago
by
Emmanuel Lepage
Browse files
Options
Downloads
Patches
Plain Diff
[ #10724 ] Add bookmarks to the dataengine
parent
5df6c398
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
kde/src/klib/dataengine/sflphonEngine.cpp
+38
-2
38 additions, 2 deletions
kde/src/klib/dataengine/sflphonEngine.cpp
kde/src/klib/dataengine/sflphonEngine.h
+1
-0
1 addition, 0 deletions
kde/src/klib/dataengine/sflphonEngine.h
with
39 additions
and
2 deletions
kde/src/klib/dataengine/sflphonEngine.cpp
+
38
−
2
View file @
c86edc0c
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
#include
"../../lib/sflphone_const.h"
#include
"../../lib/sflphone_const.h"
#include
"../../klib/AkonadiBackend.h"
#include
"../../klib/AkonadiBackend.h"
#include
"../../klib/HelperFunctions.h"
#include
"../../klib/HelperFunctions.h"
#include
"../../klib/ConfigurationSkeleton.h"
#include
"sflphoneService.h"
>
#include
"sflphoneService.h"
>
CallModel
<>*
SFLPhoneEngine
::
m_pModel
=
NULL
;
CallModel
<>*
SFLPhoneEngine
::
m_pModel
=
NULL
;
...
@@ -56,6 +57,9 @@ bool SFLPhoneEngine::sourceRequestEvent(const QString &name)
...
@@ -56,6 +57,9 @@ bool SFLPhoneEngine::sourceRequestEvent(const QString &name)
else
if
(
name
==
"contacts"
)
{
else
if
(
name
==
"contacts"
)
{
updateContacts
();
updateContacts
();
}
}
else
if
(
name
==
"bookmark"
)
{
updateBookmarkList
();
}
return
true
;
//updateSourceEvent(name);
return
true
;
//updateSourceEvent(name);
}
}
...
@@ -67,7 +71,7 @@ bool SFLPhoneEngine::updateSourceEvent(const QString &name)
...
@@ -67,7 +71,7 @@ bool SFLPhoneEngine::updateSourceEvent(const QString &name)
QStringList
SFLPhoneEngine
::
sources
()
const
{
QStringList
SFLPhoneEngine
::
sources
()
const
{
QStringList
toReturn
;
QStringList
toReturn
;
toReturn
<<
"calls"
<<
"history"
<<
"conferences"
<<
"info"
<<
"accounts"
<<
"contacts"
;
toReturn
<<
"calls"
<<
"history"
<<
"conferences"
<<
"info"
<<
"accounts"
<<
"contacts"
<<
"bookmark"
;
return
toReturn
;
return
toReturn
;
}
}
...
@@ -116,7 +120,6 @@ void SFLPhoneEngine::updateHistory()
...
@@ -116,7 +120,6 @@ void SFLPhoneEngine::updateHistory()
setHistoryCategory
(
list
,
HistorySortingMode
::
Date
);
setHistoryCategory
(
list
,
HistorySortingMode
::
Date
);
foreach
(
Call
*
oldCall
,
list
)
{
foreach
(
Call
*
oldCall
,
list
)
{
qDebug
()
<<
oldCall
->
getStopTimeStamp
();
historyCall
[
oldCall
->
getCallId
()][
"peerName"
]
=
oldCall
->
getPeerName
();
historyCall
[
oldCall
->
getCallId
()][
"peerName"
]
=
oldCall
->
getPeerName
();
historyCall
[
oldCall
->
getCallId
()][
"peerNumber"
]
=
oldCall
->
getPeerPhoneNumber
();
historyCall
[
oldCall
->
getCallId
()][
"peerNumber"
]
=
oldCall
->
getPeerPhoneNumber
();
historyCall
[
oldCall
->
getCallId
()][
"length"
]
=
oldCall
->
getStopTimeStamp
().
toInt
()
-
oldCall
->
getStartTimeStamp
().
toInt
();
historyCall
[
oldCall
->
getCallId
()][
"length"
]
=
oldCall
->
getStopTimeStamp
().
toInt
()
-
oldCall
->
getStartTimeStamp
().
toInt
();
...
@@ -140,6 +143,38 @@ void SFLPhoneEngine::updateCallList()
...
@@ -140,6 +143,38 @@ void SFLPhoneEngine::updateCallList()
}
}
}
}
void
SFLPhoneEngine
::
updateBookmarkList
()
{
removeAllData
(
"bookmark"
);
int
i
=
0
;
QStringList
cl
=
getModel
()
->
getNumbersByPopularity
();
for
(;
i
<
((
cl
.
size
()
<
10
)
?
cl
.
size
()
:
10
);
i
++
)
{
QHash
<
QString
,
QVariant
>
pop
;
Contact
*
cont
=
AkonadiBackend
::
getInstance
()
->
getContactByPhone
(
cl
[
i
],
true
);
if
(
cont
)
{
pop
[
"peerName"
]
=
cont
->
getFormattedName
();
}
else
{
pop
[
"peerName"
]
=
cl
[
i
];
}
pop
[
"peerNumber"
]
=
cl
[
i
];
pop
[
"section"
]
=
"Popular"
;
pop
[
"listPriority"
]
=
1000
;
setData
(
"bookmark"
,
QString
::
number
(
i
),
pop
);
}
//TODO Wont work for now
foreach
(
QString
nb
,
ConfigurationSkeleton
::
bookmarkList
())
{
i
++
;
QHash
<
QString
,
QVariant
>
pop
;
pop
[
"peerName"
]
=
"TODO"
;
pop
[
"peerNumber"
]
=
nb
;
pop
[
"section"
]
=
"1"
;
pop
[
"listPriority"
]
=
0
;
setData
(
"bookmark"
,
QString
::
number
(
i
),
pop
);
}
}
void
SFLPhoneEngine
::
updateConferenceList
()
void
SFLPhoneEngine
::
updateConferenceList
()
{
{
foreach
(
Call
*
call
,
m_pModel
->
getCalls
())
{
foreach
(
Call
*
call
,
m_pModel
->
getCalls
())
{
...
@@ -172,6 +207,7 @@ void SFLPhoneEngine::updateCollection()
...
@@ -172,6 +207,7 @@ void SFLPhoneEngine::updateCollection()
setData
(
"contacts"
,
QString
::
number
(
i
),
QVariant
(
cont
));
setData
(
"contacts"
,
QString
::
number
(
i
),
QVariant
(
cont
));
i
++
;
i
++
;
}
}
updateBookmarkList
();
}
}
void
SFLPhoneEngine
::
updateContacts
()
void
SFLPhoneEngine
::
updateContacts
()
...
...
This diff is collapsed.
Click to expand it.
kde/src/klib/dataengine/sflphonEngine.h
+
1
−
0
View file @
c86edc0c
...
@@ -61,6 +61,7 @@ class SFLPhoneEngine : public Plasma::DataEngine,public SortableDockCommon<>
...
@@ -61,6 +61,7 @@ class SFLPhoneEngine : public Plasma::DataEngine,public SortableDockCommon<>
void
updateAccounts
();
void
updateAccounts
();
void
updateConferenceList
();
void
updateConferenceList
();
void
updateContacts
();
void
updateContacts
();
void
updateBookmarkList
();
void
updateInfo
();
void
updateInfo
();
private
slots
:
private
slots
:
void
updateCollection
();
void
updateCollection
();
...
...
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