[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [tellico/frameworks] src: Remove usage of KSharedPtr
From:       Robby Stephenson <robby () periapsis ! org>
Date:       2015-05-01 1:57:03
Message-ID: E1Yo0CN-0005S8-FR () scm ! kde ! org
[Download RAW message or body]

Git commit 97c4c085c7f63bddd05c69c14433d4fe2633c44f by Robby Stephenson.
Committed on 30/04/2015 at 18:13.
Pushed by rstephenson into branch 'frameworks'.

Remove usage of KSharedPtr

M  +2    -3    src/borrower.h
M  +0    -2    src/collection.h
M  +1    -2    src/collections/CMakeLists.txt
M  +6    -7    src/datavectors.h
M  +1    -1    src/document.cpp
M  +2    -3    src/fetch/z3950connection.h
M  +0    -2    src/filter.h
M  +3    -3    src/mainwindow.cpp
M  +3    -3    src/models/entrysortmodel.cpp
M  +2    -2    src/tests/adstest.cpp
M  +2    -2    src/tests/alexandriatest.cpp
M  +1    -1    src/tests/amctest.cpp
M  +2    -2    src/tests/bibtexmltest.cpp
M  +2    -2    src/tests/bibtextest.cpp
M  +3    -3    src/tests/ciwtest.cpp
M  +1    -1    src/tests/collectiontest.cpp
M  +16   -16   src/tests/delicioustest.cpp
M  +38   -38   src/tests/gcstartest.cpp
M  +2    -2    src/tests/griffithtest.cpp
M  +2    -2    src/tests/referencertest.cpp
M  +2    -2    src/tests/ristest.cpp
M  +11   -11   src/tests/tellicoreadtest.cpp
M  +2    -2    src/tests/vinoxmltest.cpp

http://commits.kde.org/tellico/97c4c085c7f63bddd05c69c14433d4fe2633c44f

diff --git a/src/borrower.h b/src/borrower.h
index a2645a2..1f3e30a 100644
--- a/src/borrower.h
+++ b/src/borrower.h
@@ -28,10 +28,9 @@
 #include "datavectors.h"
 #include "entry.h"
 
-#include <ksharedptr.h>
-
 #include <QDate>
 #include <QString>
+#include <QExplicitlySharedDataPointer>
 
 namespace Tellico {
   namespace Data {
@@ -73,7 +72,7 @@ private:
   bool m_inCalendar;
 };
 
-typedef KSharedPtr<Loan> LoanPtr;
+typedef QExplicitlySharedDataPointer<Loan> LoanPtr;
 typedef QList<LoanPtr> LoanList;
 
 /**
diff --git a/src/collection.h b/src/collection.h
index 2ea8c87..56372bd 100644
--- a/src/collection.h
+++ b/src/collection.h
@@ -31,8 +31,6 @@
 #include "borrower.h"
 #include "datavectors.h"
 
-#include <ksharedptr.h>
-
 #include <QStringList>
 #include <QHash>
 #include <QObject>
diff --git a/src/collections/CMakeLists.txt b/src/collections/CMakeLists.txt
index a6b2b50..c68ee7d 100644
--- a/src/collections/CMakeLists.txt
+++ b/src/collections/CMakeLists.txt
@@ -20,5 +20,4 @@ SET(collections_STAT_SRCS
 add_library(collections STATIC ${collections_STAT_SRCS})
 
 # bibtexcollection depends on utils/bibtexhandler
-# they all depend on ksharedptr in KDELibs4Support for the moment
-TARGET_LINK_LIBRARIES(collections utils Qt5::Core KF5::KDELibs4Support)
+TARGET_LINK_LIBRARIES(collections utils Qt5::Core)
diff --git a/src/datavectors.h b/src/datavectors.h
index 7546d6f..567fdd1 100644
--- a/src/datavectors.h
+++ b/src/datavectors.h
@@ -31,15 +31,14 @@
 #include <QHash>
 #include <QPair>
 #include <QMetaType>
-
-#include <ksharedptr.h>
+#include <QExplicitlySharedDataPointer>
 
 namespace Tellico {
   typedef QMap<QString, QString> StringMap;
   typedef QHash<QString, QString> StringHash;
 
   class Filter;
-  typedef KSharedPtr<Filter> FilterPtr;
+  typedef QExplicitlySharedDataPointer<Filter> FilterPtr;
   typedef QList<FilterPtr> FilterList;
 
   namespace Data {
@@ -47,15 +46,15 @@ namespace Tellico {
     typedef int ID;
 
     class Collection;
-    typedef KSharedPtr<Collection> CollPtr;
+    typedef QExplicitlySharedDataPointer<Collection> CollPtr;
     typedef QList<CollPtr> CollList;
 
     class Field;
-    typedef KSharedPtr<Field> FieldPtr;
+    typedef QExplicitlySharedDataPointer<Field> FieldPtr;
     typedef QList<FieldPtr> FieldList;
 
     class Entry;
-    typedef KSharedPtr<Entry> EntryPtr;
+    typedef QExplicitlySharedDataPointer<Entry> EntryPtr;
     typedef QList<EntryPtr> EntryList;
 
     // complicated, I know
@@ -66,7 +65,7 @@ namespace Tellico {
     typedef QPair<Data::EntryList, PairVector> MergePair;
 
     class Borrower;
-    typedef KSharedPtr<Borrower> BorrowerPtr;
+    typedef QExplicitlySharedDataPointer<Borrower> BorrowerPtr;
     typedef QList<BorrowerPtr> BorrowerList;
   }
 }
diff --git a/src/document.cpp b/src/document.cpp
index 7c7ca1b..d6e5697 100644
--- a/src/document.cpp
+++ b/src/document.cpp
@@ -262,7 +262,7 @@ void Document::deleteContents() {
   if(m_coll) {
     m_coll->clear();
   }
-  m_coll = 0; // old collection gets deleted as a KSharedPtr
+  m_coll = 0; // old collection gets deleted as refcount goes to 0
   m_cancelImageWriting = true;
 }
 
diff --git a/src/fetch/z3950connection.h b/src/fetch/z3950connection.h
index 21a115e..4dc01d1 100644
--- a/src/fetch/z3950connection.h
+++ b/src/fetch/z3950connection.h
@@ -25,10 +25,9 @@
 #ifndef TELLICO_FETCH_Z3950CONNECTION_H
 #define TELLICO_FETCH_Z3950CONNECTION_H
 
-#include <ksharedptr.h>
-
 #include <QThread>
 #include <QEvent>
+#include <QExplicitlySharedDataPointer>
 
 namespace Tellico {
   namespace Fetch {
@@ -112,7 +111,7 @@ private:
   bool m_connected;
   bool m_aborted;
 
-  KSharedPtr<Z3950Fetcher> m_fetcher;
+  QExplicitlySharedDataPointer<Z3950Fetcher> m_fetcher;
   QString m_host;
   uint m_port;
   QString m_dbname;
diff --git a/src/filter.h b/src/filter.h
index b357f91..7ddd886 100644
--- a/src/filter.h
+++ b/src/filter.h
@@ -27,8 +27,6 @@
 
 #include "datavectors.h"
 
-#include <ksharedptr.h>
-
 #include <QList>
 #include <QString>
 #include <QVariant>
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 9b2c66b..c3c7c7b 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -1651,9 +1651,9 @@ void MainWindow::slotUpdateFilter(FilterPtr filter_) {
 
 void MainWindow::setFilter(const QString& text_) {
   QString text = text_.trimmed();
-  FilterPtr filter(0);
+  FilterPtr filter;
   if(!text.isEmpty()) {
-    filter.attach(new Filter(Filter::MatchAll));
+    filter = new Filter(Filter::MatchAll);
     QString fieldName; // empty field name means match on any field
     // if the text contains '=' assume it's a field name or title
     if(text.indexOf(QLatin1Char('=')) > -1) {
@@ -1693,7 +1693,7 @@ void MainWindow::setFilter(const QString& text_) {
     }
   }
   // only update filter if one exists or did exist
-  if(!filter.isNull() || m_detailedView->filter()) {
+  if(filter || m_detailedView->filter()) {
     Controller::self()->slotUpdateFilter(filter);
   }
 }
diff --git a/src/models/entrysortmodel.cpp b/src/models/entrysortmodel.cpp
index 94002b8..2bba6c4 100644
--- a/src/models/entrysortmodel.cpp
+++ b/src/models/entrysortmodel.cpp
@@ -64,13 +64,13 @@ bool EntrySortModel::lessThan(const QModelIndex& left_, const \
QModelIndex& right  }
   Data::EntryPtr leftEntry = left_.data(EntryPtrRole).value<Data::EntryPtr>();
   Data::EntryPtr rightEntry = right_.data(EntryPtrRole).value<Data::EntryPtr>();
-  if(leftEntry.isNull()) {
-    if(!rightEntry.isNull()) {
+  if(!leftEntry) {
+    if(rightEntry) {
       return true;
     } else {
       return false;
     }
-  } else if(!leftEntry.isNull() && rightEntry.isNull()) {
+  } else if(leftEntry && !rightEntry) {
     return false;
   }
 
diff --git a/src/tests/adstest.cpp b/src/tests/adstest.cpp
index 6c69ff3..9c80ca2 100644
--- a/src/tests/adstest.cpp
+++ b/src/tests/adstest.cpp
@@ -41,13 +41,13 @@ void AdsTest::testImport() {
   Tellico::Import::ADSImporter importer(urls);
   Tellico::Data::CollPtr coll = importer.collection();
 
-  QVERIFY(!coll.isNull());
+  QVERIFY(coll);
   QCOMPARE(coll->type(), Tellico::Data::Collection::Bibtex);
   QCOMPARE(coll->entryCount(), 1);
   QCOMPARE(coll->title(), QLatin1String("Bibliography"));
 
   Tellico::Data::EntryPtr entry = coll->entryById(1);
-  QVERIFY(!entry.isNull());
+  QVERIFY(entry);
   QCOMPARE(entry->field("title"), QLatin1String("Distant clusters of galaxies \
detected by X-rays"));  QCOMPARE(entry->field("entry-type"), \
QLatin1String("article"));  QCOMPARE(entry->field("year"), QLatin1String("1993"));
diff --git a/src/tests/alexandriatest.cpp b/src/tests/alexandriatest.cpp
index d9f0a90..f59fbb7 100644
--- a/src/tests/alexandriatest.cpp
+++ b/src/tests/alexandriatest.cpp
@@ -52,7 +52,7 @@ void AlexandriaTest::testImport() {
 
   Tellico::Data::CollPtr coll = importer.collection();
 
-  QVERIFY(!coll.isNull());
+  QVERIFY(coll);
   QCOMPARE(coll->type(), Tellico::Data::Collection::Book);
   QCOMPARE(coll->entryCount(), 2);
   // should be translated somehow
@@ -85,7 +85,7 @@ void AlexandriaTest::testImport() {
   importer.setLibraryPath(outputDir.path() + "/.alexandria/" + coll->title());
   Tellico::Data::CollPtr coll2 = importer.collection();
 
-  QVERIFY(!coll2.isNull());
+  QVERIFY(coll2);
   QCOMPARE(coll2->type(), coll->type());
   QCOMPARE(coll2->title(), coll->title());
   QCOMPARE(coll2->entryCount(), coll->entryCount());
diff --git a/src/tests/amctest.cpp b/src/tests/amctest.cpp
index 123575f..3c66ab2 100644
--- a/src/tests/amctest.cpp
+++ b/src/tests/amctest.cpp
@@ -39,7 +39,7 @@ void AmcTest::testImport() {
   Tellico::Import::AMCImporter importer(url);
   Tellico::Data::CollPtr coll = importer.collection();
 
-  QVERIFY(!coll.isNull());
+  QVERIFY(coll);
   QCOMPARE(coll->entryCount(), 2);
 
   Tellico::Data::EntryPtr entry = coll->entryById(2);
diff --git a/src/tests/bibtexmltest.cpp b/src/tests/bibtexmltest.cpp
index 1014d9c..c5876d5 100644
--- a/src/tests/bibtexmltest.cpp
+++ b/src/tests/bibtexmltest.cpp
@@ -46,7 +46,7 @@ void BibtexmlTest::testImport() {
 
   Tellico::Data::CollPtr coll = importer.collection();
 
-  QVERIFY(!coll.isNull());
+  QVERIFY(coll);
   QCOMPARE(coll->type(), Tellico::Data::Collection::Bibtex);
   QCOMPARE(coll->entryCount(), 2);
 
@@ -63,7 +63,7 @@ void BibtexmlTest::testImport() {
   Tellico::Data::CollPtr coll2 = importer2.collection();
   Tellico::Data::BibtexCollection* bColl2 = \
static_cast<Tellico::Data::BibtexCollection*>(coll2.data());  
-  QVERIFY(!coll2.isNull());
+  QVERIFY(coll2);
   QCOMPARE(coll2->type(), coll->type());
   QCOMPARE(coll2->entryCount(), coll->entryCount());
 
diff --git a/src/tests/bibtextest.cpp b/src/tests/bibtextest.cpp
index 6c3c3cf..0b52150 100644
--- a/src/tests/bibtextest.cpp
+++ b/src/tests/bibtextest.cpp
@@ -60,7 +60,7 @@ void BibtexTest::testImport() {
   Tellico::Data::CollPtr coll = importer.collection();
   Tellico::Data::BibtexCollection* bColl = \
static_cast<Tellico::Data::BibtexCollection*>(coll.data());  
-  QVERIFY(!coll.isNull());
+  QVERIFY(coll);
   QCOMPARE(coll->type(), Tellico::Data::Collection::Bibtex);
   QCOMPARE(coll->entryCount(), 36);
   QVERIFY(coll->hasField(QLatin1String("issn")));
@@ -87,7 +87,7 @@ void BibtexTest::testImport() {
   Tellico::Data::CollPtr coll2 = importer2.collection();
   Tellico::Data::BibtexCollection* bColl2 = \
static_cast<Tellico::Data::BibtexCollection*>(coll2.data());  
-  QVERIFY(!coll2.isNull());
+  QVERIFY(coll2);
   QCOMPARE(coll2->type(), coll->type());
   QCOMPARE(coll2->entryCount(), coll->entryCount());
 
diff --git a/src/tests/ciwtest.cpp b/src/tests/ciwtest.cpp
index ad4c183..3627936 100644
--- a/src/tests/ciwtest.cpp
+++ b/src/tests/ciwtest.cpp
@@ -41,13 +41,13 @@ void CiwTest::testImport() {
   Tellico::Import::CIWImporter importer(urls);
   Tellico::Data::CollPtr coll = importer.collection();
 
-  QVERIFY(!coll.isNull());
+  QVERIFY(coll);
   QCOMPARE(coll->type(), Tellico::Data::Collection::Bibtex);
   QCOMPARE(coll->entryCount(), 6);
   QCOMPARE(coll->title(), QLatin1String("Bibliography"));
 
   Tellico::Data::EntryPtr entry = coll->entryById(3);
-  QVERIFY(!entry.isNull());
+  QVERIFY(entry);
   QCOMPARE(entry->field("entry-type"), QLatin1String("article"));
   QCOMPARE(entry->field("title"), QLatin1String("Key Process Conditions for \
                Production of C(4) Dicarboxylic Acids in "
                                                 "Bioreactor Batch Cultures of an \
Engineered Saccharomyces cerevisiae Strain")); @@ -61,7 +61,7 @@ void \
CiwTest::testImport() {  QVERIFY(!entry->field("abstract").isEmpty());
 
   entry = coll->entryById(6);
-  QVERIFY(!entry.isNull());
+  QVERIFY(entry);
   QCOMPARE(entry->field("entry-type"), QLatin1String("article"));
   QCOMPARE(entry->field("title"), QLatin1String("Prematurity: An Overview and Public \
Health Implications"));  QCOMPARE(entry->field("booktitle"), QLatin1String("ANNUAL \
                REVIEW OF PUBLIC HEALTH, VOL 32"));
diff --git a/src/tests/collectiontest.cpp b/src/tests/collectiontest.cpp
index 8ef7e4a..789f53d 100644
--- a/src/tests/collectiontest.cpp
+++ b/src/tests/collectiontest.cpp
@@ -67,7 +67,7 @@ void CollectionTest::initTestCase() {
 
 void CollectionTest::testEmpty() {
   Tellico::Data::CollPtr nullColl;
-  QVERIFY(nullColl.isNull());
+  QVERIFY(!nullColl);
 
   Tellico::Data::Collection coll(false, QLatin1String("Title"));
 
diff --git a/src/tests/delicioustest.cpp b/src/tests/delicioustest.cpp
index be6e2df..db57ac4 100644
--- a/src/tests/delicioustest.cpp
+++ b/src/tests/delicioustest.cpp
@@ -57,12 +57,12 @@ void DeliciousTest::testBooks1() {
   Tellico::Import::DeliciousImporter importer(url);
   Tellico::Data::CollPtr coll = importer.collection();
 
-  QVERIFY(!coll.isNull());
+  QVERIFY(coll);
   QCOMPARE(coll->type(), Tellico::Data::Collection::Book);
   QCOMPARE(coll->entryCount(), 5);
 
   Tellico::Data::EntryPtr entry = coll->entryById(1);
-  QVERIFY(!entry.isNull());
+  QVERIFY(entry);
   QCOMPARE(entry->field("title"), QLatin1String("Lost in Translation"));
   QCOMPARE(entry->field("pub_year"), QLatin1String("1998"));
   QCOMPARE(entry->field("author"), QLatin1String("Nicole Mones; Robby Stephenson"));
@@ -82,12 +82,12 @@ void DeliciousTest::testBooks2() {
   Tellico::Import::DeliciousImporter importer(url);
   Tellico::Data::CollPtr coll = importer.collection();
 
-  QVERIFY(!coll.isNull());
+  QVERIFY(coll);
   QCOMPARE(coll->type(), Tellico::Data::Collection::Book);
   QCOMPARE(coll->entryCount(), 7);
 
   Tellico::Data::EntryPtr entry = coll->entryById(1);
-  QVERIFY(!entry.isNull());
+  QVERIFY(entry);
   QCOMPARE(entry->field("title"), QLatin1String("The Restaurant at the End of the \
Universe"));  QCOMPARE(entry->field("isbn"), QLatin1String("0517545357"));
   QCOMPARE(entry->field("cdate"), QLatin1String("2007-12-19"));
@@ -110,13 +110,13 @@ void DeliciousTest::testMovies1() {
   Tellico::Import::DeliciousImporter importer(url);
   Tellico::Data::CollPtr coll = importer.collection();
 
-  QVERIFY(!coll.isNull());
+  QVERIFY(coll);
   QCOMPARE(coll->type(), Tellico::Data::Collection::Video);
   QCOMPARE(coll->entryCount(), 4);
 
   // first a movie
   Tellico::Data::EntryPtr entry = coll->entryById(2);
-  QVERIFY(!entry.isNull());
+  QVERIFY(entry);
   QCOMPARE(entry->field("title"), QLatin1String("Driving Miss Daisy"));
   QCOMPARE(entry->field("year"), QLatin1String("1990"));
   QCOMPARE(entry->field("nationality"), QLatin1String("USA"));
@@ -139,7 +139,7 @@ void DeliciousTest::testMovies1() {
 
   // check the TV show, too
   entry = coll->entryById(4);
-  QVERIFY(!entry.isNull());
+  QVERIFY(entry);
   QCOMPARE(entry->field("title"), QLatin1String("South Park - The Complete Sixth \
Season"));  QCOMPARE(entry->field("year"), QLatin1String("1997"));
   QCOMPARE(entry->field("nationality"), QLatin1String("USA"));
@@ -162,12 +162,12 @@ void DeliciousTest::testMovies2() {
   Tellico::Import::DeliciousImporter importer(url);
   Tellico::Data::CollPtr coll = importer.collection();
 
-  QVERIFY(!coll.isNull());
+  QVERIFY(coll);
   QCOMPARE(coll->type(), Tellico::Data::Collection::Video);
   QCOMPARE(coll->entryCount(), 4);
 
   Tellico::Data::EntryPtr entry = coll->entryById(2);
-  QVERIFY(!entry.isNull());
+  QVERIFY(entry);
   QCOMPARE(entry->field("title"), QLatin1String("2001 - A Space Odyssey"));
   QCOMPARE(entry->field("certification"), QLatin1String("G (USA)"));
   QCOMPARE(entry->field("nationality"), QLatin1String("USA"));
@@ -186,7 +186,7 @@ void DeliciousTest::testMovies2() {
   QCOMPARE(entry->field("mdate"), QLatin1String("2009-06-11"));
 
   entry = coll->entryById(4);
-  QVERIFY(!entry.isNull());
+  QVERIFY(entry);
   QCOMPARE(entry->field("region"), QLatin1String("Region 1"));
 }
 
@@ -195,13 +195,13 @@ void DeliciousTest::testMusic1() {
   Tellico::Import::DeliciousImporter importer(url);
   Tellico::Data::CollPtr coll = importer.collection();
 
-  QVERIFY(!coll.isNull());
+  QVERIFY(coll);
   QCOMPARE(coll->type(), Tellico::Data::Collection::Album);
   QCOMPARE(coll->entryCount(), 3);
 
   // first a movie
   Tellico::Data::EntryPtr entry = coll->entryById(1);
-  QVERIFY(!entry.isNull());
+  QVERIFY(entry);
   QCOMPARE(entry->field("title"), QLatin1String("Are You Listening?"));
   QCOMPARE(entry->field("artist"), QLatin1String("Dolores O'Riordan"));
   QCOMPARE(entry->field("year"), QLatin1String("2007"));
@@ -219,12 +219,12 @@ void DeliciousTest::testMusic2() {
   Tellico::Import::DeliciousImporter importer(url);
   Tellico::Data::CollPtr coll = importer.collection();
 
-  QVERIFY(!coll.isNull());
+  QVERIFY(coll);
   QCOMPARE(coll->type(), Tellico::Data::Collection::Album);
   QCOMPARE(coll->entryCount(), 3);
 
   Tellico::Data::EntryPtr entry = coll->entryById(2);
-  QVERIFY(!entry.isNull());
+  QVERIFY(entry);
   QCOMPARE(entry->field("title"), QLatin1String("The Ultimate Sin"));
   QCOMPARE(entry->field("artist"), QLatin1String("Ozzy Osbourne"));
   QCOMPARE(entry->field("year"), QLatin1String("1987"));
@@ -241,13 +241,13 @@ void DeliciousTest::testGames1() {
   Tellico::Import::DeliciousImporter importer(url);
   Tellico::Data::CollPtr coll = importer.collection();
 
-  QVERIFY(!coll.isNull());
+  QVERIFY(coll);
   QCOMPARE(coll->type(), Tellico::Data::Collection::Game);
   QCOMPARE(coll->entryCount(), 2);
 
   // first a movie
   Tellico::Data::EntryPtr entry = coll->entryById(1);
-  QVERIFY(!entry.isNull());
+  QVERIFY(entry);
   QCOMPARE(entry->field("title"), QLatin1String("Spider-Man 2: The Movie 2"));
   QCOMPARE(entry->field("certification"), QLatin1String("Teen"));
   QCOMPARE(entry->field("platform"), QLatin1String("GameCube"));
diff --git a/src/tests/gcstartest.cpp b/src/tests/gcstartest.cpp
index 823b70f..a2f3336 100644
--- a/src/tests/gcstartest.cpp
+++ b/src/tests/gcstartest.cpp
@@ -53,14 +53,14 @@ void GCstarTest::testBook() {
   Tellico::Import::GCstarImporter importer(url);
   Tellico::Data::CollPtr coll = importer.collection();
 
-  QVERIFY(!coll.isNull());
+  QVERIFY(coll);
   QCOMPARE(coll->type(), Tellico::Data::Collection::Book);
   QCOMPARE(coll->entryCount(), 2);
   // should be translated somehow
   QCOMPARE(coll->title(), QLatin1String("GCstar Import"));
 
   Tellico::Data::EntryPtr entry = coll->entryById(1);
-  QVERIFY(!entry.isNull());
+  QVERIFY(entry);
   QCOMPARE(entry->field("title"), QLatin1String("The Reason for God"));
   QCOMPARE(entry->field("pub_year"), QLatin1String("2008"));
   QCOMPARE(FIELDS(entry, "author").count(), 2);
@@ -83,7 +83,7 @@ void GCstarTest::testBook() {
   Tellico::Import::GCstarImporter importer2(exporter.text());
   Tellico::Data::CollPtr coll2 = importer2.collection();
 
-  QVERIFY(!coll2.isNull());
+  QVERIFY(coll2);
   QCOMPARE(coll2->type(), coll->type());
   QCOMPARE(coll2->entryCount(), coll->entryCount());
   QCOMPARE(coll2->title(), coll->title());
@@ -105,14 +105,14 @@ void GCstarTest::testComicBook() {
   Tellico::Import::GCstarImporter importer(url);
   Tellico::Data::CollPtr coll = importer.collection();
 
-  QVERIFY(!coll.isNull());
+  QVERIFY(coll);
   QCOMPARE(coll->type(), Tellico::Data::Collection::ComicBook);
   QCOMPARE(coll->entryCount(), 1);
   // should be translated somehow
   QCOMPARE(coll->title(), QLatin1String("GCstar Import"));
 
   Tellico::Data::EntryPtr entry = coll->entryById(1);
-  QVERIFY(!entry.isNull());
+  QVERIFY(entry);
   QCOMPARE(entry->field("title"), QLatin1String("title"));
   QCOMPARE(entry->field("pub_year"), QLatin1String("2010"));
   QCOMPARE(entry->field("series"), QLatin1String("series"));
@@ -141,7 +141,7 @@ void GCstarTest::testComicBook() {
   Tellico::Import::GCstarImporter importer2(exporter.text());
   Tellico::Data::CollPtr coll2 = importer2.collection();
 
-  QVERIFY(!coll2.isNull());
+  QVERIFY(coll2);
   QCOMPARE(coll2->type(), coll->type());
   QCOMPARE(coll2->entryCount(), coll->entryCount());
   QCOMPARE(coll2->title(), coll->title());
@@ -163,12 +163,12 @@ void GCstarTest::testVideo() {
   Tellico::Import::GCstarImporter importer(url);
   Tellico::Data::CollPtr coll = importer.collection();
 
-  QVERIFY(!coll.isNull());
+  QVERIFY(coll);
   QCOMPARE(coll->type(), Tellico::Data::Collection::Video);
   QCOMPARE(coll->entryCount(), 3);
 
   Tellico::Data::EntryPtr entry = coll->entryById(2);
-  QVERIFY(!entry.isNull());
+  QVERIFY(entry);
   QCOMPARE(entry->field("title"), QLatin1String("The Man from Snowy River"));
   QCOMPARE(entry->field("year"), QLatin1String("1982"));
   QCOMPARE(FIELDS(entry, "director").count(), 1);
@@ -191,7 +191,7 @@ void GCstarTest::testVideo() {
   QVERIFY(!entry->field("comments").isEmpty());
 
   entry = coll->entryById(4);
-  QVERIFY(!entry.isNull());
+  QVERIFY(entry);
   castList = Tellico::FieldFormat::splitTable(entry->field("cast"));
   QCOMPARE(castList.count(), 11);
   QCOMPARE(castList.at(0), QLatin1String("Famke Janssen::Marnie Watson"));
@@ -202,7 +202,7 @@ void GCstarTest::testVideo() {
   Tellico::Import::GCstarImporter importer2(exporter.text());
   Tellico::Data::CollPtr coll2 = importer2.collection();
 
-  QVERIFY(!coll2.isNull());
+  QVERIFY(coll2);
   QCOMPARE(coll2->type(), coll->type());
   QCOMPARE(coll2->entryCount(), coll->entryCount());
   QCOMPARE(coll2->title(), coll->title());
@@ -232,12 +232,12 @@ void GCstarTest::testMusic() {
   Tellico::Import::GCstarImporter importer(url);
   Tellico::Data::CollPtr coll = importer.collection();
 
-  QVERIFY(!coll.isNull());
+  QVERIFY(coll);
   QCOMPARE(coll->type(), Tellico::Data::Collection::Album);
   QCOMPARE(coll->entryCount(), 1);
 
   Tellico::Data::EntryPtr entry = coll->entryById(1);
-  QVERIFY(!entry.isNull());
+  QVERIFY(entry);
   QCOMPARE(entry->field("title"), QLatin1String("Lifesong"));
   QCOMPARE(entry->field("year"), QLatin1String("2005"));
   QCOMPARE(FIELDS(entry, "artist").count(), 1);
@@ -261,7 +261,7 @@ void GCstarTest::testMusic() {
   Tellico::Import::GCstarImporter importer2(exporter.text());
   Tellico::Data::CollPtr coll2 = importer2.collection();
 
-  QVERIFY(!coll2.isNull());
+  QVERIFY(coll2);
   QCOMPARE(coll2->type(), coll->type());
   QCOMPARE(coll2->entryCount(), coll->entryCount());
   QCOMPARE(coll2->title(), coll->title());
@@ -283,12 +283,12 @@ void GCstarTest::testVideoGame() {
   Tellico::Import::GCstarImporter importer(url);
   Tellico::Data::CollPtr coll = importer.collection();
 
-  QVERIFY(!coll.isNull());
+  QVERIFY(coll);
   QCOMPARE(coll->type(), Tellico::Data::Collection::Game);
   QCOMPARE(coll->entryCount(), 2);
 
   Tellico::Data::EntryPtr entry = coll->entryById(2);
-  QVERIFY(!entry.isNull());
+  QVERIFY(entry);
   QCOMPARE(entry->field("title"), QLatin1String("Halo 3"));
   QCOMPARE(entry->field("year"), QLatin1String("2007"));
   QCOMPARE(entry->field("platform"), QLatin1String("Xbox 360"));
@@ -306,7 +306,7 @@ void GCstarTest::testVideoGame() {
   Tellico::Import::GCstarImporter importer2(exporter.text());
   Tellico::Data::CollPtr coll2 = importer2.collection();
 
-  QVERIFY(!coll2.isNull());
+  QVERIFY(coll2);
   QCOMPARE(coll2->type(), coll->type());
   QCOMPARE(coll2->entryCount(), coll->entryCount());
   QCOMPARE(coll2->title(), coll->title());
@@ -328,12 +328,12 @@ void GCstarTest::testBoardGame() {
   Tellico::Import::GCstarImporter importer(url);
   Tellico::Data::CollPtr coll = importer.collection();
 
-  QVERIFY(!coll.isNull());
+  QVERIFY(coll);
   QCOMPARE(coll->type(), Tellico::Data::Collection::BoardGame);
   QCOMPARE(coll->entryCount(), 2);
 
   Tellico::Data::EntryPtr entry = coll->entryById(1);
-  QVERIFY(!entry.isNull());
+  QVERIFY(entry);
   QCOMPARE(entry->field("title"), QLatin1String("Risk"));
   QCOMPARE(entry->field("year"), QLatin1String("1959"));
   QCOMPARE(FIELDS(entry, "designer").count(), 2);
@@ -352,7 +352,7 @@ void GCstarTest::testBoardGame() {
   Tellico::Import::GCstarImporter importer2(exporter.text());
   Tellico::Data::CollPtr coll2 = importer2.collection();
 
-  QVERIFY(!coll2.isNull());
+  QVERIFY(coll2);
   QCOMPARE(coll2->type(), coll->type());
   QCOMPARE(coll2->entryCount(), coll->entryCount());
   QCOMPARE(coll2->title(), coll->title());
@@ -374,12 +374,12 @@ void GCstarTest::testWine() {
   Tellico::Import::GCstarImporter importer(url);
   Tellico::Data::CollPtr coll = importer.collection();
 
-  QVERIFY(!coll.isNull());
+  QVERIFY(coll);
   QCOMPARE(coll->type(), Tellico::Data::Collection::Wine);
   QCOMPARE(coll->entryCount(), 1);
 
   Tellico::Data::EntryPtr entry = coll->entryById(1);
-  QVERIFY(!entry.isNull());
+  QVERIFY(entry);
   QCOMPARE(entry->field("vintage"), QLatin1String("1990"));
   QCOMPARE(entry->field("producer"), QLatin1String("producer"));
   QCOMPARE(entry->field("type"), QLatin1String("Red Wine"));
@@ -405,7 +405,7 @@ void GCstarTest::testWine() {
   Tellico::Import::GCstarImporter importer2(exporter.text());
   Tellico::Data::CollPtr coll2 = importer2.collection();
 
-  QVERIFY(!coll2.isNull());
+  QVERIFY(coll2);
   QCOMPARE(coll2->type(), coll->type());
   QCOMPARE(coll2->entryCount(), coll->entryCount());
   QCOMPARE(coll2->title(), coll->title());
@@ -427,12 +427,12 @@ void GCstarTest::testCoin() {
   Tellico::Import::GCstarImporter importer(url);
   Tellico::Data::CollPtr coll = importer.collection();
 
-  QVERIFY(!coll.isNull());
+  QVERIFY(coll);
   QCOMPARE(coll->type(), Tellico::Data::Collection::Coin);
   QCOMPARE(coll->entryCount(), 1);
 
   Tellico::Data::EntryPtr entry = coll->entryById(1);
-  QVERIFY(!entry.isNull());
+  QVERIFY(entry);
   QCOMPARE(entry->field("denomination"), QLatin1String("0.05"));
   QCOMPARE(entry->field("year"), QLatin1String("1974"));
   QCOMPARE(entry->field("currency"), QLatin1String("USD"));
@@ -451,7 +451,7 @@ void GCstarTest::testCoin() {
   Tellico::Import::GCstarImporter importer2(exporter.text());
   Tellico::Data::CollPtr coll2 = importer2.collection();
 
-  QVERIFY(!coll2.isNull());
+  QVERIFY(coll2);
   QCOMPARE(coll2->type(), coll->type());
   QCOMPARE(coll2->entryCount(), coll->entryCount());
   QCOMPARE(coll2->title(), coll->title());
@@ -473,7 +473,7 @@ void GCstarTest::testCustomFields() {
   Tellico::Import::GCstarImporter importer(url);
   Tellico::Data::CollPtr coll = importer.collection();
 
-  QVERIFY(!coll.isNull());
+  QVERIFY(coll);
   QCOMPARE(coll->type(), Tellico::Data::Collection::Book);
   QCOMPARE(coll->entryCount(), 2);
   // should be translated somehow
@@ -481,14 +481,14 @@ void GCstarTest::testCustomFields() {
 
   // test custom fields
   Tellico::Data::FieldPtr field = coll->fieldByName(QLatin1String("gcsfield1"));
-  QVERIFY(!field.isNull());
+  QVERIFY(field);
   QCOMPARE(field->name(), QLatin1String("gcsfield1"));
   QCOMPARE(field->title(), QLatin1String("New boolean"));
   QCOMPARE(field->category(), QLatin1String("User fields"));
   QCOMPARE(field->type(), Tellico::Data::Field::Bool);
 
   field = coll->fieldByName(QLatin1String("gcsfield2"));
-  QVERIFY(!field.isNull());
+  QVERIFY(field);
   QCOMPARE(field->title(), QLatin1String("New choice"));
   QCOMPARE(field->type(), Tellico::Data::Field::Choice);
   QCOMPARE(field->allowed(), QStringList() << QLatin1String("yes")
@@ -496,52 +496,52 @@ void GCstarTest::testCustomFields() {
                                            << QLatin1String("maybe"));
 
   field = coll->fieldByName(QLatin1String("gcsfield3"));
-  QVERIFY(!field.isNull());
+  QVERIFY(field);
   QCOMPARE(field->title(), QLatin1String("New rating"));
   QCOMPARE(field->type(), Tellico::Data::Field::Rating);
   QCOMPARE(field->property(QLatin1String("minimum")), QLatin1String("1"));
   QCOMPARE(field->property(QLatin1String("maximum")), QLatin1String("5"));
 
   field = coll->fieldByName(QLatin1String("gcsfield4"));
-  QVERIFY(!field.isNull());
+  QVERIFY(field);
   QCOMPARE(field->title(), QLatin1String("New field"));
   QCOMPARE(field->type(), Tellico::Data::Field::Line);
 
   field = coll->fieldByName(QLatin1String("gcsfield5"));
-  QVERIFY(!field.isNull());
+  QVERIFY(field);
   QCOMPARE(field->title(), QLatin1String("New image"));
   QCOMPARE(field->type(), Tellico::Data::Field::Image);
 
   field = coll->fieldByName(QLatin1String("gcsfield6"));
-  QVERIFY(!field.isNull());
+  QVERIFY(field);
   QCOMPARE(field->title(), QLatin1String("New long field"));
   QCOMPARE(field->type(), Tellico::Data::Field::Para);
 
   field = coll->fieldByName(QLatin1String("gcsfield7"));
-  QVERIFY(!field.isNull());
+  QVERIFY(field);
   QCOMPARE(field->title(), QLatin1String("New date"));
   QCOMPARE(field->type(), Tellico::Data::Field::Date);
 
   field = coll->fieldByName(QLatin1String("gcsfield8"));
-  QVERIFY(!field.isNull());
+  QVERIFY(field);
   QCOMPARE(field->title(), QLatin1String("New number"));
   QCOMPARE(field->type(), Tellico::Data::Field::Number);
   QCOMPARE(field->defaultValue(), QLatin1String("2"));
 
   field = coll->fieldByName(QLatin1String("gcsfield9"));
-  QVERIFY(!field.isNull());
+  QVERIFY(field);
   QCOMPARE(field->title(), QLatin1String("dependency"));
   QCOMPARE(field->type(), Tellico::Data::Field::Line);
   QCOMPARE(field->property(QLatin1String("template")), \
QLatin1String("%{gcsfield1},%{gcsfield2}"));  
   field = coll->fieldByName(QLatin1String("gcsfield10"));
-  QVERIFY(!field.isNull());
+  QVERIFY(field);
   QCOMPARE(field->title(), QLatin1String("list"));
   QCOMPARE(field->type(), Tellico::Data::Field::Table);
   QCOMPARE(field->property(QLatin1String("columns")), QLatin1String("1"));
 
   Tellico::Data::EntryPtr entry = coll->entryById(2);
-  QVERIFY(!entry.isNull());
+  QVERIFY(entry);
   QCOMPARE(entry->field("gcsfield1"), QLatin1String("true"));
   QCOMPARE(entry->field("gcsfield2"), QLatin1String("maybe"));
   QCOMPARE(entry->field("gcsfield3"), QLatin1String("3"));
@@ -557,7 +557,7 @@ void GCstarTest::testCustomFields() {
 
   Tellico::Import::GCstarImporter importer2(exporter.text());
   Tellico::Data::CollPtr coll2 = importer2.collection();
-  QVERIFY(!coll2.isNull());
+  QVERIFY(coll2);
 
   foreach(Tellico::Data::FieldPtr f1, coll->fields()) {
     Tellico::Data::FieldPtr f2 = coll2->fieldByName(f1->name());
diff --git a/src/tests/griffithtest.cpp b/src/tests/griffithtest.cpp
index a62e06d..2d84ceb 100644
--- a/src/tests/griffithtest.cpp
+++ b/src/tests/griffithtest.cpp
@@ -54,12 +54,12 @@ void GriffithTest::testMovies() {
   importer.setOptions(importer.options() & ~Tellico::Import::ImportShowImageErrors);
   Tellico::Data::CollPtr coll = importer.collection();
 
-  QVERIFY(!coll.isNull());
+  QVERIFY(coll);
   QCOMPARE(coll->type(), Tellico::Data::Collection::Video);
   QCOMPARE(coll->entryCount(), 5);
 
   Tellico::Data::EntryPtr entry = coll->entryById(1);
-  QVERIFY(!entry.isNull());
+  QVERIFY(entry);
   QCOMPARE(entry->field("title"), QLatin1String("Serendipity"));
   QCOMPARE(entry->field("origtitle"), QLatin1String("Serendipity"));
   QCOMPARE(entry->field("director"), QLatin1String("Peter Chelsom"));
diff --git a/src/tests/referencertest.cpp b/src/tests/referencertest.cpp
index 307c156..263e5fe 100644
--- a/src/tests/referencertest.cpp
+++ b/src/tests/referencertest.cpp
@@ -49,14 +49,14 @@ void ReferencerTest::testImport() {
   Tellico::Import::ReferencerImporter importer(url);
   Tellico::Data::CollPtr coll = importer.collection();
 
-  QVERIFY(!coll.isNull());
+  QVERIFY(coll);
   QCOMPARE(coll->type(), Tellico::Data::Collection::Bibtex);
   QCOMPARE(coll->entryCount(), 2);
   // should be translated somehow
   QCOMPARE(coll->title(), QLatin1String("Referencer Import"));
 
   Tellico::Data::EntryPtr entry = coll->entryById(2);
-  QVERIFY(!entry.isNull());
+  QVERIFY(entry);
   QCOMPARE(entry->field("entry-type"), QLatin1String("article"));
   QCOMPARE(entry->field("year"), QLatin1String("2002"));
   QCOMPARE(entry->field("pages"), QLatin1String("1057-1119"));
diff --git a/src/tests/ristest.cpp b/src/tests/ristest.cpp
index 5a2181e..f4bd351 100644
--- a/src/tests/ristest.cpp
+++ b/src/tests/ristest.cpp
@@ -45,13 +45,13 @@ void RisTest::testImport() {
 
   Tellico::Data::CollPtr coll = importer.collection();
 
-  QVERIFY(!coll.isNull());
+  QVERIFY(coll);
   QCOMPARE(coll->type(), Tellico::Data::Collection::Bibtex);
   QCOMPARE(coll->entryCount(), 2);
   QCOMPARE(coll->title(), QLatin1String("Bibliography"));
 
   Tellico::Data::EntryPtr entry = coll->entryById(2);
-  QVERIFY(!entry.isNull());
+  QVERIFY(entry);
   QCOMPARE(entry->field("entry-type"), QLatin1String("article"));
   QCOMPARE(entry->field("year"), QLatin1String("2002"));
   QCOMPARE(entry->field("pages"), QLatin1String("1057-1119"));
diff --git a/src/tests/tellicoreadtest.cpp b/src/tests/tellicoreadtest.cpp
index 52457c4..ef97abe 100644
--- a/src/tests/tellicoreadtest.cpp
+++ b/src/tests/tellicoreadtest.cpp
@@ -61,7 +61,7 @@ void TellicoReadTest::testBookCollection() {
   // skip the first one
   for(int i = 1; i < m_collections.count(); ++i) {
     Tellico::Data::CollPtr coll2 = m_collections[i];
-    QVERIFY(!coll2.isNull());
+    QVERIFY(coll2);
     QCOMPARE(coll1->type(), coll2->type());
     QCOMPARE(coll1->title(), coll2->title());
     QCOMPARE(coll1->entryCount(), coll2->entryCount());
@@ -89,8 +89,8 @@ void TellicoReadTest::testEntries() {
       // don't test id values since the initial value has changed from 0 to 1
       Tellico::Data::EntryPtr entry1 = m_collections[0]->entries().at(j);
       Tellico::Data::EntryPtr entry2 = m_collections[i]->entries().at(j);
-      QVERIFY(!entry1.isNull());
-      QVERIFY(!entry2.isNull());
+      QVERIFY(entry1);
+      QVERIFY(entry2);
       QCOMPARE(entry1->field(fieldName), entry2->field(fieldName));
     }
   }
@@ -117,12 +117,12 @@ void TellicoReadTest::testCoinCollection() {
   Tellico::Import::TellicoImporter importer(url);
   Tellico::Data::CollPtr coll = importer.collection();
 
-  QVERIFY(!coll.isNull());
+  QVERIFY(coll);
   QCOMPARE(coll->type(), Tellico::Data::Collection::Coin);
 
   Tellico::Data::FieldPtr field = coll->fieldByName("title");
   // old field has Dependent value, now is Line
-  QVERIFY(!field.isNull());
+  QVERIFY(field);
   QCOMPARE(field->type(), Tellico::Data::Field::Line);
   QCOMPARE(field->title(), QL1("Title"));
   QVERIFY(field->hasFlag(Tellico::Data::Field::Derived));
@@ -138,7 +138,7 @@ void TellicoReadTest::testTableData() {
   Tellico::Import::TellicoImporter importer(url);
   Tellico::Data::CollPtr coll = importer.collection();
 
-  QVERIFY(!coll.isNull());
+  QVERIFY(coll);
   QCOMPARE(coll->entryCount(), 3);
 
   Tellico::Export::TellicoXMLExporter exporter(coll);
@@ -146,7 +146,7 @@ void TellicoReadTest::testTableData() {
   Tellico::Import::TellicoImporter importer2(exporter.text());
   Tellico::Data::CollPtr coll2 = importer2.collection();
 
-  QVERIFY(!coll2.isNull());
+  QVERIFY(coll2);
   QCOMPARE(coll2->type(), coll->type());
   QCOMPARE(coll2->entryCount(), coll->entryCount());
 
@@ -187,12 +187,12 @@ void TellicoReadTest::testDuplicateLoans() {
   Tellico::Import::TellicoImporter importer(url);
   Tellico::Data::CollPtr coll = importer.collection();
 
-  QVERIFY(!coll.isNull());
+  QVERIFY(coll);
 
   QCOMPARE(coll->borrowers().count(), 1);
 
   Tellico::Data::BorrowerPtr bor = coll->borrowers().first();
-  QVERIFY(!bor.isNull());
+  QVERIFY(bor);
 
   QCOMPARE(bor->loans().count(), 1);
 }
@@ -203,12 +203,12 @@ void TellicoReadTest::testDuplicateBorrowers() {
   Tellico::Import::TellicoImporter importer(url);
   Tellico::Data::CollPtr coll = importer.collection();
 
-  QVERIFY(!coll.isNull());
+  QVERIFY(coll);
 
   QCOMPARE(coll->borrowers().count(), 1);
 
   Tellico::Data::BorrowerPtr bor = coll->borrowers().first();
-  QVERIFY(!bor.isNull());
+  QVERIFY(bor);
 
   QCOMPARE(bor->loans().count(), 2);
 }
diff --git a/src/tests/vinoxmltest.cpp b/src/tests/vinoxmltest.cpp
index 863adb8..352f5f0 100644
--- a/src/tests/vinoxmltest.cpp
+++ b/src/tests/vinoxmltest.cpp
@@ -50,12 +50,12 @@ void VinoXMLTest::testImport() {
   Tellico::Import::VinoXMLImporter importer(url);
   Tellico::Data::CollPtr coll = importer.collection();
 
-  QVERIFY(!coll.isNull());
+  QVERIFY(coll);
   QCOMPARE(coll->type(), Tellico::Data::Collection::Wine);
   QCOMPARE(coll->entryCount(), 1);
 
   Tellico::Data::EntryPtr entry = coll->entries().first();
-  QVERIFY(!entry.isNull());
+  QVERIFY(entry);
   QCOMPARE(entry->field("title"), QLatin1String("2002 Goldwater Estate Merlot"));
   QCOMPARE(entry->field("producer"), QLatin1String("Goldwater Estate"));
   QCOMPARE(entry->field("vintage"), QLatin1String("2002"));


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic