Skip to content

Commit

Permalink
Fix compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
erikjv authored and TheOneRing committed Apr 17, 2024
1 parent 45046bc commit d872c32
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 28 deletions.
4 changes: 2 additions & 2 deletions src/gui/accountsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ void AccountSettings::slotRemoveCurrentFolder(Folder *folder)
messageBox->setAttribute(Qt::WA_DeleteOnClose);
QPushButton *yesButton = messageBox->addButton(tr("Remove Folder Sync Connection"), QMessageBox::YesRole);
messageBox->addButton(tr("Cancel"), QMessageBox::NoRole);
connect(messageBox, &QMessageBox::finished, this, [messageBox, yesButton, folder, this] {
connect(messageBox, &QMessageBox::finished, this, [messageBox, yesButton, folder] {
if (messageBox->clickedButton() == yesButton) {
FolderMan::instance()->removeFolder(folder);
}
Expand Down Expand Up @@ -335,7 +335,7 @@ void AccountSettings::slotDisableVfsCurrentFolder(Folder *folder)
"This action will abort any currently running synchronization."));
auto acceptButton = msgBox->addButton(tr("Disable support"), QMessageBox::AcceptRole);
msgBox->addButton(tr("Cancel"), QMessageBox::RejectRole);
connect(msgBox, &QMessageBox::finished, msgBox, [this, msgBox, folder, acceptButton] {
connect(msgBox, &QMessageBox::finished, msgBox, [msgBox, folder, acceptButton] {
msgBox->deleteLater();
if (msgBox->clickedButton() != acceptButton || !folder) {
return;
Expand Down
2 changes: 1 addition & 1 deletion src/gui/folderstatusmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class FolderStatusModel : public QAbstractTableModel
FolderStatusUrl,
Folder
};
Q_ENUMS(Roles);
Q_ENUMS(Roles)

FolderStatusModel(QObject *parent = nullptr);
~FolderStatusModel() override;
Expand Down
7 changes: 3 additions & 4 deletions src/gui/folderwizard/folderwizard.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@

#pragma once

#include <QUrl>
#include <QWizard>

#include "accountfwd.h"

#include "gui/folder.h"

class QCheckBox;
class QTreeWidgetItem;

Expand All @@ -43,7 +42,7 @@ class FolderWizard : public QWizard
Page_Target,
Page_SelectiveSync
};
Q_ENUM(PageType);
Q_ENUM(PageType)

struct Result
{
Expand Down Expand Up @@ -87,7 +86,7 @@ class FolderWizard : public QWizard

Result result();

Q_DECLARE_PRIVATE(FolderWizard);
Q_DECLARE_PRIVATE(FolderWizard)

private:
QScopedPointer<FolderWizardPrivate> d_ptr;
Expand Down
3 changes: 2 additions & 1 deletion src/gui/folderwizard/folderwizard_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "libsync/accountfwd.h"

#include <QCoreApplication>
#include <QLoggingCategory>
#include <QStringList>

namespace OCC {
Expand Down Expand Up @@ -50,7 +51,7 @@ class FolderWizardPrivate
const AccountStatePtr &accountState();

private:
Q_DECLARE_PUBLIC(FolderWizard);
Q_DECLARE_PUBLIC(FolderWizard)
FolderWizard *q_ptr;

AccountStatePtr _account;
Expand Down
2 changes: 1 addition & 1 deletion src/gui/owncloudgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ void ownCloudGui::slotTrayMessageIfServerUnsupported(Account *account)
void ownCloudGui::slotComputeOverallSyncStatus()
{
auto getIcon = [this](const SyncResult &result) { return Theme::instance()->themeTrayIcon(result, contextMenuVisible()); };
auto getIconFromStatus = [getIcon, this](const SyncResult::Status &status) { return getIcon(SyncResult{status}); };
auto getIconFromStatus = [getIcon](const SyncResult::Status &status) { return getIcon(SyncResult{status}); };
bool allSignedOut = true;
bool allPaused = true;
bool allDisconnected = true;
Expand Down
2 changes: 1 addition & 1 deletion src/gui/socketapi/socketapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ void SocketApi::command_OPEN_PRIVATE_LINK_VERSIONS(const QString &localFile, Soc
Utility::openBrowser(queryUrl, nullptr);
});
} else {
fetchPrivateLinkUrlHelper(localFile, [this](const QUrl &link) {
fetchPrivateLinkUrlHelper(localFile, [](const QUrl &link) {
Utility::openBrowser(Utility::concatUrlPath(link, {}, {{QStringLiteral("details"), QStringLiteral("versionsTabView")}}), nullptr);
});
}
Expand Down
12 changes: 0 additions & 12 deletions src/gui/spaces/spacesmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,12 @@
*/
#include "spacesmodel.h"

#include "common/utility.h"
#include "networkjobs.h"

#include "libsync/account.h"

#include "libsync/graphapi/spacesmanager.h"

#include "resources/resources.h"

#include <QIcon>
#include <QPixmap>
#include <QRandomGenerator>

namespace {
constexpr QSize ImageSizeC(128, 128);
constexpr QSize ImageMarginC(ImageSizeC * 0.1);
}

using namespace OCC::Spaces;

SpacesModel::SpacesModel(QObject *parent)
Expand Down
8 changes: 4 additions & 4 deletions src/gui/systray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ auto NOTIFICATIONS_IFACE_C()

namespace OCC {

#ifdef Q_OS_OSX
#ifdef Q_OS_MACOS
void *createOsXNotificationCenterDelegate();
void releaseOsXNotificationCenterDelegate(void *delegate);
void sendOsXUserNotification(const QString &title, const QString &message);
Expand All @@ -57,7 +57,7 @@ Systray::Systray(QObject *parent)

Systray::~Systray()
{
#ifdef Q_OS_OSX
#ifdef Q_OS_MACOS
if (delegate) {
releaseOsXNotificationCenterDelegate(delegate);
}
Expand All @@ -66,7 +66,7 @@ Systray::~Systray()

void Systray::showMessage(const QString &title, const QString &message, const QIcon &icon, int millisecondsTimeoutHint)
{
#ifdef Q_OS_OSX
#ifdef Q_OS_MACOS
Q_UNUSED(icon)
Q_UNUSED(millisecondsTimeoutHint)

Expand All @@ -85,7 +85,7 @@ void Systray::showMessage(const QString &title, const QString &message, const QI
{
QSystemTrayIcon::showMessage(title, message, icon, millisecondsTimeoutHint);
}
#endif // Q_OS_OSX
#endif // Q_OS_MACOS
}

void Systray::setToolTip(const QString &tip)
Expand Down
2 changes: 1 addition & 1 deletion src/libsync/account.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ class OWNCLOUDSYNC_EXPORT Account : public QObject
Unknown,
Unsupported
};
Q_ENUMS(ServerSupportLevel);
Q_ENUMS(ServerSupportLevel)
ServerSupportLevel serverSupportLevel() const;

/** True when the server connection is using HTTP2 */
Expand Down
1 change: 1 addition & 0 deletions src/libsync/accountfwd.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#ifndef SERVERFWD_H
#define SERVERFWD_H

#include <QPointer>
#include <QSharedPointer>

namespace OCC {
Expand Down
2 changes: 1 addition & 1 deletion src/libsync/platform_mac.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class MacPlatform : public Platform
void startServices() override;

private:
Q_DECLARE_PRIVATE(MacPlatform);
Q_DECLARE_PRIVATE(MacPlatform)
QScopedPointer<MacPlatformPrivate> d_ptr;
};

Expand Down

0 comments on commit d872c32

Please sign in to comment.