forked from qt-creator/qt-creator
QtSupport: Use Qt5-style connects
The heavy lifting was done by clazy. Change-Id: I24cb0cd088b74364320cdd34282d7b15305a93bf Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
committed by
Orgad Shaneh
parent
9a637ba3e3
commit
c64f85cd5a
@@ -33,7 +33,7 @@ using namespace Core;
|
|||||||
static MessageManager *m_instance = 0;
|
static MessageManager *m_instance = 0;
|
||||||
Internal::MessageOutputWindow *m_messageOutputWindow = 0;
|
Internal::MessageOutputWindow *m_messageOutputWindow = 0;
|
||||||
|
|
||||||
QObject *MessageManager::instance()
|
MessageManager *MessageManager::instance()
|
||||||
{
|
{
|
||||||
return m_instance;
|
return m_instance;
|
||||||
}
|
}
|
||||||
@@ -66,11 +66,6 @@ void MessageManager::showOutputPane()
|
|||||||
m_messageOutputWindow->popup(IOutputPane::ModeSwitch);
|
m_messageOutputWindow->popup(IOutputPane::ModeSwitch);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MessageManager::write(const QString &text)
|
|
||||||
{
|
|
||||||
write(text, NoModeSwitch);
|
|
||||||
}
|
|
||||||
|
|
||||||
void MessageManager::write(const QString &text, PrintToOutputPaneFlags flags)
|
void MessageManager::write(const QString &text, PrintToOutputPaneFlags flags)
|
||||||
{
|
{
|
||||||
if (!m_messageOutputWindow)
|
if (!m_messageOutputWindow)
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ class CORE_EXPORT MessageManager : public QObject
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static QObject *instance();
|
static MessageManager *instance();
|
||||||
|
|
||||||
static void showOutputPane();
|
static void showOutputPane();
|
||||||
|
|
||||||
@@ -55,10 +55,9 @@ public:
|
|||||||
|
|
||||||
Q_DECLARE_FLAGS(PrintToOutputPaneFlags, PrintToOutputPaneFlag)
|
Q_DECLARE_FLAGS(PrintToOutputPaneFlags, PrintToOutputPaneFlag)
|
||||||
|
|
||||||
static void write(const QString &text); // imply NoModeSwitch
|
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
static void write(const QString &text, Core::MessageManager::PrintToOutputPaneFlags flags);
|
static void write(const QString &text,
|
||||||
|
Core::MessageManager::PrintToOutputPaneFlags flags = NoModeSwitch);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
MessageManager();
|
MessageManager();
|
||||||
|
|||||||
@@ -42,8 +42,8 @@ CodeGenSettingsPageWidget::CodeGenSettingsPageWidget(QWidget *parent) :
|
|||||||
QWidget(parent)
|
QWidget(parent)
|
||||||
{
|
{
|
||||||
m_ui.setupUi(this);
|
m_ui.setupUi(this);
|
||||||
connect(m_ui.includeQtModuleCheckBox, SIGNAL(toggled(bool)),
|
connect(m_ui.includeQtModuleCheckBox, &QAbstractButton::toggled,
|
||||||
m_ui.addQtVersionCheckBox, SLOT(setEnabled(bool)));
|
m_ui.addQtVersionCheckBox, &QWidget::setEnabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
CodeGenSettings CodeGenSettingsPageWidget::parameters() const
|
CodeGenSettings CodeGenSettingsPageWidget::parameters() const
|
||||||
|
|||||||
@@ -734,14 +734,16 @@ ExamplesListModelFilter::ExamplesListModelFilter(ExamplesListModel *sourceModel,
|
|||||||
m_exampleDataRequested(false)
|
m_exampleDataRequested(false)
|
||||||
{
|
{
|
||||||
// initialization hooks
|
// initialization hooks
|
||||||
connect(QtVersionManager::instance(), SIGNAL(qtVersionsLoaded()),
|
connect(QtVersionManager::instance(), &QtVersionManager::qtVersionsLoaded,
|
||||||
this, SLOT(qtVersionManagerLoaded()));
|
this, &ExamplesListModelFilter::qtVersionManagerLoaded);
|
||||||
connect(Core::HelpManager::instance(), SIGNAL(setupFinished()),
|
connect(Core::HelpManager::instance(), &Core::HelpManager::setupFinished,
|
||||||
this, SLOT(helpManagerInitialized()));
|
this, &ExamplesListModelFilter::helpManagerInitialized);
|
||||||
|
|
||||||
connect(this, SIGNAL(showTutorialsOnlyChanged()), SLOT(updateFilter()));
|
connect(this, &ExamplesListModelFilter::showTutorialsOnlyChanged,
|
||||||
|
this, &ExamplesListModelFilter::updateFilter);
|
||||||
|
|
||||||
connect(m_sourceModel, SIGNAL(selectedExampleSetChanged()), this, SIGNAL(exampleSetIndexChanged()));
|
connect(m_sourceModel, &ExamplesListModel::selectedExampleSetChanged,
|
||||||
|
this, &ExamplesListModelFilter::exampleSetIndexChanged);
|
||||||
|
|
||||||
setSourceModel(m_sourceModel);
|
setSourceModel(m_sourceModel);
|
||||||
}
|
}
|
||||||
@@ -868,10 +870,10 @@ void ExamplesListModelFilter::tryToInitialize()
|
|||||||
if (!m_initalized
|
if (!m_initalized
|
||||||
&& m_qtVersionManagerInitialized && m_helpManagerInitialized && m_exampleDataRequested) {
|
&& m_qtVersionManagerInitialized && m_helpManagerInitialized && m_exampleDataRequested) {
|
||||||
m_initalized = true;
|
m_initalized = true;
|
||||||
connect(QtVersionManager::instance(), SIGNAL(qtVersionsChanged(QList<int>,QList<int>,QList<int>)),
|
connect(QtVersionManager::instance(), &QtVersionManager::qtVersionsChanged,
|
||||||
this, SLOT(handleQtVersionsChanged()));
|
this, &ExamplesListModelFilter::handleQtVersionsChanged);
|
||||||
connect(ProjectExplorer::KitManager::instance(), SIGNAL(defaultkitChanged()),
|
connect(ProjectExplorer::KitManager::instance(), &ProjectExplorer::KitManager::defaultkitChanged,
|
||||||
this, SLOT(handleQtVersionsChanged()));
|
this, &ExamplesListModelFilter::handleQtVersionsChanged);
|
||||||
handleQtVersionsChanged();
|
handleQtVersionsChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -210,11 +210,10 @@ signals:
|
|||||||
void searchStrings(const QStringList &arg);
|
void searchStrings(const QStringList &arg);
|
||||||
void exampleSetIndexChanged();
|
void exampleSetIndexChanged();
|
||||||
|
|
||||||
private slots:
|
private:
|
||||||
void qtVersionManagerLoaded();
|
void qtVersionManagerLoaded();
|
||||||
void helpManagerInitialized();
|
void helpManagerInitialized();
|
||||||
|
|
||||||
private:
|
|
||||||
void exampleDataRequested() const;
|
void exampleDataRequested() const;
|
||||||
void tryToInitialize();
|
void tryToInitialize();
|
||||||
void timerEvent(QTimerEvent *event);
|
void timerEvent(QTimerEvent *event);
|
||||||
|
|||||||
@@ -64,17 +64,6 @@ using namespace Utils;
|
|||||||
namespace QtSupport {
|
namespace QtSupport {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class ExampleDialog : public QDialog
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
enum ResultCode { Copy = QDialog::Accepted + 1, Keep };
|
|
||||||
ExampleDialog(QWidget *parent = 0) : QDialog(parent) {};
|
|
||||||
private slots:
|
|
||||||
void handleCopyClicked() { done(Copy); };
|
|
||||||
void handleKeepClicked() { done(Keep); };
|
|
||||||
};
|
|
||||||
|
|
||||||
const char C_FALLBACK_ROOT[] = "ProjectsFallbackRoot";
|
const char C_FALLBACK_ROOT[] = "ProjectsFallbackRoot";
|
||||||
|
|
||||||
QPointer<ExamplesListModel> &examplesModelStatic()
|
QPointer<ExamplesListModel> &examplesModelStatic()
|
||||||
@@ -90,7 +79,7 @@ class Fetcher : public QObject
|
|||||||
public:
|
public:
|
||||||
Fetcher() : QObject(), m_shutdown(false)
|
Fetcher() : QObject(), m_shutdown(false)
|
||||||
{
|
{
|
||||||
connect(Core::ICore::instance(), SIGNAL(coreAboutToClose()), this, SLOT(shutdown()));
|
connect(Core::ICore::instance(), &Core::ICore::coreAboutToClose, this, &Fetcher::shutdown);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wait()
|
void wait()
|
||||||
@@ -146,7 +135,7 @@ public slots:
|
|||||||
m_waitcondition.wakeAll();
|
m_waitcondition.wakeAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
private slots:
|
private:
|
||||||
void shutdown()
|
void shutdown()
|
||||||
{
|
{
|
||||||
m_shutdown = true;
|
m_shutdown = true;
|
||||||
@@ -293,7 +282,7 @@ void ExamplesWelcomePage::openUrl(const QUrl &url)
|
|||||||
QString ExamplesWelcomePage::copyToAlternativeLocation(const QFileInfo& proFileInfo, QStringList &filesToOpen, const QStringList& dependencies)
|
QString ExamplesWelcomePage::copyToAlternativeLocation(const QFileInfo& proFileInfo, QStringList &filesToOpen, const QStringList& dependencies)
|
||||||
{
|
{
|
||||||
const QString projectDir = proFileInfo.canonicalPath();
|
const QString projectDir = proFileInfo.canonicalPath();
|
||||||
ExampleDialog d(Core::ICore::mainWindow());
|
QDialog d(Core::ICore::mainWindow());
|
||||||
QGridLayout *lay = new QGridLayout(&d);
|
QGridLayout *lay = new QGridLayout(&d);
|
||||||
QLabel *descrLbl = new QLabel;
|
QLabel *descrLbl = new QLabel;
|
||||||
d.setWindowTitle(tr("Copy Project to writable Location?"));
|
d.setWindowTitle(tr("Copy Project to writable Location?"));
|
||||||
@@ -321,16 +310,17 @@ QString ExamplesWelcomePage::copyToAlternativeLocation(const QFileInfo& proFileI
|
|||||||
Core::DocumentManager::projectsDirectory()).toString());
|
Core::DocumentManager::projectsDirectory()).toString());
|
||||||
lay->addWidget(txt, 1, 0);
|
lay->addWidget(txt, 1, 0);
|
||||||
lay->addWidget(chooser, 1, 1);
|
lay->addWidget(chooser, 1, 1);
|
||||||
|
enum { Copy = QDialog::Accepted + 1, Keep = QDialog::Accepted + 2 };
|
||||||
QDialogButtonBox *bb = new QDialogButtonBox;
|
QDialogButtonBox *bb = new QDialogButtonBox;
|
||||||
QPushButton *copyBtn = bb->addButton(tr("&Copy Project and Open"), QDialogButtonBox::AcceptRole);
|
QPushButton *copyBtn = bb->addButton(tr("&Copy Project and Open"), QDialogButtonBox::AcceptRole);
|
||||||
connect(copyBtn, SIGNAL(released()), &d, SLOT(handleCopyClicked()));
|
connect(copyBtn, &QAbstractButton::released, &d, [&d] { d.done(Copy); });
|
||||||
copyBtn->setDefault(true);
|
copyBtn->setDefault(true);
|
||||||
QPushButton *keepBtn = bb->addButton(tr("&Keep Project and Open"), QDialogButtonBox::RejectRole);
|
QPushButton *keepBtn = bb->addButton(tr("&Keep Project and Open"), QDialogButtonBox::RejectRole);
|
||||||
connect(keepBtn, SIGNAL(released()), &d, SLOT(handleKeepClicked()));
|
connect(keepBtn, &QAbstractButton::released, &d, [&d] { d.done(Keep); });
|
||||||
lay->addWidget(bb, 2, 0, 1, 2);
|
lay->addWidget(bb, 2, 0, 1, 2);
|
||||||
connect(chooser, SIGNAL(validChanged(bool)), copyBtn, SLOT(setEnabled(bool)));
|
connect(chooser, &PathChooser::validChanged, copyBtn, &QWidget::setEnabled);
|
||||||
int code = d.exec();
|
int code = d.exec();
|
||||||
if (code == ExampleDialog::Copy) {
|
if (code == Copy) {
|
||||||
QString exampleDirName = proFileInfo.dir().dirName();
|
QString exampleDirName = proFileInfo.dir().dirName();
|
||||||
QString destBaseDir = chooser->path();
|
QString destBaseDir = chooser->path();
|
||||||
settings->setValue(QString::fromLatin1(C_FALLBACK_ROOT), destBaseDir);
|
settings->setValue(QString::fromLatin1(C_FALLBACK_ROOT), destBaseDir);
|
||||||
@@ -370,7 +360,7 @@ QString ExamplesWelcomePage::copyToAlternativeLocation(const QFileInfo& proFileI
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (code == ExampleDialog::Keep)
|
if (code == Keep)
|
||||||
return proFileInfo.absoluteFilePath();
|
return proFileInfo.absoluteFilePath();
|
||||||
return QString();
|
return QString();
|
||||||
|
|
||||||
|
|||||||
@@ -47,9 +47,8 @@ ProMessageHandler::ProMessageHandler(bool verbose, bool exact)
|
|||||||
//: Prefix used for output from the cumulative evaluation of project files.
|
//: Prefix used for output from the cumulative evaluation of project files.
|
||||||
, m_prefix(tr("[Inexact] "))
|
, m_prefix(tr("[Inexact] "))
|
||||||
{
|
{
|
||||||
QObject::connect(this, SIGNAL(writeMessage(QString,Core::MessageManager::PrintToOutputPaneFlags)),
|
connect(this, &ProMessageHandler::writeMessage,
|
||||||
Core::MessageManager::instance(), SLOT(write(QString,Core::MessageManager::PrintToOutputPaneFlags)),
|
Core::MessageManager::instance(), &Core::MessageManager::write, Qt::QueuedConnection);
|
||||||
Qt::QueuedConnection);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProMessageHandler::message(int type, const QString &msg, const QString &fileName, int lineNo)
|
void ProMessageHandler::message(int type, const QString &msg, const QString &fileName, int lineNo)
|
||||||
@@ -129,8 +128,8 @@ ProFileCacheManager::ProFileCacheManager(QObject *parent) :
|
|||||||
s_instance = this;
|
s_instance = this;
|
||||||
m_timer.setInterval(5000);
|
m_timer.setInterval(5000);
|
||||||
m_timer.setSingleShot(true);
|
m_timer.setSingleShot(true);
|
||||||
connect(&m_timer, SIGNAL(timeout()),
|
connect(&m_timer, &QTimer::timeout,
|
||||||
this, SLOT(clear()));
|
this, &ProFileCacheManager::clear);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProFileCacheManager::incRefCount()
|
void ProFileCacheManager::incRefCount()
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
ProFileCacheManager(QObject *parent);
|
ProFileCacheManager(QObject *parent);
|
||||||
~ProFileCacheManager();
|
~ProFileCacheManager();
|
||||||
Q_SLOT void clear();
|
void clear();
|
||||||
ProFileCache *m_cache;
|
ProFileCache *m_cache;
|
||||||
int m_refCount;
|
int m_refCount;
|
||||||
QTimer m_timer;
|
QTimer m_timer;
|
||||||
|
|||||||
@@ -55,12 +55,13 @@ QtKitConfigWidget::QtKitConfigWidget(ProjectExplorer::Kit *k, const ProjectExplo
|
|||||||
refresh();
|
refresh();
|
||||||
m_combo->setToolTip(toolTip());
|
m_combo->setToolTip(toolTip());
|
||||||
|
|
||||||
connect(m_combo, SIGNAL(currentIndexChanged(int)), this, SLOT(currentWasChanged(int)));
|
connect(m_combo, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
||||||
|
this, &QtKitConfigWidget::currentWasChanged);
|
||||||
|
|
||||||
connect(QtVersionManager::instance(), SIGNAL(qtVersionsChanged(QList<int>,QList<int>,QList<int>)),
|
connect(QtVersionManager::instance(), &QtVersionManager::qtVersionsChanged,
|
||||||
this, SLOT(versionsChanged(QList<int>,QList<int>,QList<int>)));
|
this, &QtKitConfigWidget::versionsChanged);
|
||||||
|
|
||||||
connect(m_manageButton, SIGNAL(clicked()), this, SLOT(manageQtVersions()));
|
connect(m_manageButton, &QAbstractButton::clicked, this, &QtKitConfigWidget::manageQtVersions);
|
||||||
}
|
}
|
||||||
|
|
||||||
QtKitConfigWidget::~QtKitConfigWidget()
|
QtKitConfigWidget::~QtKitConfigWidget()
|
||||||
|
|||||||
@@ -52,12 +52,10 @@ public:
|
|||||||
QWidget *buttonWidget() const override;
|
QWidget *buttonWidget() const override;
|
||||||
QString toolTip() const override;
|
QString toolTip() const override;
|
||||||
|
|
||||||
private slots:
|
private:
|
||||||
void versionsChanged(const QList<int> &added, const QList<int> &removed, const QList<int> &changed);
|
void versionsChanged(const QList<int> &added, const QList<int> &removed, const QList<int> &changed);
|
||||||
void manageQtVersions();
|
void manageQtVersions();
|
||||||
void currentWasChanged(int idx);
|
void currentWasChanged(int idx);
|
||||||
|
|
||||||
private:
|
|
||||||
int findQtVersion(const int id) const;
|
int findQtVersion(const int id) const;
|
||||||
|
|
||||||
QComboBox *m_combo;
|
QComboBox *m_combo;
|
||||||
|
|||||||
@@ -219,8 +219,8 @@ void QtKitInformation::kitsWereLoaded()
|
|||||||
foreach (ProjectExplorer::Kit *k, ProjectExplorer::KitManager::kits())
|
foreach (ProjectExplorer::Kit *k, ProjectExplorer::KitManager::kits())
|
||||||
fix(k);
|
fix(k);
|
||||||
|
|
||||||
connect(QtVersionManager::instance(), SIGNAL(qtVersionsChanged(QList<int>,QList<int>,QList<int>)),
|
connect(QtVersionManager::instance(), &QtVersionManager::qtVersionsChanged,
|
||||||
this, SLOT(qtVersionsChanged(QList<int>,QList<int>,QList<int>)));
|
this, &QtKitInformation::qtVersionsChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
KitMatcher QtKitInformation::platformMatcher(Core::Id platform)
|
KitMatcher QtKitInformation::platformMatcher(Core::Id platform)
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ public:
|
|||||||
QSet<Core::Id> supportedPlatforms(const ProjectExplorer::Kit *k) const override;
|
QSet<Core::Id> supportedPlatforms(const ProjectExplorer::Kit *k) const override;
|
||||||
QSet<Core::Id> availableFeatures(const ProjectExplorer::Kit *k) const override;
|
QSet<Core::Id> availableFeatures(const ProjectExplorer::Kit *k) const override;
|
||||||
|
|
||||||
private slots:
|
private:
|
||||||
void qtVersionsChanged(const QList<int> &addedIds,
|
void qtVersionsChanged(const QList<int> &addedIds,
|
||||||
const QList<int> &removedIds,
|
const QList<int> &removedIds,
|
||||||
const QList<int> &changedIds);
|
const QList<int> &changedIds);
|
||||||
|
|||||||
@@ -769,8 +769,8 @@ void QtOptionsPageWidget::updateWidgets()
|
|||||||
if (m_configurationWidget) {
|
if (m_configurationWidget) {
|
||||||
m_versionUi->formLayout->addRow(m_configurationWidget);
|
m_versionUi->formLayout->addRow(m_configurationWidget);
|
||||||
m_configurationWidget->setEnabled(!version->isAutodetected());
|
m_configurationWidget->setEnabled(!version->isAutodetected());
|
||||||
connect(m_configurationWidget, SIGNAL(changed()),
|
connect(m_configurationWidget, &QtConfigWidget::changed,
|
||||||
this, SLOT(qtVersionChanged()));
|
this, &QtOptionsPageWidget::qtVersionChanged);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
m_versionUi->nameEdit->clear();
|
m_versionUi->nameEdit->clear();
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ private:
|
|||||||
QIcon m_validVersionIcon;
|
QIcon m_validVersionIcon;
|
||||||
QtConfigWidget *m_configurationWidget;
|
QtConfigWidget *m_configurationWidget;
|
||||||
|
|
||||||
private slots:
|
private:
|
||||||
void updateQtVersions(const QList<int> &, const QList<int> &, const QList<int> &);
|
void updateQtVersions(const QList<int> &, const QList<int> &, const QList<int> &);
|
||||||
void qtVersionChanged();
|
void qtVersionChanged();
|
||||||
void versionChanged(const QModelIndex ¤t, const QModelIndex &previous);
|
void versionChanged(const QModelIndex ¤t, const QModelIndex &previous);
|
||||||
@@ -103,7 +103,6 @@ private slots:
|
|||||||
void setInfoWidgetVisibility();
|
void setInfoWidgetVisibility();
|
||||||
void infoAnchorClicked(const QUrl &);
|
void infoAnchorClicked(const QUrl &);
|
||||||
|
|
||||||
private:
|
|
||||||
struct ValidityInfo {
|
struct ValidityInfo {
|
||||||
QString description;
|
QString description;
|
||||||
QString message;
|
QString message;
|
||||||
|
|||||||
@@ -88,8 +88,8 @@ QtOutputFormatter::QtOutputFormatter(Project *project)
|
|||||||
d->projectFinder.setProjectFiles(project->files(Project::SourceFiles));
|
d->projectFinder.setProjectFiles(project->files(Project::SourceFiles));
|
||||||
d->projectFinder.setProjectDirectory(project->projectDirectory().toString());
|
d->projectFinder.setProjectDirectory(project->projectDirectory().toString());
|
||||||
|
|
||||||
connect(project, SIGNAL(fileListChanged()),
|
connect(project, &Project::fileListChanged,
|
||||||
this, SLOT(updateProjectFileList()));
|
this, &QtOutputFormatter::updateProjectFileList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -63,10 +63,8 @@ protected:
|
|||||||
void clearLastLine();
|
void clearLastLine();
|
||||||
virtual void openEditor(const QString &fileName, int line, int column = -1);
|
virtual void openEditor(const QString &fileName, int line, int column = -1);
|
||||||
|
|
||||||
private slots:
|
|
||||||
void updateProjectFileList();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void updateProjectFileList();
|
||||||
LinkResult matchLine(const QString &line) const;
|
LinkResult matchLine(const QString &line) const;
|
||||||
void appendMessagePart(QTextCursor &cursor, const QString &txt, const QTextCharFormat &format);
|
void appendMessagePart(QTextCursor &cursor, const QString &txt, const QTextCharFormat &format);
|
||||||
void appendLine(QTextCursor &cursor, const LinkResult &lr, const QString &line,
|
void appendLine(QTextCursor &cursor, const LinkResult &lr, const QString &line,
|
||||||
|
|||||||
@@ -118,13 +118,13 @@ QtVersionManager::QtVersionManager()
|
|||||||
|
|
||||||
// Give the file a bit of time to settle before reading it...
|
// Give the file a bit of time to settle before reading it...
|
||||||
m_fileWatcherTimer->setInterval(2000);
|
m_fileWatcherTimer->setInterval(2000);
|
||||||
connect(m_fileWatcherTimer, SIGNAL(timeout()), SLOT(updateFromInstaller()));
|
connect(m_fileWatcherTimer, &QTimer::timeout, this, [this] { updateFromInstaller(); });
|
||||||
}
|
}
|
||||||
|
|
||||||
void QtVersionManager::triggerQtVersionRestore()
|
void QtVersionManager::triggerQtVersionRestore()
|
||||||
{
|
{
|
||||||
disconnect(ProjectExplorer::ToolChainManager::instance(), SIGNAL(toolChainsLoaded()),
|
disconnect(ProjectExplorer::ToolChainManager::instance(), &ProjectExplorer::ToolChainManager::toolChainsLoaded,
|
||||||
this, SLOT(triggerQtVersionRestore()));
|
this, &QtVersionManager::triggerQtVersionRestore);
|
||||||
|
|
||||||
bool success = restoreQtVersions();
|
bool success = restoreQtVersions();
|
||||||
m_instance->updateFromInstaller(false);
|
m_instance->updateFromInstaller(false);
|
||||||
@@ -142,8 +142,8 @@ void QtVersionManager::triggerQtVersionRestore()
|
|||||||
const FileName configFileName = globalSettingsFileName();
|
const FileName configFileName = globalSettingsFileName();
|
||||||
if (configFileName.exists()) {
|
if (configFileName.exists()) {
|
||||||
m_configFileWatcher = new FileSystemWatcher(m_instance);
|
m_configFileWatcher = new FileSystemWatcher(m_instance);
|
||||||
connect(m_configFileWatcher, SIGNAL(fileChanged(QString)),
|
connect(m_configFileWatcher, &FileSystemWatcher::fileChanged,
|
||||||
m_fileWatcherTimer, SLOT(start()));
|
m_fileWatcherTimer, static_cast<void (QTimer::*)()>(&QTimer::start));
|
||||||
m_configFileWatcher->addFile(configFileName.toString(),
|
m_configFileWatcher->addFile(configFileName.toString(),
|
||||||
FileSystemWatcher::WatchModifiedDate);
|
FileSystemWatcher::WatchModifiedDate);
|
||||||
} // exists
|
} // exists
|
||||||
@@ -165,8 +165,8 @@ QtVersionManager::~QtVersionManager()
|
|||||||
|
|
||||||
void QtVersionManager::initialized()
|
void QtVersionManager::initialized()
|
||||||
{
|
{
|
||||||
connect(ProjectExplorer::ToolChainManager::instance(), SIGNAL(toolChainsLoaded()),
|
connect(ProjectExplorer::ToolChainManager::instance(), &ProjectExplorer::ToolChainManager::toolChainsLoaded,
|
||||||
QtVersionManager::instance(), SLOT(triggerQtVersionRestore()));
|
QtVersionManager::instance(), &QtVersionManager::triggerQtVersionRestore);
|
||||||
}
|
}
|
||||||
|
|
||||||
QtVersionManager *QtVersionManager::instance()
|
QtVersionManager *QtVersionManager::instance()
|
||||||
|
|||||||
@@ -73,11 +73,10 @@ signals:
|
|||||||
public slots:
|
public slots:
|
||||||
void updateDumpFor(const Utils::FileName &qmakeCommand);
|
void updateDumpFor(const Utils::FileName &qmakeCommand);
|
||||||
|
|
||||||
private slots:
|
private:
|
||||||
void updateFromInstaller(bool emitSignal = true);
|
void updateFromInstaller(bool emitSignal = true);
|
||||||
void triggerQtVersionRestore();
|
void triggerQtVersionRestore();
|
||||||
|
|
||||||
private:
|
|
||||||
// Used by QtOptionsPage
|
// Used by QtOptionsPage
|
||||||
static void setNewQtVersions(QList<BaseQtVersion *> newVersions);
|
static void setNewQtVersions(QList<BaseQtVersion *> newVersions);
|
||||||
// Used by QtVersion
|
// Used by QtVersion
|
||||||
|
|||||||
Reference in New Issue
Block a user