forked from qt-creator/qt-creator
qtsupport: remove unneeded thing from headers, style.
Change-Id: I059af357fa772290a78f62c31cb7c532ae7d77ff Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
This commit is contained in:
@@ -48,10 +48,11 @@
|
||||
|
||||
using namespace QtSupport;
|
||||
using namespace QtSupport::Internal;
|
||||
using ProjectExplorer::DebuggingHelperLibrary;
|
||||
using namespace QtSupport::Internal;
|
||||
using namespace ProjectExplorer;
|
||||
|
||||
DebuggingHelperBuildTask::DebuggingHelperBuildTask(const BaseQtVersion *version,
|
||||
ProjectExplorer::ToolChain *toolChain,
|
||||
ToolChain *toolChain,
|
||||
Tools tools) :
|
||||
m_tools(tools & availableTools(version)),
|
||||
m_invalidQt(false),
|
||||
@@ -65,9 +66,8 @@ DebuggingHelperBuildTask::DebuggingHelperBuildTask(const BaseQtVersion *version,
|
||||
qRegisterMetaType<DebuggingHelperBuildTask::Tools>("DebuggingHelperBuildTask::Tools");
|
||||
|
||||
// Print result in application ouptut
|
||||
Core::MessageManager *messageManager = Core::MessageManager::instance();
|
||||
connect(this, SIGNAL(logOutput(QString,bool)),
|
||||
messageManager, SLOT(printToOutputPane(QString,bool)),
|
||||
Core::MessageManager::instance(), SLOT(printToOutputPane(QString,bool)),
|
||||
Qt::QueuedConnection);
|
||||
|
||||
//
|
||||
@@ -95,10 +95,10 @@ DebuggingHelperBuildTask::DebuggingHelperBuildTask(const BaseQtVersion *version,
|
||||
log(QCoreApplication::translate("QtVersion", "Building helper(s) with toolchain '%1' ...\n"
|
||||
).arg(toolChain->displayName()), QString());
|
||||
|
||||
if (toolChain->targetAbi().os() == ProjectExplorer::Abi::LinuxOS
|
||||
&& ProjectExplorer::Abi::hostAbi().os() == ProjectExplorer::Abi::WindowsOS)
|
||||
if (toolChain->targetAbi().os() == Abi::LinuxOS
|
||||
&& Abi::hostAbi().os() == Abi::WindowsOS)
|
||||
m_target = QLatin1String("-unix");
|
||||
if (toolChain->targetAbi().os() == ProjectExplorer::Abi::SymbianOS) {
|
||||
if (toolChain->targetAbi().os() == Abi::SymbianOS) {
|
||||
m_makeArguments << QLatin1String("debug-") + toolChain->defaultMakeTarget();
|
||||
m_makeArguments << QLatin1String("release-") + toolChain->defaultMakeTarget();
|
||||
m_makeArguments << QLatin1String("-k");
|
||||
@@ -108,8 +108,8 @@ DebuggingHelperBuildTask::DebuggingHelperBuildTask(const BaseQtVersion *version,
|
||||
}
|
||||
m_qmakeCommand = version->qmakeCommand();
|
||||
m_qmakeArguments = QStringList() << QLatin1String("-nocache");
|
||||
if (toolChain->targetAbi().os() == ProjectExplorer::Abi::MacOS
|
||||
&& toolChain->targetAbi().architecture() == ProjectExplorer::Abi::X86Architecture) {
|
||||
if (toolChain->targetAbi().os() == Abi::MacOS
|
||||
&& toolChain->targetAbi().architecture() == Abi::X86Architecture) {
|
||||
// explicitly set 32 or 64 bit in case Qt is compiled with both
|
||||
if (toolChain->targetAbi().wordWidth() == 32)
|
||||
m_qmakeArguments << QLatin1String("CONFIG+=x86");
|
||||
@@ -126,9 +126,6 @@ DebuggingHelperBuildTask::DebuggingHelperBuildTask(const BaseQtVersion *version,
|
||||
Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
DebuggingHelperBuildTask::~DebuggingHelperBuildTask()
|
||||
{
|
||||
}
|
||||
|
||||
DebuggingHelperBuildTask::Tools DebuggingHelperBuildTask::availableTools(const BaseQtVersion *version)
|
||||
{
|
||||
@@ -136,8 +133,8 @@ DebuggingHelperBuildTask::Tools DebuggingHelperBuildTask::availableTools(const B
|
||||
// Check the build requirements of the tools
|
||||
DebuggingHelperBuildTask::Tools tools = 0;
|
||||
// Gdb helpers are needed on Mac/gdb only.
|
||||
foreach (const ProjectExplorer::Abi &abi, version->qtAbis()) {
|
||||
if (abi.os() == ProjectExplorer::Abi::MacOS) {
|
||||
foreach (const Abi &abi, version->qtAbis()) {
|
||||
if (abi.os() == Abi::MacOS) {
|
||||
tools |= DebuggingHelperBuildTask::GdbDebugging;
|
||||
break;
|
||||
}
|
||||
|
@@ -42,11 +42,8 @@
|
||||
#include <QtCore/QFutureInterface>
|
||||
#include <QtCore/QMetaType>
|
||||
|
||||
namespace ProjectExplorer {
|
||||
class ToolChain;
|
||||
} // namespace ProjectExplorer
|
||||
|
||||
namespace QtSupport {
|
||||
|
||||
class BaseQtVersion;
|
||||
|
||||
class QTSUPPORT_EXPORT DebuggingHelperBuildTask : public QObject
|
||||
@@ -66,7 +63,6 @@ public:
|
||||
explicit DebuggingHelperBuildTask(const BaseQtVersion *version,
|
||||
ProjectExplorer::ToolChain *toolChain,
|
||||
Tools tools = AllTools);
|
||||
virtual ~DebuggingHelperBuildTask();
|
||||
|
||||
void showOutputOnError(bool show);
|
||||
void run(QFutureInterface<void> &future);
|
||||
@@ -100,7 +96,7 @@ private:
|
||||
bool m_showErrors;
|
||||
};
|
||||
|
||||
} // namespace Qt4ProjectManager
|
||||
} // namespace QtSupport
|
||||
|
||||
Q_DECLARE_METATYPE(QtSupport::DebuggingHelperBuildTask::Tools)
|
||||
|
||||
|
@@ -45,7 +45,46 @@
|
||||
|
||||
namespace QtSupport {
|
||||
|
||||
static inline QStringList validBinaryFilenames()
|
||||
static QStringList recursiveFileList(const QDir &dir, const QString &prefix)
|
||||
{
|
||||
QStringList files;
|
||||
|
||||
QString _prefix = prefix;
|
||||
if (!_prefix.isEmpty() && !_prefix.endsWith(QLatin1Char('/')))
|
||||
_prefix.append(QLatin1Char('/'));
|
||||
|
||||
foreach (const QString &fileName, dir.entryList(QDir::Files))
|
||||
files << _prefix + fileName;
|
||||
|
||||
foreach (const QString &subDir, dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot))
|
||||
files += recursiveFileList(QDir(dir.absoluteFilePath(subDir)), _prefix + subDir);
|
||||
|
||||
return files;
|
||||
}
|
||||
|
||||
static QStringList installDirectories(const QString &qtInstallData)
|
||||
{
|
||||
const QChar slash = QLatin1Char('/');
|
||||
const uint hash = qHash(qtInstallData);
|
||||
QStringList directories;
|
||||
directories
|
||||
<< (qtInstallData + QLatin1String("/qtc-qmlobserver/"))
|
||||
<< QDir::cleanPath((QCoreApplication::applicationDirPath() + QLatin1String("/../qtc-qmlobserver/") + QString::number(hash))) + slash
|
||||
<< (QDesktopServices::storageLocation(QDesktopServices::DataLocation) + QLatin1String("/qtc-qmlobserver/") + QString::number(hash)) + slash;
|
||||
return directories;
|
||||
}
|
||||
|
||||
static QString sourcePath()
|
||||
{
|
||||
return Core::ICore::resourcePath() + QLatin1String("/qml/qmlobserver/");
|
||||
}
|
||||
|
||||
static QStringList sourceFileNames()
|
||||
{
|
||||
return recursiveFileList(QDir(sourcePath()), QString());
|
||||
}
|
||||
|
||||
static QStringList validBinaryFilenames()
|
||||
{
|
||||
return QStringList()
|
||||
<< QLatin1String("debug/qmlobserver.exe")
|
||||
@@ -118,15 +157,14 @@ static inline bool mkpath(const QString &targetDirectory, QString *errorMessage)
|
||||
|
||||
QString QmlObserverTool::copy(const QString &qtInstallData, QString *errorMessage)
|
||||
{
|
||||
const QStringList directories = QmlObserverTool::installDirectories(qtInstallData);
|
||||
const QStringList directories = installDirectories(qtInstallData);
|
||||
|
||||
// Try to find a writeable directory.
|
||||
// Try to find a writable directory.
|
||||
foreach (const QString &directory, directories) {
|
||||
if (!mkpath(directory, errorMessage)) {
|
||||
if (!mkpath(directory, errorMessage))
|
||||
continue;
|
||||
} else {
|
||||
|
||||
errorMessage->clear();
|
||||
}
|
||||
|
||||
if (copyFiles(sourcePath(), sourceFileNames(), directory, errorMessage)) {
|
||||
errorMessage->clear();
|
||||
@@ -139,44 +177,4 @@ QString QmlObserverTool::copy(const QString &qtInstallData, QString *errorMessag
|
||||
return QString();
|
||||
}
|
||||
|
||||
QStringList QmlObserverTool::recursiveFileList(const QDir &dir, const QString &prefix)
|
||||
{
|
||||
QStringList files;
|
||||
|
||||
QString _prefix = prefix;
|
||||
if (!_prefix.isEmpty() && !_prefix.endsWith(QLatin1Char('/'))) {
|
||||
_prefix.append(QLatin1Char('/'));
|
||||
}
|
||||
foreach (const QString &fileName, dir.entryList(QDir::Files)) {
|
||||
files << _prefix + fileName;
|
||||
}
|
||||
|
||||
foreach (const QString &subDir, dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot)) {
|
||||
files += recursiveFileList(QDir(dir.absoluteFilePath(subDir)), _prefix + subDir);
|
||||
}
|
||||
return files;
|
||||
}
|
||||
|
||||
QStringList QmlObserverTool::installDirectories(const QString &qtInstallData)
|
||||
{
|
||||
const QChar slash = QLatin1Char('/');
|
||||
const uint hash = qHash(qtInstallData);
|
||||
QStringList directories;
|
||||
directories
|
||||
<< (qtInstallData + QLatin1String("/qtc-qmlobserver/"))
|
||||
<< QDir::cleanPath((QCoreApplication::applicationDirPath() + QLatin1String("/../qtc-qmlobserver/") + QString::number(hash))) + slash
|
||||
<< (QDesktopServices::storageLocation(QDesktopServices::DataLocation) + QLatin1String("/qtc-qmlobserver/") + QString::number(hash)) + slash;
|
||||
return directories;
|
||||
}
|
||||
|
||||
QString QmlObserverTool::sourcePath()
|
||||
{
|
||||
return Core::ICore::resourcePath() + QLatin1String("/qml/qmlobserver/");
|
||||
}
|
||||
|
||||
QStringList QmlObserverTool::sourceFileNames()
|
||||
{
|
||||
return recursiveFileList(QDir(sourcePath()));
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
@@ -36,16 +36,6 @@
|
||||
#include "qtsupport_global.h"
|
||||
#include <utils/buildablehelperlibrary.h>
|
||||
|
||||
QT_FORWARD_DECLARE_CLASS(QDir)
|
||||
|
||||
namespace Utils {
|
||||
class Environment;
|
||||
}
|
||||
|
||||
namespace ProjectExplorer {
|
||||
class Project;
|
||||
}
|
||||
|
||||
namespace QtSupport {
|
||||
|
||||
class BaseQtVersion;
|
||||
@@ -62,14 +52,8 @@ public:
|
||||
|
||||
// Copy the source files to a target location and return the chosen target location.
|
||||
static QString copy(const QString &qtInstallData, QString *errorMessage);
|
||||
|
||||
private:
|
||||
static QStringList recursiveFileList(const QDir &dir, const QString &prefix = QString());
|
||||
static QStringList installDirectories(const QString &qtInstallData);
|
||||
static QString sourcePath();
|
||||
static QStringList sourceFileNames();
|
||||
};
|
||||
|
||||
} // namespace
|
||||
} // namespace QtSupport
|
||||
|
||||
#endif // QMLOBSERVERTOOL_H
|
||||
|
@@ -39,19 +39,8 @@
|
||||
#include <QtCore/QSet>
|
||||
#include <QtCore/QStringList>
|
||||
|
||||
namespace Utils {
|
||||
class Environment;
|
||||
}
|
||||
|
||||
namespace ProjectExplorer {
|
||||
class HeaderPath;
|
||||
class IOutputParser;
|
||||
class Task;
|
||||
}
|
||||
|
||||
namespace QtSupport {
|
||||
namespace Internal {
|
||||
class QtOptionsPageWidget;
|
||||
class QtOptionsPage;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user