equal
deleted
inserted
replaced
1 /**************************************************************************** |
1 /**************************************************************************** |
2 ** |
2 ** |
3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). |
3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
4 ** All rights reserved. |
4 ** All rights reserved. |
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
6 ** |
6 ** |
7 ** This file is part of the Qt Assistant of the Qt Toolkit. |
7 ** This file is part of the Qt Assistant of the Qt Toolkit. |
8 ** |
8 ** |
513 } |
513 } |
514 |
514 |
515 QString QHelpDBReader::mergeList(const QStringList &list) const |
515 QString QHelpDBReader::mergeList(const QStringList &list) const |
516 { |
516 { |
517 QString str; |
517 QString str; |
518 foreach (QString s, list) |
518 foreach (const QString &s, list) |
519 str.append(QLatin1Char('\'') + quote(s) + QLatin1String("\', ")); |
519 str.append(QLatin1Char('\'') + quote(s) + QLatin1String("\', ")); |
520 if (str.endsWith(QLatin1String(", "))) |
520 if (str.endsWith(QLatin1String(", "))) |
521 str = str.left(str.length()-2); |
521 str = str.left(str.length()-2); |
522 return str; |
522 return str; |
523 } |
523 } |
565 return true; |
565 return true; |
566 } |
566 } |
567 |
567 |
568 bool needUpdate = !m_viewAttributes.count(); |
568 bool needUpdate = !m_viewAttributes.count(); |
569 |
569 |
570 foreach (QString s, attributes) |
570 foreach (const QString &s, attributes) |
571 m_viewAttributes.remove(s); |
571 m_viewAttributes.remove(s); |
572 |
572 |
573 if (m_viewAttributes.count() || needUpdate) { |
573 if (m_viewAttributes.count() || needUpdate) { |
574 m_viewAttributes.clear(); |
574 m_viewAttributes.clear(); |
575 m_indicesCache = indexIds; |
575 m_indicesCache = indexIds; |
576 } |
576 } |
577 foreach (QString s, attributes) |
577 foreach (const QString &s, attributes) |
578 m_viewAttributes.insert(s); |
578 m_viewAttributes.insert(s); |
579 m_useAttributesCache = true; |
579 m_useAttributesCache = true; |
580 return true; |
580 return true; |
581 } |
581 } |
582 |
582 |