Commit 5b90d82a authored by Kai Koehne's avatar Kai Koehne
Browse files

Qt4Project: Move DebuggingHelperBuildTask into separate file

parent bcaf2031
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** No Commercial Usage
**
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** 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 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**************************************************************************/
#include "debugginghelperbuildtask.h"
using namespace Qt4ProjectManager;
using namespace Qt4ProjectManager::Internal;
DebuggingHelperBuildTask::DebuggingHelperBuildTask(const QSharedPointer<QtVersion> &version) :
m_version(version)
{
}
DebuggingHelperBuildTask::~DebuggingHelperBuildTask()
{
}
void DebuggingHelperBuildTask::run(QFutureInterface<void> &future)
{
future.setProgressRange(0, 5);
future.setProgressValue(1);
QString output;
QString errorMessage;
if (m_version->buildDebuggingHelperLibrary(future, false, &output, &errorMessage)) {
emit finished(m_version->displayName(), output);
} else {
qWarning("%s", qPrintable(errorMessage));
emit finished(m_version->displayName(), errorMessage);
}
deleteLater();
}
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** No Commercial Usage
**
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** 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 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**************************************************************************/
#ifndef DEBUGGINGHELPERBUILDTASK_H
#define DEBUGGINGHELPERBUILDTASK_H
#include "qtversionmanager.h"
#include <utils/environment.h>
#include <QObject>
namespace Qt4ProjectManager {
namespace Internal {
// A task suitable to be run by QtConcurrent to build the helpers.
// Note that it may outlive the settings page if someone quickly cancels it,
// so, the versions are passed around by QSharedPointer.
class DebuggingHelperBuildTask : public QObject {
Q_DISABLE_COPY(DebuggingHelperBuildTask)
Q_OBJECT
public:
explicit DebuggingHelperBuildTask(const QSharedPointer<QtVersion> &version);
virtual ~DebuggingHelperBuildTask();
void run(QFutureInterface<void> &future);
signals:
void finished(const QString &versionName, const QString &output);
private:
QSharedPointer<QtVersion> m_version;
};
} //namespace Internal
} //namespace Qt4ProjectManager
#endif // DEBUGGINGHELPERBUILDTASK_H
......@@ -66,7 +66,8 @@ HEADERS += \
qmldumptool.h \
qmlobservertool.h \
profilecompletion.h \
profilekeywords.h
profilekeywords.h \
debugginghelperbuildtask.h
SOURCES += qt4projectmanagerplugin.cpp \
qtparser.cpp \
qt4projectmanager.cpp \
......@@ -126,7 +127,8 @@ SOURCES += qt4projectmanagerplugin.cpp \
qmldumptool.cpp \
qmlobservertool.cpp \
profilecompletion.cpp \
profilekeywords.cpp
profilekeywords.cpp \
debugginghelperbuildtask.cpp
FORMS += makestep.ui \
qmakestep.ui \
qt4projectconfigwidget.ui \
......
......@@ -39,6 +39,7 @@
#include "qtversionmanager.h"
#include "qmldumptool.h"
#include "qmlobservertool.h"
#include "debugginghelperbuildtask.h"
#include <projectexplorer/debugginghelper.h>
#include <projectexplorer/toolchaintype.h>
......@@ -64,33 +65,6 @@ enum ModelRoles { BuildLogRole = Qt::UserRole, BuildRunningRole = Qt::UserRole +
using namespace Qt4ProjectManager;
using namespace Qt4ProjectManager::Internal;
///
// DebuggingHelperBuildTask
///
DebuggingHelperBuildTask::DebuggingHelperBuildTask(const QSharedPointerQtVersion &version) :
m_version(version)
{
}
DebuggingHelperBuildTask::~DebuggingHelperBuildTask()
{
}
void DebuggingHelperBuildTask::run(QFutureInterface<void> &future)
{
future.setProgressRange(0, 5);
future.setProgressValue(1);
QString output;
QString errorMessage;
if (m_version->buildDebuggingHelperLibrary(future, false, &output, &errorMessage)) {
emit finished(m_version->displayName(), output);
} else {
qWarning("%s", qPrintable(errorMessage));
emit finished(m_version->displayName(), errorMessage);
}
deleteLater();
}
///
// QtOptionsPage
......
......@@ -54,25 +54,6 @@ namespace Ui {
class QtVersionManager;
}
// A task suitable to be run by QtConcurrent to build the helpers.
// Note that it may outlive the settings page if someone quickly cancels it,
// so, the versions are passed around by QSharedPointer.
class DebuggingHelperBuildTask : public QObject {
Q_DISABLE_COPY(DebuggingHelperBuildTask)
Q_OBJECT
public:
explicit DebuggingHelperBuildTask(const QSharedPointerQtVersion &version);
virtual ~DebuggingHelperBuildTask();
void run(QFutureInterface<void> &future);
signals:
void finished(const QString &versionName, const QString &output);
private:
QSharedPointerQtVersion m_version;
};
class QtOptionsPageWidget : public QWidget
{
Q_OBJECT
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment