Skip to content

Commit

Permalink
Fix LGTM updater class warnings (#2984)
Browse files Browse the repository at this point in the history
* Fix LGTM updater class warnings

* Declare destructor in the correct location
  • Loading branch information
vadi2 committed Aug 14, 2019
1 parent 25eb411 commit 7b68f8a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/updater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#endif

#include "pre_guard.h"
#include <QPushButton>
#include <QtConcurrent>
#include "post_guard.h"

Expand All @@ -47,6 +48,10 @@ Updater::Updater(QObject* parent, QSettings* settings) : QObject(parent)

feed = new dblsqd::Feed(QStringLiteral("https://feeds.dblsqd.com/MKMMR7HNSP65PquQQbiDIw"), QStringLiteral("release"));
}
Updater::~Updater()
{
delete (feed);
}

// start the update process and figure out what needs to be done
// if it's silent updates, do that right away, otherwise
Expand Down Expand Up @@ -250,14 +255,13 @@ void Updater::untarOnLinux(const QString& fileName)

void Updater::updateBinaryOnLinux()
{
// FIXME don't hardcode name in case we want to change it
QFileInfo unzippedBinary(QStandardPaths::writableLocation(QStandardPaths::TempLocation) + "/" + unzippedBinaryName);
auto systemEnvironment = QProcessEnvironment::systemEnvironment();
auto appimageLocation = systemEnvironment.contains(QStringLiteral("APPIMAGE")) ?
systemEnvironment.value(QStringLiteral("APPIMAGE"), QString()) :
QCoreApplication::applicationFilePath();

QString installedBinaryPath(appimageLocation);
const QString& installedBinaryPath(appimageLocation);

auto executablePermissions = unzippedBinary.permissions();
executablePermissions |= QFileDevice::ExeOwner | QFileDevice::ExeUser;
Expand All @@ -283,7 +287,7 @@ void Updater::installOrRestartClicked(QAbstractButton* button, const QString& fi
{
Q_UNUSED(button)

// moc, when used with cmake on macos bugs out if the entire function declaration and definition is entirely
// moc, when used with cmake on macOS bugs out if the entire function declaration and definition is entirely
// commented out so we leave a stub in
#if !defined(Q_OS_MACOS)

Expand Down
1 change: 1 addition & 0 deletions src/updater.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class Updater : public QObject
public:
Q_DISABLE_COPY(Updater)
explicit Updater(QObject* parent = nullptr, QSettings* settings = nullptr);
virtual ~Updater();
void checkUpdatesOnStart();
void manuallyCheckUpdates();
void showChangelog() const;
Expand Down

0 comments on commit 7b68f8a

Please sign in to comment.