SDKtool: Always write settings to the place creator expects them

Simplify the .pro-file while at it and add rpath.

Change-Id: Ia111e76093c6c375d04fca51d81ac87a267b0121
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
Tobias Hunger
2012-09-25 11:59:01 +02:00
parent 1b575cb50c
commit 471f44aae3
3 changed files with 13 additions and 33 deletions

View File

@@ -68,7 +68,6 @@ QString AddQtOperation::argumentsHelpText() const
" --name <NAME> display name of the new Qt version. (required)\n" " --name <NAME> display name of the new Qt version. (required)\n"
" --qmake <PATH> path to qmake. (required)\n" " --qmake <PATH> path to qmake. (required)\n"
" --type <TYPE> type of Qt version to add. (required)\n" " --type <TYPE> type of Qt version to add. (required)\n"
" --noauto do not mark tool chain as autodetected.\n"
" <KEY> <TYPE:VALUE> extra key value pairs\n"); " <KEY> <TYPE:VALUE> extra key value pairs\n");
} }

View File

@@ -1,7 +1,9 @@
include(../../../qtcreator.pri) include(../../../qtcreator.pri)
include(../../rpath.pri)
include(../../libs/utils/utils.pri) include(../../libs/utils/utils.pri)
CONFIG += console CONFIG += console
CONFIG -= app_bundle
QT -= gui test QT -= gui test
@@ -36,9 +38,7 @@ HEADERS += \
rmtoolchainoperation.h \ rmtoolchainoperation.h \
settings.h \ settings.h \
INCLUDEPATH += \ DESTDIR=$$IDE_LIBEXEC_PATH
$$PWD/../../plugins \ macx:DEFINES += "DATA_PATH=\"\\\".\\\"\""
$$PWD/../../libs else:DEFINES += "DATA_PATH=\"\\\"../share/qtcreator\\\"\""
DESTDIR=$$IDE_APP_PATH

View File

@@ -31,10 +31,12 @@
#include "settings.h" #include "settings.h"
#include "operation.h" #include "operation.h"
#include <app/app_version.h>
#include <iostream> #include <iostream>
#include <QCoreApplication> #include <QCoreApplication>
#include <QFileInfo> #include <QDir>
Settings *Settings::m_instance = 0; Settings *Settings::m_instance = 0;
@@ -50,32 +52,11 @@ Settings::Settings() :
m_instance = this; m_instance = this;
// autodetect sdk dir: // autodetect sdk dir:
Utils::FileName sdk = Utils::FileName::fromString(QCoreApplication::applicationDirPath()); sdkPath = Utils::FileName::fromString(QCoreApplication::applicationDirPath());
Utils::FileName qtc = sdk; sdkPath.appendPath(QLatin1String(DATA_PATH));
qtc.appendPath(QLatin1String("qtcreator")); sdkPath = Utils::FileName::fromString(QDir::cleanPath(sdkPath.toString()));
#ifdef Q_OS_WIN sdkPath.appendPath(QLatin1String(Core::Constants::IDE_SETTINGSVARIANT_STR)
qtc.append(".exe"); + QLatin1String("/qtcreator"));
#endif
QFileInfo qtcFi = qtc.toFileInfo();
if (!qtcFi.exists() || !qtcFi.isFile() || !qtcFi.isExecutable()) {
// we are in src/tools/sdktool (or lib/qtcreator/bin):
qtc = sdk;
qtc.appendPath(QLatin1String("../../../bin/qtcreator"));
#ifdef Q_OS_WIN
qtc.append(".exe");
#endif
qtcFi = qtc.toFileInfo();
if (!qtcFi.exists() || !qtcFi.isFile() || !qtcFi.isExecutable())
qtc.clear();
}
if (!qtc.isEmpty()) {
sdk = qtc.parentDir();
sdk = sdk.parentDir();
sdk.appendPath(QLatin1String("share/qtcreator/Nokia/qtcreator"));
sdkPath = sdk;
}
} }
Utils::FileName Settings::getPath(const QString &file) Utils::FileName Settings::getPath(const QString &file)