Commit eb2915c1 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Use Q_SIGNALS/Q_SLOTS + add explicit

parent d31fd65f
......@@ -87,7 +87,7 @@ class AutoPasteModel : public QAbstractTableModel
*/
bool moveItem(int sourceRow, int destinationRow);
public slots:
public Q_SLOTS:
/**
* Loads the stored data
* @see save()
......
......@@ -27,7 +27,7 @@ public:
DlgWebinterface(QDialog *parent = nullptr);
~DlgWebinterface() override;
signals:
Q_SIGNALS:
void changed();
void saved();
......
......@@ -35,14 +35,14 @@ class IntegrationPreferences : public QWidget
explicit IntegrationPreferences(KConfigDialog *parent, Qt::WindowFlags f = Qt::Widget);
~IntegrationPreferences() override;
private slots:
private Q_SLOTS:
void slotUpdateButtons();
void slotAddItem();
void slotRemoveItem();
void slotIncreasePriority();
void slotDecreasePriority();
signals:
Q_SIGNALS:
/**
* Emitted whenever something changes
*/
......
......@@ -21,7 +21,7 @@ class PluginSelector : public KPluginSelector
PluginSelector(QDialog * parent);
~PluginSelector() override;
private slots:
private Q_SLOTS:
void saveState();
void loadDefaults();
};
......
......@@ -23,10 +23,10 @@ class PreferencesDialog : public KConfigDialog
public:
PreferencesDialog( QWidget * parent, KConfigSkeleton * config );
signals:
Q_SIGNALS:
void resetDefaults();
private slots:
private Q_SLOTS:
void slotToggleAfterFinishAction(int state);
void disableApplyButton();
void enableApplyButton();
......
......@@ -39,7 +39,7 @@ class TransfersGroupTree : public QTreeView
TransfersGroupTree(QWidget *parent = nullptr);
void setModel(QAbstractItemModel *model) override;
public slots:
public Q_SLOTS:
void editCurrent();
void addGroup();
void deleteSelectedGroup();
......
......@@ -22,7 +22,7 @@ class TransfersGroupWidget : public QWidget
public:
TransfersGroupWidget(QWidget *parent = nullptr);
private slots:
private Q_SLOTS:
void slotSelectionChanged();
private:
......
......@@ -33,13 +33,13 @@ class VerificationPreferences : public QWidget
public:
explicit VerificationPreferences(KConfigDialog *parent, Qt::WindowFlags f = Qt::Widget);
signals:
Q_SIGNALS:
/**
* Emitted when the mirrors change
*/
void changed();
private slots:
private Q_SLOTS:
void slotDefaultClicked();
void slotAccpeted();
void slotRejected();
......
......@@ -172,11 +172,11 @@ class KGET_EXPORT DataSourceFactory : public QObject
void dataSourceFactoryChange(Transfer::ChangesFlags change);
void log(const QString &message, Transfer::LogLevel logLevel);
public slots:
public Q_SLOTS:
void save(const QDomElement &element);
void load(const QDomElement *e);
private slots:
private Q_SLOTS:
void slotUpdateCapabilities();
void slotRemovedFile();
......
......@@ -31,7 +31,7 @@ class KGET_EXPORT Download : public QObject
void finishedSuccessfully(QUrl dest, QByteArray data);
void finishedWithError();
private slots:
private Q_SLOTS:
void slotResult(KJob * job);
void slotData(KIO::Job *job, const QByteArray& data);
......
......@@ -162,7 +162,7 @@ class KGET_EXPORT FileModel : public QAbstractItemModel
*/
bool isFile(const QModelIndex &index) const;
public slots:
public Q_SLOTS:
/**
* Watches if the check state changes, the result of that will be emitted
* when stopWatchCheckState() is being called()
......@@ -203,7 +203,7 @@ class KGET_EXPORT FileModel : public QAbstractItemModel
void changeData(int row, int column, FileItem *item, bool fileFinished = false);
private slots:
private Q_SLOTS:
void renameFailed(const QUrl &beforeRename, const QUrl &afterRename);
private:
......
......@@ -50,7 +50,7 @@ class KeyDownloader : public QObject
*/
void downloadKey(QString fingerprint, Signature *sig);
private slots:
private Q_SLOTS:
/**
* Parses the downloaded data and if it is a key tries to add it to GnuPG,
* if it is not a key try a different server.
......
......@@ -470,7 +470,7 @@ class GenericObserver : public QObject
GenericObserver(QObject *parent = nullptr);
~GenericObserver () override;
public slots:
public Q_SLOTS:
void groupAddedEvent(TransferGroupHandler *handler);
void groupRemovedEvent(TransferGroupHandler *handler);
void transfersAddedEvent(const QList<TransferHandler*> &handlers);
......@@ -479,7 +479,7 @@ class GenericObserver : public QObject
void groupsChangedEvent(QMap<TransferGroupHandler*, TransferGroup::ChangesFlags> groups);
void transferMovedEvent(TransferHandler *, TransferGroupHandler *);
private slots:
private Q_SLOTS:
void slotSave();
void slotAfterFinishAction();
void slotAbortAfterFinishAction();
......
......@@ -26,7 +26,7 @@ public:
void start() override {};
signals:
Q_SIGNALS:
/**
* Emitted when doKill is called, e.g. when the gui is closed.
* Not handling this signal might lead to a crash if something tries to
......
......@@ -33,10 +33,10 @@ public:
qulonglong totalAmount(Unit unit) const;
unsigned long percent() const;
public slots:
public Q_SLOTS:
void slotUpdateDescription();
signals:
Q_SIGNALS:
/**
* Emitted when doKill is called, e.g. when the gui is closed.
* Not handling this signal might lead to a crash if something tries to
......
......@@ -34,12 +34,12 @@ public:
void settingsChanged();
public slots:
public Q_SLOTS:
void slotTransfersAdded(QList<TransferHandler*> transfers);
void slotTransfersAboutToBeRemoved(const QList<TransferHandler*> &transfer);
void slotTransfersChanged(QMap<TransferHandler *, Transfer::ChangesFlags> transfers);
private slots:
private Q_SLOTS:
void slotRequestStop(KJob *job, TransferHandler *transfer);
void slotRequestSuspend(KJob *job, TransferHandler *transfer);
void slotRequestResume(KJob *job, TransferHandler *transfer);
......
......@@ -53,11 +53,11 @@ public:
return m_transfers;
};
signals:
Q_SIGNALS:
void error(const KLocalizedString &);
void progress(int progress);
private slots:
private Q_SLOTS:
void slotReadFile(const QUrl &url);
private:
......
......@@ -90,10 +90,10 @@ class KGET_EXPORT Signature : public QObject
void save(const QDomElement &element);
void load(const QDomElement &e);
signals:
Q_SIGNALS:
void verified(int verificationStatus);
private slots:
private Q_SLOTS:
#ifdef HAVE_QGPGME
void slotVerified(const GpgME::VerificationResult &result);
#endif //HAVE_QGPGME
......
......@@ -44,7 +44,7 @@ class SignatureThread : public QThread
void verify(const QUrl &dest, const QByteArray &sig);
#ifdef HAVE_QGPGME
signals:
Q_SIGNALS:
/**
* Emitted when the verification of a file finishes, connect to this signal
* if you do the verification for one file only and do not want to bother with
......
......@@ -304,13 +304,13 @@ class KGET_EXPORT Transfer : public Job
*/
virtual void load(const QDomElement *element);
signals:
Q_SIGNALS:
/**
* Emitted when the capabilities of the Transfer change
*/
void capabilitiesChanged();
public slots:
public Q_SLOTS:
/**
* Set Transfer history
*/
......
......@@ -141,7 +141,7 @@ class KGET_EXPORT TransferDataSource : public QObject
*/
virtual int changeNeeded() const;
signals:
Q_SIGNALS:
/**
* Emitted after findFileSize is called successfully
* @param source that found the filesize
......
......@@ -228,14 +228,14 @@ class KGET_EXPORT TransferGroupHandler : public Handler
*/
void calculateUploadLimit() {m_group->calculateUploadLimit();}
public slots:
public Q_SLOTS:
/**
* These are all JobQueue-related functions
*/
void start() override;
void stop() override;
signals:
Q_SIGNALS:
void groupChangedEvent(TransferGroupHandler * transfer, TransferGroupHandler::ChangesFlags flags);
private:
......
......@@ -285,14 +285,14 @@ class KGET_EXPORT TransferHandler : public Handler
*/
virtual Signature * signature(const QUrl &file) {return m_transfer->signature(file);}
public slots:
public Q_SLOTS:
/**
* These are all Job-related functions
*/
void start() override;
void stop() override;
signals:
Q_SIGNALS:
/**
* Emitted when the capabilities of the Transfer change
*/
......
......@@ -66,7 +66,7 @@ public:
static TransferHistoryStore *getStore();
public slots:
public Q_SLOTS:
virtual void load() {};
virtual void clear() {};
virtual void saveItem(const TransferHistoryItem &item)
......@@ -85,7 +85,7 @@ public slots:
Q_UNUSED(item)
};
signals:
Q_SIGNALS:
void elementLoaded(int number, int total, const TransferHistoryItem &item);
void loadFinished();
void saveFinished();
......
......@@ -26,7 +26,7 @@ public:
SQLiteStore(const QString &database);
~SQLiteStore() override;
public slots:
public Q_SLOTS:
void load() override;
void clear() override;
void saveItem(const TransferHistoryItem &item) override;
......
......@@ -24,7 +24,7 @@ public:
XmlStore(const QString &url);
~XmlStore() override;
public slots:
public Q_SLOTS:
void load() override;
void clear() override;
void saveItem(const TransferHistoryItem &item) override;
......@@ -32,7 +32,7 @@ public slots:
void slotLoadElement(int number, int total, const TransferHistoryItem &item);
private slots:
private Q_SLOTS:
void slotDeleteElement();
private:
......@@ -57,7 +57,7 @@ public:
void run() override;
signals:
Q_SIGNALS:
void elementLoaded(int number, int total, const TransferHistoryItem &item);
private:
......@@ -73,7 +73,7 @@ public:
void run() override;
signals:
Q_SIGNALS:
void elementLoaded(int number, int total, const TransferHistoryItem &item);
private:
......
......@@ -166,7 +166,7 @@ class KGET_EXPORT TransferTreeModel : public QStandardItemModel
static int column(Transfer::TransferChange flag);
static int column(TransferGroup::GroupChange flag);
signals:
Q_SIGNALS:
void groupAddedEvent(TransferGroupHandler *);
void groupRemovedEvent(TransferGroupHandler *);
void groupsChangedEvent(QMap<TransferGroupHandler *, TransferGroup::ChangesFlags>);
......
......@@ -46,7 +46,7 @@ class ExistingTransferDialog : public QDialog
NoAll
};
private slots:
private Q_SLOTS:
void slotYesClicked();
void slotNoClicked();
void slotCancelClicked();
......
......@@ -49,7 +49,7 @@ class VerificationThread : public QThread
void doVerify();
void doBrokenPieces();
signals:
Q_SIGNALS:
/**
* Emitted when the verification of a file finishes, connect to this signal
* if you do the verification for one file only and do not want to bother with
......
......@@ -243,7 +243,7 @@ class KGET_EXPORT Verifier : public QObject
void save(const QDomElement &element);
void load(const QDomElement &e);
signals:
Q_SIGNALS:
/**
* Emitted when the verification of a file finishes
*/
......@@ -254,7 +254,7 @@ class KGET_EXPORT Verifier : public QObject
*/
void brokenPieces(const QList<KIO::fileoffset_t> &offsets, KIO::filesize_t length);
private slots:
private Q_SLOTS:
void changeStatus(const QString &type, bool verified);
private:
......
......@@ -34,7 +34,7 @@ class DBusKGetWrapper : public QObject
Q_OBJECT
public:
DBusKGetWrapper(MainWindow *parent);
explicit DBusKGetWrapper(MainWindow *parent);
~DBusKGetWrapper() override;
QStringList addTransfer(const QString& src, const QString& destDir = QString(), bool start = false);
......@@ -49,12 +49,12 @@ class DBusKGetWrapper : public QObject
void importLinks(const QList <QString> &links);
bool isSupported(const QString &url) const;
signals:
Q_SIGNALS:
void transferAddedRemoved();
void transfersAdded(const QStringList &urls, const QStringList &dBusObjectPaths);
void transfersRemoved(const QStringList &urls, const QStringList &dbusObjectPaths);
private slots:
private Q_SLOTS:
void slotTransfersAdded(const QList<TransferHandler*> &transfers);
void slotTransfersRemoved(const QList<TransferHandler*> &transfers);
......
......@@ -21,10 +21,10 @@ class DBusTransferWrapper : public QObject
{
Q_OBJECT
public:
DBusTransferWrapper(TransferHandler * parent);
explicit DBusTransferWrapper(TransferHandler * parent);
~DBusTransferWrapper() override;
public slots:
public Q_SLOTS:
int capabilities() const;
void start();
void stop();
......@@ -145,7 +145,7 @@ class DBusTransferWrapper : public QObject
*/
bool repair(const QString &file);
signals:
Q_SIGNALS:
/**
* Emitted when the transfer changes
*/
......@@ -156,7 +156,7 @@ class DBusTransferWrapper : public QObject
*/
void capabilitiesChanged();
private slots:
private Q_SLOTS:
void slotTransferChanged(TransferHandler *transfer, TransferHandler::ChangesFlags changeflags);
private:
......
......@@ -29,10 +29,10 @@ class DBusVerifierWrapper : public QObject
{
Q_OBJECT
public:
DBusVerifierWrapper(Verifier *parent);
explicit DBusVerifierWrapper(Verifier *parent);
~DBusVerifierWrapper() override;
public slots:
public Q_SLOTS:
/**
* @return the dest url
*/
......@@ -65,7 +65,7 @@ class DBusVerifierWrapper : public QObject
*/
void brokenPieces() const;
signals:
Q_SIGNALS:
/**
* Emitted when the verification of a file finishes
*/
......@@ -78,7 +78,7 @@ class DBusVerifierWrapper : public QObject
*/
void brokenPieces(const QStringList &offsets, qulonglong length);
private slots:
private Q_SLOTS:
void slotBrokenPieces(const QList<KIO::fileoffset_t> &offsets, KIO::filesize_t length);
private:
......
......@@ -29,7 +29,7 @@ public:
void settingsChanged();
private slots:
private Q_SLOTS:
void init(bool);
void handleRequest();
......
......@@ -82,7 +82,7 @@ public:
return 0;
}
public slots:
public Q_SLOTS:
void slotActivateRequested (QStringList args, const QString & /*workingDir*/)
{
parser->parse(args);
......
......@@ -51,7 +51,7 @@ public:
//no slot, to make sure that MainWindow is correctly initialized before any transfers get added
void init();
public slots:
public Q_SLOTS:
void slotQuit();
void slotImportUrl(const QString &url);
void slotUpdateTitlePercent();
......@@ -69,7 +69,7 @@ protected:
// set sensitive initial size
QSize sizeHint() const override;
private slots:
private Q_SLOTS:
// slots connected to actions
void slotToggleDropTarget();
void slotNewTransfer();
......
......@@ -35,7 +35,7 @@ class KGetBarApplet : public KGetApplet
Q_OBJECT
public:
KGetBarApplet(QObject *parent, const QVariantList &args);
~KGetBarApplet();
~KGetBarApplet() override;
void init();
......
......@@ -37,14 +37,14 @@ class KGetBarApplet::Private : public QGraphicsWidget
Q_OBJECT
public:
Private(QGraphicsWidget *parent = 0);
~Private();
explicit Private(QGraphicsWidget *parent = nullptr);
~Private() override;
public slots:
public Q_SLOTS:
void addTransfers(const QList<OrgKdeKgetTransferInterface*> &transfers);
void removeTransfers(const QList<OrgKdeKgetTransferInterface*> &transfers);
private slots:
private Q_SLOTS:
void slotUpdateTransfer(int transferChange);
private:
......
......@@ -43,7 +43,7 @@ class ProxyWidget : public QGraphicsWidget
Q_OBJECT
public:
ProxyWidget(QGraphicsWidget * parent);
~ProxyWidget();
~ProxyWidget() override;
void paint(QPainter * p, const QStyleOptionGraphicsItem * option, QWidget * widget);
......@@ -51,7 +51,7 @@ class ProxyWidget : public QGraphicsWidget
QGraphicsWidget * dataWidget();
private slots:
private Q_SLOTS:
void themeChanged();
private:
......@@ -75,14 +75,14 @@ public:
void init();
void setDataWidget(QGraphicsWidget * widget);
public slots:
public Q_SLOTS:
void dataUpdated(const QString &name, const Plasma::DataEngine::Data &data);