forked from qt-creator/qt-creator
Remove PathChooser subclasses that are no longer needed.
Change-Id: Iceb848d1be36e1dba1cea3c336dc4ec0094e491e Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
This commit is contained in:
@@ -79,15 +79,6 @@ static bool validateLibraryPath(const QString &path, const Utils::PathChooser *p
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
LibraryPathChooser::LibraryPathChooser(QWidget *parent)
|
|
||||||
: Utils::PathChooser(parent)
|
|
||||||
{
|
|
||||||
setAdditionalPathValidator([this](const QString &path, QString *errorMessage) {
|
|
||||||
return validateLibraryPath(path, this, errorMessage);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
AddLibraryWizard::AddLibraryWizard(const QString &fileName, QWidget *parent) :
|
AddLibraryWizard::AddLibraryWizard(const QString &fileName, QWidget *parent) :
|
||||||
Utils::Wizard(parent), m_proFile(fileName)
|
Utils::Wizard(parent), m_proFile(fileName)
|
||||||
{
|
{
|
||||||
@@ -203,7 +194,11 @@ DetailsPage::DetailsPage(AddLibraryWizard *parent)
|
|||||||
{
|
{
|
||||||
m_libraryDetailsWidget = new Ui::LibraryDetailsWidget();
|
m_libraryDetailsWidget = new Ui::LibraryDetailsWidget();
|
||||||
m_libraryDetailsWidget->setupUi(this);
|
m_libraryDetailsWidget->setupUi(this);
|
||||||
|
Utils::PathChooser * const libPathChooser = m_libraryDetailsWidget->libraryPathChooser;
|
||||||
|
const auto pathValidator = [libPathChooser](const QString &path, QString *errorMessage) {
|
||||||
|
return validateLibraryPath(path, libPathChooser, errorMessage);
|
||||||
|
};
|
||||||
|
libPathChooser->setAdditionalPathValidator(pathValidator);
|
||||||
setProperty(Utils::SHORT_TITLE_PROPERTY, tr("Details"));
|
setProperty(Utils::SHORT_TITLE_PROPERTY, tr("Details"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -144,14 +144,6 @@ private:
|
|||||||
QString m_snippet;
|
QString m_snippet;
|
||||||
};
|
};
|
||||||
|
|
||||||
class LibraryPathChooser : public Utils::PathChooser
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
LibraryPathChooser(QWidget *parent);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace QmakeProjectManager
|
} // namespace QmakeProjectManager
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1">
|
<item row="1" column="1">
|
||||||
<widget class="QmakeProjectManager::Internal::LibraryPathChooser" name="libraryPathChooser" native="true"/>
|
<widget class="Utils::PathChooser" name="libraryPathChooser" native="true"/>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0">
|
<item row="3" column="0">
|
||||||
<widget class="QLabel" name="includeLabel">
|
<widget class="QLabel" name="includeLabel">
|
||||||
@@ -241,12 +241,6 @@
|
|||||||
<header location="global">utils/pathchooser.h</header>
|
<header location="global">utils/pathchooser.h</header>
|
||||||
<container>1</container>
|
<container>1</container>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
<customwidget>
|
|
||||||
<class>QmakeProjectManager::Internal::LibraryPathChooser</class>
|
|
||||||
<extends>QWidget</extends>
|
|
||||||
<header location="global">qmakeprojectmanager/addlibrarywizard.h</header>
|
|
||||||
<container>1</container>
|
|
||||||
</customwidget>
|
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
SOURCES += \
|
SOURCES += \
|
||||||
$$PWD/cascadesimportwizard.cpp \
|
$$PWD/cascadesimportwizard.cpp \
|
||||||
$$PWD/srcprojectwizardpage.cpp \
|
$$PWD/srcprojectwizardpage.cpp \
|
||||||
$$PWD/srcprojectpathchooser.cpp \
|
|
||||||
$$PWD/fileconverter.cpp \
|
$$PWD/fileconverter.cpp \
|
||||||
$$PWD/bardescriptorconverter.cpp \
|
$$PWD/bardescriptorconverter.cpp \
|
||||||
$$PWD/projectfileconverter.cpp \
|
$$PWD/projectfileconverter.cpp \
|
||||||
@@ -11,7 +10,6 @@ SOURCES += \
|
|||||||
HEADERS += \
|
HEADERS += \
|
||||||
$$PWD/cascadesimportwizard.h \
|
$$PWD/cascadesimportwizard.h \
|
||||||
$$PWD/srcprojectwizardpage.h \
|
$$PWD/srcprojectwizardpage.h \
|
||||||
$$PWD/srcprojectpathchooser.h \
|
|
||||||
$$PWD/fileconverter.h \
|
$$PWD/fileconverter.h \
|
||||||
$$PWD/bardescriptorconverter.h \
|
$$PWD/bardescriptorconverter.h \
|
||||||
$$PWD/projectfileconverter.h \
|
$$PWD/projectfileconverter.h \
|
||||||
|
|||||||
@@ -1,74 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2015 BlackBerry Limited. All rights reserved.
|
|
||||||
**
|
|
||||||
** Contact: BlackBerry (qt@blackberry.com)
|
|
||||||
**
|
|
||||||
** This file is part of Qt Creator.
|
|
||||||
**
|
|
||||||
** Commercial License Usage
|
|
||||||
** Licensees holding valid commercial Qt licenses may use this file in
|
|
||||||
** accordance with the commercial license agreement provided with the
|
|
||||||
** Software or, alternatively, in accordance with the terms contained in
|
|
||||||
** a written agreement between you and The Qt Company. For licensing terms and
|
|
||||||
** conditions see http://www.qt.io/terms-conditions. For further information
|
|
||||||
** use the contact form at http://www.qt.io/contact-us.
|
|
||||||
**
|
|
||||||
** GNU Lesser General Public License Usage
|
|
||||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
|
||||||
** General Public License version 2.1 or version 3 as published by the Free
|
|
||||||
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
|
|
||||||
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
|
|
||||||
** following information to ensure the GNU Lesser General Public License
|
|
||||||
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
|
|
||||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|
||||||
**
|
|
||||||
** In addition, as a special exception, The Qt Company gives you certain additional
|
|
||||||
** rights. These rights are described in The Qt Company LGPL Exception
|
|
||||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
||||||
**
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include "srcprojectpathchooser.h"
|
|
||||||
|
|
||||||
#include <QDirIterator>
|
|
||||||
|
|
||||||
namespace Qnx {
|
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
static bool validateProjectPath(const QString &path, QString *errorMessage)
|
|
||||||
{
|
|
||||||
bool proFound = false;
|
|
||||||
bool barDescriptorFound = false;
|
|
||||||
QDirIterator di(path);
|
|
||||||
while (di.hasNext()) {
|
|
||||||
di.next();
|
|
||||||
QFileInfo fi = di.fileInfo();
|
|
||||||
if (fi.isFile()) {
|
|
||||||
if (fi.fileName() == QLatin1String("bar-descriptor.xml"))
|
|
||||||
barDescriptorFound = true;
|
|
||||||
else if (fi.fileName().endsWith(QLatin1String(".pro")))
|
|
||||||
proFound = true;
|
|
||||||
}
|
|
||||||
if (barDescriptorFound && proFound)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
const bool ret = barDescriptorFound && proFound;
|
|
||||||
if (!ret && errorMessage) {
|
|
||||||
*errorMessage = QCoreApplication::translate("Qnx",
|
|
||||||
"Directory does not seem to be a valid Cascades project.");
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
SrcProjectPathChooser::SrcProjectPathChooser(QWidget *parent) :
|
|
||||||
Utils::PathChooser(parent)
|
|
||||||
{
|
|
||||||
setPromptDialogTitle(tr("Choose imported Cascades project directory"));
|
|
||||||
setExpectedKind(Utils::PathChooser::ExistingDirectory);
|
|
||||||
setAdditionalPathValidator(validateProjectPath);
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace Internal
|
|
||||||
} // namespace Qnx
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2015 BlackBerry Limited. All rights reserved.
|
|
||||||
**
|
|
||||||
** Contact: BlackBerry (qt@blackberry.com)
|
|
||||||
**
|
|
||||||
** This file is part of Qt Creator.
|
|
||||||
**
|
|
||||||
** Commercial License Usage
|
|
||||||
** Licensees holding valid commercial Qt licenses may use this file in
|
|
||||||
** accordance with the commercial license agreement provided with the
|
|
||||||
** Software or, alternatively, in accordance with the terms contained in
|
|
||||||
** a written agreement between you and The Qt Company. For licensing terms and
|
|
||||||
** conditions see http://www.qt.io/terms-conditions. For further information
|
|
||||||
** use the contact form at http://www.qt.io/contact-us.
|
|
||||||
**
|
|
||||||
** GNU Lesser General Public License Usage
|
|
||||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
|
||||||
** General Public License version 2.1 or version 3 as published by the Free
|
|
||||||
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
|
|
||||||
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
|
|
||||||
** following information to ensure the GNU Lesser General Public License
|
|
||||||
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
|
|
||||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|
||||||
**
|
|
||||||
** In addition, as a special exception, The Qt Company gives you certain additional
|
|
||||||
** rights. These rights are described in The Qt Company LGPL Exception
|
|
||||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
||||||
**
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#ifndef SRCPROJECTPATHCHOOSER_H
|
|
||||||
#define SRCPROJECTPATHCHOOSER_H
|
|
||||||
|
|
||||||
#include <utils/pathchooser.h>
|
|
||||||
|
|
||||||
namespace Qnx {
|
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
class SrcProjectPathChooser : public Utils::PathChooser
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
explicit SrcProjectPathChooser(QWidget *parent = 0);
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace Internal
|
|
||||||
} // namespace Qnx
|
|
||||||
|
|
||||||
|
|
||||||
#endif // SRCPROJECTPATHCHOOSER_H
|
|
||||||
@@ -34,15 +34,45 @@
|
|||||||
#include <utils/wizard.h>
|
#include <utils/wizard.h>
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
#include <QDirIterator>
|
||||||
|
|
||||||
namespace Qnx {
|
namespace Qnx {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
|
static bool validateProjectPath(const QString &path, QString *errorMessage)
|
||||||
|
{
|
||||||
|
bool proFound = false;
|
||||||
|
bool barDescriptorFound = false;
|
||||||
|
QDirIterator di(path);
|
||||||
|
while (di.hasNext()) {
|
||||||
|
di.next();
|
||||||
|
QFileInfo fi = di.fileInfo();
|
||||||
|
if (fi.isFile()) {
|
||||||
|
if (fi.fileName() == QLatin1String("bar-descriptor.xml"))
|
||||||
|
barDescriptorFound = true;
|
||||||
|
else if (fi.fileName().endsWith(QLatin1String(".pro")))
|
||||||
|
proFound = true;
|
||||||
|
}
|
||||||
|
if (barDescriptorFound && proFound)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
const bool ret = barDescriptorFound && proFound;
|
||||||
|
if (!ret && errorMessage) {
|
||||||
|
*errorMessage = QCoreApplication::translate("Qnx",
|
||||||
|
"Directory does not seem to be a valid Cascades project.");
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
SrcProjectWizardPage::SrcProjectWizardPage(QWidget *parent)
|
SrcProjectWizardPage::SrcProjectWizardPage(QWidget *parent)
|
||||||
: QWizardPage(parent), m_complete(false)
|
: QWizardPage(parent), m_complete(false)
|
||||||
{
|
{
|
||||||
ui = new Ui::SrcProjectWizardPage;
|
ui = new Ui::SrcProjectWizardPage;
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
ui->pathChooser->setPromptDialogTitle(tr("Choose imported Cascades project directory"));
|
||||||
|
ui->pathChooser->setExpectedKind(Utils::PathChooser::ExistingDirectory);
|
||||||
|
ui->pathChooser->setAdditionalPathValidator(validateProjectPath);
|
||||||
|
|
||||||
connect(ui->pathChooser, SIGNAL(pathChanged(QString)), this, SLOT(onPathChooserPathChanged(QString)));
|
connect(ui->pathChooser, SIGNAL(pathChanged(QString)), this, SLOT(onPathChooserPathChanged(QString)));
|
||||||
|
|
||||||
|
|||||||
@@ -25,15 +25,15 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="1">
|
<item row="0" column="1">
|
||||||
<widget class="Qnx::Internal::SrcProjectPathChooser" name="pathChooser" native="true"/>
|
<widget class="Utils::PathChooser" name="pathChooser" native="true"/>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
<class>Qnx::Internal::SrcProjectPathChooser</class>
|
<class>Utils::PathChooser</class>
|
||||||
<extends>QWidget</extends>
|
<extends>QWidget</extends>
|
||||||
<header location="global">qnx/cascadesimport/srcprojectpathchooser.h</header>
|
<header location="global">utils/pathchooser.h</header>
|
||||||
<container>1</container>
|
<container>1</container>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
|
|||||||
@@ -274,21 +274,16 @@ QtcPlugin {
|
|||||||
prefix: "cascadesimport/"
|
prefix: "cascadesimport/"
|
||||||
files: [
|
files: [
|
||||||
"cascadesimport.qrc",
|
"cascadesimport.qrc",
|
||||||
|
|
||||||
"srcprojectwizardpage.ui",
|
"srcprojectwizardpage.ui",
|
||||||
|
|
||||||
"cascadesimportwizard.cpp",
|
"cascadesimportwizard.cpp",
|
||||||
"srcprojectwizardpage.cpp",
|
"srcprojectwizardpage.cpp",
|
||||||
"srcprojectpathchooser.cpp",
|
|
||||||
"fileconverter.cpp",
|
"fileconverter.cpp",
|
||||||
"bardescriptorconverter.cpp",
|
"bardescriptorconverter.cpp",
|
||||||
"projectfileconverter.cpp",
|
"projectfileconverter.cpp",
|
||||||
"importlogconverter.cpp",
|
"importlogconverter.cpp",
|
||||||
"importlog.cpp",
|
"importlog.cpp",
|
||||||
|
|
||||||
"cascadesimportwizard.h",
|
"cascadesimportwizard.h",
|
||||||
"srcprojectwizardpage.h",
|
"srcprojectwizardpage.h",
|
||||||
"srcprojectpathchooser.h",
|
|
||||||
"fileconverter.h",
|
"fileconverter.h",
|
||||||
"bardescriptorconverter.h",
|
"bardescriptorconverter.h",
|
||||||
"projectfileconverter.h",
|
"projectfileconverter.h",
|
||||||
|
|||||||
Reference in New Issue
Block a user