~bzoltan/kubuntu-packaging/decouple_cmake_plugin

« back to all changes in this revision

Viewing changes to src/plugins/qtsupport/qmldumptool.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:
49
49
namespace {
50
50
 
51
51
using namespace QtSupport;
52
 
using QtSupport::DebuggingHelperBuildTask;
53
 
using ProjectExplorer::ToolChain;
 
52
using namespace ProjectExplorer;
54
53
 
55
54
class QmlDumpBuildTask;
56
55
 
81
80
        m_buildTask->run(future);
82
81
    }
83
82
 
84
 
    void updateProjectWhenDone(QPointer<ProjectExplorer::Project> project, bool preferDebug)
 
83
    void updateProjectWhenDone(QPointer<Project> project, bool preferDebug)
85
84
    {
86
85
        foreach (const ProjectToUpdate &update, m_projectsToUpdate) {
87
86
            if (update.project == project)
102
101
private slots:
103
102
    void finish(int qtId, const QString &output, DebuggingHelperBuildTask::Tools tools)
104
103
    {
105
 
        BaseQtVersion *version = QtVersionManager::instance()->version(qtId);
 
104
        BaseQtVersion *version = QtVersionManager::version(qtId);
106
105
 
107
106
        QTC_ASSERT(tools == DebuggingHelperBuildTask::QmlDump, return);
108
107
        QString errorMessage;
146
145
private:
147
146
    class ProjectToUpdate {
148
147
    public:
149
 
        QPointer<ProjectExplorer::Project> project;
 
148
        QPointer<Project> project;
150
149
        bool preferDebug;
151
150
    };
152
151
 
196
195
    if (qtVersion->type() != QLatin1String(Constants::DESKTOPQT)
197
196
            && qtVersion->type() != QLatin1String(Constants::SIMULATORQT)) {
198
197
        if (reason)
199
 
            *reason = QCoreApplication::translate("Qt4ProjectManager::QmlDumpTool", "Only available for Qt for Desktop and Qt for Qt Simulator.");
 
198
            *reason = QCoreApplication::translate("QmakeProjectManager::QmlDumpTool", "Only available for Qt for Desktop and Qt for Qt Simulator.");
200
199
        return false;
201
200
    }
202
201
    if (qtVersion->qtVersion() < QtVersionNumber(4, 7, 1)) {
203
202
        if (reason)
204
 
            *reason = QCoreApplication::translate("Qt4ProjectManager::QmlDumpTool", "Only available for Qt 4.7.1 or newer.");
 
203
            *reason = QCoreApplication::translate("QmakeProjectManager::QmlDumpTool", "Only available for Qt 4.7.1 or newer.");
205
204
        return false;
206
205
    }
207
206
    if (qtVersion->qtVersion() >= QtVersionNumber(4, 8, 0)) {
208
207
        if (reason)
209
 
            *reason = QCoreApplication::translate("Qt4ProjectManager::QmlDumpTool", "Not needed.");
 
208
            *reason = QCoreApplication::translate("QmakeProjectManager::QmlDumpTool", "Not needed.");
210
209
        return false;
211
210
    }
212
211
 
213
212
 
214
213
    if (!hasPrivateHeaders(installHeaders)) {
215
214
        if (reason)
216
 
            *reason = QCoreApplication::translate("Qt4ProjectManager::QmlDumpTool", "Private headers are missing for this Qt version.");
 
215
            *reason = QCoreApplication::translate("QmakeProjectManager::QmlDumpTool", "Private headers are missing for this Qt version.");
217
216
        return false;
218
217
    }
219
218
    return true;
281
280
 
282
281
bool QmlDumpTool::build(BuildHelperArguments arguments, QString *log, QString *errorMessage)
283
282
{
284
 
    arguments.helperName = QCoreApplication::translate("Qt4ProjectManager::QmlDumpTool", "qmldump");
 
283
    arguments.helperName = QCoreApplication::translate("QmakeProjectManager::QmlDumpTool", "qmldump");
285
284
    arguments.proFilename = QLatin1String("qmldump.pro");
286
285
    return buildHelper(arguments, log, errorMessage);
287
286
}
313
312
    return directories;
314
313
}
315
314
 
316
 
void QmlDumpTool::pathAndEnvironment(ProjectExplorer::Project *project, BaseQtVersion *version,
317
 
                                     ProjectExplorer::ToolChain *toolChain,
 
315
void QmlDumpTool::pathAndEnvironment(Project *project, BaseQtVersion *version,
 
316
                                     ToolChain *toolChain,
318
317
                                     bool preferDebug, QString *dumperPath, Utils::Environment *env)
319
318
{
320
319
    QString path;
328
327
            buildTask->updateProjectWhenDone(project, preferDebug);
329
328
            QFuture<void> task = QtConcurrent::run(&QmlDumpBuildTask::run, buildTask);
330
329
            const QString taskName = QmlDumpBuildTask::tr("Building helper");
331
 
            Core::ICore::progressManager()->addTask(task, taskName,
332
 
                                                                QLatin1String("Qt4ProjectManager::BuildHelpers"));
 
330
            Core::ProgressManager::addTask(task, taskName, "QmakeProjectManager::BuildHelpers");
333
331
        }
334
332
        return;
335
333
    }