A bit of macOS porting

Anne Jan Brouwer [2018-06-14 12:01]
A bit of macOS porting
Filename
qtswarmtv/qtswarmtv.pro
qtswarmtv/seasonepisodewidget.cpp
qtswarmtv/seasonepisodewidget.hpp
qtswarmtv/serieslistcontrol.cpp
qtswarmtv/serieslistcontrol.hpp
swarmtv/libswarmtv/libswarmtv.pro
swarmtv/shellfront/shellfront.pro
diff --git a/qtswarmtv/qtswarmtv.pro b/qtswarmtv/qtswarmtv.pro
index d96e47c..fba11a3 100644
--- a/qtswarmtv/qtswarmtv.pro
+++ b/qtswarmtv/qtswarmtv.pro
@@ -80,6 +80,11 @@ FORMS    += mainwindow.ui \
     seasonepisodewidget.ui

 LIBS 	 += -lswarmtv -ltvdb
+INCLUDEPATH	+= ../swarmtv/libswarmtv
+
+mac{
+INCLUDEPATH += /usr/local/include
+}

 # install
 target.path = /usr/local/bin/
diff --git a/qtswarmtv/seasonepisodewidget.cpp b/qtswarmtv/seasonepisodewidget.cpp
index 7d1d075..9dde2aa 100644
--- a/qtswarmtv/seasonepisodewidget.cpp
+++ b/qtswarmtv/seasonepisodewidget.cpp
@@ -59,7 +59,7 @@ void seasonEpisodeWidget::retrieveEpisodeData()
 {
   //int rc=0;
   //tvdb_buffer_t buf;
-  //tvdb_list_front_t seriesInfo;
+  //tvdb_list_node_t seriesInfo;

   // Disable the tree view to show we are searching
   ui->treeWidget->setDisabled(true);
@@ -106,10 +106,10 @@ void seasonEpisodeWidget::retrieveEpisodeData()
 void seasonEpisodeWidget::seriesResults(tvdb_buffer_t *series_xml)
 {
   int rc=0;
-  tvdb_list_front_t seriesInfo;
+  tvdb_list_node_t seriesInfo;

   // Initialize structs
-  memset(&seriesInfo, 0, sizeof(tvdb_list_front_t));
+  memset(&seriesInfo, 0, sizeof(tvdb_list_node_t));

   // Parse the XML data
   rc = tvdb_parse_series_info(series_xml, "", &seriesInfo);
@@ -237,7 +237,7 @@ void seasonEpisodeWidget::addEpisodeEntry(QTreeWidgetItem *seasonItem, tvdb_seri
   ui->treeWidget->setItemWidget(overviewItem, 0, overviewWidget);
 }

-void seasonEpisodeWidget::fillListView(tvdb_list_front_t *seriesInfo)
+void seasonEpisodeWidget::fillListView(tvdb_list_node_t *seriesInfo)
 {
   tvdb_list_reset(seriesInfo);
   const tvdb_list_node_t *n=NULL;
diff --git a/qtswarmtv/seasonepisodewidget.hpp b/qtswarmtv/seasonepisodewidget.hpp
index 32b8be4..803d8dd 100644
--- a/qtswarmtv/seasonepisodewidget.hpp
+++ b/qtswarmtv/seasonepisodewidget.hpp
@@ -24,7 +24,7 @@ public:
     void setSeriesTitle(QString &name);
     void setSeriesId(int id);
     void setrieveEpisodeData();
-    void fillListView(tvdb_list_front_t *);
+    void fillListView(tvdb_list_node_t *);
     void retrieveEpisodeData();

 public slots:
diff --git a/qtswarmtv/serieslistcontrol.cpp b/qtswarmtv/serieslistcontrol.cpp
index c3f030c..a3fc3a4 100644
--- a/qtswarmtv/serieslistcontrol.cpp
+++ b/qtswarmtv/serieslistcontrol.cpp
@@ -72,7 +72,7 @@ void seriesListControl::addWidget(int count, tvdb_series_t *series)
   myItem->show();
 }

-void seriesListControl::handleSeries(tvdb_list_front_t *series)
+void seriesListControl::handleSeries(tvdb_list_node_t *series)
 {
   int count=0;
   tvdb_list_node_t *n=NULL;
@@ -115,7 +115,7 @@ void seriesListControl::findSeries()
 void seriesListControl::searchResults(tvdb_buffer_t *series_xml)
 {
   int rc=0;
-  tvdb_list_front_t series;
+  tvdb_list_node_t series;

   // Parse results
   tvdb_list_init(&series);
diff --git a/qtswarmtv/serieslistcontrol.hpp b/qtswarmtv/serieslistcontrol.hpp
index d647991..eba8f36 100644
--- a/qtswarmtv/serieslistcontrol.hpp
+++ b/qtswarmtv/serieslistcontrol.hpp
@@ -32,7 +32,7 @@ public slots:
     void showContextMenu(const QPoint&);

 private:
-    void handleSeries(tvdb_list_front_t *series);
+    void handleSeries(tvdb_list_node_t *series);
     void addWidget(int count, tvdb_series_t *series);
     void openSimpleEditDialog(seriesWidget *series);
     void createFilter();
diff --git a/swarmtv/libswarmtv/libswarmtv.pro b/swarmtv/libswarmtv/libswarmtv.pro
index 3bbe7bf..dae428c 100644
--- a/swarmtv/libswarmtv/libswarmtv.pro
+++ b/swarmtv/libswarmtv/libswarmtv.pro
@@ -22,7 +22,7 @@ INCLUDEPATH += . \
                filehandler/torrent \
                filehandler/nzb
 CONFIG += dll link_pkgconfig
-PKGCONFIG += sqlite3 dbus-1 glib-2.0 dbus-glib-1
+PKGCONFIG += sqlite3 dbus-1 glib-2.0 dbus-glib-1 libxml-2.0
 LIBS += -lcurl -lpcre
 unix{
 LIBS += -lesmtp
@@ -30,6 +30,10 @@ LIBS += -lesmtp
 win32{
 LIBS += -lsqlite3 -lxml2 -lcurldll -liconv -lwsock32
 }
+mac{
+LIBS += -L/usr/local/lib
+}
+
 target.path = /usr/local/lib/
 headers.path = /usr/local/include/
 INSTALLS += target headers
diff --git a/swarmtv/shellfront/shellfront.pro b/swarmtv/shellfront/shellfront.pro
index db46b93..c7c76f4 100644
--- a/swarmtv/shellfront/shellfront.pro
+++ b/swarmtv/shellfront/shellfront.pro
@@ -7,16 +7,22 @@ TARGET = swarmtv
 DEPENDPATH += .
 INCLUDEPATH += . ../libswarmtv
 CONFIG += link_pkgconfig
-PKGCONFIG += xml2po dbus-1 glib-2.0 dbus-glib-1 sqlite3
+PKGCONFIG += dbus-1 glib-2.0 dbus-glib-1 sqlite3 libxml-2.0
 LIBS += -L../libswarmtv -lswarmtv -lcurl -lpcre
 unix{
- LIBS += -lesmtp -ldbus-1 -lglib-2.0 -ldbus-glib-1
+LIBS += -lesmtp -ldbus-1 -lglib-2.0 -ldbus-glib-1
 }
 win32{
 LIBS += -lxml2 -lwsock32 -lws2_32 -liconv
 }
+mac {
+INCLUDEPATH += /usr/local/include
+LIBS += -L/usr/local/lib
+}
+
 target.path = /usr/local/bin/
 INSTALLS += target
+
 # Input
 HEADERS += daemonize.h \
            dbus.h \