Commit 355f89b4 authored by Kevin Funk's avatar Kevin Funk

Modernize: Use override

Changes:
* Replace Q_DECL_OVERRIDE with override
* Also strip 'virtual' from methods having 'override' already.
parent 394dc542
......@@ -31,10 +31,10 @@ class AboutProtocol : public KIO::SlaveBase
{
public:
AboutProtocol(const QByteArray &pool_socket, const QByteArray &app_socket);
virtual ~AboutProtocol();
~AboutProtocol() override;
virtual void get(const QUrl& url);
virtual void mimetype(const QUrl& url);
void get(const QUrl& url) override;
void mimetype(const QUrl& url) override;
};
#endif
......@@ -30,15 +30,15 @@ class ActivitiesProtocol : public KIO::ForwardingSlaveBase {
public:
ActivitiesProtocol(const QByteArray &poolSocket, const QByteArray &appSocket);
~ActivitiesProtocol();
~ActivitiesProtocol() override;
protected:
bool rewriteUrl(const QUrl &url, QUrl &newUrl) Q_DECL_OVERRIDE;
void listDir(const QUrl &url) Q_DECL_OVERRIDE;
void prepareUDSEntry(KIO::UDSEntry &entry, bool listing = false) const Q_DECL_OVERRIDE;
void stat(const QUrl& url) Q_DECL_OVERRIDE;
void mimetype(const QUrl& url) Q_DECL_OVERRIDE;
void del(const QUrl& url, bool isfile) Q_DECL_OVERRIDE;
bool rewriteUrl(const QUrl &url, QUrl &newUrl) override;
void listDir(const QUrl &url) override;
void prepareUDSEntry(KIO::UDSEntry &entry, bool listing = false) const override;
void stat(const QUrl& url) override;
void mimetype(const QUrl& url) override;
void del(const QUrl& url, bool isfile) override;
private:
D_PTR;
......
......@@ -35,10 +35,10 @@
class FileItemLinkingPlugin : public KAbstractFileItemActionPlugin {
public:
FileItemLinkingPlugin(QObject *parent, const QVariantList &);
~FileItemLinkingPlugin();
~FileItemLinkingPlugin() override;
QList<QAction *> actions(const KFileItemListProperties &fileItemInfos,
QWidget *parentWidget) Q_DECL_OVERRIDE;
QWidget *parentWidget) override;
private:
D_PTR;
......
......@@ -36,7 +36,7 @@ class FileItemLinkingPluginActionLoader: public QThread {
public:
static FileItemLinkingPluginActionLoader* create(const KFileItemListProperties &items);
void run() Q_DECL_OVERRIDE;
void run() override;
Action createAction(const QString &activity, bool link,
const QString &title = QString(),
......
......@@ -26,9 +26,9 @@ class ArchiveProtocol : public ArchiveProtocolBase
{
public:
ArchiveProtocol( const QByteArray &proto, const QByteArray &pool, const QByteArray &app );
virtual ~ArchiveProtocol() = default;
~ArchiveProtocol() override = default;
KArchive *createArchive( const QString & proto, const QString & archiveFile ) Q_DECL_OVERRIDE;
KArchive *createArchive( const QString & proto, const QString & archiveFile ) override;
};
#endif // KIO_ARCHIVE_H
......@@ -34,11 +34,11 @@ class LIBKIOARCHIVE_EXPORT ArchiveProtocolBase : public KIO::SlaveBase
{
public:
ArchiveProtocolBase( const QByteArray &proto, const QByteArray &pool, const QByteArray &app );
virtual ~ArchiveProtocolBase();
~ArchiveProtocolBase() override;
virtual void listDir( const QUrl & url );
virtual void stat( const QUrl & url );
virtual void get( const QUrl & url );
void listDir( const QUrl & url ) override;
void stat( const QUrl & url ) override;
void get( const QUrl & url ) override;
private:
void createRootUDSEntry( KIO::UDSEntry & entry );
......
......@@ -28,9 +28,9 @@ class BookmarksProtocol : public KIO::SlaveBase
{
public:
BookmarksProtocol( const QByteArray &pool, const QByteArray &app );
~BookmarksProtocol();
~BookmarksProtocol() override;
void get( const QUrl& url );
void get( const QUrl& url ) override;
private:
int columns;
......
......@@ -44,9 +44,9 @@ class FileNameSearchProtocol : public KIO::SlaveBase
{
public:
FileNameSearchProtocol(const QByteArray &pool, const QByteArray &app);
virtual ~FileNameSearchProtocol();
~FileNameSearchProtocol() override;
void listDir(const QUrl &url) Q_DECL_OVERRIDE;
void listDir(const QUrl &url) override;
private:
void searchDirectory(const QUrl &directory,
......
......@@ -39,7 +39,7 @@ class FilterProtocol : /*public QObject, */ public KIO::SlaveBase
public:
FilterProtocol( const QByteArray & protocol, const QByteArray &pool, const QByteArray &app );
virtual void get( const QUrl &url );
void get( const QUrl &url ) override;
#if 0
virtual void put( const QUrl &url, int _mode, KIO::JobFlags _flags );
virtual void setSubURL(const QUrl &url);
......
......@@ -26,7 +26,7 @@ class fishProtocol : public KIO::SlaveBase
{
public:
fishProtocol(const QByteArray &pool_socket, const QByteArray &app_socket);
virtual ~fishProtocol();
~fishProtocol() override;
/**
Connects to a server and logs us in via SSH. Then starts FISH protocol.
......@@ -34,46 +34,46 @@ Connects to a server and logs us in via SSH. Then starts FISH protocol.
It is set to false if the connection becomes closed.
*/
void openConnection();
void openConnection() override;
/**
Clean up connection
*/
void shutdownConnection(bool forced=false);
/** sets connection information for subsequent commands */
void setHost(const QString & host, quint16 port, const QString & user, const QString & pass);
void setHost(const QString & host, quint16 port, const QString & user, const QString & pass) override;
/** Forced close of the connection */
void closeConnection();
void closeConnection() override;
/** get a file */
void get(const QUrl& url);
void get(const QUrl& url) override;
/** put a file */
void put(const QUrl& url, int permissions, KIO::JobFlags flags );
void put(const QUrl& url, int permissions, KIO::JobFlags flags ) override;
/** aborts command sequence and calls error() */
void error(int type, const QString &detail);
/** executes next command in sequence or calls finished() if all is done */
void finished();
/** stat a file */
void stat(const QUrl& url);
void stat(const QUrl& url) override;
/** find mimetype for a file */
void mimetype(const QUrl& url);
void mimetype(const QUrl& url) override;
/** list a directory */
void listDir(const QUrl& url);
void listDir(const QUrl& url) override;
/** create a directory */
void mkdir(const QUrl&url, int permissions);
void mkdir(const QUrl&url, int permissions) override;
/** rename a file */
void rename(const QUrl& src, const QUrl& dest, KIO::JobFlags flags);
void rename(const QUrl& src, const QUrl& dest, KIO::JobFlags flags) override;
/** create a symlink */
void symlink(const QString& target, const QUrl& dest, KIO::JobFlags flags);
void symlink(const QString& target, const QUrl& dest, KIO::JobFlags flags) override;
/** change file permissions */
void chmod(const QUrl& url, int permissions);
void chmod(const QUrl& url, int permissions) override;
/** copies a file */
void copy(const QUrl &src, const QUrl &dest, int permissions, KIO::JobFlags flags);
void copy(const QUrl &src, const QUrl &dest, int permissions, KIO::JobFlags flags) override;
/** report status */
void slave_status();
void slave_status() override;
/** removes a file or directory */
void del(const QUrl &u, bool isfile);
void del(const QUrl &u, bool isfile) override;
/** special like background execute */
void special( const QByteArray &data );
void special( const QByteArray &data ) override;
private: // Private attributes
/** fd for reading and writing to the process */
......
......@@ -12,11 +12,11 @@ class InfoProtocol : public KIO::SlaveBase
public:
InfoProtocol( const QByteArray &pool, const QByteArray &app );
virtual ~InfoProtocol();
~InfoProtocol() override;
virtual void get( const QUrl& url );
virtual void stat( const QUrl& url );
virtual void mimetype( const QUrl& url );
void get( const QUrl& url ) override;
void stat( const QUrl& url ) override;
void mimetype( const QUrl& url ) override;
protected:
......
......@@ -37,11 +37,11 @@ class KFileAudioPreview : public KPreviewWidgetBase
public:
explicit KFileAudioPreview(QWidget *parent = nullptr,
const QVariantList &args = QVariantList());
~KFileAudioPreview();
~KFileAudioPreview() override;
public Q_SLOTS:
virtual void showPreview(const QUrl &url);
virtual void clearPreview();
void showPreview(const QUrl &url) override;
void clearPreview() override;
private Q_SLOTS:
void toggleAuto(bool on);
......
......@@ -67,7 +67,7 @@ public:
* Constructs a media control widget with a \p parent.
*/
explicit MediaControls(QWidget *parent = nullptr);
~MediaControls();
~MediaControls() override;
bool isSeekSliderVisible() const;
bool isVolumeControlVisible() const;
......@@ -87,7 +87,7 @@ public Q_SLOTS:
void setAudioOutput(AudioOutput *audioOutput);
protected:
void resizeEvent(QResizeEvent *event);
void resizeEvent(QResizeEvent *event) override;
private:
Q_PRIVATE_SLOT(d_func(), void _k_stateChanged(Phonon::State, Phonon::State))
......
......@@ -35,13 +35,13 @@ class MANProtocol : public QObject, public KIO::SlaveBase
public:
MANProtocol(const QByteArray &pool_socket, const QByteArray &app_socket);
virtual ~MANProtocol();
~MANProtocol() override;
virtual void get(const QUrl& url);
virtual void stat(const QUrl& url);
void get(const QUrl& url) override;
void stat(const QUrl& url) override;
virtual void mimetype(const QUrl &url);
virtual void listDir(const QUrl &url);
void mimetype(const QUrl &url) override;
void listDir(const QUrl &url) override;
void outputError(const QString& errmsg);
void outputMatchingPages(const QStringList &matchingPages);
......
......@@ -44,12 +44,12 @@ class KManPart : public KHTMLPart
KParts::BrowserExtension * extension() {return m_extension;}
public Q_SLOTS:
virtual bool openUrl( const QUrl &url );
bool openUrl( const QUrl &url ) override;
protected Q_SLOTS:
void readData(KIO::Job * , const QByteArray & data);
void jobDone( KJob *);
protected:
virtual bool openFile();
bool openFile() override;
KParts::BrowserExtension * m_extension;
KIO::TransferJob *m_job;
};
......
......@@ -39,7 +39,7 @@ Q_OBJECT
public:
explicit CachedDevice(LIBMTP_mtpdevice_t *device, LIBMTP_raw_device_t *rawdevice, const QString udi, qint32 timeout);
virtual ~CachedDevice();
~CachedDevice() override;
LIBMTP_mtpdevice_t *getDevice();
const QString getName();
......@@ -61,7 +61,7 @@ Q_OBJECT
public:
DeviceCache(qint32 timeout, QObject *parent = nullptr);
virtual ~DeviceCache();
~DeviceCache() override;
QHash< QString, CachedDevice * > getAll();
CachedDevice *get(const QString &string, bool isUdi = false);
......
......@@ -54,24 +54,24 @@ public:
* Overwritten KIO-functions, see "kio_mtp.cpp"
*/
MTPSlave(const QByteArray &pool, const QByteArray &app);
virtual ~MTPSlave();
virtual void listDir(const QUrl &url) Q_DECL_OVERRIDE;
virtual void stat(const QUrl &url) Q_DECL_OVERRIDE;
virtual void mimetype(const QUrl &url) Q_DECL_OVERRIDE;
virtual void get(const QUrl &url) Q_DECL_OVERRIDE;
virtual void put(const QUrl &url, int, JobFlags flags) Q_DECL_OVERRIDE;
virtual void copy(const QUrl &src, const QUrl &dest, int, JobFlags flags) Q_DECL_OVERRIDE;
virtual void mkdir(const QUrl &url, int) Q_DECL_OVERRIDE;
virtual void del(const QUrl &url, bool) Q_DECL_OVERRIDE;
virtual void rename(const QUrl &src, const QUrl &dest, JobFlags flags) Q_DECL_OVERRIDE;
~MTPSlave() override;
void listDir(const QUrl &url) override;
void stat(const QUrl &url) override;
void mimetype(const QUrl &url) override;
void get(const QUrl &url) override;
void put(const QUrl &url, int, JobFlags flags) override;
void copy(const QUrl &src, const QUrl &dest, int, JobFlags flags) override;
void mkdir(const QUrl &url, int) override;
void del(const QUrl &url, bool) override;
void rename(const QUrl &src, const QUrl &dest, JobFlags flags) override;
// private slots:
//
// void test();
protected:
void virtual_hook(int id, void *data) Q_DECL_OVERRIDE;
void virtual_hook(int id, void *data) override;
private:
/**
......
......@@ -38,7 +38,7 @@ class NetworkDBusInterface: public QDBusAbstractInterface
public:
NetworkDBusInterface( const QString& service, const QString& path, const QDBusConnection& connection, QObject* parent = nullptr );
virtual ~NetworkDBusInterface();
~NetworkDBusInterface() override;
public Q_SLOTS:
QDBusReply<Mollet::NetDevice> deviceData( const QString& hostAddress );
......
......@@ -39,7 +39,7 @@ class NetworkInitWatcher : public QObject
public:
NetworkInitWatcher( Network* network, QMutex* mutex );
virtual ~NetworkInitWatcher();
~NetworkInitWatcher() override;
public Q_SLOTS:
void onNetworkInitDone();
......
......@@ -40,13 +40,13 @@ class NetworkSlave : public KIO::SlaveBase
{
public:
NetworkSlave( const QByteArray& name, const QByteArray& poolSocket, const QByteArray& programSocket );
virtual ~NetworkSlave();
~NetworkSlave() override;
public: // KIO::SlaveBase API
virtual void mimetype( const QUrl& url );
virtual void get( const QUrl& url );
virtual void stat( const QUrl& url );
virtual void listDir( const QUrl& url );
void mimetype( const QUrl& url ) override;
void get( const QUrl& url ) override;
void stat( const QUrl& url ) override;
void listDir( const QUrl& url ) override;
private:
void feedEntryAsNetwork( KIO::UDSEntry* entry );
......
......@@ -36,7 +36,7 @@ class NetworkThread : public QThread
{
public:
NetworkThread();
virtual ~NetworkThread();
~NetworkThread() override;
public:
Mollet::Network* network() const;
......@@ -47,7 +47,7 @@ class NetworkThread : public QThread
void finish();
protected: // QThread API
virtual void run();
void run() override;
private:
QMutex mMutex;
......
......@@ -41,7 +41,7 @@ class KioSlaveNotifier : public QObject
public:
explicit KioSlaveNotifier( Network* network, QObject* parent = nullptr );
virtual ~KioSlaveNotifier();
~KioSlaveNotifier() override;
public: // for debugging, remove also from adaptor.xml
QStringList watchedDirectories() const;
......
......@@ -43,7 +43,7 @@ class NetworkDBusAdaptor: public QDBusAbstractAdaptor
public:
explicit NetworkDBusAdaptor( NetworkWatcher* parent );
virtual ~NetworkDBusAdaptor();
~NetworkDBusAdaptor() override;
public:
NetworkWatcher* parent() const;
......
......@@ -41,7 +41,7 @@ class NetworkWatcher : public KDEDModule
public:
NetworkWatcher( QObject* parent, const QList<QVariant>& parameters );
virtual ~NetworkWatcher();
~NetworkWatcher() override;
public:
Mollet::NetDevice deviceData( const QString& hostAddress );
......
......@@ -35,7 +35,7 @@ class AbstractNetSystemFactory : public QObject
Q_OBJECT
public:
virtual ~AbstractNetSystemFactory();
~AbstractNetSystemFactory() override;
public: // API to be implemented
};
......
......@@ -36,7 +36,7 @@ class AbstractNetworkBuilder : public QObject
Q_OBJECT
public:
virtual ~AbstractNetworkBuilder();
~AbstractNetworkBuilder() override;
public: // API to be implemented
// build initial table synch
......
......@@ -53,11 +53,11 @@ class DNSSDNetworkBuilder : public AbstractNetworkBuilder
public:
explicit DNSSDNetworkBuilder( NetworkPrivate* networkPrivate );
virtual ~DNSSDNetworkBuilder();
~DNSSDNetworkBuilder() override;
public: // AbstractNetworkBuilder API
virtual void registerNetSystemFactory( AbstractNetSystemFactory* netSystemFactory );
virtual void start();
void registerNetSystemFactory( AbstractNetSystemFactory* netSystemFactory ) override;
void start() override;
private Q_SLOTS:
void addServiceType( const QString& serviceType );
......
......@@ -44,17 +44,17 @@ class SimpleItemFactory : public AbstractNetSystemFactory,
public:
SimpleItemFactory();
virtual ~SimpleItemFactory();
~SimpleItemFactory() override;
public: // DNSSDNetSystemAble API
virtual bool canCreateNetSystemFromDNSSD( const QString& serviceType ) const;
virtual NetServicePrivate* createNetService( const KDNSSD::RemoteService::Ptr& service, const NetDevice& device ) const;
virtual QString dnssdId( const KDNSSD::RemoteService::Ptr& dnssdService ) const;
bool canCreateNetSystemFromDNSSD( const QString& serviceType ) const override;
NetServicePrivate* createNetService( const KDNSSD::RemoteService::Ptr& service, const NetDevice& device ) const override;
QString dnssdId( const KDNSSD::RemoteService::Ptr& dnssdService ) const override;
public: // UpnpNetSystemAble API
virtual bool canCreateNetSystemFromUpnp( const Cagibi::Device& upnpDevice ) const;
virtual NetServicePrivate* createNetService( const Cagibi::Device& upnpDevice, const NetDevice& device ) const;
virtual QString upnpId( const Cagibi::Device& upnpDevice ) const;
bool canCreateNetSystemFromUpnp( const Cagibi::Device& upnpDevice ) const override;
NetServicePrivate* createNetService( const Cagibi::Device& upnpDevice, const NetDevice& device ) const override;
QString upnpId( const Cagibi::Device& upnpDevice ) const override;
private:
};
......
......@@ -51,11 +51,11 @@ class UpnpNetworkBuilder : public AbstractNetworkBuilder
public:
explicit UpnpNetworkBuilder( NetworkPrivate* networkPrivate );
virtual ~UpnpNetworkBuilder();
~UpnpNetworkBuilder() override;
public: // AbstractNetworkBuilder API
virtual void registerNetSystemFactory( AbstractNetSystemFactory* netSystemFactory );
virtual void start();
void registerNetSystemFactory( AbstractNetSystemFactory* netSystemFactory ) override;
void start() override;
//TODO: void stop(); ? why needed, what to do?
protected:
......
......@@ -50,7 +50,7 @@ class MOLLETNETWORK_EXPORT Network : public QObject
public:
Network();
virtual ~Network();
~Network() override;
public:
QList<NetDevice> deviceList() const;
......
......@@ -45,23 +45,23 @@ class NFSSlave : public QObject, public KIO::SlaveBase
public:
NFSSlave(const QByteArray& pool, const QByteArray& app);
~NFSSlave();
void openConnection() Q_DECL_OVERRIDE;
void closeConnection() Q_DECL_OVERRIDE;
void setHost(const QString& host, quint16 port, const QString& user, const QString& pass) Q_DECL_OVERRIDE;
void put(const QUrl& url, int _mode, KIO::JobFlags _flags) Q_DECL_OVERRIDE;
void get(const QUrl& url) Q_DECL_OVERRIDE;
void listDir(const QUrl& url) Q_DECL_OVERRIDE;
void symlink(const QString& target, const QUrl& dest, KIO::JobFlags) Q_DECL_OVERRIDE;
void stat(const QUrl& url) Q_DECL_OVERRIDE;
void mkdir(const QUrl& url, int permissions) Q_DECL_OVERRIDE;
void del(const QUrl& url, bool isfile) Q_DECL_OVERRIDE;
void chmod(const QUrl& url, int permissions) Q_DECL_OVERRIDE;
void rename(const QUrl& src, const QUrl& dest, KIO::JobFlags flags) Q_DECL_OVERRIDE;
void copy(const QUrl& src, const QUrl& dest, int mode, KIO::JobFlags flags) Q_DECL_OVERRIDE;
~NFSSlave() override;
void openConnection() override;
void closeConnection() override;
void setHost(const QString& host, quint16 port, const QString& user, const QString& pass) override;
void put(const QUrl& url, int _mode, KIO::JobFlags _flags) override;
void get(const QUrl& url) override;
void listDir(const QUrl& url) override;
void symlink(const QString& target, const QUrl& dest, KIO::JobFlags) override;
void stat(const QUrl& url) override;
void mkdir(const QUrl& url, int permissions) override;
void del(const QUrl& url, bool isfile) override;
void chmod(const QUrl& url, int permissions) override;
void rename(const QUrl& src, const QUrl& dest, KIO::JobFlags flags) override;
void copy(const QUrl& src, const QUrl& dest, int mode, KIO::JobFlags flags) override;
protected:
// Verifies the current protocol and connection state, returns true if valid.
......
......@@ -33,32 +33,32 @@ class NFSProtocolV2 : public NFSProtocol
{
public:
NFSProtocolV2(NFSSlave* slave);
~NFSProtocolV2();
~NFSProtocolV2() override;
bool isCompatible(bool& connectionError) Q_DECL_OVERRIDE;
bool isConnected() const Q_DECL_OVERRIDE;
bool isCompatible(bool& connectionError) override;
bool isConnected() const override;
void openConnection() Q_DECL_OVERRIDE;
void closeConnection() Q_DECL_OVERRIDE;
void openConnection() override;
void closeConnection() override;
void setHost(const QString& host) Q_DECL_OVERRIDE;
void setHost(const QString& host) override;
void put(const QUrl& url, int _mode, KIO::JobFlags _flags) Q_DECL_OVERRIDE;
void get(const QUrl& url) Q_DECL_OVERRIDE;
void listDir(const QUrl& url) Q_DECL_OVERRIDE;
void symlink(const QString& target, const QUrl& dest, KIO::JobFlags) Q_DECL_OVERRIDE;
void stat(const QUrl& url) Q_DECL_OVERRIDE;
void mkdir(const QUrl& url, int permissions) Q_DECL_OVERRIDE;
void del(const QUrl& url, bool isfile) Q_DECL_OVERRIDE;
void chmod(const QUrl& url, int permissions) Q_DECL_OVERRIDE;
void rename(const QUrl& src, const QUrl& dest, KIO::JobFlags flags) Q_DECL_OVERRIDE;
void put(const QUrl& url, int _mode, KIO::JobFlags _flags) override;
void get(const QUrl& url) override;
void listDir(const QUrl& url) override;
void symlink(const QString& target, const QUrl& dest, KIO::JobFlags) override;
void stat(const QUrl& url) override;
void mkdir(const QUrl& url, int permissions) override;
void del(const QUrl& url, bool isfile) override;
void chmod(const QUrl& url, int permissions) override;
void rename(const QUrl& src, const QUrl& dest, KIO::JobFlags flags) override;
protected:
void copySame(const QUrl& src, const QUrl& dest, int mode, KIO::JobFlags flags) Q_DECL_OVERRIDE;
void copyFrom(const QUrl& src, const QUrl& dest, int mode, KIO::JobFlags flags) Q_DECL_OVERRIDE;
void copyTo(const QUrl& src, const QUrl& dest, int mode, KIO::JobFlags flags) Q_DECL_OVERRIDE;
void copySame(const QUrl& src, const QUrl& dest, int mode, KIO::JobFlags flags) override;
void copyFrom(const QUrl& src, const QUrl& dest, int mode, KIO::JobFlags flags) override;
void copyTo(const QUrl& src, const QUrl& dest, int mode, KIO::JobFlags flags) override;
NFSFileHandle lookupFileHandle(const QString& path) Q_DECL_OVERRIDE;
NFSFileHandle lookupFileHandle(const QString& path) override;
private:
bool create(const QString& path, int mode, int& rpcStatus, diropres& result);
......
......@@ -33,36 +33,36 @@ class NFSProtocolV3 : public NFSProtocol
{
public:
NFSProtocolV3(NFSSlave* slave);
~NFSProtocolV3();
~NFSProtocolV3() override;
bool isCompatible(bool& connectionError) Q_DECL_OVERRIDE;
bool isConnected() const Q_DECL_OVERRIDE;
bool isCompatible(bool& connectionError) override;
bool isConnected() const override;
void openConnection() Q_DECL_OVERRIDE;
void closeConnection() Q_DECL_OVERRIDE;
void openConnection() override;
void closeConnection() override;