mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
Use std::unique_ptr in sparkle updater class rather than manual management
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
parent
0f30993b2c
commit
88b2ae0d21
@ -26,7 +26,7 @@ class SparkleUpdater : public Updater
|
||||
Q_OBJECT
|
||||
public:
|
||||
SparkleUpdater(const QUrl &appCastUrl);
|
||||
~SparkleUpdater() override;
|
||||
~SparkleUpdater();
|
||||
|
||||
void setUpdateUrl(const QUrl &url);
|
||||
|
||||
@ -39,7 +39,7 @@ public:
|
||||
|
||||
private:
|
||||
class Private;
|
||||
Private *d;
|
||||
std::unique_ptr<Private> d;
|
||||
};
|
||||
|
||||
} // namespace OCC
|
||||
|
||||
@ -76,19 +76,24 @@
|
||||
|
||||
namespace OCC {
|
||||
|
||||
class SparkleUpdater::Private
|
||||
class Q_DECL_HIDDEN SparkleUpdater::Private
|
||||
{
|
||||
public:
|
||||
SUUpdater* updater;
|
||||
DelegateObject *delegate;
|
||||
public:
|
||||
~Private()
|
||||
{
|
||||
[updater release];
|
||||
[delegate release];
|
||||
}
|
||||
|
||||
SUUpdater* updater;
|
||||
DelegateObject *delegate;
|
||||
};
|
||||
|
||||
// Delete ~/Library//Preferences/com.owncloud.desktopclient.plist to re-test
|
||||
SparkleUpdater::SparkleUpdater(const QUrl& appCastUrl)
|
||||
: Updater()
|
||||
, d(std::make_unique<Private>())
|
||||
{
|
||||
d = new Private;
|
||||
|
||||
d->delegate = [[DelegateObject alloc] init];
|
||||
[d->delegate retain];
|
||||
|
||||
@ -107,11 +112,7 @@ SparkleUpdater::SparkleUpdater(const QUrl& appCastUrl)
|
||||
[d->updater setUserAgentString: userAgent];
|
||||
}
|
||||
|
||||
SparkleUpdater::~SparkleUpdater()
|
||||
{
|
||||
[d->updater release];
|
||||
delete d;
|
||||
}
|
||||
SparkleUpdater::~SparkleUpdater() = default;
|
||||
|
||||
void SparkleUpdater::setUpdateUrl(const QUrl &url)
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user