qmake project: Use Qt5-style connects

Change-Id: Ie82f4a0228a672fd7da35e35d2a000c0cc3c533a
Reviewed-by: hjk <hjk@theqtcompany.com>
This commit is contained in:
Tobias Hunger
2016-01-07 18:01:04 +01:00
committed by hjk
parent b17fbfcd75
commit 5915b66fc8
2 changed files with 9 additions and 18 deletions

View File

@@ -121,16 +121,15 @@ class CentralizedFolderWatcher : public QObject
Q_OBJECT Q_OBJECT
public: public:
CentralizedFolderWatcher(QmakeProject *parent); CentralizedFolderWatcher(QmakeProject *parent);
~CentralizedFolderWatcher();
void watchFolders(const QList<QString> &folders, QmakePriFileNode *node); void watchFolders(const QList<QString> &folders, QmakePriFileNode *node);
void unwatchFolders(const QList<QString> &folders, QmakePriFileNode *node); void unwatchFolders(const QList<QString> &folders, QmakePriFileNode *node);
private slots: private:
void folderChanged(const QString &folder); void folderChanged(const QString &folder);
void onTimer(); void onTimer();
void delayedFolderChanged(const QString &folder); void delayedFolderChanged(const QString &folder);
private:
QmakeProject *m_project; QmakeProject *m_project;
QSet<QString> recursiveDirs(const QString &folder); QSet<QString> recursiveDirs(const QString &folder);
QFileSystemWatcher m_watcher; QFileSystemWatcher m_watcher;
@@ -322,10 +321,10 @@ QmakeProject::QmakeProject(QmakeManager *manager, const QString &fileName) :
m_asyncUpdateTimer.setSingleShot(true); m_asyncUpdateTimer.setSingleShot(true);
m_asyncUpdateTimer.setInterval(3000); m_asyncUpdateTimer.setInterval(3000);
connect(&m_asyncUpdateTimer, SIGNAL(timeout()), this, SLOT(asyncUpdate())); connect(&m_asyncUpdateTimer, &QTimer::timeout, this, &QmakeProject::asyncUpdate);
connect(BuildManager::instance(), SIGNAL(buildQueueFinished(bool)), connect(BuildManager::instance(), &BuildManager::buildQueueFinished,
SLOT(buildFinished(bool))); this, &QmakeProject::buildFinished);
setPreferredKitMatcher(KitMatcher([this](const Kit *kit) -> bool { setPreferredKitMatcher(KitMatcher([this](const Kit *kit) -> bool {
return matchesKit(kit); return matchesKit(kit);
@@ -1166,15 +1165,9 @@ CentralizedFolderWatcher::CentralizedFolderWatcher(QmakeProject *parent)
{ {
m_compressTimer.setSingleShot(true); m_compressTimer.setSingleShot(true);
m_compressTimer.setInterval(200); m_compressTimer.setInterval(200);
connect(&m_compressTimer, SIGNAL(timeout()), connect(&m_compressTimer, &QTimer::timeout, this, &CentralizedFolderWatcher::onTimer);
this, SLOT(onTimer())); connect(&m_watcher, &QFileSystemWatcher::directoryChanged,
connect (&m_watcher, SIGNAL(directoryChanged(QString)), this, &CentralizedFolderWatcher::folderChanged);
this, SLOT(folderChanged(QString)));
}
CentralizedFolderWatcher::~CentralizedFolderWatcher()
{
} }
QSet<QString> CentralizedFolderWatcher::recursiveDirs(const QString &folder) QSet<QString> CentralizedFolderWatcher::recursiveDirs(const QString &folder)

View File

@@ -155,13 +155,11 @@ public slots:
protected: protected:
RestoreResult fromMap(const QVariantMap &map, QString *errorMessage); RestoreResult fromMap(const QVariantMap &map, QString *errorMessage);
private slots: private:
void asyncUpdate(); void asyncUpdate();
void buildFinished(bool success); void buildFinished(bool success);
void activeTargetWasChanged(); void activeTargetWasChanged();
private:
QString executableFor(const QmakeProFileNode *node); QString executableFor(const QmakeProFileNode *node);
void updateRunConfigurations(); void updateRunConfigurations();