~ubuntu-branches/debian/stretch/psi-plus/stretch

« back to all changes in this revision

Viewing changes to src/tools/optionstree/varianttree.h

  • Committer: Package Import Robot
  • Author(s): Boris Pek
  • Date: 2013-10-23 02:42:20 UTC
  • mfrom: (1.4.7)
  • Revision ID: package-import@ubuntu.com-20131023024220-bk2hyoenqkwfhpgw
Tags: 0.16.242-1
* New upstream release:
  fixed the problem of initialization of private conversation when both
  sides use libotr 4.0.x. (Closes: #724880)
* Update debian/watch: sources were moved.
* Delete psi-plus-content-downloader package and update all related files.
  This plugin is in psi-plus-plugins package now.
* Update debian/control:
  - remove all currently unneeded Replaces and Breaks fields
  - add build dependency on libidn11-dev
* Update debian/rules: simplify get-orig-source section.
* Update debian/copyright:
  - update Source field due to changes in sources location
  - remove copyright holders whose code was deleted from source tree
    (bundled libidn library was removed)

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
/**
34
34
 * \class VariantTree
35
35
 * \brief A recursive structure for storing QVariants in trees, with comments
36
 
 * 
37
 
 * All the methods in this class are recursive, based on a hierachy delimited 
38
 
 * with dots in the node name. As such, the nodes "Paris" and "Benvolio" are 
39
 
 * top level elements (members of this layer), while "Capulet.Juliet" is a 
40
 
 * member of a deeper node ("Capulet") and "Verona.Montague.Romeo" represents 
 
36
 *
 
37
 * All the methods in this class are recursive, based on a hierachy delimited
 
38
 * with dots in the node name. As such, the nodes "Paris" and "Benvolio" are
 
39
 * top level elements (members of this layer), while "Capulet.Juliet" is a
 
40
 * member of a deeper node ("Capulet") and "Verona.Montague.Romeo" represents
41
41
 * the node "Romeo" which is a member of "Montague", which is again a member
42
42
 * of "Verona" (which is a member of this layer).
43
 
 * 
44
 
 * As such, for each function, if the supplied node contains a dot ("."), 
45
 
 * the node name is split at the first (if there are several) dot, with the 
46
 
 * remainder passed to the same method of the member of this node with the 
 
43
 *
 
44
 * As such, for each function, if the supplied node contains a dot ("."),
 
45
 * the node name is split at the first (if there are several) dot, with the
 
46
 * remainder passed to the same method of the member of this node with the
47
47
 * name given by the primary component. For the set methods, multiple layers
48
48
 * in the hierachy may be created implicitly if the node is not found.
49
49
 */
56
56
 
57
57
        void setValue(QString node, QVariant value);
58
58
        QVariant getValue(const QString& node) const;
59
 
        
 
59
 
60
60
        bool isInternalNode(QString node) const;
61
61
 
62
62
        void setComment(QString node, QString comment);
63
63
        QString getComment(QString node) const;
64
64
 
65
65
        bool remove(const QString &node, bool internal_nodes = false);
66
 
        
67
 
        QStringList nodeChildren(const QString& node = "", bool direct = false, bool internal_nodes = false) const; 
 
66
 
 
67
        QStringList nodeChildren(const QString& node = "", bool direct = false, bool internal_nodes = false) const;
68
68
 
69
69
        void toXml(QDomDocument &doc, QDomElement& ele) const;
70
70
        void fromXml(const QDomElement &ele);
71
71
 
72
72
        static bool isValidNodeName(const QString &name);
73
 
        
 
73
 
74
74
        static const QVariant missingValue;
75
75
        static const QString missingComment;
76
76
 
77
77
protected:
78
78
        static QVariant elementToVariant(const QDomElement&);
79
79
        static void variantToElement(const QVariant&, QDomElement&);
80
 
        
 
80
 
81
81
        static bool getKeyRest(const QString& node, QString &key, QString &rest);
82
82
 
83
83
private:
86
86
        QHash<QString, QString> comments_;
87
87
        QHash<QString, QDomDocumentFragment> unknowns_;         // unknown types preservation
88
88
        QHash<QString, QString> unknowns2_;             // unknown types preservation
89
 
        
 
89
 
90
90
        // needed to have a document for the fragments.
91
91
        static QDomDocument *unknownsDoc;
92
92
        friend class OptionsTreeReader;