nextcloud-desktop/src/gui/ocsshareejob.cpp
Olivier Goffart 7aca2352be
Use the Qt5 connection syntax (automated with clazy)
This is motivated by the fact that QMetaObject::noralizeSignature takes 7.35%
CPU of the LargeSyncBench. (Mostly from ABstractNetworkJob::setupConnections and
PropagateUploadFileV1::startNextChunk). It could be fixed by using normalized
signature in the connection statement, but i tought it was a good oportunity
to modernize the code.

This commit only contains calls that were automatically converted with clazy.
2017-10-05 22:01:35 +02:00

45 lines
1.3 KiB
C++

/*
* Copyright (C) by Roeland Jago Douma <roeland@owncloud.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*/
#include "ocsshareejob.h"
namespace OCC {
OcsShareeJob::OcsShareeJob(AccountPtr account)
: OcsJob(account)
{
setPath("ocs/v1.php/apps/files_sharing/api/v1/sharees");
connect(this, &OcsJob::jobFinished, this, &OcsShareeJob::jobDone);
}
void OcsShareeJob::getSharees(const QString &search,
const QString &itemType,
int page,
int perPage)
{
setVerb("GET");
addParam(QString::fromLatin1("search"), search);
addParam(QString::fromLatin1("itemType"), itemType);
addParam(QString::fromLatin1("page"), QString::number(page));
addParam(QString::fromLatin1("perPage"), QString::number(perPage));
start();
}
void OcsShareeJob::jobDone(const QJsonDocument &reply)
{
emit shareeJobFinished(reply);
}
}