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

Use override keyword

parent 00dde6f2
......@@ -68,7 +68,7 @@ public:
/**
* Default Destructor
*/
virtual ~KompareShell();
~KompareShell() override;
/**
* Use this method to load whatever file/URL you have
......@@ -96,23 +96,23 @@ public slots:
KompareInterface* viewPart() const;
protected:
virtual bool queryClose();
bool queryClose() override;
/**
* This method is called when it is time for the app to save its
* properties for session management purposes.
*/
void saveProperties(KConfigGroup &);
void saveProperties(KConfigGroup &) override;
/**
* This method is called when this app is restored. The KConfig
* object points to the session management config file that was saved
* with @ref saveProperties
*/
void readProperties(const KConfigGroup &);
void readProperties(const KConfigGroup &) override;
private slots:
void slotSetStatusBarText( const QString& text );
void slotSetStatusBarText( const QString& text ) override;
void slotFileOpen();
void slotFileCompareFiles();
void slotFileBlendURLAndDiff();
......
......@@ -46,10 +46,10 @@ class KompareNavTreePart : public KParts::ReadOnlyPart
public:
explicit KompareNavTreePart( QWidget* parentWidget, QObject* parent, const QVariantList& args );
virtual ~KompareNavTreePart();
~KompareNavTreePart() override;
public:
virtual bool openFile() { return false; };
bool openFile() override { return false; };
public slots:
void slotSetSelection( const Diff2::DiffModel* model, const Diff2::Difference* diff );
......@@ -118,10 +118,10 @@ class KChangeLVI : public QTreeWidgetItem
{
public:
KChangeLVI( QTreeWidget* parent, Diff2::Difference* diff );
~KChangeLVI();
~KChangeLVI() override;
public:
Diff2::Difference* difference() { return m_difference; };
virtual bool operator<( const QTreeWidgetItem& item ) const;
bool operator<( const QTreeWidgetItem& item ) const override;
void setDifferenceText();
private:
......@@ -132,7 +132,7 @@ class KFileLVI : public QTreeWidgetItem
{
public:
KFileLVI( QTreeWidget* parent, Diff2::DiffModel* model );
~KFileLVI();
~KFileLVI() override;
public:
Diff2::DiffModel* model() { return m_model; };
void fillChangesList( QTreeWidget* changesList, QHash<const Diff2::Difference*, KChangeLVI*>* diffToChangeItemDict );
......@@ -148,7 +148,7 @@ class KDirLVI : public QTreeWidgetItem
public:
KDirLVI( KDirLVI* parent, QString& dir );
KDirLVI( QTreeWidget* parent, QString& dir );
~KDirLVI();
~KDirLVI() override;
public:
void addModel( QString& dir, Diff2::DiffModel* model, QHash<const Diff2::DiffModel*, KDirLVI*>* modelToDirItemDict );
QString& dirName() { return m_dirName; };
......
......@@ -70,17 +70,17 @@ public:
/**
* Destructor
*/
virtual ~KomparePart();
~KomparePart() override;
// Sessionmanagement stuff, added to the kompare iface
// because they are not in the Part class where they belong
// Should be added when bic changes are allowed again (kde 4.0)
virtual int readProperties( KConfig *config );
virtual int saveProperties( KConfig *config );
int readProperties( KConfig *config ) override;
int saveProperties( KConfig *config ) override;
// this one is called when the shell_app is about to close.
// we need it now to save the properties of the part when apps don't (can't)
// use the readProperties and saveProperties methods
virtual bool queryClose();
bool queryClose() override;
// Do we really want to expose this ???
const Diff2::KompareModelList* model() const { return m_modelList; };
......@@ -90,43 +90,43 @@ public:
/**
* Open and parse the diff file at diffUrl.
*/
virtual bool openDiff( const QUrl& diffUrl );
bool openDiff( const QUrl& diffUrl ) override;
/** Added on request of Harald Fernengel */
virtual bool openDiff( const QString& diffOutput );
bool openDiff( const QString& diffOutput ) override;
/** Open and parse the diff3 file at diff3Url */
virtual bool openDiff3( const QUrl& diff3URL );
bool openDiff3( const QUrl& diff3URL ) override;
/** Open and parse the file diff3Output with the output of diff3 */
virtual bool openDiff3( const QString& diff3Output );
bool openDiff3( const QString& diff3Output ) override;
/** Compare, with diff, source with destination */
virtual void compare( const QUrl& sourceFile, const QUrl& destinationFile );
void compare( const QUrl& sourceFile, const QUrl& destinationFile ) override;
/** Compare a Source file to a custom Destination string */
virtual void compareFileString( const QUrl & sourceFile, const QString & destination);
void compareFileString( const QUrl & sourceFile, const QString & destination) override;
/** Compare a custom Source string to a Destination file */
virtual void compareStringFile( const QString & source, const QUrl & destinationFile);
void compareStringFile( const QString & source, const QUrl & destinationFile) override;
/** Compare, with diff, source with destination */
virtual void compareFiles( const QUrl& sourceFile, const QUrl& destinationFile );
void compareFiles( const QUrl& sourceFile, const QUrl& destinationFile ) override;
/** Compare, with diff, source with destination */
virtual void compareDirs ( const QUrl& sourceDir, const QUrl& destinationDir );
void compareDirs ( const QUrl& sourceDir, const QUrl& destinationDir ) override;
/** Compare, with diff3, originalFile with changedFile1 and changedFile2 */
virtual void compare3Files( const QUrl& originalFile, const QUrl& changedFile1, const QUrl& changedFile2 );
void compare3Files( const QUrl& originalFile, const QUrl& changedFile1, const QUrl& changedFile2 ) override;
/** This will show the file and the file with the diff applied */
virtual void openFileAndDiff( const QUrl& file, const QUrl& diffFile );
void openFileAndDiff( const QUrl& file, const QUrl& diffFile ) override;
/** This will show the directory and the directory with the diff applied */
virtual void openDirAndDiff ( const QUrl& dir, const QUrl& diffFile );
void openDirAndDiff ( const QUrl& dir, const QUrl& diffFile ) override;
/** Reimplementing this because this one knows more about the real part then the interface */
virtual void setEncoding( const QString& encoding );
void setEncoding( const QString& encoding ) override;
// This is the interpart interface, it is signal and slot based so no "real" interface here
// All you have to do is connect the parts from your application.
......@@ -179,9 +179,9 @@ protected:
* when using openURL( const QUrl& ) or in our case also openDiff( const QUrl& );
* return true when everything went ok, false if there were problems
*/
virtual bool openFile();
bool openFile() override;
// ... Uhm we return true without saving ???
virtual bool saveFile() { return true; };
bool saveFile() override { return true; };
protected slots:
void slotSetStatus( Kompare::Status status );
......
......@@ -41,7 +41,7 @@ class KompareConnectWidget : public QWidget
public:
KompareConnectWidget( ViewSettings* settings, QWidget* parent, const char* name = 0 );
~KompareConnectWidget();
~KompareConnectWidget() override;
public slots:
void slotSetSelection( const Diff2::DiffModel* model, const Diff2::Difference* diff );
......@@ -53,7 +53,7 @@ signals:
void selectionChanged(const Diff2::Difference* diff);
protected:
void paintEvent( QPaintEvent* e );
void paintEvent( QPaintEvent* e ) override;
QPainterPath makeBezier( int l, int r ) const;
private:
......@@ -68,15 +68,15 @@ class KompareConnectWidgetFrame : public QSplitterHandle
Q_OBJECT
public:
KompareConnectWidgetFrame( ViewSettings* settings, KompareSplitter* parent, const char* name = 0 );
~KompareConnectWidgetFrame();
~KompareConnectWidgetFrame() override;
QSize sizeHint() const;
QSize sizeHint() const override;
KompareConnectWidget* wid() { return &m_wid; }
protected:
// stop the parent QSplitterHandle painting
void paintEvent( QPaintEvent* /* e */ ) { }
void paintEvent( QPaintEvent* /* e */ ) override { }
#if 0
void mouseMoveEvent( QMouseEvent * );
......
......@@ -52,7 +52,7 @@ class KompareListView : public QTreeWidget
public:
KompareListView( bool isSource, ViewSettings* settings, QWidget* parent, const char* name = 0 );
virtual ~KompareListView();
~KompareListView() override;
KompareListViewItem* itemAtIndex( int i );
int firstVisibleDifference();
......@@ -90,12 +90,12 @@ signals:
void resized();
protected:
virtual void wheelEvent( QWheelEvent* e );
virtual void resizeEvent( QResizeEvent* e );
virtual void mousePressEvent ( QMouseEvent * e );
virtual void mouseDoubleClickEvent ( QMouseEvent* );
virtual void mouseReleaseEvent ( QMouseEvent * ) {};
virtual void mouseMoveEvent ( QMouseEvent * ) {};
void wheelEvent( QWheelEvent* e ) override;
void resizeEvent( QResizeEvent* e ) override;
void mousePressEvent ( QMouseEvent * e ) override;
void mouseDoubleClickEvent ( QMouseEvent* ) override;
void mouseReleaseEvent ( QMouseEvent * ) override {};
void mouseMoveEvent ( QMouseEvent * ) override {};
private:
QRect totalVisualItemRect( QTreeWidgetItem* item );
......@@ -119,7 +119,7 @@ class KompareListViewFrame : public QFrame
public:
KompareListViewFrame( bool isSource, ViewSettings* settings, KompareSplitter* parent, const char* name = 0 );
virtual ~KompareListViewFrame() {};
~KompareListViewFrame() override {};
KompareListView* view() { return &m_view; };
public slots:
......@@ -137,9 +137,9 @@ class KompareListViewItemDelegate : public QStyledItemDelegate
public:
KompareListViewItemDelegate( QObject* parent );
virtual ~KompareListViewItemDelegate();
virtual void paint( QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index ) const;
virtual QSize sizeHint( const QStyleOptionViewItem& option, const QModelIndex& index ) const;
~KompareListViewItemDelegate() override;
void paint( QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index ) const override;
QSize sizeHint( const QStyleOptionViewItem& option, const QModelIndex& index ) const override;
};
class KompareListViewItem : public QTreeWidgetItem
......@@ -178,13 +178,13 @@ class KompareListViewDiffItem : public KompareListViewItem
public:
KompareListViewDiffItem( KompareListView* parent, Diff2::Difference* difference );
KompareListViewDiffItem( KompareListView* parent, KompareListViewItem* after, Diff2::Difference* difference );
~KompareListViewDiffItem();
~KompareListViewDiffItem() override;
void applyDifference( bool apply );
Diff2::Difference* difference() { return m_difference; };
virtual int maxHeight();
int maxHeight() override;
private:
void init();
......@@ -203,9 +203,9 @@ class KompareListViewLineContainerItem : public KompareListViewItem
{
public:
KompareListViewLineContainerItem( KompareListViewDiffItem* parent, bool isSource );
~KompareListViewLineContainerItem();
~KompareListViewLineContainerItem() override;
virtual int maxHeight() { return 0; }
int maxHeight() override { return 0; }
KompareListViewDiffItem* diffItemParent() const;
......@@ -224,11 +224,11 @@ class KompareListViewLineItem : public KompareListViewItem
public:
KompareListViewLineItem( KompareListViewLineContainerItem* parent, int line, Diff2::DifferenceString* text );
KompareListViewLineItem( KompareListViewLineContainerItem* parent, int line, Diff2::DifferenceString* text, int type );
~KompareListViewLineItem();
~KompareListViewLineItem() override;
virtual int maxHeight() { return 0; }
int maxHeight() override { return 0; }
virtual void paintCell( QPainter* p, const QStyleOptionViewItem& option, int column );
void paintCell( QPainter* p, const QStyleOptionViewItem& option, int column ) override;
KompareListViewDiffItem* diffItemParent() const;
......@@ -249,7 +249,7 @@ public:
KompareListViewBlankLineItem( KompareListViewLineContainerItem* parent );
protected:
virtual void paintText( QPainter* p, const QColor& bg, int column, int width, int align );
void paintText( QPainter* p, const QColor& bg, int column, int width, int align ) override;
};
class KompareListViewHunkItem : public KompareListViewItem
......@@ -257,11 +257,11 @@ class KompareListViewHunkItem : public KompareListViewItem
public:
KompareListViewHunkItem( KompareListView* parent, Diff2::DiffHunk* hunk, bool zeroHeight = false );
KompareListViewHunkItem( KompareListView* parent, KompareListViewItem* after, Diff2::DiffHunk* hunk, bool zeroHeight= false );
~KompareListViewHunkItem();
~KompareListViewHunkItem() override;
virtual void paintCell( QPainter* p, const QStyleOptionViewItem& option, int column );
void paintCell( QPainter* p, const QStyleOptionViewItem& option, int column ) override;
virtual int maxHeight();
int maxHeight() override;
private:
bool m_zeroHeight;
......
......@@ -31,7 +31,7 @@ class KomparePrefDlg : public KPageDialog
Q_OBJECT
public:
KomparePrefDlg( ViewSettings*, DiffSettings* );
~KomparePrefDlg();
~KomparePrefDlg() override;
protected slots:
/** No descriptions */
......
......@@ -27,7 +27,7 @@ class KompareSaveOptionsBase : public QWidget, public Ui::KompareSaveOptionsBase
public:
explicit KompareSaveOptionsBase(QWidget* parent = 0, Qt::WindowFlags fl = 0);
~KompareSaveOptionsBase();
~KompareSaveOptionsBase() override;
protected slots:
virtual void languageChange();
......
......@@ -30,7 +30,7 @@ class KompareSaveOptionsWidget : public KompareSaveOptionsBase
Q_OBJECT
public:
KompareSaveOptionsWidget( QString source, QString destination, DiffSettings* settings, QWidget* parent );
~KompareSaveOptionsWidget();
~KompareSaveOptionsWidget() override;
void saveOptions();
QString directory() const;
......
......@@ -43,7 +43,7 @@ class KompareSplitter : public QSplitter
public:
KompareSplitter(ViewSettings *settings, QWidget *parent);
~KompareSplitter();
~KompareSplitter() override;
signals:
void configChanged();
......@@ -59,7 +59,7 @@ public slots:
void slotUpdateScrollBars();
void slotDelayedUpdateVScrollValue();
void slotUpdateVScrollValue();
void keyPressEvent( QKeyEvent* e );
void keyPressEvent( QKeyEvent* e ) override;
void slotApplyDifference( bool apply );
void slotApplyAllDifferences( bool apply );
......@@ -73,7 +73,7 @@ public slots:
void slotConfigChanged();
protected:
void wheelEvent( QWheelEvent* e );
void wheelEvent( QWheelEvent* e ) override;
ViewSettings* settings() const { return m_settings; }
......@@ -84,7 +84,7 @@ protected slots:
private:
// override from QSplitter
QSplitterHandle* createHandle();
QSplitterHandle* createHandle() override;
void setCursor( int id, const QCursor& cursor );
void unsetCursor( int id );
......
......@@ -30,7 +30,7 @@ class KompareView : public QFrame
public:
KompareView(ViewSettings *settings, QWidget *parent);
~KompareView() {}
~KompareView() override {}
KompareSplitter *splitter() { return m_splitter; }
private:
......
......@@ -38,7 +38,7 @@ class KompareURLDialog : public KPageDialog
public:
explicit KompareURLDialog( QWidget *parent= 0, Qt::WindowFlags flags= 0 );
~KompareURLDialog();
~KompareURLDialog() override;
QUrl getFirstURL() const;
QUrl getSecondURL() const;
......@@ -53,13 +53,13 @@ public:
void setSecondURLRequesterMode( unsigned int mode );
public slots:
virtual void accept();
virtual void reject();
void accept() override;
void reject() override;
private slots:
void slotEnableOk();
protected:
void showEvent ( QShowEvent * event );
void showEvent ( QShowEvent * event ) override;
private:
FilesPage* m_filesPage;
FilesSettings* m_filesSettings;
......
......@@ -43,7 +43,7 @@ class DIALOGPAGES_EXPORT DiffPage : public QFrame
Q_OBJECT
public:
DiffPage();
~DiffPage();
~DiffPage() override;
public:
void setSettings( DiffSettings* );
......
......@@ -36,7 +36,7 @@ class DIALOGPAGES_EXPORT FilesPage : public QFrame
Q_OBJECT
public:
FilesPage();
virtual ~FilesPage();
~FilesPage() override;
public:
KUrlRequester* firstURLRequester() const;
......
......@@ -31,12 +31,12 @@ class DIALOGPAGES_EXPORT FilesSettings : public SettingsBase
Q_OBJECT
public:
FilesSettings( QWidget* parent );
virtual ~FilesSettings();
~FilesSettings() override;
public:
// some virtual functions that will be overloaded from the base class
virtual void loadSettings( KConfig* config );
virtual void saveSettings( KConfig* config );
void loadSettings( KConfig* config ) override;
void saveSettings( KConfig* config ) override;
void setGroup( const QString& groupName );
......
......@@ -36,7 +36,7 @@ class DIALOGPAGES_EXPORT ViewPage : public QFrame
Q_OBJECT
public:
ViewPage();
~ViewPage();
~ViewPage() override;
public:
void setSettings( ViewSettings* );
......
......@@ -36,11 +36,11 @@ public:
static const QColor default_appliedColor;
ViewSettings( QWidget* parent );
~ViewSettings();
~ViewSettings() override;
public:
// some virtual functions that will be overloaded from the base class
virtual void loadSettings( KConfig* config );
virtual void saveSettings( KConfig* config );
void loadSettings( KConfig* config ) override;
void saveSettings( KConfig* config ) override;
QColor colorForDifferenceType( int type, bool selected = false, bool applied = false );
public:
......
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