diff options
author | Christian Kandeler <christian.kandeler@theqtcompany.com> | 2015-03-03 11:08:26 +0100 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@theqtcompany.com> | 2015-03-03 14:25:15 +0200 |
commit | 3ba48ca11e16949ff84dd7289084e2f7b3327d5b (patch) | |
tree | 6c32e6799f856004ad1039aa427029674422090b /plugins | |
parent | 5b565ea657f2821a3fdd6d84211968812d9829a9 (diff) | |
download | qt-creator-3ba48ca11e16949ff84dd7289084e2f7b3327d5b.tar.gz |
Remove now-unneeded PathChooser subclass.
Change-Id: Ic7cbe4566159675ae9e776d723ed213c1e7c71ec
Reviewed-by: Andre Poenitz <andre.poenitz@theqtcompany.com>
Diffstat (limited to 'plugins')
6 files changed, 14 insertions, 88 deletions
diff --git a/plugins/clangstaticanalyzer/clangstaticanalyzer.pro b/plugins/clangstaticanalyzer/clangstaticanalyzer.pro index 67eb90ad41..cdffb1f1d1 100644 --- a/plugins/clangstaticanalyzer/clangstaticanalyzer.pro +++ b/plugins/clangstaticanalyzer/clangstaticanalyzer.pro @@ -10,7 +10,6 @@ SOURCES += \ clangstaticanalyzerdiagnosticmodel.cpp \ clangstaticanalyzerdiagnosticview.cpp \ clangstaticanalyzerlogfilereader.cpp \ - clangstaticanalyzerpathchooser.cpp \ clangstaticanalyzerplugin.cpp \ clangstaticanalyzerprojectsettings.cpp \ clangstaticanalyzerprojectsettingsmanager.cpp \ @@ -30,7 +29,6 @@ HEADERS += \ clangstaticanalyzerdiagnosticview.h \ clangstaticanalyzer_global.h \ clangstaticanalyzerlogfilereader.h \ - clangstaticanalyzerpathchooser.h \ clangstaticanalyzerplugin.h \ clangstaticanalyzerprojectsettings.h \ clangstaticanalyzerprojectsettingsmanager.h \ diff --git a/plugins/clangstaticanalyzer/clangstaticanalyzer.qbs b/plugins/clangstaticanalyzer/clangstaticanalyzer.qbs index a97dc9f83c..b430b980da 100644 --- a/plugins/clangstaticanalyzer/clangstaticanalyzer.qbs +++ b/plugins/clangstaticanalyzer/clangstaticanalyzer.qbs @@ -28,8 +28,6 @@ QtcPlugin { "clangstaticanalyzerdiagnosticview.h", "clangstaticanalyzerlogfilereader.cpp", "clangstaticanalyzerlogfilereader.h", - "clangstaticanalyzerpathchooser.cpp", - "clangstaticanalyzerpathchooser.h", "clangstaticanalyzerplugin.cpp", "clangstaticanalyzerplugin.h", "clangstaticanalyzerprojectsettings.cpp", diff --git a/plugins/clangstaticanalyzer/clangstaticanalyzerconfigwidget.cpp b/plugins/clangstaticanalyzer/clangstaticanalyzerconfigwidget.cpp index 6b8b0f0cee..f61a82bd5a 100644 --- a/plugins/clangstaticanalyzer/clangstaticanalyzerconfigwidget.cpp +++ b/plugins/clangstaticanalyzer/clangstaticanalyzerconfigwidget.cpp @@ -19,6 +19,8 @@ #include "clangstaticanalyzerconfigwidget.h" #include "ui_clangstaticanalyzerconfigwidget.h" +#include "clangstaticanalyzerutils.h" + #include <QThread> namespace ClangStaticAnalyzer { @@ -33,7 +35,15 @@ ClangStaticAnalyzerConfigWidget::ClangStaticAnalyzerConfigWidget( { m_ui->setupUi(this); - m_ui->clangExecutableChooser->setPath(settings->clangExecutable()); + Utils::PathChooser * const chooser = m_ui->clangExecutableChooser; + chooser->setExpectedKind(Utils::PathChooser::ExistingCommand); + chooser->setHistoryCompleter(QLatin1String("ClangStaticAnalyzer.ClangCommand.History")); + chooser->setPromptDialogTitle(tr("Clang Command")); + chooser->setPath(settings->clangExecutable()); + const auto validator = [chooser](const QString &, QString *errorMessage) { + return isClangExecutableUsable(chooser->fileName().toString(), errorMessage); + }; + chooser->setAdditionalPathValidator(validator); connect(m_ui->clangExecutableChooser, &Utils::PathChooser::changed, m_settings, &ClangStaticAnalyzerSettings::setClangExecutable); diff --git a/plugins/clangstaticanalyzer/clangstaticanalyzerconfigwidget.ui b/plugins/clangstaticanalyzer/clangstaticanalyzerconfigwidget.ui index 8997f3a7d1..800733a331 100644 --- a/plugins/clangstaticanalyzer/clangstaticanalyzerconfigwidget.ui +++ b/plugins/clangstaticanalyzer/clangstaticanalyzerconfigwidget.ui @@ -30,7 +30,7 @@ <item row="0" column="1"> <layout class="QHBoxLayout" name="horizontalLayout"> <item> - <widget class="ClangStaticAnalyzer::Internal::PathChooser" name="clangExecutableChooser" native="true"/> + <widget class="Utils::PathChooser" name="clangExecutableChooser" native="true"/> </item> </layout> </item> @@ -88,9 +88,9 @@ </widget> <customwidgets> <customwidget> - <class>ClangStaticAnalyzer::Internal::PathChooser</class> + <class>Utils::PathChooser</class> <extends>QWidget</extends> - <header location="global">clangstaticanalyzer/clangstaticanalyzerpathchooser.h</header> + <header location="global">utils/pathchooser.h</header> <container>1</container> </customwidget> </customwidgets> diff --git a/plugins/clangstaticanalyzer/clangstaticanalyzerpathchooser.cpp b/plugins/clangstaticanalyzer/clangstaticanalyzerpathchooser.cpp deleted file mode 100644 index b5711bfeab..0000000000 --- a/plugins/clangstaticanalyzer/clangstaticanalyzerpathchooser.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd -** All rights reserved. -** For any questions to The Qt Company, please use contact form at http://www.qt.io/contact-us -** -** This file is part of the Qt Enterprise LicenseChecker Add-on. -** -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. -** -** If you have questions regarding the use of this file, please use -** contact form at http://www.qt.io/contact-us -** -****************************************************************************/ -#include "clangstaticanalyzerpathchooser.h" - -#include "clangstaticanalyzerutils.h" - -namespace ClangStaticAnalyzer { -namespace Internal { - -PathChooser::PathChooser(QWidget *parent) : Utils::PathChooser(parent) -{ - setExpectedKind(Utils::PathChooser::ExistingCommand); - setHistoryCompleter(QLatin1String("ClangStaticAnalyzer.ClangCommand.History")); - setPromptDialogTitle(tr("Clang Command")); -} - -bool PathChooser::validatePath(const QString &path, QString *errorMessage) -{ - if (!Utils::PathChooser::validatePath(path, errorMessage)) - return false; - return isClangExecutableUsable(fileName().toString(), errorMessage); -} - -} // namespace Internal -} // namespace ClangStaticAnalyzer diff --git a/plugins/clangstaticanalyzer/clangstaticanalyzerpathchooser.h b/plugins/clangstaticanalyzer/clangstaticanalyzerpathchooser.h deleted file mode 100644 index b4bc3c5947..0000000000 --- a/plugins/clangstaticanalyzer/clangstaticanalyzerpathchooser.h +++ /dev/null @@ -1,40 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd -** All rights reserved. -** For any questions to The Qt Company, please use contact form at http://www.qt.io/contact-us -** -** This file is part of the Qt Enterprise LicenseChecker Add-on. -** -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. -** -** If you have questions regarding the use of this file, please use -** contact form at http://www.qt.io/contact-us -** -****************************************************************************/ -#ifndef QTC_CLANGSTATICANALYZER_PATHCHOOSER_H -#define QTC_CLANGSTATICANALYZER_PATHCHOOSER_H - -#include <utils/pathchooser.h> - -namespace ClangStaticAnalyzer { -namespace Internal { - -class PathChooser : public Utils::PathChooser -{ - Q_OBJECT - -public: - PathChooser(QWidget *parent = 0); - -private: - bool validatePath(const QString &path, QString *errorMessage = 0); -}; - -} // namespace Internal -} // namespace ClangStaticAnalyzer - -#endif // Include guard. |