Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit bd9d5094 authored by Laurent Montel's avatar Laurent Montel 😁

Pedantic + add override where necessary

parent b320a630
......@@ -80,7 +80,7 @@ private:
boost::scoped_ptr<KCalCore::MemoryCalendar> mCalendar;
};
}; //Namespace
}; //Namespace
} //Namespace
} //Namespace
#endif
......@@ -32,7 +32,7 @@ namespace Kolab {
KOLAB_EXPORT std::string getLocalTimezone();
}; //Namespace
}; //Namespace
} //Namespace
} //Namespace
#endif
......@@ -235,5 +235,5 @@ cDateTime Calendaring::Event::getLastOccurrence() const
}
};
};
}
}
......@@ -116,7 +116,7 @@ private:
Kolab::ITipHandler mITipHandler;
};
};
};
}
}
#endif // EVENT_H
......@@ -53,7 +53,7 @@ namespace Kolab {
return QString::fromUtf8(s.c_str());
}
};
};
}
}
#endif
......@@ -85,7 +85,7 @@ namespace Kolab {
for ( unsigned int i = 0 ; i < numCryptoMessageFormats ; ++i )
if ( f == cryptoMessageFormats[i].format )
return cryptoMessageFormats[i].configName;
return 0;
return nullptr;
}
QStringList cryptoMessageFormatsToStringList( unsigned int f ) {
......@@ -93,7 +93,7 @@ namespace Kolab {
for ( unsigned int i = 0 ; i < numCryptoMessageFormats ; ++i )
if ( f & cryptoMessageFormats[i].format )
result.push_back( cryptoMessageFormats[i].configName );
return result;
return result;
}
......@@ -102,7 +102,7 @@ namespace Kolab {
for ( unsigned int i = 0 ; i < numCryptoMessageFormats ; ++i )
if ( t == cryptoMessageFormats[i].configName )
return cryptoMessageFormats[i].format;
return AutoFormat;
return AutoFormat;
}
unsigned int stringListToCryptoMessageFormats( const QStringList & sl ) {
......
......@@ -37,7 +37,7 @@ namespace Kolab {
KOLAB_EXPORT KContacts::ContactGroup toKABC(const Kolab::DistList &);
KOLAB_EXPORT Kolab::DistList fromKABC(const KContacts::ContactGroup &);
};
};
}
}
#endif
......@@ -43,7 +43,7 @@ namespace Kolab {
KOLAB_EXPORT KCalCore::Journal::Ptr toKCalCore(const Kolab::Journal &);
KOLAB_EXPORT Kolab::Journal fromKCalCore(const KCalCore::Journal &);
};
};
}
}
#endif
......@@ -33,7 +33,7 @@ namespace Kolab {
KOLAB_EXPORT KMime::Message::Ptr toNote(const Kolab::Note &);
KOLAB_EXPORT Kolab::Note fromNote(const KMime::Message::Ptr &);
};
};
}
}
#endif
......@@ -61,7 +61,7 @@ ErrorHandler::ErrorHandler()
m_debugStream(new DebugStream)
{
};
}
QDebug ErrorHandler::debugStream(ErrorHandler::Severity severity, int line, const char* file)
{
......
......@@ -120,10 +120,10 @@ public:
ErrorHandler::Severity m_severity;
DebugStream();
virtual ~DebugStream();
bool isSequential() const { return true; }
qint64 readData(char *, qint64) { return 0; /* eof */ }
qint64 readLineData(char *, qint64) { return 0; /* eof */ }
qint64 writeData(const char *data, qint64 len);
bool isSequential() const override { return true; }
qint64 readData(char *, qint64) override { return 0; /* eof */ }
qint64 readLineData(char *, qint64) override { return 0; /* eof */ }
qint64 writeData(const char *data, qint64 len) override;
private:
Q_DISABLE_COPY(DebugStream)
};
......
......@@ -42,10 +42,10 @@
namespace Kolab {
static inline QString eventKolabType() { return QString::fromLatin1(KOLAB_TYPE_EVENT); };
static inline QString todoKolabType() { return QString::fromLatin1(KOLAB_TYPE_TASK); };
static inline QString journalKolabType() { return QString::fromLatin1(KOLAB_TYPE_JOURNAL); };
static inline QString contactKolabType() { return QString::fromLatin1(KOLAB_TYPE_CONTACT); };
static inline QString eventKolabType() { return QString::fromLatin1(KOLAB_TYPE_EVENT); }
static inline QString todoKolabType() { return QString::fromLatin1(KOLAB_TYPE_TASK); }
static inline QString journalKolabType() { return QString::fromLatin1(KOLAB_TYPE_JOURNAL); }
static inline QString contactKolabType() { return QString::fromLatin1(KOLAB_TYPE_CONTACT); }
static inline QString distlistKolabType() { return QString::fromLatin1(KOLAB_TYPE_DISTLIST); }
static inline QString distlistKolabTypeCompat() { return QString::fromLatin1(KOLAB_TYPE_DISTLIST_V2); }
static inline QString noteKolabType() { return QString::fromLatin1(KOLAB_TYPE_NOTE); }
......@@ -54,9 +54,9 @@ static inline QString dictKolabType() { return QString::fromLatin1(KOLAB_TYPE_DI
static inline QString freebusyKolabType() { return QString::fromLatin1(KOLAB_TYPE_FREEBUSY); }
static inline QString relationKolabType() { return QString::fromLatin1(KOLAB_TYPE_RELATION); }
static inline QString xCalMimeType() { return QString::fromLatin1(MIME_TYPE_XCAL); };
static inline QString xCardMimeType() { return QString::fromLatin1(MIME_TYPE_XCARD); };
static inline QString kolabMimeType() { return QString::fromLatin1(MIME_TYPE_KOLAB); };
static inline QString xCalMimeType() { return QString::fromLatin1(MIME_TYPE_XCAL); }
static inline QString xCardMimeType() { return QString::fromLatin1(MIME_TYPE_XCARD); }
static inline QString kolabMimeType() { return QString::fromLatin1(MIME_TYPE_KOLAB); }
KCalCore::Event::Ptr readV2EventXML(const QByteArray& xmlData, QStringList& attachments)
{
......@@ -576,5 +576,5 @@ KMime::Message::Ptr KolabObjectWriter::writeRelation(const Akonadi::Relation &re
}
}; //Namespace
} //Namespace
......@@ -32,14 +32,14 @@
#include <boost/algorithm/string/predicate.hpp>
Q_DECLARE_METATYPE(Kolab::Event);
Q_DECLARE_METATYPE(Kolab::Todo);
Q_DECLARE_METATYPE(Kolab::Journal);
Q_DECLARE_METATYPE(Kolab::Contact);
Q_DECLARE_METATYPE(Kolab::DistList);
Q_DECLARE_METATYPE(Kolab::Note);
Q_DECLARE_METATYPE(Kolab::Freebusy);
Q_DECLARE_METATYPE(Kolab::Configuration);
Q_DECLARE_METATYPE(Kolab::Event)
Q_DECLARE_METATYPE(Kolab::Todo)
Q_DECLARE_METATYPE(Kolab::Journal)
Q_DECLARE_METATYPE(Kolab::Contact)
Q_DECLARE_METATYPE(Kolab::DistList)
Q_DECLARE_METATYPE(Kolab::Note)
Q_DECLARE_METATYPE(Kolab::Freebusy)
Q_DECLARE_METATYPE(Kolab::Configuration)
static inline std::string eventKolabType() { return std::string(KOLAB_TYPE_EVENT); }
static inline std::string todoKolabType() { return std::string(KOLAB_TYPE_TASK); }
......
......@@ -372,4 +372,4 @@ std::string XMLObject::writeFile(const File &file, Version version, const std::s
}
};
}
......@@ -73,7 +73,7 @@ public:
void saveTo( KContacts::Addressee* address );
QString type() const { return "Contact"; }
QString type() const override { return "Contact"; }
void setGivenName( const QString& name );
QString givenName() const;
......@@ -189,16 +189,16 @@ public:
void setLongitude( float longitude ) { mLongitude = longitude; }
// Load the attributes of this class
bool loadAttribute( QDomElement& );
bool loadAttribute( QDomElement& ) override;
// Save the attributes of this class
bool saveAttributes( QDomElement& ) const;
bool saveAttributes( QDomElement& ) const override;
// Load this note by reading the XML file
bool loadXML( const QDomDocument& xml );
bool loadXML( const QDomDocument& xml ) override;
// Serialize this note to an XML string
QString saveXML() const;
QString saveXML() const override;
protected:
void setFields( const KContacts::Addressee* );
......@@ -222,7 +222,7 @@ private:
QByteArray loadSoundFromAddressee( const KContacts::Sound& sound );
QString productID() const;
QString productID() const override;
QString mGivenName;
QString mMiddleNames;
......
......@@ -48,24 +48,24 @@ public:
void saveTo( KContacts::ContactGroup* contactGroup );
QString type() const { return "DistributionList"; }
QString type() const override { return "DistributionList"; }
void setName( const QString& name );
QString name() const;
// Load the attributes of this class
bool loadAttribute( QDomElement& );
bool loadAttribute( QDomElement& ) override;
// Save the attributes of this class
bool saveAttributes( QDomElement& ) const;
bool saveAttributes( QDomElement& ) const override;
// Load this note by reading the XML file
bool loadXML( const QDomDocument& xml );
bool loadXML( const QDomDocument& xml ) override;
// Serialize this note to an XML string
QString saveXML() const;
QString saveXML() const override;
QString productID() const;
QString productID() const override;
protected:
void setFields( const KContacts::ContactGroup* );
......
......@@ -65,7 +65,7 @@ public:
void saveTo( const KCalCore::Event::Ptr &event );
virtual QString type() const { return "Event"; }
QString type() const override { return "Event"; }
virtual void setTransparency( KCalCore::Event::Transparency transparency );
virtual KCalCore::Event::Transparency transparency() const;
......@@ -76,16 +76,16 @@ public:
virtual KDateTime endDate() const;
// Load the attributes of this class
virtual bool loadAttribute( QDomElement& );
bool loadAttribute( QDomElement& ) override;
// Save the attributes of this class
virtual bool saveAttributes( QDomElement& ) const;
bool saveAttributes( QDomElement& ) const override;
// Load this event by reading the XML file
virtual bool loadXML( const QDomDocument& xml );
bool loadXML( const QDomDocument& xml ) override;
// Serialize this event to an XML string
virtual QString saveXML() const;
QString saveXML() const override;
protected:
// Read all known fields from this ical incidence
......
......@@ -105,7 +105,7 @@ public:
QList<Attendee>& attendees();
const QList<Attendee>& attendees() const;
virtual QString type() const { return "Incidence"; }
QString type() const override { return "Incidence"; }
/**
* The internal uid is used as the uid inside KOrganizer whenever
* two or more events with the same uid appear, which KOrganizer
......@@ -116,10 +116,10 @@ public:
QString internalUID() const;
// Load the attributes of this class
virtual bool loadAttribute( QDomElement& );
bool loadAttribute( QDomElement& ) override;
// Save the attributes of this class
virtual bool saveAttributes( QDomElement& ) const;
bool saveAttributes( QDomElement& ) const override;
protected:
enum FloatingStatus { Unset, AllDay, HasTime };
......@@ -141,7 +141,7 @@ protected:
void saveCustomAttributes( QDomElement& element ) const;
void loadCustomAttributes( QDomElement& element );
QString productID() const;
QString productID() const override;
QString mSummary;
QString mLocation;
......
......@@ -60,7 +60,7 @@ public:
explicit Journal( const QString& tz, const KCalCore::Journal::Ptr &journal = KCalCore::Journal::Ptr() );
virtual ~Journal();
virtual QString type() const { return "Journal"; }
QString type() const override { return "Journal"; }
void saveTo( const KCalCore::Journal::Ptr &journal );
......@@ -74,22 +74,22 @@ public:
virtual KDateTime endDate() const;
// Load the attributes of this class
virtual bool loadAttribute( QDomElement& );
bool loadAttribute( QDomElement& ) override;
// Save the attributes of this class
virtual bool saveAttributes( QDomElement& ) const;
bool saveAttributes( QDomElement& ) const override;
// Load this journal by reading the XML file
virtual bool loadXML( const QDomDocument& xml );
bool loadXML( const QDomDocument& xml ) override;
// Serialize this journal to an XML string
virtual QString saveXML() const;
QString saveXML() const override;
protected:
// Read all known fields from this ical journal
void setFields( const KCalCore::Journal::Ptr & );
QString productID() const;
QString productID() const override;
QString mSummary;
KDateTime mStartDate;
......
......@@ -63,7 +63,7 @@ public:
void saveTo( const KCalCore::Journal::Ptr &journal );
virtual QString type() const { return "Note"; }
QString type() const override { return "Note"; }
virtual void setSummary( const QString& summary );
virtual QString summary() const;
......@@ -78,16 +78,16 @@ public:
virtual bool richText() const;
// Load the attributes of this class
virtual bool loadAttribute( QDomElement& );
bool loadAttribute( QDomElement& ) override;
// Save the attributes of this class
virtual bool saveAttributes( QDomElement& ) const;
bool saveAttributes( QDomElement& ) const override;
// Load this note by reading the XML file
virtual bool loadXML( const QDomDocument& xml );
bool loadXML( const QDomDocument& xml ) override;
// Serialize this note to an XML string
virtual QString saveXML() const;
QString saveXML() const override;
protected:
// Read all known fields from this ical incidence
......@@ -96,7 +96,7 @@ protected:
// Save all known fields into this ical incidence
void saveTo( const KCalCore::Incidence::Ptr & ) const;
QString productID() const;
QString productID() const override;
QString mSummary;
QColor mBackgroundColor;
......
......@@ -67,7 +67,7 @@ public:
const QString& tz, const KCalCore::Todo::Ptr &todo = KCalCore::Todo::Ptr() );
virtual ~Task();
virtual QString type() const { return "Task"; }
QString type() const override { return "Task"; }
void saveTo( const KCalCore::Todo::Ptr &todo );
......@@ -94,16 +94,16 @@ public:
virtual bool hasCompletedDate() const;
// Load the attributes of this class
virtual bool loadAttribute( QDomElement& );
bool loadAttribute( QDomElement& ) override;
// Save the attributes of this class
virtual bool saveAttributes( QDomElement& ) const;
bool saveAttributes( QDomElement& ) const override;
// Load this task by reading the XML file
virtual bool loadXML( const QDomDocument& xml );
bool loadXML( const QDomDocument& xml ) override;
// Serialize this task to an XML string
virtual QString saveXML() const;
QString saveXML() const override;
protected:
// Read all known fields from this ical todo
......
......@@ -231,5 +231,5 @@ Kolab::Attachment getAttachmentByName(const QString &name, const KMime::Message:
}
}; //Namespace
}; //Namespace
} //Namespace
} //Namespace
......@@ -53,7 +53,7 @@ KMime::Content* createMainPart(const QByteArray& mimeType, const QByteArray& dec
KMime::Content* createAttachmentPart(const QByteArray& cid, const QByteArray& mimeType, const QString& fileName, const QByteArray& decodedContent);
QString fromCid(const QString &cid);
};
}; //Namespace
}
} //Namespace
#endif
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