From bc764c7748e653afd805e6a2a41feb04d0f32d6a Mon Sep 17 00:00:00 2001 From: Montel Laurent Date: Wed, 10 Dec 2014 09:47:51 +0100 Subject: [PATCH] Make it static --- agents/invitations/incidenceattribute.cpp | 3 ++- migration/knotes/notealarmattribute.cpp | 3 ++- migration/knotes/notedisplayattribute.cpp | 3 ++- migration/knotes/notelockattribute.cpp | 3 ++- resources/dav/resource/davprotocolattribute.cpp | 3 ++- resources/google/calendar/defaultreminderattribute.cpp | 3 ++- resources/imap/highestmodseqattribute.cpp | 3 ++- resources/imap/noinferiorsattribute.cpp | 3 ++- resources/imap/noselectattribute.cpp | 3 ++- resources/imap/timestampattribute.cpp | 3 ++- resources/imap/uidnextattribute.cpp | 3 ++- resources/imap/uidvalidityattribute.cpp | 3 ++- resources/mbox/deleteditemsattribute.cpp | 3 ++- resources/nntp/nntpcollectionattribute.cpp | 3 ++- resources/shared/collectionannotationsattribute.cpp | 3 ++- resources/shared/collectionflagsattribute.cpp | 3 ++- resources/shared/filestore/entitycompactchangeattribute.cpp | 3 ++- resources/shared/imapaclattribute.cpp | 3 ++- resources/shared/imapquotaattribute.cpp | 3 ++- 19 files changed, 38 insertions(+), 19 deletions(-) diff --git a/agents/invitations/incidenceattribute.cpp b/agents/invitations/incidenceattribute.cpp index 20531ea19..116da69dd 100644 --- a/agents/invitations/incidenceattribute.cpp +++ b/agents/invitations/incidenceattribute.cpp @@ -45,7 +45,8 @@ IncidenceAttribute::~IncidenceAttribute() QByteArray IncidenceAttribute::type() const { - return "incidence"; + static const QByteArray sType( "incidence" ); + return sType; } Attribute* IncidenceAttribute::clone() const diff --git a/migration/knotes/notealarmattribute.cpp b/migration/knotes/notealarmattribute.cpp index 3d486f580..3a9e2c555 100644 --- a/migration/knotes/notealarmattribute.cpp +++ b/migration/knotes/notealarmattribute.cpp @@ -53,7 +53,8 @@ QByteArray NoteAlarmAttribute::serialized() const QByteArray NoteAlarmAttribute::type() const { - return "NoteAlarmAttribute"; + static const QByteArray sType( "NoteAlarmAttribute" ); + return sType; } void NoteAlarmAttribute::setDateTime(const KDateTime &dateTime) diff --git a/migration/knotes/notedisplayattribute.cpp b/migration/knotes/notedisplayattribute.cpp index d8ebe3b29..ef5702952 100644 --- a/migration/knotes/notedisplayattribute.cpp +++ b/migration/knotes/notedisplayattribute.cpp @@ -111,7 +111,8 @@ QByteArray NoteDisplayAttribute::serialized() const QByteArray NoteDisplayAttribute::type() const { - return "NoteDisplayAttribute"; + static const QByteArray sType( "NoteDisplayAttribute" ); + return sType; } void NoteDisplayAttribute::setBackgroundColor(const QColor &color) diff --git a/migration/knotes/notelockattribute.cpp b/migration/knotes/notelockattribute.cpp index 404cbd07d..ada60a778 100644 --- a/migration/knotes/notelockattribute.cpp +++ b/migration/knotes/notelockattribute.cpp @@ -52,7 +52,8 @@ QByteArray NoteLockAttribute::serialized() const QByteArray NoteLockAttribute::type() const { //We can't change this name! - return "KJotsLockAttribute"; + static const QByteArray sType( "KJotsLockAttribute" ); + return sType; } diff --git a/resources/dav/resource/davprotocolattribute.cpp b/resources/dav/resource/davprotocolattribute.cpp index e961ee9a7..d6bbc04e8 100644 --- a/resources/dav/resource/davprotocolattribute.cpp +++ b/resources/dav/resource/davprotocolattribute.cpp @@ -40,7 +40,8 @@ Akonadi::Attribute* DavProtocolAttribute::clone() const QByteArray DavProtocolAttribute::type() const { - return "davprotocol"; + static const QByteArray sType( "davprotocol" ); + return sType; } QByteArray DavProtocolAttribute::serialized() const diff --git a/resources/google/calendar/defaultreminderattribute.cpp b/resources/google/calendar/defaultreminderattribute.cpp index 5fa009d23..61f750530 100644 --- a/resources/google/calendar/defaultreminderattribute.cpp +++ b/resources/google/calendar/defaultreminderattribute.cpp @@ -109,6 +109,7 @@ KCalCore::Alarm::List DefaultReminderAttribute::alarms( KCalCore::Incidence *inc QByteArray DefaultReminderAttribute::type() const { - return "defaultReminders"; + static const QByteArray sType( "defaultReminders" ); + return sType; } diff --git a/resources/imap/highestmodseqattribute.cpp b/resources/imap/highestmodseqattribute.cpp index af166fd97..9a9e6b0b8 100644 --- a/resources/imap/highestmodseqattribute.cpp +++ b/resources/imap/highestmodseqattribute.cpp @@ -44,7 +44,8 @@ Akonadi::Attribute* HighestModSeqAttribute::clone() const QByteArray HighestModSeqAttribute::type() const { - return "highestmodseq"; + static const QByteArray sType( "highestmodseq" ); + return sType; } void HighestModSeqAttribute::deserialize( const QByteArray &data ) diff --git a/resources/imap/noinferiorsattribute.cpp b/resources/imap/noinferiorsattribute.cpp index c506de3ee..ffca8d7be 100644 --- a/resources/imap/noinferiorsattribute.cpp +++ b/resources/imap/noinferiorsattribute.cpp @@ -40,7 +40,8 @@ bool NoInferiorsAttribute::noInferiors() const QByteArray NoInferiorsAttribute::type() const { - return "noinferiors"; + static const QByteArray sType( "noinferiors" ); + return sType; } Akonadi::Attribute* NoInferiorsAttribute::clone() const diff --git a/resources/imap/noselectattribute.cpp b/resources/imap/noselectattribute.cpp index 849032b5d..6cde6a974 100644 --- a/resources/imap/noselectattribute.cpp +++ b/resources/imap/noselectattribute.cpp @@ -40,7 +40,8 @@ bool NoSelectAttribute::noSelect() const QByteArray NoSelectAttribute::type() const { - return "noselect"; + static const QByteArray sType( "noselect" ); + return sType; } Akonadi::Attribute* NoSelectAttribute::clone() const diff --git a/resources/imap/timestampattribute.cpp b/resources/imap/timestampattribute.cpp index e1ab6f65b..1aac345d6 100644 --- a/resources/imap/timestampattribute.cpp +++ b/resources/imap/timestampattribute.cpp @@ -42,7 +42,8 @@ uint TimestampAttribute::timestamp() const QByteArray TimestampAttribute::type() const { - return "timestamp"; + static const QByteArray sType( "timestamp" ); + return sType; } Akonadi::Attribute *TimestampAttribute::clone() const diff --git a/resources/imap/uidnextattribute.cpp b/resources/imap/uidnextattribute.cpp index 24a3f2e48..f72d52bb0 100644 --- a/resources/imap/uidnextattribute.cpp +++ b/resources/imap/uidnextattribute.cpp @@ -40,7 +40,8 @@ int UidNextAttribute::uidNext() const QByteArray UidNextAttribute::type() const { - return "uidnext"; + static const QByteArray sType( "uidnext" ); + return sType; } Akonadi::Attribute* UidNextAttribute::clone() const diff --git a/resources/imap/uidvalidityattribute.cpp b/resources/imap/uidvalidityattribute.cpp index 04bb21793..67d733aaa 100644 --- a/resources/imap/uidvalidityattribute.cpp +++ b/resources/imap/uidvalidityattribute.cpp @@ -40,7 +40,8 @@ int UidValidityAttribute::uidValidity() const QByteArray UidValidityAttribute::type() const { - return "uidvalidity"; + static const QByteArray sType( "uidvalidity" ); + return sType; } Akonadi::Attribute* UidValidityAttribute::clone() const diff --git a/resources/mbox/deleteditemsattribute.cpp b/resources/mbox/deleteditemsattribute.cpp index f1bebd4e4..6e858f5ed 100644 --- a/resources/mbox/deleteditemsattribute.cpp +++ b/resources/mbox/deleteditemsattribute.cpp @@ -92,5 +92,6 @@ int DeletedItemsAttribute::offsetCount() const QByteArray DeletedItemsAttribute::type() const { - return "DeletedMboxItems"; + static const QByteArray sType( "DeletedMboxItems" ); + return sType; } diff --git a/resources/nntp/nntpcollectionattribute.cpp b/resources/nntp/nntpcollectionattribute.cpp index 6aba4b34b..83b8d31fe 100644 --- a/resources/nntp/nntpcollectionattribute.cpp +++ b/resources/nntp/nntpcollectionattribute.cpp @@ -29,7 +29,8 @@ NntpCollectionAttribute::NntpCollectionAttribute() QByteArray NntpCollectionAttribute::type() const { - return "NNTP"; + static const QByteArray sType( "NNTP" ); + return sType; } NntpCollectionAttribute * NntpCollectionAttribute::clone() const diff --git a/resources/shared/collectionannotationsattribute.cpp b/resources/shared/collectionannotationsattribute.cpp index b4df346ff..83a799109 100644 --- a/resources/shared/collectionannotationsattribute.cpp +++ b/resources/shared/collectionannotationsattribute.cpp @@ -46,7 +46,8 @@ QMap CollectionAnnotationsAttribute::annotations() const QByteArray CollectionAnnotationsAttribute::type() const { - return "collectionannotations"; + static const QByteArray sType( "collectionannotations" ); + return sType; } Akonadi::Attribute* CollectionAnnotationsAttribute::clone() const diff --git a/resources/shared/collectionflagsattribute.cpp b/resources/shared/collectionflagsattribute.cpp index 42c980bb0..a5a482669 100644 --- a/resources/shared/collectionflagsattribute.cpp +++ b/resources/shared/collectionflagsattribute.cpp @@ -41,7 +41,8 @@ QList CollectionFlagsAttribute::flags() const QByteArray CollectionFlagsAttribute::type() const { - return "collectionflags"; + static const QByteArray sType( "collectionflags" ); + return sType; } Akonadi::Attribute* CollectionFlagsAttribute::clone() const diff --git a/resources/shared/filestore/entitycompactchangeattribute.cpp b/resources/shared/filestore/entitycompactchangeattribute.cpp index 3484b4994..1320b326a 100644 --- a/resources/shared/filestore/entitycompactchangeattribute.cpp +++ b/resources/shared/filestore/entitycompactchangeattribute.cpp @@ -81,7 +81,8 @@ QString FileStore::EntityCompactChangeAttribute::remoteRevision() const QByteArray FileStore::EntityCompactChangeAttribute::type() const { - return "ENTITYCOMPACTCHANGE"; + static const QByteArray sType( "ENTITYCOMPACTCHANGE" ); + return sType; } FileStore::EntityCompactChangeAttribute* FileStore::EntityCompactChangeAttribute::clone() const diff --git a/resources/shared/imapaclattribute.cpp b/resources/shared/imapaclattribute.cpp index ad4fe2cf2..8882edd98 100644 --- a/resources/shared/imapaclattribute.cpp +++ b/resources/shared/imapaclattribute.cpp @@ -51,7 +51,8 @@ QMap ImapAclAttribute::oldRights() const QByteArray ImapAclAttribute::type() const { - return "imapacl"; + static const QByteArray sType( "imapacl" ); + return sType; } Akonadi::Attribute* ImapAclAttribute::clone() const diff --git a/resources/shared/imapquotaattribute.cpp b/resources/shared/imapquotaattribute.cpp index 879e5cd4b..ecd868359 100644 --- a/resources/shared/imapquotaattribute.cpp +++ b/resources/shared/imapquotaattribute.cpp @@ -69,7 +69,8 @@ QList< QMap > Akonadi::ImapQuotaAttribute::usages() const QByteArray ImapQuotaAttribute::type() const { - return "imapquota"; + static const QByteArray sType( "imapquota" ); + return sType; } Akonadi::Attribute* ImapQuotaAttribute::clone() const -- GitLab