Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
Vivy
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Wiki
Wiki externe
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Compilation
Pipelines
Jobs
Planifications de pipeline
Artéfacts
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
Elliu
Vivy
Validations
767f234e
Vérifiée
Valider
767f234e
rédigé
3 years ago
par
Kubat
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
UI: Fix the PropertyModel::Item creation for "ordered QJsonObjects"
parent
07d11cac
Aucune branche associée trouvée
Branches contenant la validation
Aucune étiquette associée trouvée
1 requête de fusion
!18
Implement the VivyDocument specification
Modifications
2
Masquer les modifications d'espaces
En ligne
Côte à côte
Affichage de
2 fichiers modifiés
src/UI/PropertyModel.cc
+8
-7
8 ajouts, 7 suppressions
src/UI/PropertyModel.cc
src/UI/PropertyModel.hh
+1
-1
1 ajout, 1 suppression
src/UI/PropertyModel.hh
avec
9 ajouts
et
8 suppressions
src/UI/PropertyModel.cc
+
8
−
7
Voir le fichier @
767f234e
...
@@ -107,13 +107,12 @@ PropertyModel::Item::createChild(Item *root, QJsonObject::ConstIterator const &i
...
@@ -107,13 +107,12 @@ PropertyModel::Item::createChild(Item *root, QJsonObject::ConstIterator const &i
}
}
PropertyModel
::
Item
*
PropertyModel
::
Item
*
PropertyModel
::
Item
::
createChild
(
Item
*
root
,
QJson
Array
const
&
singleElem
Array
)
noexcept
PropertyModel
::
Item
::
createChild
(
Item
*
root
,
QJson
Object
const
&
singleElem
)
noexcept
{
{
Q_ASSERT
(
singleElem
Array
.
count
()
==
1
);
Q_ASSERT
(
singleElem
.
count
()
==
1
);
const
QJsonValue
v
=
singleElemArray
.
at
(
0
);
const
QString
key
=
singleElem
.
keys
().
at
(
0
);
const
QString
key
=
v
.
toObject
().
keys
().
at
(
0
);
const
QJsonValue
val
=
singleElem
.
value
(
key
);
const
QJsonValue
val
=
v
.
toObject
().
value
(
key
);
Item
*
child
=
fromJson
(
val
,
root
);
Item
*
child
=
fromJson
(
val
,
root
);
child
->
setKey
(
key
);
child
->
setKey
(
key
);
...
@@ -144,8 +143,10 @@ PropertyModel::Item::fromJson(const QJsonValue &value, PropertyModel::Item *pare
...
@@ -144,8 +143,10 @@ PropertyModel::Item::fromJson(const QJsonValue &value, PropertyModel::Item *pare
root
->
appendChild
(
createChild
(
root
,
it
));
root
->
appendChild
(
createChild
(
root
,
it
));
}
}
else
if
(
isOrderedJsonObject
(
value
))
else
if
(
isOrderedJsonObject
(
value
))
{
root
->
appendChild
(
createChild
(
root
,
value
.
toArray
()));
for
(
const
QJsonValue
v
:
value
.
toArray
())
root
->
appendChild
(
createChild
(
root
,
v
.
toObject
()));
}
else
if
(
value
.
isArray
())
{
else
if
(
value
.
isArray
())
{
for
(
int
index
=
0
;
const
QJsonValue
v
:
value
.
toArray
())
{
for
(
int
index
=
0
;
const
QJsonValue
v
:
value
.
toArray
())
{
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
src/UI/PropertyModel.hh
+
1
−
1
Voir le fichier @
767f234e
...
@@ -46,7 +46,7 @@ private:
...
@@ -46,7 +46,7 @@ private:
private:
private:
static
bool
isOrderedJsonObject
(
QJsonValue
const
&
)
noexcept
;
static
bool
isOrderedJsonObject
(
QJsonValue
const
&
)
noexcept
;
static
Item
*
createChild
(
Item
*
root
,
QJsonObject
::
ConstIterator
const
&
)
noexcept
;
static
Item
*
createChild
(
Item
*
root
,
QJsonObject
::
ConstIterator
const
&
)
noexcept
;
static
Item
*
createChild
(
Item
*
root
,
QJson
Array
const
&
)
noexcept
;
static
Item
*
createChild
(
Item
*
root
,
QJson
Object
const
&
)
noexcept
;
static
Item
*
createChild
(
Item
*
root
,
int
pos
,
QJsonValue
const
&
)
noexcept
;
static
Item
*
createChild
(
Item
*
root
,
int
pos
,
QJsonValue
const
&
)
noexcept
;
QString
key
{};
QString
key
{};
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter