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-client-macos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
35
Issues
35
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-client-macos
Commits
d14bda3b
Commit
d14bda3b
authored
Oct 13, 2015
by
Alexandre Lision
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
smartlist: use new PeopleProxy model
Issue: #81198 Change-Id: I5618a510d2ed781af022f701bcf19afbf53514fb
parent
7f3c37de
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
src/SmartViewVC.mm
src/SmartViewVC.mm
+8
-7
No files found.
src/SmartViewVC.mm
View file @
d14bda3b
...
...
@@ -29,6 +29,7 @@
#import <recentmodel.h>
#import <callmodel.h>
#import <call.h>
#import <itemdataroles.h>
#import <person.h>
#import <contactmethod.h>
#import <globalinstances.h>
...
...
@@ -66,7 +67,7 @@ NSInteger const TXT_BUTTON_TAG = 500;
NSLog
(
@"INIT SmartView VC"
);
isShowingContacts
=
false
;
treeController
=
[[
QNSTreeController
alloc
]
initWithQModel
:
RecentModel
:
:
instance
()];
treeController
=
[[
QNSTreeController
alloc
]
initWithQModel
:
RecentModel
:
:
instance
()
->
peopleProxy
()
];
[
treeController
setAvoidsEmptySelection
:
NO
];
[
treeController
setChildrenKeyPath
:
@"children"
];
...
...
@@ -113,7 +114,7 @@ NSInteger const TXT_BUTTON_TAG = 500;
// Before calling check if we properly extracted a contact method and that
// there is NOT already an ongoing call for this index (e.g: no children for this node)
if
(
m
&&
!
RecentModel
::
instance
()
->
index
(
0
,
0
,
qIdx
).
isValid
()){
if
(
m
&&
!
RecentModel
::
instance
()
->
peopleProxy
()
->
index
(
0
,
0
,
qIdx
).
isValid
()){
Call
*
c
=
CallModel
::
instance
()
->
dialingCall
();
c
->
setPeerContactMethod
(
m
);
c
<<
Call
::
Action
::
ACCEPT
;
...
...
@@ -181,9 +182,9 @@ NSInteger const TXT_BUTTON_TAG = 500;
QModelIndex
qIdx
=
[
treeController
toQIdx
:[
treeController
selectedNodes
][
0
]];
// ask the tree controller for the current selection
if
(
auto
selected
=
RecentModel
::
instance
()
->
getActiveCall
(
qIdx
))
{
if
(
auto
selected
=
RecentModel
::
instance
()
->
getActiveCall
(
RecentModel
::
instance
()
->
peopleProxy
()
->
mapToSource
(
qIdx
)
))
{
CallModel
::
instance
()
->
selectCall
(
selected
);
}
else
if
(
auto
selected
=
RecentModel
::
instance
()
->
getActiveCall
(
qIdx
.
parent
(
))){
}
else
if
(
auto
selected
=
RecentModel
::
instance
()
->
getActiveCall
(
RecentModel
::
instance
()
->
peopleProxy
()
->
mapToSource
(
qIdx
.
parent
()
))){
CallModel
::
instance
()
->
selectCall
(
selected
);
}
else
{
CallModel
::
instance
()
->
selectionModel
()
->
clearCurrentIndex
();
...
...
@@ -202,11 +203,11 @@ NSInteger const TXT_BUTTON_TAG = 500;
[((
ContextualTableCellView
*
)
result
)
setContextualsControls
:[
NSMutableArray
arrayWithObject
:[
result
viewWithTag
:
CALL_BUTTON_TAG
]]];
if
(
auto
call
=
RecentModel
::
instance
()
->
getActiveCall
(
qIdx
))
{
[
details
setStringValue
:
call
->
roleData
((
int
)
Call
:
:
Role
::
HumanStateNam
e
).
toString
().
toNSString
()];
if
(
auto
call
=
RecentModel
::
instance
()
->
getActiveCall
(
RecentModel
::
instance
()
->
peopleProxy
()
->
mapToSource
(
qIdx
)
))
{
[
details
setStringValue
:
call
->
roleData
((
int
)
Ring
:
:
Role
::
FormattedStat
e
).
toString
().
toNSString
()];
[((
ContextualTableCellView
*
)
result
)
setActiveState
:
YES
];
}
else
{
[
details
setStringValue
:
qIdx
.
data
((
int
)
Person
:
:
Role
::
FormattedLastUsed
).
toString
().
toNSString
()];
[
details
setStringValue
:
qIdx
.
data
((
int
)
Ring
:
:
Role
::
FormattedLastUsed
).
toString
().
toNSString
()];
[((
ContextualTableCellView
*
)
result
)
setActiveState
:
NO
];
}
...
...
Write
Preview
Markdown
is supported
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