diff options
8 files changed, 5 insertions, 36 deletions
diff --git a/src/imports/location/declarativeplaces/qdeclarativecategory.cpp b/src/imports/location/declarativeplaces/qdeclarativecategory.cpp index 100b1b7b..f65ef252 100644 --- a/src/imports/location/declarativeplaces/qdeclarativecategory.cpp +++ b/src/imports/location/declarativeplaces/qdeclarativecategory.cpp @@ -108,16 +108,6 @@ QString QDeclarativeCategory::name() const } /*! - \qmlfunction bool Category::isEmpty - - Returns true if category is valid. -*/ -bool QDeclarativeCategory::isEmpty() const -{ - return m_category.isEmpty(); -} - -/*! \qmlproperty QVariantHash Address::alternativeAttributes This property alternative values for label property. diff --git a/src/imports/location/declarativeplaces/qdeclarativecategory_p.h b/src/imports/location/declarativeplaces/qdeclarativecategory_p.h index b05c3654..d40da1fb 100644 --- a/src/imports/location/declarativeplaces/qdeclarativecategory_p.h +++ b/src/imports/location/declarativeplaces/qdeclarativecategory_p.h @@ -40,8 +40,6 @@ public: QString name() const; void setName(const QString &name); - Q_INVOKABLE bool isEmpty() const; - signals: void categoryIdChanged(); void descriptionChanged(); diff --git a/src/location/places/qplacecategory.cpp b/src/location/places/qplacecategory.cpp index 504de616..6ffcb4bd 100644 --- a/src/location/places/qplacecategory.cpp +++ b/src/location/places/qplacecategory.cpp @@ -188,11 +188,3 @@ void QPlaceCategory::setName(const QString &name) { d->name = name; } - -/*! - Returns true if category is empty. -*/ -bool QPlaceCategory::isEmpty() const -{ - return d->categoryId.isEmpty(); -} diff --git a/src/location/places/qplacecategory.h b/src/location/places/qplacecategory.h index e3ee321f..0059d61a 100644 --- a/src/location/places/qplacecategory.h +++ b/src/location/places/qplacecategory.h @@ -77,7 +77,6 @@ public: QString name() const; void setName(const QString &name); - bool isEmpty() const; private: QSharedDataPointer<QPlaceCategoryPrivate> d; }; diff --git a/src/location/places/qplacesearchquery.cpp b/src/location/places/qplacesearchquery.cpp index cd8693da..bf4989e0 100644 --- a/src/location/places/qplacesearchquery.cpp +++ b/src/location/places/qplacesearchquery.cpp @@ -192,8 +192,7 @@ QList<QPlaceCategory> QPlaceSearchQuery::categories() const void QPlaceSearchQuery::setCategory(const QPlaceCategory &category) { d->categories.clear(); - if (!category.isEmpty()) - d->categories.append(category); + d->categories.append(category); } /*! diff --git a/src/plugins/places/nokia/qplacejsoncategoriesparser.cpp b/src/plugins/places/nokia/qplacejsoncategoriesparser.cpp index 8a32e3ab..33f9be4e 100644 --- a/src/plugins/places/nokia/qplacejsoncategoriesparser.cpp +++ b/src/plugins/places/nokia/qplacejsoncategoriesparser.cpp @@ -112,14 +112,14 @@ QList<QPlaceCategory> QPlaceJSonCategoriesParser::processCategories(const QScrip // array contains count as last element if (it.name() != "length") { cat = processCategory(it.value()); - if (!cat.isEmpty() && !results.contains(cat.categoryId())) { + if (!cat.categoryId().isEmpty() && !results.contains(cat.categoryId())) { results.insert(cat.categoryId(), cat); } } } } else { cat = processCategory(value); - if (!cat.isEmpty() && !results.contains(cat.categoryId())) { + if (!cat.categoryId().isEmpty() && !results.contains(cat.categoryId())) { results.insert(cat.categoryId(), cat); } } @@ -177,7 +177,7 @@ QList<QPlaceCategory> QPlaceJSonCategoriesParser::processGroup(const QScriptValu if (value.isValid()) { parentCategory = processCategory(value); } - if (!parentCategory.isEmpty()) { + if (!parentCategory.categoryId().isEmpty()) { results = processCategories(group); results.append(parentCategory); } diff --git a/src/plugins/places/nokia/qplacejsonsearchparser.cpp b/src/plugins/places/nokia/qplacejsonsearchparser.cpp index f37f57c4..3b210390 100644 --- a/src/plugins/places/nokia/qplacejsonsearchparser.cpp +++ b/src/plugins/places/nokia/qplacejsonsearchparser.cpp @@ -258,7 +258,7 @@ void QPlaceJSonSearchParser::processCategories(const QScriptValue &categories, Q if (value.isValid() && !value.toString().isEmpty()) { QPlaceCategory category = QPlaceCategoriesRepository::instance()->mapCategory( value.toString()); - if (!category.isEmpty()) { + if (!category.categoryId().isEmpty()) { categoriesList.append(category); } } diff --git a/tests/auto/qplacecategory/tst_qplacecategory.cpp b/tests/auto/qplacecategory/tst_qplacecategory.cpp index f8e49f95..6c9c7f10 100644 --- a/tests/auto/qplacecategory/tst_qplacecategory.cpp +++ b/tests/auto/qplacecategory/tst_qplacecategory.cpp @@ -18,7 +18,6 @@ private Q_SLOTS: void categoryIdTest(); void descriptionTest(); void nameTest(); - void isEmptyTest(); void operatorsTest(); }; @@ -77,14 +76,6 @@ void tst_QPlaceCategory::nameTest() QVERIFY2(testObj.name() == "testText", "Wrong value returned"); } -void tst_QPlaceCategory::isEmptyTest() -{ - QPlaceCategory testObj; - QVERIFY2(testObj.isEmpty() == true, "Wrong default value"); - testObj.setCategoryId("testText"); - QVERIFY2(testObj.isEmpty() == false, "Wrong value returned"); -} - void tst_QPlaceCategory::operatorsTest() { QPlaceCategory testObj; |