Commit 94efb577 authored by Jonathan Marten's avatar Jonathan Marten
Browse files

Use 'override' as identified by GCC

parent 71a61899
......@@ -66,7 +66,7 @@ public:
return mMetaContact;
}
virtual bool operator<(const QTreeWidgetItem &other) const;
virtual bool operator<(const QTreeWidgetItem &other) const override;
private:
QDate mDate;
Kopete::MetaContact *mMetaContact;
......
......@@ -43,7 +43,7 @@ public:
{
}
void handleMessage(Kopete::MessageEvent *event);
void handleMessage(Kopete::MessageEvent *event) override;
};
class HistoryMessageLoggerFactory : public Kopete::MessageHandlerFactory
......@@ -54,7 +54,7 @@ public:
{
}
Kopete::MessageHandler *create(Kopete::ChatSession * /*manager*/, Kopete::Message::MessageDirection direction)
Kopete::MessageHandler *create(Kopete::ChatSession * /*manager*/, Kopete::Message::MessageDirection direction) override
{
if (direction != Kopete::Message::Inbound) {
return 0;
......@@ -62,7 +62,7 @@ public:
return new HistoryMessageLogger(history);
}
int filterPosition(Kopete::ChatSession *, Kopete::Message::MessageDirection)
int filterPosition(Kopete::ChatSession *, Kopete::Message::MessageDirection) override
{
return Kopete::MessageHandlerFactory::InStageToSent+5;
}
......
......@@ -35,8 +35,8 @@ public:
explicit HistoryPreferences(QWidget *parent = nullptr, const QVariantList &args = QVariantList());
~HistoryPreferences();
virtual void save();
virtual void load();
virtual void save() override;
virtual void load() override;
private slots:
void slotModified();
......
......@@ -156,7 +156,7 @@ private:
startMutex = 0;
}
void run() {
void run() override {
{
QMutexLocker locker(startMutex);
......
......@@ -335,13 +335,13 @@ public:
connect(&t, SIGNAL(timeout()), SLOT(check()));
}
void start()
void start() override
{
t.start(5000);
poll();
}
QList<Info> interfaces() const
QList<Info> interfaces() const override
{
return info;
}
......@@ -415,7 +415,7 @@ class UnixNetProvider : public IrisNetProvider
Q_OBJECT
Q_INTERFACES(XMPP::IrisNetProvider);
public:
virtual NetInterfaceProvider *createNetInterfaceProvider()
virtual NetInterfaceProvider *createNetInterfaceProvider() override
{
return new UnixNet;
}
......
......@@ -546,12 +546,12 @@ public:
emit resolve_error(id, error);
}
virtual bool supportsSingle() const
virtual bool supportsSingle() const override
{
return true;
}
virtual bool supportsLongLived() const
virtual bool supportsLongLived() const override
{
if(mode == Local)
return true; // we support long-lived local queries
......@@ -559,14 +559,14 @@ public:
return false; // we do NOT support long-lived internet queries
}
virtual bool supportsRecordType(int type) const
virtual bool supportsRecordType(int type) const override
{
// all record types supported
Q_UNUSED(type);
return true;
}
virtual int resolve_start(const QByteArray &name, int qType, bool longLived)
virtual int resolve_start(const QByteArray &name, int qType, bool longLived) override
{
if(mode == Internet)
{
......@@ -654,7 +654,7 @@ public:
}
}
virtual void resolve_stop(int id)
virtual void resolve_stop(int id) override
{
Item *i = getItemById(id);
Q_ASSERT(i);
......@@ -664,7 +664,7 @@ public:
releaseItem(i);
}
virtual void resolve_localResultsReady(int id, const QList<XMPP::NameRecord> &results)
virtual void resolve_localResultsReady(int id, const QList<XMPP::NameRecord> &results) override
{
Item *i = getItemById(id);
Q_ASSERT(i);
......@@ -675,7 +675,7 @@ public:
Q_ARG(QList<XMPP::NameRecord>, results));
}
virtual void resolve_localError(int id, XMPP::NameResolver::Error e)
virtual void resolve_localError(int id, XMPP::NameResolver::Error e) override
{
Item *i = getItemById(id);
Q_ASSERT(i);
......@@ -2212,7 +2212,7 @@ public:
publishExtraItemList.clear();
}
virtual int browse_start(const QString &_type, const QString &_domain)
virtual int browse_start(const QString &_type, const QString &_domain) override
{
QString domain;
if(_domain.isEmpty() || _domain == ".")
......@@ -2267,7 +2267,7 @@ public:
return i->id;
}
virtual void browse_stop(int id)
virtual void browse_stop(int id) override
{
BrowseItem *i = browseItemList.itemById(id);
Q_ASSERT(i);
......@@ -2275,7 +2275,7 @@ public:
browseItemList.remove(i);
}
virtual int resolve_start(const QByteArray &name)
virtual int resolve_start(const QByteArray &name) override
{
int id = resolveItemList.reserveId();
......@@ -2297,7 +2297,7 @@ public:
return i->id;
}
virtual void resolve_stop(int id)
virtual void resolve_stop(int id) override
{
ResolveItem *i = resolveItemList.itemById(id);
Q_ASSERT(i);
......@@ -2305,7 +2305,7 @@ public:
resolveItemList.remove(i);
}
virtual int publish_start(const QString &instance, const QString &_type, int port, const QMap<QString,QByteArray> &attributes)
virtual int publish_start(const QString &instance, const QString &_type, int port, const QMap<QString,QByteArray> &attributes) override
{
int id = publishItemList.reserveId();
......@@ -2351,7 +2351,7 @@ public:
return i->id;
}
virtual void publish_update(int id, const QMap<QString,QByteArray> &attributes)
virtual void publish_update(int id, const QMap<QString,QByteArray> &attributes) override
{
PublishItem *i = publishItemList.itemById(id);
Q_ASSERT(i);
......@@ -2363,7 +2363,7 @@ public:
i->publish->update(attributes);
}
virtual void publish_stop(int id)
virtual void publish_stop(int id) override
{
PublishItem *i = publishItemList.itemById(id);
Q_ASSERT(i);
......@@ -2372,7 +2372,7 @@ public:
publishItemList.remove(i);
}
virtual int publish_extra_start(int pub_id, const NameRecord &name)
virtual int publish_extra_start(int pub_id, const NameRecord &name) override
{
PublishItem *pi = publishItemList.itemById(pub_id);
Q_ASSERT(pi);
......@@ -2406,7 +2406,7 @@ public:
return i->id;
}
virtual void publish_extra_update(int id, const NameRecord &name)
virtual void publish_extra_update(int id, const NameRecord &name) override
{
PublishExtraItem *i = publishExtraItemList.itemById(id);
Q_ASSERT(i);
......@@ -2435,7 +2435,7 @@ public:
i->publish->update(rec);
}
virtual void publish_extra_stop(int id)
virtual void publish_extra_stop(int id) override
{
PublishExtraItem *i = publishExtraItemList.itemById(id);
Q_ASSERT(i);
......@@ -2694,19 +2694,19 @@ public:
global = new JDnsGlobal;
}
virtual NameProvider *createNameProviderInternet()
virtual NameProvider *createNameProviderInternet() override
{
ensure_global();
return JDnsNameProvider::create(global, JDnsNameProvider::Internet);
}
virtual NameProvider *createNameProviderLocal()
virtual NameProvider *createNameProviderLocal() override
{
ensure_global();
return JDnsNameProvider::create(global, JDnsNameProvider::Local);
}
virtual ServiceProvider *createServiceProvider()
virtual ServiceProvider *createServiceProvider() override
{
ensure_global();
return JDnsServiceProvider::create(global);
......
......@@ -53,17 +53,17 @@ public:
void connectToHost(const QString &host, quint16 port, QAbstractSocket::NetworkLayerProtocol protocol = QAbstractSocket::UnknownNetworkLayerProtocol);
/*! Connect to the hosts for the specified service */
void connectToHost(const QString &service, const QString &transport, const QString &domain, quint16 port = std::numeric_limits<quint16>::max());
virtual QAbstractSocket* abstractSocket() const;
virtual QAbstractSocket* abstractSocket() const override;
int socket() const;
void setSocket(qintptr);
int state() const;
// from ByteStream
bool isOpen() const;
void close();
void close() override;
qint64 bytesAvailable() const;
qint64 bytesToWrite() const;
qint64 bytesAvailable() const override;
qint64 bytesToWrite() const override;
// local
QHostAddress address() const;
......@@ -74,8 +74,8 @@ public:
quint16 peerPort() const;
protected:
qint64 writeData(const char *data, qint64 maxSize);
qint64 readData(char *data, qint64 maxSize);
qint64 writeData(const char *data, qint64 maxSize) override;
qint64 readData(char *data, qint64 maxSize) override;
signals:
void hostFound();
......
......@@ -41,9 +41,9 @@ public:
ByteStream(QObject *parent=0);
~ByteStream()=0;
bool isSequential() const { return true; }
qint64 bytesAvailable() const;
qint64 bytesToWrite() const;
bool isSequential() const override { return true; }
qint64 bytesAvailable() const override;
qint64 bytesToWrite() const override;
static QByteArray takeArray(QByteArray &from, int size=0, bool del=true);
......@@ -58,8 +58,8 @@ signals:
void error(int);
protected:
qint64 writeData(const char *data, qint64 maxSize);
qint64 readData(char *data, qint64 maxSize);
qint64 writeData(const char *data, qint64 maxSize) override;
qint64 readData(char *data, qint64 maxSize) override;
void setError(int code = ErrOk, const QString &text = QString());
void clearReadBuffer();
......
......@@ -37,10 +37,11 @@ public:
void connectToHost(const QString &proxyHost, int proxyPort, const QString &host, int port);
// from ByteStream
void close();
qint64 bytesToWrite() const;
void close() override;
qint64 bytesToWrite() const override;
protected:
qint64 writeData(const char *data, qint64 maxSize);
qint64 writeData(const char *data, qint64 maxSize) override;
signals:
void connected();
......
......@@ -35,7 +35,7 @@ public:
HttpPoll(QObject *parent=0);
~HttpPoll();
virtual QAbstractSocket* abstractSocket() const;
virtual QAbstractSocket* abstractSocket() const override;
void setAuth(const QString &user, const QString &pass="");
void connectToUrl(const QUrl &url);
......@@ -46,7 +46,7 @@ public:
// from ByteStream
bool isOpen() const;
void close();
void close() override;
signals:
void connected();
......@@ -54,7 +54,7 @@ signals:
void syncFinished();
protected:
int tryWrite();
int tryWrite() override;
private slots:
void http_result();
......
......@@ -63,7 +63,7 @@ public:
SocksClient(qintptr, QObject *parent=0);
~SocksClient();
virtual QAbstractSocket* abstractSocket() const;
virtual QAbstractSocket* abstractSocket() const override;
bool isIncoming() const;
......@@ -79,9 +79,9 @@ public:
void grantUDPAssociate(const QString &relayHost, int relayPort);
// from ByteStream
void close();
qint64 bytesAvailable() const;
qint64 bytesToWrite() const;
void close() override;
qint64 bytesAvailable() const override;
qint64 bytesToWrite() const override;
// remote address
QHostAddress peerAddress() const;
......@@ -93,8 +93,8 @@ public:
SocksUDP *createUDP(const QString &host, int port, const QHostAddress &routeAddr, int routePort);
protected:
qint64 writeData(const char *data, qint64 maxSize);
qint64 readData(char *data, qint64 maxSize);
qint64 writeData(const char *data, qint64 maxSize) override;
qint64 readData(char *data, qint64 maxSize) override;
signals:
// outgoing
......
......@@ -77,12 +77,12 @@ public:
int relayedPort() const;
// reimplemented
virtual void stop();
virtual bool hasPendingDatagrams(int path) const;
virtual QByteArray readDatagram(int path, QHostAddress *addr, int *port);
virtual void writeDatagram(int path, const QByteArray &buf, const QHostAddress &addr, int port);
virtual void addChannelPeer(const QHostAddress &addr, int port);
virtual void setDebugLevel(DebugLevel level);
virtual void stop() override;
virtual bool hasPendingDatagrams(int path) const override;
virtual QByteArray readDatagram(int path, QHostAddress *addr, int *port) override;
virtual void writeDatagram(int path, const QByteArray &buf, const QHostAddress &addr, int port) override;
virtual void addChannelPeer(const QHostAddress &addr, int port) override;
virtual void setDebugLevel(DebugLevel level) override;
signals:
// may be emitted multiple times.
......
......@@ -60,12 +60,12 @@ public:
TurnClient::Error turnErrorCode() const;
// reimplemented
virtual void stop();
virtual bool hasPendingDatagrams(int path) const;
virtual QByteArray readDatagram(int path, QHostAddress *addr, int *port);
virtual void writeDatagram(int path, const QByteArray &buf, const QHostAddress &addr, int port);
virtual void addChannelPeer(const QHostAddress &addr, int port);
virtual void setDebugLevel(DebugLevel level);
virtual void stop() override;
virtual bool hasPendingDatagrams(int path) const override;
virtual QByteArray readDatagram(int path, QHostAddress *addr, int *port) override;
virtual void writeDatagram(int path, const QByteArray &buf, const QHostAddress &addr, int port) override;
virtual void addChannelPeer(const QHostAddress &addr, int port) override;
virtual void setDebugLevel(DebugLevel level) override;
private:
class Private;
......
......@@ -66,9 +66,9 @@ signals:
protected:
// reimplemented
#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
void incomingConnection(int socketDescriptor);
void incomingConnection(int socketDescriptor) override;
#else
void incomingConnection(qintptr socketDescriptor);
void incomingConnection(qintptr socketDescriptor) override;
#endif
};
......
......@@ -74,7 +74,7 @@ public:
void waitForShutdown(const QList<QJDnsShared*> &_list);
protected:
virtual void run();
virtual void run() override;
private slots:
void agent_started();
......
......@@ -28,11 +28,11 @@ namespace XMPP {
public:
RandRandomNumberGenerator() {}
virtual double generateNumber() const {
virtual double generateNumber() const override{
return rand();
}
virtual double getMaximumGeneratedNumber() const {
virtual double getMaximumGeneratedNumber() const override{
return RAND_MAX;
}
};
......
......@@ -74,7 +74,7 @@ public:
delete dec;
}
void reset()
void reset() override
{
delete dec;
dec = 0;
......@@ -112,7 +112,7 @@ public:
return last;
}
QChar next()
QChar next() override
{
if(paused)
return EndOfData;
......@@ -371,18 +371,18 @@ namespace XMPP
}
}
bool startDocument()
bool startDocument() override
{
depth = 0;
return true;
}
bool endDocument()
bool endDocument() override
{
return true;
}
bool startPrefixMapping(const QString &prefix, const QString &uri)
bool startPrefixMapping(const QString &prefix, const QString &uri) override
{
if(depth == 0) {
nsnames += prefix;
......@@ -391,7 +391,7 @@ namespace XMPP
return true;
}
bool startElement(const QString &namespaceURI, const QString &localName, const QString &qName, const QXmlAttributes &atts)
bool startElement(const QString &namespaceURI, const QString &localName, const QString &qName, const QXmlAttributes &atts) override
{
if(depth == 0) {
Parser::Event *e = new Parser::Event;
......@@ -441,7 +441,7 @@ namespace XMPP
return true;
}
bool endElement(const QString &namespaceURI, const QString &localName, const QString &qName)
bool endElement(const QString &namespaceURI, const QString &localName, const QString &qName) override
{
--depth;
if(depth == 0) {
......@@ -475,7 +475,7 @@ namespace XMPP
return true;
}
bool characters(const QString &str)
bool characters(const QString &str) override
{
if(depth >= 1) {
QString content = str;
......
......@@ -144,7 +144,7 @@ namespace XMPP
BasicProtocol();
~BasicProtocol();
void reset();
void reset() override;
// for outgoing xml
QDomDocument doc;
......@@ -199,17 +199,17 @@ namespace XMPP
void delayError(int code);
// reimplemented
QDomElement docElement();
void handleDocOpen(const Parser::Event &pe);
bool handleError();
bool handleCloseFinished();
bool doStep(const QDomElement &e);
void itemWritten(int id, int size);
QDomElement docElement() override;
void handleDocOpen(const Parser::Event &pe) override;
bool handleError() override;
bool handleCloseFinished() override;
bool doStep(const QDomElement &e) override;
void itemWritten(int id, int size) override;
virtual QString defaultNamespace();
virtual QStringList extraNamespaces(); // stringlist: prefix,uri,prefix,uri, [...]
virtual QStringList extraNamespaces() ; // stringlist: prefix,uri,prefix,uri, [...]
virtual void handleStreamOpen(const Parser::Event &pe);
virtual bool doStep2(const QDomElement &e)=0;
virtual bool doStep2(const QDomElement &e) = 0;
void setReady(bool b);
......@@ -262,7 +262,7 @@ namespace XMPP
CoreProtocol();
~CoreProtocol();
void reset();
void reset() override;
void startTimer(int seconds);
// reimplemented to do SM
......@@ -363,16 +363,16 @@ namespace XMPP
bool needSMRequest();
// reimplemented
bool stepAdvancesParser() const;
bool stepRequiresElement() const;
void stringSend(const QString &s);
void stringRecv(const QString &s);
QString defaultNamespace();
QStringList extraNamespaces();
void handleStreamOpen(const Parser::Event &pe);
bool doStep2(const QDomElement &e);
void elementSend(const QDomElement &e);
void elementRecv(const QDomElement &e);
bool stepAdvancesParser() const override;
bool stepRequiresElement() const override;
void stringSend(const QString &s) override;
void stringRecv(const QString &s) override;
QString defaultNamespace() override;
QStringList extraNamespaces() override;