One more fix to connection handling.
[jenirok] / src / common / source.cpp
index 460f98e..5d1315e 100644 (file)
 #include "source.h"
 #include "eniro.h"
 #include "mobil1881.h"
+#include "dastelefonbuch.h"
 
 namespace
 {
     static const QString SOURCE_NAMES[Source::SOURCE_COUNT] =
     {
          "Eniro (FI, SE, DK)",
-         "1881 Mobil (NO)"
+         "1881 Mobil (NO)",
+         "Das Telefonbuch (DE)"
     };
 
     static const QString SOURCE_IDS[Source::SOURCE_COUNT] =
     {
          "eniro",
-         "1881mobil"
+         "1881mobil",
+         "dastelefonbuch"
     };
 
 }
@@ -53,6 +56,9 @@ Source* Source::getSource(Source::SourceId id, QObject* parent)
     case MOBIL1881:
         return new Mobil1881(parent);
         break;
+    case DASTELEFONBUCH:
+        return new DasTelefonbuch(parent);
+        break;
     default:
         qDebug() << "Unknown source:" << id;
     }
@@ -112,6 +118,13 @@ unsigned int Source::getMaxResults() const
     return maxResults_;
 }
 
+void Source::getSearchTypes(QList<SearchType>& types) const
+{
+    types.clear();
+    types.push_back(PERSONS);
+    types.push_back(YELLOW_PAGES);
+}
+
 void Source::setTimeout(unsigned int timeout)
 {
     timeout_ = timeout;
@@ -168,7 +181,6 @@ void Source::setError(Source::Error error, QString const& errorString)
 
 void Source::httpReady(int id, bool error)
 {
-
     if(error)
     {
         if(http_.error() == QHttp::Aborted)
@@ -294,7 +306,7 @@ QString& Source::htmlEntityDecode(QString& string)
         38,
         60,
         62,
-        160,
+        32,
         192,
         193,
         194,