diff --git a/buteo-sync-plugins-social.pro b/buteo-sync-plugins-social.pro new file mode 100644 index 0000000..e89d2fc --- /dev/null +++ b/buteo-sync-plugins-social.pro @@ -0,0 +1,4 @@ +TEMPLATE = subdirs +SUBDIRS = src + +OTHER_FILES += rpm/buteo-sync-plugins-social.spec diff --git a/rpm/sociald.spec b/rpm/buteo-sync-plugins-social.spec similarity index 69% rename from rpm/sociald.spec rename to rpm/buteo-sync-plugins-social.spec index 6d049bf..7f4b63e 100644 --- a/rpm/sociald.spec +++ b/rpm/buteo-sync-plugins-social.spec @@ -1,6 +1,6 @@ -Name: sociald -Summary: Syncs device data from social services -Version: 0.3.15 +Name: buteo-sync-plugins-social +Summary: Sync plugins for social services +Version: 0.4.0 Release: 1 License: LGPLv2 URL: https://git.sailfishos.org/mer-core/buteo-sync-plugins-social @@ -9,6 +9,9 @@ BuildRequires: pkgconfig(Qt5Core) BuildRequires: pkgconfig(Qt5DBus) BuildRequires: pkgconfig(Qt5Sql) BuildRequires: pkgconfig(Qt5Network) +BuildRequires: pkgconfig(Qt5Gui) +BuildRequires: pkgconfig(Qt5Contacts) +BuildRequires: qt5-qttools-linguist BuildRequires: pkgconfig(mlite5) BuildRequires: pkgconfig(buteosyncfw5) >= 0.6.36 BuildRequires: pkgconfig(libsignon-qt5) @@ -17,13 +20,15 @@ BuildRequires: pkgconfig(socialcache) >= 0.0.48 BuildRequires: pkgconfig(libsailfishkeyprovider) BuildRequires: pkgconfig(contactcache-qt5) BuildRequires: pkgconfig(qtcontacts-sqlite-qt5-extensions) >= 0.3.0 -BuildRequires: qt5-qttools-linguist +BuildRequires: pkgconfig(libmkcal-qt5) >= 0.5.9 +BuildRequires: pkgconfig(KF5CalendarCore) +BuildRequires: nemo-qml-plugin-notifications-qt5-devel Requires: buteo-syncfw-qt5-msyncd Requires: systemd Requires(pre): sailfish-setup Requires(post): systemd -Obsoletes: sociald-facebook-notifications -Obsoletes: sociald-facebook-contacts +Obsoletes: sociald < 0.4.0 +Provides: sociald %description A Buteo plugin which provides data synchronization with various social services. @@ -36,73 +41,39 @@ A Buteo plugin which provides data synchronization with various social services. #%%{_libdir}/buteo-plugins-qt5/libsociald-client.so %config %{_sysconfdir}/buteo/profiles/client/sociald.xml %config %{_sysconfdir}/buteo/profiles/sync/sociald.All.xml +%{_libdir}/libsyncpluginscommon.so.* +%exclude %{_libdir}/libsyncpluginscommon.so %license COPYING -%package facebook-calendars -Summary: Provides calendar synchronisation with Facebook -BuildRequires: pkgconfig(libmkcal-qt5) -BuildRequires: pkgconfig(KF5CalendarCore) +%package facebook +Summary: Provides synchronisation with Facebook Requires: %{name} = %{version}-%{release} - -%description facebook-calendars +Obsoletes: sociald-facebook-calendars < 0.4.0 +Obsoletes: sociald-facebook-images < 0.4.0 +Obsoletes: sociald-facebook-signon < 0.4.0 +Provides: sociald-facebook-calendars +Provides: sociald-facebook-images +Provides: sociald-facebook-signon + +%description facebook %{summary}. -%files facebook-calendars +%files facebook +# calendar: #out-of-process-plugin form: %{_libdir}/buteo-plugins-qt5/oopp/facebook-calendars-client #in-process-plugin form: #%%{_libdir}/buteo-plugins-qt5/libfacebook-calendars-client.so %config %{_sysconfdir}/buteo/profiles/client/facebook-calendars.xml %config %{_sysconfdir}/buteo/profiles/sync/facebook.Calendars.xml - -%pre facebook-calendars -USERS=$(getent group users | cut -d ":" -f 4 | tr "," "\n") -for user in $USERS; do - USERHOME=$(getent passwd ${user} | cut -d ":" -f 6) - rm -f ${USERHOME}/.cache/msyncd/sync/client/facebook-calendars.xml || : - rm -f ${USERHOME}/.cache/msyncd/sync/facebook.Calendars.xml || : -done - -%post facebook-calendars -systemctl-user try-restart msyncd.service || : - - -%package facebook-images -Summary: Provides image synchronisation with Facebook -Requires: %{name} = %{version}-%{release} - -%description facebook-images -%{summary}. - -%files facebook-images +# images: #out-of-process-plugin form: %{_libdir}/buteo-plugins-qt5/oopp/facebook-images-client #in-process-plugin form: #%%{_libdir}/buteo-plugins-qt5/libfacebook-images-client.so %config %{_sysconfdir}/buteo/profiles/client/facebook-images.xml %config %{_sysconfdir}/buteo/profiles/sync/facebook.Images.xml - -%pre facebook-images -USERS=$(getent group users | cut -d ":" -f 4 | tr "," "\n") -for user in $USERS; do - USERHOME=$(getent passwd ${user} | cut -d ":" -f 6) - rm -f ${USERHOME}/.cache/msyncd/sync/client/facebook-images.xml || : - rm -f ${USERHOME}/.cache/msyncd/sync/facebook.Images.xml || : -done - -%post facebook-images -systemctl-user try-restart msyncd.service || : - - -%package facebook-signon -Summary: Provides signon credentials refreshing with Facebook -BuildRequires: qt5-qttools-linguist -Requires: %{name} = %{version}-%{release} - -%description facebook-signon -%{summary}. - -%files facebook-signon +# signon #out-of-process-plugin form: %{_libdir}/buteo-plugins-qt5/oopp/facebook-signon-client #in-process-plugin form: @@ -110,87 +81,62 @@ Requires: %{name} = %{version}-%{release} %config %{_sysconfdir}/buteo/profiles/client/facebook-signon.xml %config %{_sysconfdir}/buteo/profiles/sync/facebook.Signon.xml -%pre facebook-signon + +%pre facebook +# calendar USERS=$(getent group users | cut -d ":" -f 4 | tr "," "\n") +for user in $USERS; do + USERHOME=$(getent passwd ${user} | cut -d ":" -f 6) + rm -f ${USERHOME}/.cache/msyncd/sync/client/facebook-calendars.xml || : + rm -f ${USERHOME}/.cache/msyncd/sync/facebook.Calendars.xml || : +done +#images +for user in $USERS; do + USERHOME=$(getent passwd ${user} | cut -d ":" -f 6) + rm -f ${USERHOME}/.cache/msyncd/sync/client/facebook-images.xml || : + rm -f ${USERHOME}/.cache/msyncd/sync/facebook.Images.xml || : +done +#signon for user in $USERS; do USERHOME=$(getent passwd ${user} | cut -d ":" -f 6) rm -f ${USERHOME}/.cache/msyncd/sync/client/facebook-signon.xml || : rm -f ${USERHOME}/.cache/msyncd/sync/facebook.Signon.xml || : done -%post facebook-signon +%post facebook systemctl-user try-restart msyncd.service || : - -%package google-calendars -Summary: Provides calendar synchronisation with Google -BuildRequires: pkgconfig(libmkcal-qt5) >= 0.5.9 -BuildRequires: pkgconfig(KF5CalendarCore) +%package google +Summary: Provides synchronisation with Google Requires: %{name} = %{version}-%{release} +Obsoletes: sociald-google-calendars < 0.4.0 +Obsoletes: sociald-google-contacts < 0.4.0 +Obsoletes: sociald-google-signon < 0.4.0 +Provides: sociald-google-calendars +Provides: sociald-google-contacts +Provides: sociald-google-signon -%description google-calendars + +%description google %{summary}. -%files google-calendars +%files google +# calendar #out-of-process-plugin form: %{_libdir}/buteo-plugins-qt5/oopp/google-calendars-client #in-process-plugin form: #%%{_libdir}/buteo-plugins-qt5/libgoogle-calendars-client.so %config %{_sysconfdir}/buteo/profiles/client/google-calendars.xml %config %{_sysconfdir}/buteo/profiles/sync/google.Calendars.xml - -%pre google-calendars -USERS=$(getent group users | cut -d ":" -f 4 | tr "," "\n") -for user in $USERS; do - USERHOME=$(getent passwd ${user} | cut -d ":" -f 6) - rm -f ${USERHOME}/.cache/msyncd/sync/client/google-calendars.xml || : - rm -f ${USERHOME}/.cache/msyncd/sync/google.Calendars.xml || : -done - -%post google-calendars -systemctl-user try-restart msyncd.service || : - - -%package google-contacts -Summary: Provides contact synchronisation with Google -BuildRequires: pkgconfig(Qt5Gui) -BuildRequires: pkgconfig(Qt5Contacts) -BuildRequires: pkgconfig(qtcontacts-sqlite-qt5-extensions) >= 0.1.58 -Requires: %{name} = %{version}-%{release} - -%description google-contacts -%{summary}. - -%files google-contacts +# contacts #out-of-process-plugin form: %{_libdir}/buteo-plugins-qt5/oopp/google-contacts-client #in-process-plugin form: #%%{_libdir}/buteo-plugins-qt5/libgoogle-contacts-client.so %config %{_sysconfdir}/buteo/profiles/client/google-contacts.xml %config %{_sysconfdir}/buteo/profiles/sync/google.Contacts.xml - -%pre google-contacts -USERS=$(getent group users | cut -d ":" -f 4 | tr "," "\n") -for user in $USERS; do - USERHOME=$(getent passwd ${user} | cut -d ":" -f 6) - rm -f ${USERHOME}/.cache/msyncd/sync/client/google-contacts.xml || : - rm -f ${USERHOME}/.cache/msyncd/sync/google.Contacts.xml || : -done - -%post google-contacts -systemctl-user try-restart msyncd.service || : - - -%package google-signon -Summary: Provides signon credentials refreshing with Google -BuildRequires: qt5-qttools-linguist -Requires: %{name} = %{version}-%{release} - -%description google-signon -%{summary}. - -%files google-signon +# signon #out-of-process-plugin form: %{_libdir}/buteo-plugins-qt5/oopp/google-signon-client #in-process-plugin form: @@ -198,31 +144,42 @@ Requires: %{name} = %{version}-%{release} %config %{_sysconfdir}/buteo/profiles/client/google-signon.xml %config %{_sysconfdir}/buteo/profiles/sync/google.Signon.xml -%pre google-signon + +%pre google USERS=$(getent group users | cut -d ":" -f 4 | tr "," "\n") +# calendar +for user in $USERS; do + USERHOME=$(getent passwd ${user} | cut -d ":" -f 6) + rm -f ${USERHOME}/.cache/msyncd/sync/client/google-calendars.xml || : + rm -f ${USERHOME}/.cache/msyncd/sync/google.Calendars.xml || : +done +# contacts +for user in $USERS; do + USERHOME=$(getent passwd ${user} | cut -d ":" -f 6) + rm -f ${USERHOME}/.cache/msyncd/sync/client/google-contacts.xml || : + rm -f ${USERHOME}/.cache/msyncd/sync/google.Contacts.xml || : +done +# signon for user in $USERS; do USERHOME=$(getent passwd ${user} | cut -d ":" -f 6) rm -f ${USERHOME}/.cache/msyncd/sync/client/google-signon.xml || : rm -f ${USERHOME}/.cache/msyncd/sync/google.Signon.xml || : done -%post google-signon -systemctl-user try-restart msyncd.service || : - - -%package twitter-notifications -Summary: Provides notification synchronisation with Twitter -BuildRequires: pkgconfig(Qt5Contacts) -BuildRequires: pkgconfig(qtcontacts-sqlite-qt5-extensions) -BuildRequires: nemo-qml-plugin-notifications-qt5-devel -BuildRequires: qt5-qttools-linguist +%package twitter +Summary: Provides synchronisation with Twitter Requires: %{name} = %{version}-%{release} +Obsoletes: sociald-twitter-notifications < 0.4.0 +Obsoletes: sociald-twitter-posts < 0.4.0 +Provides: sociald-twitter-notifications +Provides: sociald-twitter-posts -%description twitter-notifications +%description twitter %{summary}. -%files twitter-notifications +%files twitter +# notifications #out-of-process-plugin form: %{_libdir}/buteo-plugins-qt5/oopp/twitter-notifications-client #in-process-plugin form: @@ -230,30 +187,7 @@ Requires: %{name} = %{version}-%{release} %config %{_sysconfdir}/buteo/profiles/client/twitter-notifications.xml %config %{_sysconfdir}/buteo/profiles/sync/twitter.Notifications.xml %{_datadir}/translations/lipstick-jolla-home-twitter-notif_eng_en.qm - -%pre twitter-notifications -USERS=$(getent group users | cut -d ":" -f 4 | tr "," "\n") -for user in $USERS; do - USERHOME=$(getent passwd ${user} | cut -d ":" -f 6) - rm -f ${USERHOME}/.cache/msyncd/sync/client/twitter-notifications.xml || : - rm -f ${USERHOME}/.cache/msyncd/sync/twitter.Notifications.xml || : -done - -%post twitter-notifications -systemctl-user try-restart msyncd.service || : - - -%package twitter-posts -Summary: Provides post synchronisation with Twitter -BuildRequires: pkgconfig(Qt5Contacts) -BuildRequires: pkgconfig(qtcontacts-sqlite-qt5-extensions) -BuildRequires: qt5-qttools-linguist -Requires: %{name} = %{version}-%{release} - -%description twitter-posts -%{summary}. - -%files twitter-posts +# posts #out-of-process-plugin form: %{_libdir}/buteo-plugins-qt5/oopp/twitter-posts-client #in-process-plugin form: @@ -261,138 +195,53 @@ Requires: %{name} = %{version}-%{release} %config %{_sysconfdir}/buteo/profiles/client/twitter-posts.xml %config %{_sysconfdir}/buteo/profiles/sync/twitter.Posts.xml -%pre twitter-posts +%pre twitter +# notifications USERS=$(getent group users | cut -d ":" -f 4 | tr "," "\n") +for user in $USERS; do + USERHOME=$(getent passwd ${user} | cut -d ":" -f 6) + rm -f ${USERHOME}/.cache/msyncd/sync/client/twitter-notifications.xml || : + rm -f ${USERHOME}/.cache/msyncd/sync/twitter.Notifications.xml || : +done +# posts for user in $USERS; do USERHOME=$(getent passwd ${user} | cut -d ":" -f 6) rm -f ${USERHOME}/.cache/msyncd/sync/client/twitter-posts.xml || : rm -f ${USERHOME}/.cache/msyncd/sync/twitter.Posts.xml || : done -%post twitter-posts +%post twitter systemctl-user try-restart msyncd.service || : - -%package onedrive-signon -Summary: Provides signon credentials refreshing with OneDrive -BuildRequires: qt5-qttools-linguist +%package onedrive +Summary: Provides synchronisation with OneDrive Requires: %{name} = %{version}-%{release} - -%description onedrive-signon +Obsoletes: sociald-onedrive-signon < 0.4.0 +Obsoletes: sociald-onedrive-images < 0.4.0 +Obsoletes: sociald-onedrive-backup < 0.4.0 +Provides: sociald-onedrive-signon +Provides: sociald-onedrive-images +Provides: sociald-onedrive-backup + +%description onedrive %{summary}. -%files onedrive-signon +%files onedrive +# signon #out-of-process-plugin form: %{_libdir}/buteo-plugins-qt5/oopp/onedrive-signon-client #in-process-plugin form: #%%{_libdir}/buteo-plugins-qt5/libonedrive-signon-client.so %config %{_sysconfdir}/buteo/profiles/client/onedrive-signon.xml %config %{_sysconfdir}/buteo/profiles/sync/onedrive.Signon.xml - -%pre onedrive-signon -USERS=$(getent group users | cut -d ":" -f 4 | tr "," "\n") -for user in $USERS; do - USERHOME=$(getent passwd ${user} | cut -d ":" -f 6) - rm -f ${USERHOME}/.cache/msyncd/sync/client/onedrive-signon.xml || : - rm -f ${USERHOME}/.cache/msyncd/sync/onedrive.Signon.xml || : -done - -%post onedrive-signon -systemctl-user try-restart msyncd.service || : - - -%package vk-posts -Summary: Provides post synchronisation with VK -BuildRequires: pkgconfig(Qt5Contacts) -BuildRequires: pkgconfig(qtcontacts-sqlite-qt5-extensions) -BuildRequires: qt5-qttools-linguist -Requires: %{name} = %{version}-%{release} - -%description vk-posts -%{summary}. - -%files vk-posts -#out-of-process-plugin form: -%{_libdir}/buteo-plugins-qt5/oopp/vk-posts-client -#in-process-plugin form: -#%%{_libdir}/buteo-plugins-qt5/libvk-posts-client.so -%config %{_sysconfdir}/buteo/profiles/client/vk-posts.xml -%config %{_sysconfdir}/buteo/profiles/sync/vk.Posts.xml - -%pre vk-posts -USERS=$(getent group users | cut -d ":" -f 4 | tr "," "\n") -for user in $USERS; do - USERHOME=$(getent passwd ${user} | cut -d ":" -f 6) - rm -f ${USERHOME}/.cache/msyncd/sync/client/vk-posts.xml || : - rm -f ${USERHOME}/.cache/msyncd/sync/vk.Posts.xml || : -done - -%post vk-posts -systemctl-user restart msyncd.service || : - -%package dropbox-images -Summary: Provides image synchronisation with Dropbox -Requires: %{name} = %{version}-%{release} - -%description dropbox-images -%{summary}. - -%files dropbox-images -#out-of-process-plugin form: -%{_libdir}/buteo-plugins-qt5/oopp/dropbox-images-client -#in-process-plugin form: -#%%{_libdir}/buteo-plugins-qt5/libdropbox-images-client.so -%config %{_sysconfdir}/buteo/profiles/client/dropbox-images.xml -%config %{_sysconfdir}/buteo/profiles/sync/dropbox.Images.xml - -%pre dropbox-images -USERS=$(getent group users | cut -d ":" -f 4 | tr "," "\n") -for user in $USERS; do - USERHOME=$(getent passwd ${user} | cut -d ":" -f 6) - rm -f ${USERHOME}/.cache/msyncd/sync/client/dropbox-images.xml || : - rm -f ${USERHOME}/.cache/msyncd/sync/dropbox.Images.xml || : -done - -%post dropbox-images -systemctl-user try-restart msyncd.service || : - -%package onedrive-images -Summary: Provides image synchronisation with OneDrive -Requires: %{name} = %{version}-%{release} - -%description onedrive-images -%{summary}. - -%files onedrive-images +# images #out-of-process-plugin form: %{_libdir}/buteo-plugins-qt5/oopp/onedrive-images-client +# backup #in-process-plugin form: #%%{_libdir}/buteo-plugins-qt5/libonedrive-images-client.so %config %{_sysconfdir}/buteo/profiles/client/onedrive-images.xml %config %{_sysconfdir}/buteo/profiles/sync/onedrive.Images.xml - -%pre onedrive-images -USERS=$(getent group users | cut -d ":" -f 4 | tr "," "\n") -for user in $USERS; do - USERHOME=$(getent passwd ${user} | cut -d ":" -f 6) - rm -f ${USERHOME}/.cache/msyncd/sync/client/onedrive-images.xml || : - rm -f ${USERHOME}/.cache/msyncd/sync/onedrive.Images.xml || : -done - -%post onedrive-images -systemctl-user try-restart msyncd.service || : - - - -%package onedrive-backup -Summary: Provides backup-blob synchronization for OneDrive -BuildRequires: qt5-qttools-linguist -Requires: %{name} = %{version}-%{release} - -%description onedrive-backup -%{summary}. - -%files onedrive-backup #out-of-process-plugin form: %{_libdir}/buteo-plugins-qt5/oopp/onedrive-backup-client %{_libdir}/buteo-plugins-qt5/oopp/onedrive-backupquery-client @@ -408,8 +257,21 @@ Requires: %{name} = %{version}-%{release} %config %{_sysconfdir}/buteo/profiles/sync/onedrive.BackupQuery.xml %config %{_sysconfdir}/buteo/profiles/sync/onedrive.BackupRestore.xml -%pre onedrive-backup +%pre onedrive USERS=$(getent group users | cut -d ":" -f 4 | tr "," "\n") +# signon +for user in $USERS; do + USERHOME=$(getent passwd ${user} | cut -d ":" -f 6) + rm -f ${USERHOME}/.cache/msyncd/sync/client/onedrive-signon.xml || : + rm -f ${USERHOME}/.cache/msyncd/sync/onedrive.Signon.xml || : +done +# images +for user in $USERS; do + USERHOME=$(getent passwd ${user} | cut -d ":" -f 6) + rm -f ${USERHOME}/.cache/msyncd/sync/client/onedrive-images.xml || : + rm -f ${USERHOME}/.cache/msyncd/sync/onedrive.Images.xml || : +done +# backup for user in $USERS; do USERHOME=$(getent passwd ${user} | cut -d ":" -f 6) rm -f ${USERHOME}/.cache/msyncd/sync/client/onedrive-backup.xml || : @@ -420,170 +282,166 @@ for user in $USERS; do rm -f ${USERHOME}/.cache/msyncd/sync/onedrive.BackupRestore.xml || : done -%post onedrive-backup +%post onedrive systemctl-user try-restart msyncd.service || : - -%package dropbox-backup -Summary: Provides backup-blob synchronization for Dropbox -BuildRequires: qt5-qttools-linguist +%package vk +Summary: Provides synchronisation with VK Requires: %{name} = %{version}-%{release} - -%description dropbox-backup +Obsoletes: sociald-vk-posts < 0.4.0 +Obsoletes: sociald-vk-notifications < 0.4.0 +Obsoletes: sociald-vk-calendars < 0.4.0 +Obsoletes: sociald-vk-contacts < 0.4.0 +Obsoletes: sociald-vk-images < 0.4.0 +Provides: sociald-vk-posts +Provides: sociald-vk-notifications +Provides: sociald-vk-calendars +Provides: sociald-vk-contacts +Provides: sociald-vk-images + +%description vk %{summary}. -%files dropbox-backup +%files vk +# posts #out-of-process-plugin form: -%{_libdir}/buteo-plugins-qt5/oopp/dropbox-backup-client -%{_libdir}/buteo-plugins-qt5/oopp/dropbox-backupquery-client -%{_libdir}/buteo-plugins-qt5/oopp/dropbox-backuprestore-client +%{_libdir}/buteo-plugins-qt5/oopp/vk-posts-client #in-process-plugin form: -#%%{_libdir}/buteo-plugins-qt5/libdropbox-backup-client.so -#%%{_libdir}/buteo-plugins-qt5/libdropbox-backupquery-client.so -#%%{_libdir}/buteo-plugins-qt5/libdropbox-backuprestore-client.so -%config %{_sysconfdir}/buteo/profiles/client/dropbox-backup.xml -%config %{_sysconfdir}/buteo/profiles/client/dropbox-backupquery.xml -%config %{_sysconfdir}/buteo/profiles/client/dropbox-backuprestore.xml -%config %{_sysconfdir}/buteo/profiles/sync/dropbox.Backup.xml -%config %{_sysconfdir}/buteo/profiles/sync/dropbox.BackupQuery.xml -%config %{_sysconfdir}/buteo/profiles/sync/dropbox.BackupRestore.xml - -%pre dropbox-backup -USERS=$(getent group users | cut -d ":" -f 4 | tr "," "\n") -for user in $USERS; do - USERHOME=$(getent passwd ${user} | cut -d ":" -f 6) - rm -f ${USERHOME}/.cache/msyncd/sync/client/dropbox-backup.xml || : - rm -f ${USERHOME}/.cache/msyncd/sync/client/dropbox-backupquery.xml || : - rm -f ${USERHOME}/.cache/msyncd/sync/client/dropbox-backuprestore.xml || : - rm -f ${USERHOME}/.cache/msyncd/sync/dropbox.Backup.xml || : - rm -f ${USERHOME}/.cache/msyncd/sync/dropbox.BackupQuery.xml || : - rm -f ${USERHOME}/.cache/msyncd/sync/dropbox.BackupRestore.xml || : -done - -%post dropbox-backup -systemctl-user try-restart msyncd.service || : - - - -%package vk-notifications -Summary: Provides notification synchronisation with VK -BuildRequires: nemo-qml-plugin-notifications-qt5-devel -BuildRequires: qt5-qttools-linguist -Requires: %{name} = %{version}-%{release} - -%description vk-notifications -%{summary}. - -%files vk-notifications +#%%{_libdir}/buteo-plugins-qt5/libvk-posts-client.so +%config %{_sysconfdir}/buteo/profiles/client/vk-posts.xml +%config %{_sysconfdir}/buteo/profiles/sync/vk.Posts.xml +# notifications #out-of-process-plugin form: %{_libdir}/buteo-plugins-qt5/oopp/vk-notifications-client #in-process-plugin form: #%%{_libdir}/buteo-plugins-qt5/libvk-notifications-client.so %config %{_sysconfdir}/buteo/profiles/client/vk-notifications.xml %config %{_sysconfdir}/buteo/profiles/sync/vk.Notifications.xml - -%pre vk-notifications -USERS=$(getent group users | cut -d ":" -f 4 | tr "," "\n") -for user in $USERS; do - USERHOME=$(getent passwd ${user} | cut -d ":" -f 6) - rm -f ${USERHOME}/.cache/msyncd/sync/client/vk-notifications.xml || : - rm -f ${USERHOME}/.cache/msyncd/sync/vk.Notifications.xml || : -done - -%post vk-notifications -systemctl-user restart msyncd.service || : - - -%package vk-calendars -Summary: Provides calendar synchronisation with VK -BuildRequires: pkgconfig(libmkcal-qt5) -BuildRequires: pkgconfig(KF5CalendarCore) -Requires: %{name} = %{version}-%{release} - -%description vk-calendars -%{summary}. - -%files vk-calendars +# calendars #out-of-proces-plugin form: %{_libdir}/buteo-plugins-qt5/oopp/vk-calendars-client #in-process-plugin form: #%%{_libdir}/buteo-plugins-qt5/libvk-calendars-client.so %config %{_sysconfdir}/buteo/profiles/client/vk-calendars.xml %config %{_sysconfdir}/buteo/profiles/sync/vk.Calendars.xml - -%pre vk-calendars -USERS=$(getent group users | cut -d ":" -f 4 | tr "," "\n") -for user in $USERS; do - USERHOME=$(getent passwd ${user} | cut -d ":" -f 6) - rm -f ${USERHOME}/.cache/msyncd/sync/client/vk-calendars.xml || : - rm -f ${USERHOME}/.cache/msyncd/sync/vk.Calendars.xml || : -done - -%post vk-calendars -systemctl-user restart msyncd.service || : - - -%package vk-contacts -Summary: Provides contact synchronisation with VK -BuildRequires: pkgconfig(Qt5Gui) -BuildRequires: pkgconfig(Qt5Contacts) -BuildRequires: pkgconfig(qtcontacts-sqlite-qt5-extensions) -Requires: %{name} = %{version}-%{release} - -%description vk-contacts -%{summary}. - -%files vk-contacts +# contacts #out-of-process-plugin form: %{_libdir}/buteo-plugins-qt5/oopp/vk-contacts-client #in-process-plugin form: #%%{_libdir}/buteo-plugins-qt5/libvk-contacts-client.so %config %{_sysconfdir}/buteo/profiles/client/vk-contacts.xml %config %{_sysconfdir}/buteo/profiles/sync/vk.Contacts.xml +# images +#out-of-process-plugin form: +%{_libdir}/buteo-plugins-qt5/oopp/vk-images-client +#in-process-plugin form: +#%%{_libdir}/buteo-plugins-qt5/libvk-images-client.so +%config %{_sysconfdir}/buteo/profiles/client/vk-images.xml +%config %{_sysconfdir}/buteo/profiles/sync/vk.Images.xml + -%pre vk-contacts +%pre vk USERS=$(getent group users | cut -d ":" -f 4 | tr "," "\n") +# posts +for user in $USERS; do + USERHOME=$(getent passwd ${user} | cut -d ":" -f 6) + rm -f ${USERHOME}/.cache/msyncd/sync/client/vk-posts.xml || : + rm -f ${USERHOME}/.cache/msyncd/sync/vk.Posts.xml || : +done +# notifications +for user in $USERS; do + USERHOME=$(getent passwd ${user} | cut -d ":" -f 6) + rm -f ${USERHOME}/.cache/msyncd/sync/client/vk-notifications.xml || : + rm -f ${USERHOME}/.cache/msyncd/sync/vk.Notifications.xml || : +done +# calendars +for user in $USERS; do + USERHOME=$(getent passwd ${user} | cut -d ":" -f 6) + rm -f ${USERHOME}/.cache/msyncd/sync/client/vk-calendars.xml || : + rm -f ${USERHOME}/.cache/msyncd/sync/vk.Calendars.xml || : +done +# contacts for user in $USERS; do USERHOME=$(getent passwd ${user} | cut -d ":" -f 6) rm -f ${USERHOME}/.cache/msyncd/sync/client/vk-contacts.xml || : rm -f ${USERHOME}/.cache/msyncd/sync/vk.Contacts.xml || : done +# images +for user in $USERS; do + USERHOME=$(getent passwd ${user} | cut -d ":" -f 6) + rm -f ${USERHOME}/.cache/msyncd/sync/client/vk-images.xml || : + rm -f ${USERHOME}/.cache/msyncd/sync/vk.Images.xml || : +done -%post vk-contacts + +%post vk systemctl-user restart msyncd.service || : -%package vk-images -Summary: Provides image synchronisation with VK +%package dropbox +Summary: Provides synchronisation with Dropbox Requires: %{name} = %{version}-%{release} +Obsoletes: sociald-dropbox-images < 0.4.0 +Obsoletes: sociald-dropbox-backup < 0.4.0 +Provides: sociald-dropbox-images +Provides: sociald-dropbox-backup -%description vk-images +%description dropbox %{summary}. -%files vk-images +%files dropbox +# images #out-of-process-plugin form: -%{_libdir}/buteo-plugins-qt5/oopp/vk-images-client +%{_libdir}/buteo-plugins-qt5/oopp/dropbox-images-client #in-process-plugin form: -#%%{_libdir}/buteo-plugins-qt5/libvk-images-client.so -%config %{_sysconfdir}/buteo/profiles/client/vk-images.xml -%config %{_sysconfdir}/buteo/profiles/sync/vk.Images.xml +#%%{_libdir}/buteo-plugins-qt5/libdropbox-images-client.so +%config %{_sysconfdir}/buteo/profiles/client/dropbox-images.xml +%config %{_sysconfdir}/buteo/profiles/sync/dropbox.Images.xml +# backup +#out-of-process-plugin form: +%{_libdir}/buteo-plugins-qt5/oopp/dropbox-backup-client +%{_libdir}/buteo-plugins-qt5/oopp/dropbox-backupquery-client +%{_libdir}/buteo-plugins-qt5/oopp/dropbox-backuprestore-client +#in-process-plugin form: +#%%{_libdir}/buteo-plugins-qt5/libdropbox-backup-client.so +#%%{_libdir}/buteo-plugins-qt5/libdropbox-backupquery-client.so +#%%{_libdir}/buteo-plugins-qt5/libdropbox-backuprestore-client.so +%config %{_sysconfdir}/buteo/profiles/client/dropbox-backup.xml +%config %{_sysconfdir}/buteo/profiles/client/dropbox-backupquery.xml +%config %{_sysconfdir}/buteo/profiles/client/dropbox-backuprestore.xml +%config %{_sysconfdir}/buteo/profiles/sync/dropbox.Backup.xml +%config %{_sysconfdir}/buteo/profiles/sync/dropbox.BackupQuery.xml +%config %{_sysconfdir}/buteo/profiles/sync/dropbox.BackupRestore.xml -%pre vk-images +%pre dropbox USERS=$(getent group users | cut -d ":" -f 4 | tr "," "\n") +# images for user in $USERS; do USERHOME=$(getent passwd ${user} | cut -d ":" -f 6) - rm -f ${USERHOME}/.cache/msyncd/sync/client/vk-images.xml || : - rm -f ${USERHOME}/.cache/msyncd/sync/vk.Images.xml || : + rm -f ${USERHOME}/.cache/msyncd/sync/client/dropbox-images.xml || : + rm -f ${USERHOME}/.cache/msyncd/sync/dropbox.Images.xml || : +done +# backup +for user in $USERS; do + USERHOME=$(getent passwd ${user} | cut -d ":" -f 6) + rm -f ${USERHOME}/.cache/msyncd/sync/client/dropbox-backup.xml || : + rm -f ${USERHOME}/.cache/msyncd/sync/client/dropbox-backupquery.xml || : + rm -f ${USERHOME}/.cache/msyncd/sync/client/dropbox-backuprestore.xml || : + rm -f ${USERHOME}/.cache/msyncd/sync/dropbox.Backup.xml || : + rm -f ${USERHOME}/.cache/msyncd/sync/dropbox.BackupQuery.xml || : + rm -f ${USERHOME}/.cache/msyncd/sync/dropbox.BackupRestore.xml || : done -%post vk-images -systemctl-user restart msyncd.service || : - +%post dropbox +systemctl-user try-restart msyncd.service || : %package knowncontacts Summary: Store locally created contacts +Requires: %{name} = %{version}-%{release} +Obsoletes: sociald-knowncontacts < 0.4.0 +Provides: sociald-knowncontacts %description knowncontacts Buteo sync plugin that stores locally created contacts, such as email @@ -613,19 +471,6 @@ Summary: Translation source for sociald %defattr(-,root,root,-) %{_datadir}/translations/source/lipstick-jolla-home-twitter-notif.ts -%package tests -Summary: Automatable tests for sociald -BuildRequires: pkgconfig(Qt5Test) -Requires: qt5-qtdeclarative-devel-tools -Requires: qt5-qtdeclarative-import-qttest - -%description tests -%{summary}. - -%files tests -%defattr(-,root,root,-) -/opt/tests/sociald/* - %prep %setup -q -n %{name}-%{version} @@ -639,8 +484,7 @@ Requires: qt5-qtdeclarative-import-qttest "CONFIG+=twitter" \ "CONFIG+=vk" \ "CONFIG+=knowncontacts" \ - "CONFIG+=calendar" \ - "CONFIG+=build-tests" + "CONFIG+=calendar" make %{_smp_mflags} %pre @@ -663,5 +507,8 @@ rm -rf %{buildroot} %qmake5_install %post +/sbin/ldconfig || : systemctl-user try-restart msyncd.service || : +%postun +/sbin/ldconfig || : diff --git a/sociald.pro b/sociald.pro deleted file mode 100644 index 4ca6ae4..0000000 --- a/sociald.pro +++ /dev/null @@ -1,9 +0,0 @@ -TEMPLATE = subdirs -SUBDIRS = src - -CONFIG(build-tests) { - SUBDIRS += tests - tests.depends = src -} - -OTHER_FILES += rpm/sociald.spec diff --git a/src/common.pri b/src/common.pri index aa627b6..fc1f39e 100644 --- a/src/common.pri +++ b/src/common.pri @@ -17,26 +17,11 @@ QT -= \ QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF -# the unit tests need to provide a custom QNAM and uses a different database directory -HEADERS += $$PWD/common/socialdnetworkaccessmanager_p.h -!contains(DEFINES, 'SOCIALD_TEST_DEFINE') { - SOURCES += $$PWD/common/socialdnetworkaccessmanager_p.cpp -} - DEFINES += 'SYNC_DATABASE_DIR=\'\"Sync\"\'' -DEFINES += 'SOCIALD_SYNC_DATABASE_NAME=\'\"sociald.db\"\'' INCLUDEPATH += . $$PWD/common/ -HEADERS += \ - $$PWD/common/buteosyncfw_p.h \ - $$PWD/common/socialdbuteoplugin.h \ - $$PWD/common/socialnetworksyncadaptor.h \ - $$PWD/common/trace.h - -SOURCES += \ - $$PWD/common/socialdbuteoplugin.cpp \ - $$PWD/common/socialnetworksyncadaptor.cpp +LIBS += -L$$PWD/common -lsyncpluginscommon contains(DEFINES, 'SOCIALD_USE_QTPIM') { DEFINES *= USE_CONTACTS_NAMESPACE=QTCONTACTS_USE_NAMESPACE @@ -49,34 +34,27 @@ contains(DEFINES, 'SOCIALD_USE_QTPIM') { HEADERS += contactmanagerengine.h } -# don't pull in buteo plugin framework for unit test builds -!contains (DEFINES, 'SOCIALD_TEST_DEFINE') { - !contains (DEFINES, OUT_OF_PROCESS_PLUGIN) { - TEMPLATE = lib - CONFIG += plugin - target.path = $$[QT_INSTALL_LIBS]/buteo-plugins-qt5 - message("building" $$TARGET "as in-process plugin") - } - contains (DEFINES, OUT_OF_PROCESS_PLUGIN) { - TEMPLATE = app - target.path = $$[QT_INSTALL_LIBS]/buteo-plugins-qt5/oopp - message("building" $$TARGET "as out-of-process plugin") - - DEFINES += CLIENT_PLUGIN - BUTEO_OOPP_INCLUDE_DIR = $$system(pkg-config --cflags buteosyncfw5|cut -f2 -d'I') - INCLUDEPATH += $$BUTEO_OOPP_INCLUDE_DIR - - HEADERS += $$BUTEO_OOPP_INCLUDE_DIR/ButeoPluginIfaceAdaptor.h \ - $$BUTEO_OOPP_INCLUDE_DIR/PluginCbImpl.h \ - $$BUTEO_OOPP_INCLUDE_DIR/PluginServiceObj.h - - SOURCES += $$BUTEO_OOPP_INCLUDE_DIR/ButeoPluginIfaceAdaptor.cpp \ - $$BUTEO_OOPP_INCLUDE_DIR/PluginCbImpl.cpp \ - $$BUTEO_OOPP_INCLUDE_DIR/PluginServiceObj.cpp \ - $$BUTEO_OOPP_INCLUDE_DIR/plugin_main.cpp - } +!contains (DEFINES, OUT_OF_PROCESS_PLUGIN) { + TEMPLATE = lib + CONFIG += plugin + target.path = $$[QT_INSTALL_LIBS]/buteo-plugins-qt5 + message("building" $$TARGET "as in-process plugin") +} +contains (DEFINES, OUT_OF_PROCESS_PLUGIN) { + TEMPLATE = app + target.path = $$[QT_INSTALL_LIBS]/buteo-plugins-qt5/oopp + message("building" $$TARGET "as out-of-process plugin") + + DEFINES += CLIENT_PLUGIN + BUTEO_OOPP_INCLUDE_DIR = $$system(pkg-config --cflags buteosyncfw5|cut -f2 -d'I') + INCLUDEPATH += $$BUTEO_OOPP_INCLUDE_DIR + + HEADERS += $$BUTEO_OOPP_INCLUDE_DIR/ButeoPluginIfaceAdaptor.h \ + $$BUTEO_OOPP_INCLUDE_DIR/PluginCbImpl.h \ + $$BUTEO_OOPP_INCLUDE_DIR/PluginServiceObj.h + + SOURCES += $$BUTEO_OOPP_INCLUDE_DIR/ButeoPluginIfaceAdaptor.cpp \ + $$BUTEO_OOPP_INCLUDE_DIR/PluginCbImpl.cpp \ + $$BUTEO_OOPP_INCLUDE_DIR/PluginServiceObj.cpp \ + $$BUTEO_OOPP_INCLUDE_DIR/plugin_main.cpp } - -#NOTE: This causes issues with the unit tests ? -#MOC_DIR = $$PWD/../.moc -#OBJECTS_DIR = $$PWD/../.obj diff --git a/src/common/common.pro b/src/common/common.pro new file mode 100644 index 0000000..340afe6 --- /dev/null +++ b/src/common/common.pro @@ -0,0 +1,31 @@ +TEMPLATE = lib + +QT -= gui +QT += network dbus + +CONFIG += link_pkgconfig +PKGCONFIG += \ + accounts-qt5 \ + buteosyncfw5 \ + +TARGET = syncpluginscommon +TARGET = $$qtLibraryTarget($$TARGET) + +HEADERS += \ + $$PWD/buteosyncfw_p.h \ + $$PWD/socialdbuteoplugin.h \ + $$PWD/socialnetworksyncadaptor.h \ + $$PWD/trace.h + +SOURCES += \ + $$PWD/socialdbuteoplugin.cpp \ + $$PWD/socialnetworksyncadaptor.cpp + +HEADERS += $$PWD/socialdnetworkaccessmanager_p.h + +SOURCES += socialdnetworkaccessmanager_p.cpp + +TARGETPATH = $$[QT_INSTALL_LIBS] +target.path = $$TARGETPATH + +INSTALLS += target diff --git a/src/src.pro b/src/src.pro index 92f237b..b9d12bd 100644 --- a/src/src.pro +++ b/src/src.pro @@ -1,11 +1,41 @@ TEMPLATE = subdirs SUBDIRS = \ + common \ sociald -CONFIG(google): SUBDIRS += google -CONFIG(facebook): SUBDIRS += facebook -CONFIG(twitter): SUBDIRS += twitter -CONFIG(onedrive): SUBDIRS += onedrive -CONFIG(dropbox): SUBDIRS += dropbox -CONFIG(vk): SUBDIRS += vk -CONFIG(knowncontacts): SUBDIRS += knowncontacts +sociald.depends = common + +CONFIG(google): { + SUBDIRS += google + google.depends = common +} + +CONFIG(facebook): { + SUBDIRS += facebook + facebook.depends = common +} + +CONFIG(twitter): { + SUBDIRS += twitter + twitter.depends = common +} + +CONFIG(onedrive): { + SUBDIRS += onedrive + onedrive.depends = common +} + +CONFIG(dropbox): { + SUBDIRS += dropbox + dropbox.depends = common +} + +CONFIG(vk): { + SUBDIRS += vk + vk.depends = common +} + +CONFIG(knowncontacts): { + SUBDIRS += knowncontacts + knowncontacts.depends = common +} diff --git a/tests/networkstubs_p.cpp b/tests/networkstubs_p.cpp deleted file mode 100644 index 9cc53fc..0000000 --- a/tests/networkstubs_p.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2013-2014 Jolla Ltd. - ** Contact: Chris Adams - ** - ** This program/library is free software; you can redistribute it and/or - ** modify it under the terms of the GNU Lesser General Public License - ** version 2.1 as published by the Free Software Foundation. - ** - ** This program/library is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - ** Lesser General Public License for more details. - ** - ** You should have received a copy of the GNU Lesser General Public - ** License along with this program/library; if not, write to the Free - ** Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - ** 02110-1301 USA - ** - ****************************************************************************/ - -#include "networkstubs_p.h" -#include "socialdnetworkaccessmanager_p.h" - -#include -#include - -/* - * This implementation overrides the networking classes for testing purposes. - * The unit test for each social network should provide an implementation of - * TestNetworkReply::generateData() in order to return the required data. - */ - -SocialdNetworkAccessManager::SocialdNetworkAccessManager(QObject *parent) - : QNetworkAccessManager(parent) -{ -} - -QNetworkReply *SocialdNetworkAccessManager::createRequest(QNetworkAccessManager::Operation op, - const QNetworkRequest &req, - QIODevice *outgoingData) -{ - Q_UNUSED(op) - Q_UNUSED(outgoingData) - - QString generator; // TODO: create generator from request, if we want to test different branches. - - // construct a test reply, which will contain the expected data and trigger finished() - TestNetworkReply *retn = new TestNetworkReply(this); - retn->setOperation(op); - retn->setRequest(req); - retn->setUrl(req.url()); - retn->m_readAllData = TestNetworkReply::generateData(req.url(), generator); - retn->open(QIODevice::ReadOnly); - retn->setFinished(true); - QTimer::singleShot(100, retn, SIGNAL(finished())); - return retn; -} diff --git a/tests/networkstubs_p.h b/tests/networkstubs_p.h deleted file mode 100644 index 60cd984..0000000 --- a/tests/networkstubs_p.h +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2013-2014 Jolla Ltd. - ** Contact: Chris Adams - ** - ** This program/library is free software; you can redistribute it and/or - ** modify it under the terms of the GNU Lesser General Public License - ** version 2.1 as published by the Free Software Foundation. - ** - ** This program/library is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - ** Lesser General Public License for more details. - ** - ** You should have received a copy of the GNU Lesser General Public - ** License along with this program/library; if not, write to the Free - ** Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - ** 02110-1301 USA - ** - ****************************************************************************/ - -#ifndef SOCIALD_TESTS_NETWORKSTUBS_P_H -#define SOCIALD_TESTS_NETWORKSTUBS_P_H - -#include -#include -#include -#include -#include - -#include "socialdnetworkaccessmanager_p.h" - -class TestNetworkReply : public QNetworkReply -{ - Q_OBJECT - -public: - bool isSequential() const { return true; } - void abort() { qWarning() << "TNR::abort"; } - qint64 bytesAvailable() const { return m_readAllData.size() + QIODevice::bytesAvailable(); } - qint64 size() const { return bytesAvailable(); } - bool atEnd() const { return m_readAllData.size() == 0; } - bool canReadLine() const { return !atEnd(); } - qint64 readData(char *buf, qint64 sz) { - qint64 i = 0; - while (!m_readAllData.isEmpty() && i++ < sz) { - *buf++ = m_readAllData.at(0); - m_readAllData.remove(0,1); - } - return i; - } - -protected: - TestNetworkReply(QObject *parent = 0) : QNetworkReply(parent) {} - -private: - static QByteArray generateData(const QUrl &requestUrl, const QString &generator); - QByteArray m_readAllData; - friend class SocialdNetworkAccessManager; -}; - -#endif diff --git a/tests/tests.pro b/tests/tests.pro deleted file mode 100644 index 1268980..0000000 --- a/tests/tests.pro +++ /dev/null @@ -1,8 +0,0 @@ -TEMPLATE = subdirs - -SUBDIRS = - -CONFIG(google): SUBDIRS += tst_google -CONFIG(twitter): SUBDIRS += tst_twitter - -QMAKE_EXTRA_TARGETS += check diff --git a/tests/tst_common.pri b/tests/tst_common.pri deleted file mode 100644 index 1c21945..0000000 --- a/tests/tst_common.pri +++ /dev/null @@ -1,16 +0,0 @@ -DEFINES += SOCIALD_TEST_DEFINE -DEFINES += 'PRIVILEGED_DATA_DIR=\'\"/tmp\"\'' - -DEFINES += SOCIALD_USE_QTPIM -include($$PWD/../src/common.pri) - -INCLUDEPATH += $$PWD -HEADERS += $$PWD/networkstubs_p.h -SOURCES += $$PWD/networkstubs_p.cpp - -QT += testlib -TEMPLATE = app -CONFIG -= app_bundle - -target.path = /opt/tests/sociald -INSTALLS += target diff --git a/tests/tst_google/tst_google.cpp b/tests/tst_google/tst_google.cpp deleted file mode 100644 index 16cbe9f..0000000 --- a/tests/tst_google/tst_google.cpp +++ /dev/null @@ -1,97 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2013-2014 Jolla Ltd. - ** Contact: Chris Adams - ** - ** This program/library is free software; you can redistribute it and/or - ** modify it under the terms of the GNU Lesser General Public License - ** version 2.1 as published by the Free Software Foundation. - ** - ** This program/library is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - ** Lesser General Public License for more details. - ** - ** You should have received a copy of the GNU Lesser General Public - ** License along with this program/library; if not, write to the Free - ** Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - ** 02110-1301 USA - ** - ****************************************************************************/ - -#define QT_STATICPLUGIN - -#include -#include - -#include "constants_p.h" -#include -#include - -#include "googlecalendarsyncadaptor.h" -#include "googletwowaycontactsyncadaptor.h" - -class tst_google : public QObject -{ - Q_OBJECT - -public: - tst_google(); - virtual ~tst_google(); - - -public slots: - void initTestCase(); - void cleanupTestCase(); - void init(); - void cleanup(); - -private slots: - void calendars(); - void contacts(); -}; - -// -------------------------------- - -tst_google::tst_google() -{ -} - -tst_google::~tst_google() -{ -} - -void tst_google::initTestCase() -{ -} - -void tst_google::cleanupTestCase() -{ -} - -void tst_google::init() -{ -} - -void tst_google::cleanup() -{ -} - -// -------------------------------- - -void tst_google::calendars() -{ - QScopedPointer ggCalSa(new GoogleCalendarSyncAdaptor(this)); - QSKIP("TODO: write unit tests for this"); -} - -void tst_google::contacts() -{ - QScopedPointer ggConSa(new GoogleTwoWayContactSyncAdaptor(this)); - QSKIP("TODO: write unit tests for this"); -} - -// -------------------------------- - -QTEST_MAIN(tst_google) -#include "tst_google.moc" diff --git a/tests/tst_google/tst_google.pro b/tests/tst_google/tst_google.pro deleted file mode 100644 index 3eb0f3a..0000000 --- a/tests/tst_google/tst_google.pro +++ /dev/null @@ -1,11 +0,0 @@ -TARGET = tst_google - -include(../tst_common.pri) - -include($$PWD/../../src/google/google-common.pri) -include($$PWD/../../src/google/google-calendars/google-calendars.pri) -include($$PWD/../../src/google/google-contacts/google-contacts.pri) - -SOURCES += \ - tst_google.cpp \ - tst_googlenetworkstubs_p.cpp diff --git a/tests/tst_google/tst_googlenetworkstubs_p.cpp b/tests/tst_google/tst_googlenetworkstubs_p.cpp deleted file mode 100644 index 1412669..0000000 --- a/tests/tst_google/tst_googlenetworkstubs_p.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2013-2014 Jolla Ltd. - ** Contact: Chris Adams - ** - ** This program/library is free software; you can redistribute it and/or - ** modify it under the terms of the GNU Lesser General Public License - ** version 2.1 as published by the Free Software Foundation. - ** - ** This program/library is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - ** Lesser General Public License for more details. - ** - ** You should have received a copy of the GNU Lesser General Public - ** License along with this program/library; if not, write to the Free - ** Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - ** 02110-1301 USA - ** - ****************************************************************************/ - -#include "networkstubs_p.h" -#include "socialdnetworkaccessmanager_p.h" - -#include -#include - -static QByteArray createGoogleCalendarsData(const QString &generator) -{ - Q_UNUSED(generator); - // XXX TODO - return QByteArray(); -} - -static QByteArray createGoogleContactsData(const QString &generator) -{ - Q_UNUSED(generator); - // XXX TODO - return QByteArray(); -} - -QByteArray TestNetworkReply::generateData(const QUrl &requestUrl, const QString &generator) -{ - // we inspect the request url and based upon what we see there, generate some data. - QString host = requestUrl.host(); - QString path = requestUrl.path(); - - if (host == QLatin1String("google.com")) { - if (path == QLatin1String("/calendars")) { - return createGoogleCalendarsData(generator); - } else if (path == QLatin1String("/contacts")) { - return createGoogleContactsData(generator); - } - } - - // no test data function exists for this host/path combination - qWarning() << Q_FUNC_INFO << "no test data function exists for:" << host << path; - return QByteArray(); -} diff --git a/tests/tst_twitter/tst_twitter.cpp b/tests/tst_twitter/tst_twitter.cpp deleted file mode 100644 index 4942cd1..0000000 --- a/tests/tst_twitter/tst_twitter.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2013-2014 Jolla Ltd. - ** Contact: Chris Adams - ** - ** This program/library is free software; you can redistribute it and/or - ** modify it under the terms of the GNU Lesser General Public License - ** version 2.1 as published by the Free Software Foundation. - ** - ** This program/library is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - ** Lesser General Public License for more details. - ** - ** You should have received a copy of the GNU Lesser General Public - ** License along with this program/library; if not, write to the Free - ** Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - ** 02110-1301 USA - ** - ****************************************************************************/ - -#define QT_STATICPLUGIN - -#include -#include - -#include "twitterhometimelinesyncadaptor.h" -#include "twitternotificationsyncadaptor.h" - -class tst_twitter : public QObject -{ - Q_OBJECT - -public: - tst_twitter(); - virtual ~tst_twitter(); - - -public slots: - void initTestCase(); - void cleanupTestCase(); - void init(); - void cleanup(); - -private slots: - void notifications(); - void posts(); -}; - -// -------------------------------- - -tst_twitter::tst_twitter() -{ -} - -tst_twitter::~tst_twitter() -{ -} - -void tst_twitter::initTestCase() -{ -} - -void tst_twitter::cleanupTestCase() -{ -} - -void tst_twitter::init() -{ -} - -void tst_twitter::cleanup() -{ -} - -// -------------------------------- - -void tst_twitter::notifications() -{ - QScopedPointer fbNotSa(new TwitterNotificationSyncAdaptor(this)); - QSKIP("TODO: write unit tests for this"); -} - -void tst_twitter::posts() -{ - QScopedPointer fbNotSa(new TwitterHomeTimelineSyncAdaptor(this)); - QSKIP("TODO: write unit tests for this"); -} - -// -------------------------------- - -QTEST_MAIN(tst_twitter) -#include "tst_twitter.moc" diff --git a/tests/tst_twitter/tst_twitter.pro b/tests/tst_twitter/tst_twitter.pro deleted file mode 100644 index 525cac5..0000000 --- a/tests/tst_twitter/tst_twitter.pro +++ /dev/null @@ -1,11 +0,0 @@ -TARGET = tst_twitter - -include(../tst_common.pri) - -include($$PWD/../../src/twitter/twitter-common.pri) -include($$PWD/../../src/twitter/twitter-notifications/twitter-notifications.pri) -include($$PWD/../../src/twitter/twitter-posts/twitter-posts.pri) - -SOURCES += \ - tst_twitter.cpp \ - tst_twitternetworkstubs_p.cpp diff --git a/tests/tst_twitter/tst_twitternetworkstubs_p.cpp b/tests/tst_twitter/tst_twitternetworkstubs_p.cpp deleted file mode 100644 index e3ff2a6..0000000 --- a/tests/tst_twitter/tst_twitternetworkstubs_p.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2013-2014 Jolla Ltd. - ** Contact: Chris Adams - ** - ** This program/library is free software; you can redistribute it and/or - ** modify it under the terms of the GNU Lesser General Public License - ** version 2.1 as published by the Free Software Foundation. - ** - ** This program/library is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - ** Lesser General Public License for more details. - ** - ** You should have received a copy of the GNU Lesser General Public - ** License along with this program/library; if not, write to the Free - ** Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - ** 02110-1301 USA - ** - ****************************************************************************/ - -#include "networkstubs_p.h" -#include "socialdnetworkaccessmanager_p.h" - -#include -#include - -static QByteArray createTwitterHomeTimelineData(const QString &generator) -{ - Q_UNUSED(generator); - // XXX TODO - return QByteArray(); -} - -static QByteArray createTwitterMentionsTimelineData(const QString &generator) -{ - Q_UNUSED(generator); - // XXX TODO - return QByteArray(); -} - -QByteArray TestNetworkReply::generateData(const QUrl &requestUrl, const QString &generator) -{ - // we inspect the request url and based upon what we see there, generate some data. - QString host = requestUrl.host(); - QString path = requestUrl.path(); - - if (host == QLatin1String("twitter.com")) { - if (path == QLatin1String("/home")) { - return createTwitterHomeTimelineData(generator); - } else if (path == QLatin1String("/mentions")) { - return createTwitterMentionsTimelineData(generator); - } - } - - // no test data function exists for this host/path combination - qWarning() << Q_FUNC_INFO << "no test data function exists for:" << host << path; - return QByteArray(); -}