Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
Commits on Nov 11, 2011
Commits on Nov 13, 2011
Commits on Nov 15, 2011
Commits on Nov 17, 2011
Commits on Jan 17, 2012
Stefan Derkits
Commits on Mar 08, 2012
Commits on Mar 09, 2012
Stefan Derkits
Merge pull request #3 from davidsansome/include-guards
Add an extra LIBMYGPO_QT_ prefix on the include guards
Stefan Derkits
Merge pull request #2 from davidsansome/qt-4.6.4-fix
Little fix to make JsonCreator.cpp compile on Qt 4.6.4
Commits on Mar 19, 2012
Check if the compiler supports the -Wlogical-op flag - it was only ad…
…ded in GCC in 4.3.0, and the mingw compiler in Ubuntu is at 4.2.1
Commits on Mar 20, 2012
Stefan Derkits
Merge pull request #4 from davidsansome/Wlogical-op
Check if the compiler supports the -Wlogical-op flag
Commits on Apr 06, 2012
Commits on Apr 13, 2012
Commits on Apr 16, 2012
Commits on Apr 17, 2012
Commits on Oct 13, 2012
View
@@ -5,6 +5,10 @@ project( libmygpo-qt )
set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII" )
+# Don't use absolute path in Mygpo-qtTargets-$buildType.cmake
+# (This will have no effect with CMake < 2.8)
+set(QT_USE_IMPORTED_TARGETS TRUE)
+
find_package( Qt4 COMPONENTS QtCore QtNetwork QtTest REQUIRED )
set( QT_DONT_USE_QTGUI TRUE )
@@ -14,20 +18,27 @@ include( ${QT_USE_FILE} )
set( MYGPO_QT_VERSION_MAJOR "1" )
set( MYGPO_QT_VERSION_MINOR "0" )
-set( MYGPO_QT_VERSION_PATCH "5" )
+set( MYGPO_QT_VERSION_PATCH "6" )
set( MYGPO_QT_VERSION "${MYGPO_QT_VERSION_MAJOR}.${MYGPO_QT_VERSION_MINOR}.${MYGPO_QT_VERSION_PATCH}" )
set( MYGPO_QT_SONAME "${MYGPO_QT_VERSION_MAJOR}")
+include(CheckCXXCompilerFlag)
+
if (CMAKE_COMPILER_IS_GNUCXX)
ADD_DEFINITIONS( -Wcast-align -Wchar-subscripts -Wpointer-arith
-Wwrite-strings -Wpacked -Wformat-security -Wmissing-format-attribute
-Wold-style-cast -Woverloaded-virtual -Wnon-virtual-dtor -Wall -Wextra
- -Wformat=2 -Wundef -Wlogical-op -Wstack-protector -Wmissing-include-dirs
+ -Wformat=2 -Wundef -Wstack-protector -Wmissing-include-dirs
-Winit-self -Wunsafe-loop-optimizations -ggdb3 -fno-inline -DQT_STRICT_ITERATORS )
if ( NOT WIN32 )
add_definitions( -fvisibility=hidden )
endif()
+
+ check_cxx_compiler_flag( -Wlogical-op GNUCXX_HAS_WLOGICAL_OP )
+ if ( GNUCXX_HAS_WLOGICAL_OP )
+ add_definitions( -Wlogical-op )
+ endif()
endif(CMAKE_COMPILER_IS_GNUCXX)
option(MYGPO_BUILD_TESTS "Build all unit tests" ON)
@@ -45,11 +56,11 @@ set( CPACK_PACKAGE_VERSION "${MYGPO_QT_VERSION}" )
set( CPACK_DEBIAN_PACKAGE_MAINTAINER "gpodder@freelists.org" )
set( CPACK_PACKAGE_DESCRIPTION_SUMMARY "A c++/qt library to access the APIs provided by gpodder.net." )
-set(LIB_INSTALL_DIR_SUFFIX "" CACHE STRING "The directories where to install libraries to")
-set(LIB_INSTALL_DIR lib${LIB_INSTALL_DIR_SUFFIX} )
+set(LIB_SUFFIX "" CACHE STRING "The directories where to install libraries to")
+set(LIB_INSTALL_DIR lib${LIB_SUFFIX} )
+set(LIB_DIR_PKGCONF "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}")
set(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include/mygpo-qt" CACHE PATH "The directory the headers are installed in")
-set(CMAKECONFIG_INSTALL_DIR ${LIB_INSTALL_DIR}/cmake/mygpo-qt )
-# SET (CMAKE_MODULES_INSTALL_DIR "${CMAKE_ROOT}/Modules" CACHE PATH "The directory to install FindLibmygpo-qt.cmake to")
+set(CMAKECONFIG_INSTALL_DIR ${LIB_INSTALL_DIR}/cmake/mygpo-qt )
if( APPLE )
set( CPACK_GENERATOR "DragNDrop" )
@@ -79,8 +90,8 @@ ADD_CUSTOM_TARGET(uninstall
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
# pkg-config
-find_package(PkgConfig)
IF (NOT WIN32)
+ FIND_PACKAGE(PkgConfig)
IF (PKG_CONFIG_FOUND)
CONFIGURE_FILE (${CMAKE_CURRENT_SOURCE_DIR}/libmygpo-qt.pc.in
${CMAKE_CURRENT_BINARY_DIR}/libmygpo-qt.pc
View
@@ -8,7 +8,7 @@ set(MYGPO_QT_VERSION_PATCH @MYGPO_QT_VERSION_PATCH@)
set(MYGPO_QT_VERSION ${MYGPO_QT_VERSION_MAJOR}.${MYGPO_QT_VERSION_MINOR}.${MYGPO_QT_VERSION_PATCH} )
# what is my include directory
-set(LIBMYGPO_QT_INCLUDE_DIRS "/@INCLUDE_INSTALL_DIR@")
+set(LIBMYGPO_QT_INCLUDE_DIRS "@INCLUDE_INSTALL_DIR@")
# import the exported targets
include(${myDir}/Mygpo-qtTargets.cmake)
View
14 README
@@ -4,13 +4,9 @@
libmygpo-qt is a Qt Library that wraps the gpodder.net Web API (http://wiki.gpodder.org/wiki/Web_Services/API_2)
-v1.0 wraps nearly every Request from the gpodder.net API except:
--) Simple API Calls Downloading subscription Lists & Uploading subscription Lists
--) Retrieving Subscription Changes (you should use "Retrieving Updates for a given Device" instead)
-
=== Copyright & License ===
-Copyright 2010 - 2011 Stefan Derkits (stefan@derkits.at) , Christian Wagner (christian.wagner86@gmx.at) & Felix Winter (ixos01@gmail.com)
+Copyright 2010 - 2012 Stefan Derkits (stefan@derkits.at) , Christian Wagner (christian.wagner86@gmx.at) & Felix Winter (ixos01@gmail.com)
See COPYING File for License
@@ -20,7 +16,7 @@ Current Maintainer: Stefan Derkits (HorusHorrendus @ irc.freenode.net)
=== Requirements ===
--) Qt 4.6 or higher
+-) Qt 4.7 or higher
-) Cmake 2.6 or higher
-) QJson
@@ -30,7 +26,7 @@ Homepage: http://wiki.gpodder.org/wiki/Libmygpo-qt
Git Repo: https://github.com/gpodder/libmygpo-qt
Doxygen Documentation: http://stefan.derkits.at/libmygpo-doc/
Bugreports: http://bugs.gpodder.org
-Contact: gpodder-devel@lists.berlios.de
+Contact: gpodder@freelists.org
IRC Channel: #gpodder on FreeNode (irc.freenode.net)
=== How to Install ===
@@ -40,5 +36,7 @@ IRC Channel: #gpodder on FreeNode (irc.freenode.net)
-) make
-) make install (might need root)
-To use libmygpo-qt include the Header "ApiRequest.h" into your Code. You can find the cflags & linker flags for libmygpo-qt either via pkg-config (.pc file will be installed to your System) or with the Findlibmygpo-qt.cmake Macro (located in cmake/modules/ )
+To use libmygpo-qt include the Header "ApiRequest.h" into your Code. You can find the cflags & linker flags for libmygpo-qt either via pkg-config (.pc file will be installed to your System)
+or via cmake (Mygpo-qtConfig.cmake will be installed to your system).
+
You can check the Example Application to see how you can use libmygpo-qt in your Application
View
@@ -1,3 +0,0 @@
-
-add_subdirectory(modules)
-
@@ -1,4 +0,0 @@
-
-
-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR})
-find_package(libmygpo-qt REQUIRED)
@@ -1,50 +0,0 @@
-
-# - Find libmygpo-qt
-# Find the libmygpo-qt includes and the libmygpo-qt libraries
-# This module defines
-# LIBMYGPO_QT_INCLUDE_DIRS, root mygpo-qt include dir
-# LIBMYGPO_QT_LIBRARIES, the path to libmygpo-qt
-# LIBMYGPO_QT_FOUND, whether libmygpo-qt was found
-
-
-find_path(LIBMYGPO_QT_INCLUDE_DIR NAMES ApiRequest.h
- HINTS
- ~/usr/include
- /opt/local/include
- /usr/include
- /usr/local/include
- /opt/kde4/include
- ~/kde/include
- PATH_SUFFIXES mygpo-qt
-)
-
-find_library(LIBMYGPO_QT_LIBRARY NAMES mygpo-qt
- PATHS
- ~/usr/lib
- ~/usr/lib64
- /opt/local/lib
- /opt/local/lib64
- /usr/lib
- /usr/lib64
- /usr/local/lib
- /usr/local/lib64
- /opt/kde4/lib
- /opt/kde4/lib64
- ~/kde/lib
- ~/kde/lib64
-)
-
-set(LIBMYGPO_QT_INCLUDE_DIRS ${LIBMYGPO_QT_INCLUDE_DIR})
-set(LIBMYGPO_QT_LIBRARIES ${LIBMYGPO_QT_LIBRARY})
-
-if(LIBMYGPO_QT_INCLUDE_DIR AND LIBMYGPO_QT_LIBRARY)
- set(LIBMYGPO_QT_FOUND TRUE)
- message(STATUS "Found libmygpo-qt: ${LIBMYGPO_QT_INCLUDE_DIRS}, ${LIBMYGPO_QT_LIBRARIES}")
-else(LIBMYGPO_QT_INCLUDE_DIR AND LIBMYGPO_QT_LIBRARY)
- set(LIBMYGPO_QT_FOUND FALSE)
- if (LIBMYGPO_QT_FIND_REQUIRED)
- message(FATAL_ERROR "Could NOT find required package libmygpo-qt")
- endif(LIBMYGPO_QT_FIND_REQUIRED)
-endif(LIBMYGPO_QT_INCLUDE_DIR AND LIBMYGPO_QT_LIBRARY)
-
-mark_as_advanced(LIBMYGPO_QT_INCLUDE_DIRS LIBMYGPO_QT_LIBRARIES)
@@ -43,4 +43,8 @@ else (QJSON_INCLUDE_DIR AND QJSON_LIBRARIES)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(QJSON DEFAULT_MSG QJSON_LIBRARIES QJSON_INCLUDE_DIR)
+ if ( UNIX AND NOT APPLE )
+ set ( QJSON_LIBRARIES "${QJSON_LIBRARIES} ${QJSON_LDFLAGS}" CACHE INTERNAL "")
+ endif ()
+
endif (QJSON_INCLUDE_DIR AND QJSON_LIBRARIES)
View
@@ -1,6 +1,6 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
-libdir=@LIB_INSTALL_DIR@
+libdir=@LIB_DIR_PKGCONF@
includedir=@INCLUDE_INSTALL_DIR@
Name: libmygpo-qt
View
@@ -20,8 +20,8 @@
* USA *
***************************************************************************/
-#ifndef ADDREMOVERESULT_H
-#define ADDREMOVERESULT_H
+#ifndef LIBMYGPO_QT_ADDREMOVERESULT_H
+#define LIBMYGPO_QT_ADDREMOVERESULT_H
#include <QList>
#include <QVariant>
@@ -67,4 +67,4 @@ typedef QSharedPointer<AddRemoveResult> AddRemoveResultPtr;
Q_DECLARE_METATYPE( mygpo::AddRemoveResultPtr );
-#endif // ADDREMOVERESULT_H
+#endif // LIBMYGPO_QT_ADDREMOVERESULT_H
View
@@ -391,6 +391,16 @@ DeviceSyncResultPtr ApiRequestPrivate::deviceSynchronizationStatus ( const QStri
return result;
}
+DeviceSyncResultPtr ApiRequestPrivate::setDeviceSynchronizationStatus(const QString& username, const QList< QStringList >& synchronize, const QList< QString >& stopSynchronize )
+{
+ QString requestUrl = UrlBuilder::getDeviceSynchronizationStatusUrl( username );
+ QNetworkReply* reply;
+ QByteArray data = JsonCreator::deviceSynchronizationListsToJSON( synchronize, stopSynchronize );
+ reply = m_requestHandler.postRequest( data, requestUrl );
+ DeviceSyncResultPtr result( new DeviceSyncResult( reply ) );
+ return result;
+}
+
ApiRequest::ApiRequest( const QString& username, const QString& password, QNetworkAccessManager* nam ) : d( new ApiRequestPrivate( username, password, nam ) )
{
}
@@ -598,3 +608,8 @@ DeviceSyncResultPtr ApiRequest::deviceSynchronizationStatus ( const QString& use
{
return d->deviceSynchronizationStatus( username );
}
+
+DeviceSyncResultPtr ApiRequest::setDeviceSynchronizationStatus(const QString& username, const QList<QStringList>& synchronize, const QList<QString>& stopSynchronize )
+{
+ return d->setDeviceSynchronizationStatus( username, synchronize, stopSynchronize );
+}
View
@@ -20,8 +20,8 @@
* USA *
***************************************************************************/
-#ifndef APIREQUEST_H
-#define APIREQUEST_H
+#ifndef LIBMYGPO_QT_APIREQUEST_H
+#define LIBMYGPO_QT_APIREQUEST_H
#define MYGPO_MAJOR_VERSION 1
#define MYGPO_MINOR_VERSION 0
@@ -395,6 +395,8 @@ class MYGPO_EXPORT ApiRequest
DeviceSyncResultPtr deviceSynchronizationStatus( const QString& username );
+ DeviceSyncResultPtr setDeviceSynchronizationStatus( const QString& username, const QList<QStringList>& synchronize, const QList<QString>& stopSynchronize );
+
private:
ApiRequestPrivate* const d;
};
View
@@ -76,6 +76,7 @@ class ApiRequestPrivate
EpisodeActionListPtr episodeActionsByDeviceAndTimestamp( const QString& username, const QString& deviceId, const qulonglong since );
AddRemoveResultPtr uploadEpisodeActions( const QString& username, const QList<EpisodeActionPtr>& episodeActions );
DeviceSyncResultPtr deviceSynchronizationStatus( const QString& username );
+ DeviceSyncResultPtr setDeviceSynchronizationStatus( const QString& username, const QList<QStringList>& synchronize, const QList<QString>& stopSynchronize );
private:
RequestHandler m_requestHandler;
};
View
@@ -20,8 +20,8 @@
* USA *
***************************************************************************/
-#ifndef DEVICE_H
-#define DEVICE_H
+#ifndef LIBMYGPO_QT_DEVICE_H
+#define LIBMYGPO_QT_DEVICE_H
#include "mygpo_export.h"
@@ -68,4 +68,4 @@ typedef QSharedPointer<Device> DevicePtr;
Q_DECLARE_METATYPE( mygpo::DevicePtr );
-#endif //DEVICE_H
+#endif //LIBMYGPO_QT_DEVICE_H
View
@@ -20,8 +20,8 @@
* USA *
***************************************************************************/
-#ifndef DEVICELIST_H
-#define DEVICELIST_H
+#ifndef LIBMYGPO_QT_DEVICELIST_H
+#define LIBMYGPO_QT_DEVICELIST_H
#include <QNetworkReply>
#include <QSharedPointer>
@@ -65,4 +65,4 @@ typedef QSharedPointer<DeviceList> DeviceListPtr;
Q_DECLARE_METATYPE( mygpo::DeviceListPtr );
-#endif //DEVICELIST_H
+#endif //LIBMYGPO_QT_DEVICELIST_H
View
@@ -18,8 +18,8 @@
* USA *
***************************************************************************/
-#ifndef DEVICESYNCRESULT_H
-#define DEVICESYNCRESULT_H
+#ifndef LIBMYGPO_QT_DEVICESYNCRESULT_H
+#define LIBMYGPO_QT_DEVICESYNCRESULT_H
#include <QNetworkReply>
#include <QObject>
@@ -63,4 +63,4 @@ typedef QSharedPointer<DeviceSyncResult> DeviceSyncResultPtr;
}
-#endif // DEVICESYNCRESULT_H
+#endif // LIBMYGPO_QT_DEVICESYNCRESULT_H
View
@@ -20,8 +20,8 @@
* USA *
***************************************************************************/
-#ifndef DEVICEUPDATES_H
-#define DEVICEUPDATES_H
+#ifndef LIBMYGPO_QT_DEVICEUPDATES_H
+#define LIBMYGPO_QT_DEVICEUPDATES_H
#include <QNetworkReply>
#include <QUrl>
@@ -69,4 +69,4 @@ typedef QSharedPointer<DeviceUpdates> DeviceUpdatesPtr;
}
-#endif // DEVICEUPDATES_H
+#endif // LIBMYGPO_QT_DEVICEUPDATES_H
View
@@ -20,8 +20,8 @@
* USA *
***************************************************************************/
-#ifndef EPISODE_H
-#define EPISODE_H
+#ifndef LIBMYGPO_QT_EPISODE_H
+#define LIBMYGPO_QT_EPISODE_H
#include <QObject>
#include <QUrl>
@@ -93,4 +93,4 @@ typedef QSharedPointer<Episode> EpisodePtr;
Q_DECLARE_METATYPE( mygpo::EpisodePtr );
-#endif // EPISODE_H
+#endif // LIBMYGPO_QT_EPISODE_H
View
@@ -26,6 +26,8 @@
using namespace mygpo;
+static qulonglong c_maxlonglong = (2^64)-1;
+
EpisodeActionPrivate::EpisodeActionPrivate( EpisodeAction* qq, const QVariant& variant, QObject* parent ) : QObject( parent ), q( qq )
{
parse( variant );
@@ -222,6 +224,18 @@ EpisodeAction::EpisodeAction( const QUrl& podcastUrl, const QUrl& episodeUrl, co
}
+EpisodeAction::EpisodeAction(const QUrl& podcastUrl, const QUrl& episodeUrl, const QString& deviceName, EpisodeAction::ActionType action, qulonglong timestamp, qulonglong position, QObject* parent)
+ : QObject( parent ), d( new EpisodeActionPrivate( this, podcastUrl, episodeUrl, deviceName, action, timestamp, c_maxlonglong, position, c_maxlonglong ) )
+{
+
+}
+
+EpisodeAction::EpisodeAction(const QUrl& podcastUrl, const QUrl& episodeUrl, const QString& deviceName, EpisodeAction::ActionType action, qulonglong timestamp, QObject* parent)
+ : QObject( parent ), d( new EpisodeActionPrivate( this, podcastUrl, episodeUrl, deviceName, action, timestamp, c_maxlonglong, c_maxlonglong, c_maxlonglong ) )
+{
+
+}
+
EpisodeAction::~EpisodeAction()
{
delete d;
Oops, something went wrong.

No commit comments for this range