Remove unused functions and variables

Signed-off-by: Felix Weilbach <felix.weilbach@nextcloud.com>
This commit is contained in:
Felix Weilbach 2021-07-23 17:41:02 +02:00 committed by Matthieu Gallien (Rebase PR Action)
parent d72f7e9109
commit acf6cc0527
7 changed files with 19 additions and 33 deletions

View file

@ -478,7 +478,6 @@ void Application::slotCrash()
void Application::slotownCloudWizardDone(int res)
{
AccountManager *accountMan = AccountManager::instance();
FolderMan *folderMan = FolderMan::instance();
// During the wizard, scheduling of new syncs is disabled
@ -491,7 +490,7 @@ void Application::slotownCloudWizardDone(int res)
// If one account is configured: enable autostart
#ifndef QT_DEBUG
bool shouldSetAutoStart = (accountMan->accounts().size() == 1);
bool shouldSetAutoStart = AccountManager::instance()->accounts().size() == 1;
#else
bool shouldSetAutoStart = false;
#endif

View file

@ -1075,7 +1075,7 @@ Folder *FolderMan::addFolder(AccountState *accountState, const FolderDefinition
// Migration: The first account that's configured for a local folder shall
// be saved in a backwards-compatible way.
const auto folderList = FolderMan::instance()->map();
const auto oneAccountOnly = std::none_of(folderList.cbegin(), folderList.cend(), [this, folder](const auto *other) {
const auto oneAccountOnly = std::none_of(folderList.cbegin(), folderList.cend(), [folder](const auto *other) {
return other != folder && other->cleanPath() == folder->cleanPath();
});

View file

@ -45,23 +45,6 @@ namespace {
// it matches _preDefinedStatus, otherwise the default is online (0)
return preDefinedStatus.value(status.toLower(), UserStatus::Status::Online);
}
QString enumToString(UserStatus::Status status)
{
switch (status) {
case UserStatus::Status::Away:
return QObject::tr("Away");
case UserStatus::Status::DoNotDisturb:
return QObject::tr("Do not disturb");
case UserStatus::Status::Invisible:
case UserStatus::Status::Offline:
return QObject::tr("Offline");
case UserStatus::Status::Online:
return QObject::tr("Online");
}
Q_UNREACHABLE();
}
}
UserStatus::UserStatus(QObject *parent)

View file

@ -1009,7 +1009,7 @@ void ClientSideEncryption::writePrivateKey(const AccountPtr &account)
job->setInsecureFallback(false);
job->setKey(kck);
job->setBinaryData(_privateKey);
connect(job, &WritePasswordJob::finished, [this](Job *incoming) {
connect(job, &WritePasswordJob::finished, [](Job *incoming) {
Q_UNUSED(incoming);
qCInfo(lcCse()) << "Private key stored in keychain";
});
@ -1028,7 +1028,7 @@ void ClientSideEncryption::writeCertificate(const AccountPtr &account)
job->setInsecureFallback(false);
job->setKey(kck);
job->setBinaryData(_certificate.toPem());
connect(job, &WritePasswordJob::finished, [this](Job *incoming) {
connect(job, &WritePasswordJob::finished, [](Job *incoming) {
Q_UNUSED(incoming);
qCInfo(lcCse()) << "Certificate stored in keychain";
});

View file

@ -9,6 +9,7 @@ add_library(testutils
syncenginetestutils.cpp
pushnotificationstestutils.cpp
themeutils.cpp
testhelper.cpp
)
target_link_libraries(testutils PUBLIC ${APPLICATION_EXECUTABLE}sync Qt5::Test)

10
test/testhelper.cpp Normal file
View file

@ -0,0 +1,10 @@
#include "testhelper.h"
OCC::FolderDefinition folderDefinition(const QString &path)
{
OCC::FolderDefinition d;
d.localPath = path;
d.targetPath = path;
d.alias = path;
return d;
}

View file

@ -1,12 +1,11 @@
#ifndef TESTHELPER_H
#define TESTHELPER_H
#include "folder.h"
#include "gui/folder.h"
#include "creds/httpcredentials.h"
using namespace OCC;
class HttpCredentialsTest : public HttpCredentials {
class HttpCredentialsTest : public OCC::HttpCredentials
{
public:
HttpCredentialsTest(const QString& user, const QString& password)
: HttpCredentials(user, password)
@ -17,12 +16,6 @@ public:
}
};
static FolderDefinition folderDefinition(const QString &path) {
FolderDefinition d;
d.localPath = path;
d.targetPath = path;
d.alias = path;
return d;
}
OCC::FolderDefinition folderDefinition(const QString &path);
#endif // TESTHELPER_H