Commit 05523046 authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

Use more override (and without additional virtual)

parent 7c9a2e0b
......@@ -52,12 +52,12 @@ class TestJob : public Job
public:
TestJob(Scheduler *scheduler, JobQueue *parent);
virtual void start();
virtual void stop();
virtual int elapsedTime() const;
virtual int remainingTime() const;
virtual bool isStalled() const;
virtual bool isWorking() const;
void start() override;
void stop() override;
int elapsedTime() const override;
int remainingTime() const override;
bool isStalled() const override;
bool isWorking() const override;
signals:
void statusChanged();
......
......@@ -41,7 +41,7 @@ namespace kt
Q_OBJECT
public:
ChunkDownloadModel(QObject* parent);
virtual ~ChunkDownloadModel();
~ChunkDownloadModel() override;
/// A peer has been added
void downloadAdded(bt::ChunkDownloadInterface* cd);
......@@ -59,13 +59,13 @@ namespace kt
void clear();
virtual int rowCount(const QModelIndex & parent) const override;
virtual int columnCount(const QModelIndex & parent) const override;
virtual QVariant headerData(int section, Qt::Orientation orientation,int role) const override;
virtual QVariant data(const QModelIndex & index,int role) const override;
virtual bool removeRows(int row,int count,const QModelIndex & parent) override;
virtual bool insertRows(int row,int count,const QModelIndex & parent) override;
virtual QModelIndex index(int row,int column,const QModelIndex & parent = QModelIndex()) const override;
int rowCount(const QModelIndex & parent) const override;
int columnCount(const QModelIndex & parent) const override;
QVariant headerData(int section, Qt::Orientation orientation,int role) const override;
QVariant data(const QModelIndex & index,int role) const override;
bool removeRows(int row,int count,const QModelIndex & parent) override;
bool insertRows(int row,int count,const QModelIndex & parent) override;
QModelIndex index(int row,int column,const QModelIndex & parent = QModelIndex()) const override;
public slots:
void sort(int col, Qt::SortOrder order) override;
......
......@@ -45,7 +45,7 @@ namespace kt
Q_OBJECT
public:
ChunkDownloadView(QWidget* parent);
virtual ~ChunkDownloadView();
~ChunkDownloadView() override;
/// A peer has been added
void downloadAdded(bt::ChunkDownloadInterface* cd);
......
......@@ -46,7 +46,7 @@ namespace kt
Q_OBJECT
public:
FileView(QWidget *parent);
virtual ~FileView();
~FileView() override;
void changeTC(bt::TorrentInterface* tc,KSharedConfigPtr cfg);
void setShowListOfFiles(bool on,KSharedConfigPtr cfg);
......@@ -68,7 +68,7 @@ namespace kt
void changePriority(bt::Priority newpriority);
void expandCollapseTree(const QModelIndex& idx, bool expand);
void expandCollapseSelected(bool expand);
virtual bool viewportEvent(QEvent *event) override;
bool viewportEvent(QEvent *event) override;
virtual void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight);
private slots:
......
......@@ -37,12 +37,12 @@ namespace kt
Q_OBJECT
public:
IWFileListModel(bt::TorrentInterface* tc,QObject* parent);
virtual ~IWFileListModel();
~IWFileListModel() override;
virtual int columnCount(const QModelIndex & parent) const override;
virtual QVariant headerData(int section, Qt::Orientation orientation,int role) const override;
virtual QVariant data(const QModelIndex & index, int role) const override;
virtual bool setData(const QModelIndex & index, const QVariant & value, int role) override;
int columnCount(const QModelIndex & parent) const override;
QVariant headerData(int section, Qt::Orientation orientation,int role) const override;
QVariant data(const QModelIndex & index, int role) const override;
bool setData(const QModelIndex & index, const QVariant & value, int role) override;
void update() override;
void filePercentageChanged(bt::TorrentFileInterface* file,float percentage) override;
......
......@@ -37,13 +37,13 @@ namespace kt
Q_OBJECT
public:
IWFileTreeModel(bt::TorrentInterface* tc,QObject* parent);
virtual ~IWFileTreeModel();
~IWFileTreeModel() override;
virtual int columnCount(const QModelIndex & parent) const override;
virtual QVariant headerData(int section, Qt::Orientation orientation,int role) const override;
virtual QVariant data(const QModelIndex & index, int role) const override;
virtual bool setData(const QModelIndex & index, const QVariant & value, int role) override;
virtual void update() override;
int columnCount(const QModelIndex & parent) const override;
QVariant headerData(int section, Qt::Orientation orientation,int role) const override;
QVariant data(const QModelIndex & index, int role) const override;
bool setData(const QModelIndex & index, const QVariant & value, int role) override;
void update() override;
void filePercentageChanged(bt::TorrentFileInterface* file,float percentage) override;
void filePreviewChanged(bt::TorrentFileInterface* file,bool preview) override;
......
......@@ -44,16 +44,16 @@ namespace kt
FileView* fv;
public:
Monitor(bt::TorrentInterface* tc,PeerView* pv ,ChunkDownloadView* cdv,FileView* fv);
virtual ~Monitor();
~Monitor() override;
virtual void downloadRemoved(bt::ChunkDownloadInterface* cd) override;
virtual void downloadStarted(bt::ChunkDownloadInterface* cd) override;
virtual void peerAdded(bt::PeerInterface* peer) override;
virtual void peerRemoved(bt::PeerInterface* peer) override;
virtual void stopped() override;
virtual void destroyed() override;
virtual void filePercentageChanged(bt::TorrentFileInterface* file,float percentage) override;
virtual void filePreviewChanged(bt::TorrentFileInterface* file,bool preview) override;
void downloadRemoved(bt::ChunkDownloadInterface* cd) override;
void downloadStarted(bt::ChunkDownloadInterface* cd) override;
void peerAdded(bt::PeerInterface* peer) override;
void peerRemoved(bt::PeerInterface* peer) override;
void stopped() override;
void destroyed() override;
void filePercentageChanged(bt::TorrentFileInterface* file,float percentage) override;
void filePreviewChanged(bt::TorrentFileInterface* file,bool preview) override;
};
}
......
......@@ -40,7 +40,7 @@ namespace kt
Q_OBJECT
public:
PeerView(QWidget* parent);
virtual ~PeerView();
~PeerView() override;
/// A peer has been added
void peerAdded(bt::PeerInterface* peer);
......
......@@ -39,7 +39,7 @@ namespace kt
Q_OBJECT
public:
PeerViewModel(QObject* parent);
virtual ~PeerViewModel();
~PeerViewModel() override;
/// A peer has been added
void peerAdded(bt::PeerInterface* peer);
......@@ -54,13 +54,13 @@ namespace kt
void clear();
virtual int rowCount(const QModelIndex & parent) const override;
virtual int columnCount(const QModelIndex & parent) const override;
virtual QVariant headerData(int section, Qt::Orientation orientation,int role) const override;
virtual QVariant data(const QModelIndex & index,int role) const override;
virtual bool removeRows(int row,int count,const QModelIndex & parent) override;
virtual bool insertRows(int row,int count,const QModelIndex & parent) override;
virtual QModelIndex index(int row,int column,const QModelIndex & parent = QModelIndex()) const override;
int rowCount(const QModelIndex & parent) const override;
int columnCount(const QModelIndex & parent) const override;
QVariant headerData(int section, Qt::Orientation orientation,int role) const override;
QVariant data(const QModelIndex & index,int role) const override;
bool removeRows(int row,int count,const QModelIndex & parent) override;
bool insertRows(int row,int count,const QModelIndex & parent) override;
QModelIndex index(int row,int column,const QModelIndex & parent = QModelIndex()) const override;
bt::PeerInterface* indexToPeer(const QModelIndex & idx);
......
......@@ -35,22 +35,22 @@ namespace kt
Q_OBJECT
public:
TorrentFileListModel(bt::TorrentInterface* tc,DeselectMode mode,QObject* parent);
virtual ~TorrentFileListModel();
~TorrentFileListModel() override;
virtual int rowCount(const QModelIndex & parent) const override;
virtual int columnCount(const QModelIndex & parent) const override;
virtual QVariant headerData(int section, Qt::Orientation orientation,int role) const override;
virtual QVariant data(const QModelIndex & index, int role) const override;
virtual QModelIndex parent(const QModelIndex & index) const override;
virtual QModelIndex index(int row,int column,const QModelIndex & parent) const override;
virtual bool setData(const QModelIndex & index, const QVariant & value, int role) override;
virtual void checkAll() override;
virtual void uncheckAll() override;
virtual void invertCheck() override;
virtual bt::Uint64 bytesToDownload() override;
virtual bt::TorrentFileInterface* indexToFile(const QModelIndex & idx) override;
virtual QString dirPath(const QModelIndex & idx) override;
virtual void changePriority(const QModelIndexList & indexes,bt::Priority newpriority) override;
int rowCount(const QModelIndex & parent) const override;
int columnCount(const QModelIndex & parent) const override;
QVariant headerData(int section, Qt::Orientation orientation,int role) const override;
QVariant data(const QModelIndex & index, int role) const override;
QModelIndex parent(const QModelIndex & index) const override;
QModelIndex index(int row,int column,const QModelIndex & parent) const override;
bool setData(const QModelIndex & index, const QVariant & value, int role) override;
void checkAll() override;
void uncheckAll() override;
void invertCheck() override;
bt::Uint64 bytesToDownload() override;
bt::TorrentFileInterface* indexToFile(const QModelIndex & idx) override;
QString dirPath(const QModelIndex & idx) override;
void changePriority(const QModelIndexList & indexes,bt::Priority newpriority) override;
private:
void invertCheck(const QModelIndex & idx);
......
......@@ -46,7 +46,7 @@ namespace kt
KEEP_FILES,DELETE_FILES
};
TorrentFileModel(bt::TorrentInterface* tc,DeselectMode mode,QObject* parent);
virtual ~TorrentFileModel();
~TorrentFileModel() override;
/**
......@@ -128,7 +128,7 @@ namespace kt
/// Are the file names editable
bool fileNamesEditable() const {return file_names_editable;}
virtual Qt::ItemFlags flags(const QModelIndex & index) const override;
Qt::ItemFlags flags(const QModelIndex & index) const override;
virtual void filePercentageChanged(bt::TorrentFileInterface* file,float percentage);
virtual void filePreviewChanged(bt::TorrentFileInterface* file,bool preview);
......
......@@ -74,25 +74,25 @@ namespace kt
};
public:
TorrentFileTreeModel(bt::TorrentInterface* tc,DeselectMode mode,QObject* parent);
virtual ~TorrentFileTreeModel();
~TorrentFileTreeModel() override;
virtual int rowCount(const QModelIndex & parent) const override;
virtual int columnCount(const QModelIndex & parent) const override;
virtual QVariant headerData(int section, Qt::Orientation orientation,int role) const override;
virtual QVariant data(const QModelIndex & index, int role) const override;
virtual QModelIndex parent(const QModelIndex & index) const override;
virtual QModelIndex index(int row,int column,const QModelIndex & parent) const override;
virtual bool setData(const QModelIndex & index, const QVariant & value, int role) override;
virtual void checkAll() override;
virtual void uncheckAll() override;
virtual void invertCheck() override;
virtual bt::Uint64 bytesToDownload() override;
virtual QByteArray saveExpandedState(QSortFilterProxyModel* pm,QTreeView* tv) override;
virtual void loadExpandedState(QSortFilterProxyModel* pm,QTreeView* tv,const QByteArray & state) override;
virtual bt::TorrentFileInterface* indexToFile(const QModelIndex & idx) override;
virtual QString dirPath(const QModelIndex & idx) override;
virtual void changePriority(const QModelIndexList & indexes,bt::Priority newpriority) override;
virtual void onCodecChange() override;
int rowCount(const QModelIndex & parent) const override;
int columnCount(const QModelIndex & parent) const override;
QVariant headerData(int section, Qt::Orientation orientation,int role) const override;
QVariant data(const QModelIndex & index, int role) const override;
QModelIndex parent(const QModelIndex & index) const override;
QModelIndex index(int row,int column,const QModelIndex & parent) const override;
bool setData(const QModelIndex & index, const QVariant & value, int role) override;
void checkAll() override;
void uncheckAll() override;
void invertCheck() override;
bt::Uint64 bytesToDownload() override;
QByteArray saveExpandedState(QSortFilterProxyModel* pm,QTreeView* tv) override;
void loadExpandedState(QSortFilterProxyModel* pm,QTreeView* tv,const QByteArray & state) override;
bt::TorrentFileInterface* indexToFile(const QModelIndex & idx) override;
QString dirPath(const QModelIndex & idx) override;
void changePriority(const QModelIndexList & indexes,bt::Priority newpriority) override;
void onCodecChange() override;
private:
void constructTree();
void invertCheck(const QModelIndex & idx);
......
......@@ -43,20 +43,20 @@ namespace kt
Q_OBJECT
public:
TrackerModel(QObject* parent);
virtual ~TrackerModel();
~TrackerModel() override;
void changeTC(bt::TorrentInterface* tc);
void update();
virtual int rowCount(const QModelIndex &parent) const override;
virtual int columnCount(const QModelIndex &parent) const override;
virtual QVariant data(const QModelIndex &index, int role) const override;
virtual bool setData(const QModelIndex & index,const QVariant & value,int role) override;
virtual QVariant headerData(int section, Qt::Orientation orientation,int role) const override;
virtual bool insertRows(int row,int count,const QModelIndex & parent) override;
virtual bool removeRows(int row,int count,const QModelIndex & parent) override;
virtual Qt::ItemFlags flags(const QModelIndex & index) const override;
virtual QModelIndex index(int row,int column,const QModelIndex & parent = QModelIndex()) const override;
int rowCount(const QModelIndex &parent) const override;
int columnCount(const QModelIndex &parent) const override;
QVariant data(const QModelIndex &index, int role) const override;
bool setData(const QModelIndex & index,const QVariant & value,int role) override;
QVariant headerData(int section, Qt::Orientation orientation,int role) const override;
bool insertRows(int row,int count,const QModelIndex & parent) override;
bool removeRows(int row,int count,const QModelIndex & parent) override;
Qt::ItemFlags flags(const QModelIndex & index) const override;
QModelIndex index(int row,int column,const QModelIndex & parent = QModelIndex()) const override;
/// Get a tracker url given a model index
QUrl trackerUrl(const QModelIndex & idx);
......
......@@ -42,7 +42,7 @@ namespace kt
Q_OBJECT
public:
TrackerView(QWidget *parent);
virtual ~TrackerView();
~TrackerView() override;
void update();
void changeTC(bt::TorrentInterface* ti);
......
......@@ -41,7 +41,7 @@ namespace kt
public:
WebSeedsModel(QObject* parent);
virtual ~WebSeedsModel();
~WebSeedsModel() override;
/**
......@@ -55,10 +55,10 @@ namespace kt
*/
bool update();
virtual int rowCount(const QModelIndex & parent) const override;
virtual int columnCount(const QModelIndex & parent) const override;
virtual QVariant headerData(int section, Qt::Orientation orientation,int role) const override;
virtual QVariant data(const QModelIndex & index, int role) const override;
int rowCount(const QModelIndex & parent) const override;
int columnCount(const QModelIndex & parent) const override;
QVariant headerData(int section, Qt::Orientation orientation,int role) const override;
QVariant data(const QModelIndex & index, int role) const override;
private:
struct Item
......
......@@ -45,7 +45,7 @@ namespace kt
Q_OBJECT
public:
WebSeedsTab(QWidget* parent);
virtual ~WebSeedsTab();
~WebSeedsTab() override;
/**
* Switch to a different torrent.
......
......@@ -32,7 +32,7 @@ class BTDataSource : public TransferDataSource
Q_OBJECT
public:
BTDataSource(const QUrl &srcUrl, QObject *parent);
~BTDataSource();
~BTDataSource() override;
void start() override;
void stop() override;
......
......@@ -26,13 +26,13 @@ class BTDetailsWidget : public QWidget, public Ui::BTDetailsWidgetFrm
Q_OBJECT
public:
BTDetailsWidget(BTTransferHandler * transfer);
~BTDetailsWidget();
~BTDetailsWidget() override;
public slots:
void slotTransferChanged(TransferHandler * transfer, TransferHandler::ChangesFlags flags);
protected:
virtual void showEvent(QShowEvent * event) override;
void showEvent(QShowEvent * event) override;
private:
BTTransferHandler * m_transfer;
......
......@@ -22,9 +22,9 @@ class BTSettingsWidget : public KCModule, public Ui::BTSettingsWidget
BTSettingsWidget(QWidget * parent = nullptr, const QVariantList &args = QVariantList());
public slots:
virtual void load() override;
virtual void save() override;
virtual void defaults() override;
void load() override;
void save() override;
void defaults() override;
};
#endif
......
......@@ -53,31 +53,31 @@ class BTTransfer : public Transfer, public bt::MonitorInterface
BTTransfer(TransferGroup* parent, TransferFactory* factory,
Scheduler* scheduler, const QUrl &src, const QUrl& dest,
const QDomElement * e = nullptr);
~BTTransfer();
~BTTransfer() override;
void deinit(Transfer::DeleteOptions options) override;
//Job virtual functions
void start() override;
void stop() override;
virtual int elapsedTime() const override;
virtual int remainingTime() const override;
virtual bool isStalled() const override;
virtual bool isWorking() const override;
int elapsedTime() const override;
int remainingTime() const override;
bool isStalled() const override;
bool isWorking() const override;
/**
* @returns the directory the Transfer will be stored to
*/
virtual QUrl directory() const override {return m_directory;}
QUrl directory() const override {return m_directory;}
/**
* Move the download to the new destination
* @param newDirectory is a directory where the download should be stored
* @returns true if newDestination can be used
*/
virtual bool setDirectory(const QUrl &newDirectory) override;
bool setDirectory(const QUrl &newDirectory) override;
virtual QList<QUrl> files() const override;
QList<QUrl> files() const override;
FileModel *fileModel() override;
......@@ -121,14 +121,14 @@ class BTTransfer : public Transfer, public bt::MonitorInterface
void updateFilesStatus();
// bt::MonitorInterface functions
virtual void downloadRemoved(bt::ChunkDownloadInterface* cd) override;
virtual void downloadStarted(bt::ChunkDownloadInterface* cd) override;
virtual void peerAdded(bt::PeerInterface* peer) override;
virtual void peerRemoved(bt::PeerInterface* peer) override;
virtual void stopped() override;
virtual void destroyed() override;
virtual void filePercentageChanged(bt::TorrentFileInterface*, float) override {}
virtual void filePreviewChanged(bt::TorrentFileInterface*, bool) override {}
void downloadRemoved(bt::ChunkDownloadInterface* cd) override;
void downloadStarted(bt::ChunkDownloadInterface* cd) override;
void peerAdded(bt::PeerInterface* peer) override;
void peerRemoved(bt::PeerInterface* peer) override;
void stopped() override;
void destroyed() override;
void filePercentageChanged(bt::TorrentFileInterface*, float) override {}
void filePreviewChanged(bt::TorrentFileInterface*, bool) override {}
bt::TorrentControl *torrent;
QUrl m_directory;
......
......@@ -17,7 +17,7 @@ class BTTransferFactory : public TransferFactory
Q_OBJECT
public:
BTTransferFactory(QObject *parent, const QVariantList &args);
~BTTransferFactory();
~BTTransferFactory() override;
Transfer * createTransfer(const QUrl &srcUrl, const QUrl &destUrl, TransferGroup * parent, Scheduler * scheduler, const QDomElement * e = nullptr) override;
......
......@@ -31,7 +31,7 @@ class BTTransferHandler : public TransferHandler
Q_OBJECT
public:
BTTransferHandler(BTTransfer * transfer, Scheduler * scheduler);
virtual ~BTTransferHandler();
~BTTransferHandler() override;
int chunksTotal() const {return m_transfer->chunksTotal();}
int chunksDownloaded() const {return m_transfer->chunksDownloaded();}
......
......@@ -43,15 +43,15 @@ namespace kt
Q_OBJECT
public:
ScanDlg(KJob *job, QWidget* parent);
virtual ~ScanDlg();
~ScanDlg() override;
protected:
/// Handle the close event
virtual void closeEvent(QCloseEvent* e) override;
void closeEvent(QCloseEvent* e) override;
protected slots:
virtual void reject() override;
virtual void accept() override;
void reject() override;
void accept() override;
private slots:
void description(KJob *job, const QString &title, const QPair<QString, QString > &field1, const QPair< QString, QString > &field2);
......
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