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

« back to all changes in this revision

Viewing changes to src/privacy/privacylist.cpp

  • 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:
17
17
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
18
 *
19
19
 */
20
 
 
 
20
 
21
21
#include <QDomElement>
22
22
#include <QString>
23
23
#include <QStringList>
27
27
 
28
28
#define ORDER_INCREMENT 10
29
29
 
30
 
PrivacyList::PrivacyList(const QString& name, const QList<PrivacyListItem>& items) : name_(name), items_(items) 
31
 
 
30
PrivacyList::PrivacyList(const QString& name, const QList<PrivacyListItem>& items) : name_(name), items_(items)
 
31
{
32
32
        qSort(items_);
33
33
};
34
34
 
37
37
        fromXml(e);
38
38
}
39
39
 
40
 
void PrivacyList::updateItem(int index, const PrivacyListItem& item) 
 
40
void PrivacyList::updateItem(int index, const PrivacyListItem& item)
41
41
{
42
42
        unsigned int order = items_[index].order();
43
43
        items_[index] = item;
44
44
        items_[index].setOrder(order);
45
45
}
46
46
 
47
 
void PrivacyList::insertItem(int index, const PrivacyListItem& item) 
48
 
49
 
        items_.insert(index,item); 
 
47
void PrivacyList::insertItem(int index, const PrivacyListItem& item)
 
48
{
 
49
        items_.insert(index,item);
50
50
 
51
51
        reNumber();
52
52
}
57
57
}
58
58
 
59
59
 
60
 
void PrivacyList::reNumber() 
 
60
void PrivacyList::reNumber()
61
61
{
62
62
        unsigned int order = 100;
63
63
        for (int i = 0; i < items_.size(); ++i) {
113
113
                        fallThrough = true;
114
114
                }
115
115
                else if ((*it).isBlock()) {
116
 
                        if (fallThrough) 
 
116
                        if (fallThrough)
117
117
                                allBlocked = false;
118
118
                }
119
119
                else {
126
126
QDomElement PrivacyList::toXml(QDomDocument& doc) const
127
127
{
128
128
        QDomElement list = doc.createElement("list");
129
 
        list.setAttribute("name",name()); 
130
 
        
 
129
        list.setAttribute("name",name());
 
130
 
131
131
        for (QList<PrivacyListItem>::ConstIterator it = items_.begin() ; it != items_.end(); it++) {
132
132
                list.appendChild((*it).toXml(doc));
133
133
        }