Commit 49e14255 authored by Glen Ditchfield's avatar Glen Ditchfield 🐛 Committed by Glen Ditchfield
Browse files

Fix clazy warnings

parent be885bca
Pipeline #42876 passed with stage
in 5 minutes and 44 seconds
......@@ -83,7 +83,6 @@ ObjectsList PostSearchJob::handleReplyWithItems(const QNetworkReply *reply, cons
feedData.requestUrl = reply->request().url();
ObjectsList items;
QString itemId;
const QString contentType = reply->header(QNetworkRequest::ContentTypeHeader).toString();
ContentType ct = Utils::stringToContentType(contentType);
......
......@@ -329,7 +329,7 @@ ObjectPtr Private::JSONToCalendar(const QVariantMap& data)
QByteArray calendarToJSON(const CalendarPtr& calendar)
{
QVariantMap output, entry;
QVariantMap entry;
if (!calendar->uid().isEmpty()) {
entry.insert(idParam, calendar->uid());
......
......@@ -267,19 +267,19 @@ QString Contact::IMSchemeToProtocolName(const QString& scheme)
QString Contact::IMProtocolNameToScheme(const QString& protocolName)
{
QString proto;
if (protocolName.toUpper() == QLatin1String("XMPP")) {
QString proto {protocolName.toUpper()};
if (proto == QLatin1String("XMPP")) {
return SCHEME_URL + QLatin1String("JABBER");
} else if ((protocolName.toUpper() == QLatin1String("ICQ")) ||
(protocolName.toUpper() == QLatin1String("GOOGLE_TALK")) ||
(protocolName.toUpper() == QLatin1String("QQ")) ||
(protocolName.toUpper() == QLatin1String("SKYPE")) ||
(protocolName.toUpper() == QLatin1String("YAHOO")) ||
(protocolName.toUpper() == QLatin1String("MSN")) ||
(protocolName.toUpper() == QLatin1String("AIM")))
} else if ((proto == QLatin1String("ICQ")) ||
(proto == QLatin1String("GOOGLE_TALK")) ||
(proto == QLatin1String("QQ")) ||
(proto == QLatin1String("SKYPE")) ||
(proto == QLatin1String("YAHOO")) ||
(proto == QLatin1String("MSN")) ||
(proto == QLatin1String("AIM")))
{
return SCHEME_URL + protocolName.toUpper();
} else if (protocolName.toUpper() == QLatin1String("GOOGLETALK")) {
return SCHEME_URL + proto;
} else if (proto == QLatin1String("GOOGLETALK")) {
return SCHEME_URL + QStringLiteral("GOOGLE_TALK");
}
......
......@@ -143,7 +143,6 @@ ObjectsList ContactFetchJob::handleReplyWithItems(const QNetworkReply *reply, co
{
FeedData feedData;
ObjectsList items;
QString itemId;
const QString contentType = reply->header(QNetworkRequest::ContentTypeHeader).toString();
ContentType ct = Utils::stringToContentType(contentType);
if (ct == KGAPI2::JSON) {
......
......@@ -86,7 +86,6 @@ ObjectsList ContactsGroupFetchJob::handleReplyWithItems(const QNetworkReply *rep
{
FeedData feedData;
ObjectsList items;
QString itemId;
const QString contentType = reply->header(QNetworkRequest::ContentTypeHeader).toString();
ContentType ct = Utils::stringToContentType(contentType);
if (ct == KGAPI2::JSON) {
......
......@@ -45,7 +45,7 @@ Q_SIGNALS:
* The object is automatically scheduled for deletion after this signal
* is emitted.
*/
void finished(AccountPromise *self);
void finished(KGAPI2::AccountPromise *self);
private:
AccountPromise(QObject *parent = nullptr);
......
......@@ -463,7 +463,7 @@ void Job::setFields(const QStringList &fields)
}
QString Job::buildSubfields(const QString &field, const QStringList &fields) {
return QStringLiteral("%1(%2)").arg(field).arg(fields.join(QLatin1Char(',')));
return QStringLiteral("%1(%2)").arg(field, fields.join(QLatin1Char(',')));
}
void Job::restart()
......
......@@ -178,7 +178,6 @@ ObjectsList ChangeFetchJob::handleReplyWithItems(const QNetworkReply *reply,
feedData.requestUrl = reply->url();
ObjectsList items;
QString itemId;
const QString contentType = reply->header(QNetworkRequest::ContentTypeHeader).toString();
ContentType ct = Utils::stringToContentType(contentType);
......
......@@ -145,7 +145,6 @@ ObjectsList DrivesFetchJob::handleReplyWithItems(const QNetworkReply *reply,
feedData.requestUrl = reply->url();
ObjectsList items;
QString itemId;
const QString contentType = reply->header(QNetworkRequest::ContentTypeHeader).toString();
ContentType ct = Utils::stringToContentType(contentType);
......
......@@ -182,7 +182,7 @@ class KGAPIDRIVE_EXPORT FileAbstractResumableJob : public KGAPI2::Drive::FileAbs
*
* @see write
*/
void readyWrite(FileAbstractResumableJob *job);
void readyWrite(KGAPI2::Drive::FileAbstractResumableJob *job);
private:
class Private;
......
......@@ -146,7 +146,6 @@ ObjectsList TeamdriveFetchJob::handleReplyWithItems(const QNetworkReply *reply,
feedData.requestUrl = reply->url();
ObjectsList items;
QString itemId;
const QString contentType = reply->header(QNetworkRequest::ContentTypeHeader).toString();
ContentType ct = Utils::stringToContentType(contentType);
......
......@@ -21,12 +21,12 @@ namespace KGAPI2
class KGAPILATITUDE_DEPRECATED_EXPORT Latitude: public QObject
{
Q_OBJECT
Q_ENUMS(Granularity)
public:
enum Granularity {
City, Best
};
Q_ENUM(Granularity)
};
} // namespace KGAPI2
......
......@@ -205,7 +205,6 @@ ObjectsList TaskFetchJob::handleReplyWithItems(const QNetworkReply *reply, const
feedData.requestUrl = reply->url();
ObjectsList items;
QString itemId;
const QString contentType = reply->header(QNetworkRequest::ContentTypeHeader).toString();
ContentType ct = Utils::stringToContentType(contentType);
if (ct == KGAPI2::JSON) {
......
......@@ -67,7 +67,6 @@ ObjectsList TaskListFetchJob::handleReplyWithItems(const QNetworkReply *reply,
{
FeedData feedData;
ObjectsList items;
QString itemId;
const QString contentType = reply->header(QNetworkRequest::ContentTypeHeader).toString();
ContentType ct = Utils::stringToContentType(contentType);
if (ct == KGAPI2::JSON) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment