Remove now-unneeded PathChooser subclass.

Change-Id: Ic7cbe4566159675ae9e776d723ed213c1e7c71ec
Reviewed-by: Andre Poenitz <andre.poenitz@theqtcompany.com>
This commit is contained in:
Christian Kandeler
2015-03-03 11:08:26 +01:00
parent 5b565ea657
commit 3ba48ca11e
6 changed files with 14 additions and 88 deletions

View File

@@ -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 \

View File

@@ -28,8 +28,6 @@ QtcPlugin {
"clangstaticanalyzerdiagnosticview.h",
"clangstaticanalyzerlogfilereader.cpp",
"clangstaticanalyzerlogfilereader.h",
"clangstaticanalyzerpathchooser.cpp",
"clangstaticanalyzerpathchooser.h",
"clangstaticanalyzerplugin.cpp",
"clangstaticanalyzerplugin.h",
"clangstaticanalyzerprojectsettings.cpp",

View File

@@ -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);

View File

@@ -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>

View File

@@ -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

View File

@@ -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.