Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jami-libclient
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
savoirfairelinux
jami-libclient
Commits
086b14b1
Commit
086b14b1
authored
10 years ago
by
Emmanuel Lepage Vallee
Browse files
Options
Downloads
Patches
Plain Diff
[ #55020 ] Fix account creation
parent
a17c6d64
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
src/categorizedaccountmodel.cpp
+15
-2
15 additions, 2 deletions
src/categorizedaccountmodel.cpp
src/categorizedaccountmodel.h
+2
-1
2 additions, 1 deletion
src/categorizedaccountmodel.h
with
17 additions
and
3 deletions
src/categorizedaccountmodel.cpp
+
15
−
2
View file @
086b14b1
...
@@ -47,7 +47,7 @@ CategorizedAccountModel::~CategorizedAccountModel()
...
@@ -47,7 +47,7 @@ CategorizedAccountModel::~CategorizedAccountModel()
QModelIndex
CategorizedAccountModel
::
mapToSource
(
const
QModelIndex
&
idx
)
const
QModelIndex
CategorizedAccountModel
::
mapToSource
(
const
QModelIndex
&
idx
)
const
{
{
if
(
!
idx
.
isValid
()
||
!
idx
.
parent
().
isValid
())
if
(
!
idx
.
isValid
()
||
!
idx
.
parent
().
isValid
()
||
idx
.
model
()
!=
this
)
return
QModelIndex
();
return
QModelIndex
();
switch
(
idx
.
parent
().
row
())
{
switch
(
idx
.
parent
().
row
())
{
case
Categories
::
IP2IP
:
case
Categories
::
IP2IP
:
...
@@ -55,7 +55,8 @@ QModelIndex CategorizedAccountModel::mapToSource(const QModelIndex& idx) const
...
@@ -55,7 +55,8 @@ QModelIndex CategorizedAccountModel::mapToSource(const QModelIndex& idx) const
break
;
break
;
case
Categories
::
SERVER
:
{
case
Categories
::
SERVER
:
{
const
QModelIndex
&
ip2ipIdx
=
AccountListModel
::
instance
()
->
ip2ip
()
->
index
();
const
QModelIndex
&
ip2ipIdx
=
AccountListModel
::
instance
()
->
ip2ip
()
->
index
();
return
AccountListModel
::
instance
()
->
index
((
ip2ipIdx
.
row
()
<
idx
.
row
())
?
idx
.
row
()
+
1
:
idx
.
row
(),
0
);
//TODO DHT: this will stop working
return
AccountListModel
::
instance
()
->
index
((
ip2ipIdx
.
row
()
<=
idx
.
row
())
?
idx
.
row
()
+
1
:
idx
.
row
(),
0
);
}
}
break
;
break
;
default
:
default
:
...
@@ -65,6 +66,18 @@ QModelIndex CategorizedAccountModel::mapToSource(const QModelIndex& idx) const
...
@@ -65,6 +66,18 @@ QModelIndex CategorizedAccountModel::mapToSource(const QModelIndex& idx) const
return
QModelIndex
();
return
QModelIndex
();
}
}
QModelIndex
CategorizedAccountModel
::
mapFromSource
(
const
QModelIndex
&
idx
)
const
{
if
(
!
idx
.
isValid
()
||
idx
.
model
()
!=
AccountListModel
::
instance
())
return
QModelIndex
();
//TODO DHT: this will stop working
const
QModelIndex
&
ip2ipIdx
=
AccountListModel
::
instance
()
->
ip2ip
()
->
index
();
return
idx
.
row
()
==
ip2ipIdx
.
row
()
?
index
(
0
,
0
,
index
(
Categories
::
IP2IP
,
0
,
QModelIndex
()))
:
(
index
(
idx
.
row
()
+
(
idx
.
row
()
>
ip2ipIdx
.
row
()
?-
1
:
0
),
0
,
index
(
Categories
::
SERVER
,
0
,
QModelIndex
()))
);
}
QVariant
CategorizedAccountModel
::
data
(
const
QModelIndex
&
index
,
int
role
)
const
QVariant
CategorizedAccountModel
::
data
(
const
QModelIndex
&
index
,
int
role
)
const
{
{
if
(
!
index
.
isValid
())
if
(
!
index
.
isValid
())
...
...
This diff is collapsed.
Click to expand it.
src/categorizedaccountmodel.h
+
2
−
1
View file @
086b14b1
...
@@ -40,6 +40,7 @@ public:
...
@@ -40,6 +40,7 @@ public:
//Getter
//Getter
QModelIndex
mapToSource
(
const
QModelIndex
&
idx
)
const
;
QModelIndex
mapToSource
(
const
QModelIndex
&
idx
)
const
;
QModelIndex
mapFromSource
(
const
QModelIndex
&
idx
)
const
;
private:
private:
...
...
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