~bzoltan/kubuntu-packaging/decouple_cmake_plugin

« back to all changes in this revision

Viewing changes to src/plugins/qt4projectmanager/wizards/qtwizard.cpp

  • Committer: Timo Jyrinki
  • Date: 2013-11-15 12:25:23 UTC
  • mfrom: (1.1.28)
  • Revision ID: timo.jyrinki@canonical.com-20131115122523-i2kyamsu4gs2mu1m
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
 
30
30
#include "qtwizard.h"
31
31
 
32
 
#include "qt4project.h"
33
 
#include "qt4projectmanager.h"
34
 
#include "qt4projectmanagerconstants.h"
35
32
#include "modulespage.h"
36
 
#include "targetsetuppage.h"
 
33
 
 
34
#include <qt4projectmanager/qmakeproject.h>
 
35
#include <qt4projectmanager/qmakeprojectmanager.h>
 
36
#include <qt4projectmanager/qmakeprojectmanagerconstants.h>
37
37
 
38
38
#include <coreplugin/icore.h>
39
39
 
40
40
#include <cpptools/cpptoolsconstants.h>
41
41
 
42
42
#include <projectexplorer/projectexplorer.h>
 
43
#include <projectexplorer/targetsetuppage.h>
43
44
#include <qtsupport/qtkitinformation.h>
44
45
#include <qtsupport/qtsupportconstants.h>
45
46
 
48
49
#include <QCoreApplication>
49
50
#include <QVariant>
50
51
 
51
 
using namespace Qt4ProjectManager;
52
 
using namespace Qt4ProjectManager::Internal;
53
 
 
54
 
static Core::BaseFileWizardParameters
55
 
    wizardParameters(const QString &id,
56
 
                     const QString &category,
57
 
                     const QString &displayCategory,
58
 
                     const QString &name,
59
 
                     const QString &description,
60
 
                     const QIcon &icon)
61
 
{
62
 
    Core::BaseFileWizardParameters rc(Core::IWizard::ProjectWizard);
63
 
    rc.setCategory(category);
64
 
    rc.setDisplayCategory(QCoreApplication::translate("ProjectExplorer",
65
 
                                                      displayCategory.toLatin1()));
66
 
    rc.setIcon(icon);
67
 
    rc.setDisplayName(name);
68
 
    rc.setId(id);
69
 
    rc.setDescription(description);
70
 
    return rc;
71
 
}
 
52
using namespace ProjectExplorer;
 
53
using namespace QmakeProjectManager;
 
54
using namespace QmakeProjectManager::Internal;
72
55
 
73
56
// -------------------- QtWizard
74
 
QtWizard::QtWizard(const QString &id,
75
 
                   const QString &category,
76
 
                   const QString &displayCategory,
77
 
                   const QString &name,
78
 
                   const QString &description, const QIcon &icon) :
79
 
    Core::BaseFileWizard(wizardParameters(id,
80
 
                                          category,
81
 
                                          displayCategory,
82
 
                                          name,
83
 
                                          description,
84
 
                                          icon))
 
57
QtWizard::QtWizard()
85
58
{
 
59
    setWizardKind(Core::IWizard::ProjectWizard);
86
60
}
87
61
 
88
62
QString QtWizard::sourceSuffix()
154
128
}
155
129
 
156
130
// ------------ CustomQt4ProjectWizard
157
 
CustomQt4ProjectWizard::CustomQt4ProjectWizard(const Core::BaseFileWizardParameters& baseFileParameters,
158
 
                                               QObject *parent) :
159
 
    ProjectExplorer::CustomProjectWizard(baseFileParameters, parent)
 
131
CustomQt4ProjectWizard::CustomQt4ProjectWizard()
160
132
{
161
133
}
162
134
 
163
 
    QWizard *CustomQt4ProjectWizard::createWizardDialog(QWidget *parent,
164
 
                                                        const Core::WizardDialogParameters &wizardDialogParameters) const
 
135
QWizard *CustomQt4ProjectWizard::createWizardDialog
 
136
    (QWidget *parent, const Core::WizardDialogParameters &wizardDialogParameters) const
165
137
{
166
138
    BaseQt4ProjectWizardDialog *wizard = new BaseQt4ProjectWizardDialog(false, parent, wizardDialogParameters);
167
139
 
240
212
 
241
213
int BaseQt4ProjectWizardDialog::addTargetSetupPage(bool mobile, int id)
242
214
{
243
 
    m_targetSetupPage = new TargetSetupPage;
 
215
    m_targetSetupPage = new ProjectExplorer::TargetSetupPage;
244
216
    const QString platform = selectedPlatform();
245
217
    Core::FeatureSet features = mobile ? Core::FeatureSet(QtSupport::Constants::FEATURE_MOBILE)
246
218
                                       : Core::FeatureSet(QtSupport::Constants::FEATURE_DESKTOP);
322
294
{
323
295
    QList<Core::Id> selectedKitList = selectedKits();
324
296
 
325
 
    QtSupport::QtPlatformKitMatcher matcher(platform);
326
 
    QList<ProjectExplorer::Kit *> kitList
327
 
            = ProjectExplorer::KitManager::instance()->kits(&matcher);
328
 
    foreach (ProjectExplorer::Kit *k, kitList) {
 
297
    foreach (Kit *k, KitManager::matchingKits(QtSupport::QtPlatformKitMatcher(platform)))
329
298
        if (selectedKitList.contains(k->id()))
330
299
            return true;
331
 
    }
 
300
 
332
301
    return false;
333
302
}
334
303
 
354
323
        QDir::cleanPath(path + QLatin1Char('/') + name + QLatin1Char('/')
355
324
                        + name + QLatin1String(".pro"));
356
325
 
357
 
    m_targetSetupPage->setProFilePath(proFile);
 
326
    m_targetSetupPage->setProjectPath(proFile);
358
327
}