diff --git a/src/finder-sync/finder-sync-host.cpp b/src/finder-sync/finder-sync-host.cpp index 0a54bdf0e..f49f30b29 100644 --- a/src/finder-sync/finder-sync-host.cpp +++ b/src/finder-sync/finder-sync-host.cpp @@ -27,6 +27,15 @@ enum PathStatus { MAX_SYNC_STATUS, }; +namespace { +struct QtLaterDeleter { +public: + void operator()(QObject *ptr) { + ptr->deleteLater(); + } +}; +} // anonymous namespace + static const char *const kPathStatus[] = { "none", "syncing", "error", "ignored", "synced", "readonly", "paused", NULL, }; @@ -40,7 +49,7 @@ static inline PathStatus getPathStatusFromString(const QString &status) { static std::mutex update_mutex_; static std::vector watch_set_; -static std::unique_ptr get_shared_link_req_; +static std::unique_ptr get_shared_link_req_; FinderSyncHost::FinderSyncHost() : rpc_client_(new SeafileRpcClient) { rpc_client_->connectDaemon(); diff --git a/src/finder-sync/finder-sync-listener.mm b/src/finder-sync/finder-sync-listener.mm index f0570d2a3..54f03753a 100644 --- a/src/finder-sync/finder-sync-listener.mm +++ b/src/finder-sync/finder-sync-listener.mm @@ -52,10 +52,9 @@ @interface FinderSyncListener : NSObject uint32_t status; }; -template struct QtLaterDeleter { public: - void operator()(T *ptr) { + void operator()(QObject *ptr) { ptr->deleteLater(); } }; @@ -67,7 +66,7 @@ void operator()(T *ptr) { // atomic value static volatile int32_t finder_sync_started_ = 0; static FinderSyncListener *finder_sync_listener_ = nil; -static std::unique_ptr> finder_sync_host_; +static std::unique_ptr finder_sync_host_; static constexpr uint32_t kFinderSyncProtocolVersion = 0x00000002; static void handleGetFileStatus(mach_msg_command_rcv_t* msg) {