Commit 072d551c authored by Eike Ziller's avatar Eike Ziller

Merge remote-tracking branch 'origin/3.0'

Conflicts:
	qtcreator.pri
	qtcreator.qbs

Change-Id: I49dca8a41519869f122a4dfdbd6564b357ddeb1e
parents d3b8da6c 44d254b3
......@@ -7391,7 +7391,7 @@ Add, modify, and remove document filters, which determine the documentation set
<name>ProjectExplorer::ApplicationLauncher</name>
<message>
<source>Failed to start program. Path or permissions wrong?</source>
<translation>Das Programm konnte nicht gestartet werden. Möglicherweise stimmt der Pfad nicht oder die Berechtigungen sind sind ausreichend?</translation>
<translation>Das Programm konnte nicht gestartet werden. Möglicherweise stimmt der Pfad nicht oder die Berechtigungen sind nicht ausreichend?</translation>
</message>
<message>
<source>The program has unexpectedly finished.</source>
......@@ -17799,8 +17799,8 @@ Ids must begin with a lowercase letter.</source>
<context>
<name>Ios::IosToolHandler</name>
<message>
<source>Subprocess Error %1</source>
<translation>Ошибка %1 дочернего процесса</translation>
<source>iOS tool Error %1</source>
<translation>Ошибка %1 утилиты iOS</translation>
</message>
</context>
<context>
......@@ -47,8 +47,8 @@ GridView {
property string mockupSource: model.imageSource
property string helpSource: model.imageUrl !== "" ? sourcePrefix + encodeURI(model.imageUrl) : ""
imageSource: model.imageSource === undefined ? helpSource : mockupSource
videoSource: model.imageSource === undefined ? model.imageUrl : mockupSource
imageSource: isVideo ? "" : (model.imageSource === undefined ? helpSource : mockupSource)
videoSource: isVideo ? (model.imageSource === undefined ? model.imageUrl : mockupSource) : ""
caption: model.name;
description: model.description
......
......@@ -164,9 +164,8 @@ AndroidConfig::AndroidConfig(const QSettings &settings)
toolchainHost = settings.value(ToolchainHostKey).toString();
automaticKitCreation = settings.value(AutomaticKitCreationKey, true).toBool();
QString extraDirectory = settings.value(MakeExtraSearchDirectory).toString();
if (extraDirectory.isEmpty())
makeExtraSearchDirectories = QStringList();
else
makeExtraSearchDirectories.clear();
if (!extraDirectory.isEmpty())
makeExtraSearchDirectories << extraDirectory;
PersistentSettingsReader reader;
......@@ -183,9 +182,8 @@ AndroidConfig::AndroidConfig(const QSettings &settings)
if (v.isValid())
automaticKitCreation = v.toBool();
QString extraDirectory = reader.restoreValue(MakeExtraSearchDirectory).toString();
if (extraDirectory.isEmpty())
makeExtraSearchDirectories = QStringList();
else
makeExtraSearchDirectories.clear();
if (!extraDirectory.isEmpty())
makeExtraSearchDirectories << extraDirectory;
// persistent settings
}
......
......@@ -230,7 +230,7 @@ QString ClearCasePlugin::getDriveLetterOfPath(const QString &directory)
{
// cdUp until we get just the drive letter
QDir dir(directory);
while (dir.cdUp())
while (!dir.isRoot() && dir.cdUp())
{ }
return dir.path();
......
......@@ -482,11 +482,12 @@ void ManhattanStyle::drawPrimitive(PrimitiveElement element, const QStyleOption
// painter->drawLine(rect.bottomLeft() + QPoint(1, 0), rect.bottomRight() - QPoint(1, 0));
QColor highlight(255, 255, 255, 30);
painter->setPen(highlight);
}
else if (option->state & State_Enabled &&
option->state & State_MouseOver) {
} else if (option->state & State_Enabled && option->state & State_MouseOver) {
QColor lighter(255, 255, 255, 37);
painter->fillRect(rect, lighter);
} else if (widget && widget->property("highlightWidget").toBool()) {
QColor shade(0, 0, 0, 128);
painter->fillRect(rect, shade);
}
if (option->state & State_HasFocus && (option->state & State_KeyboardFocusChange)) {
QColor highlight = option->palette.highlight().color();
......@@ -872,6 +873,8 @@ void ManhattanStyle::drawComplexControl(ComplexControl control, const QStyleOpti
QStyleOptionToolButton label = *toolbutton;
label.palette = panelPalette(option->palette, lightColored(widget));
if (widget && widget->property("highlightWidget").toBool())
label.palette.setColor(QPalette::ButtonText, Qt::red);
int fw = pixelMetric(PM_DefaultFrameWidth, option, widget);
label.rect = button.adjusted(fw, fw, -fw, -fw);
......
......@@ -717,6 +717,9 @@ void CPPEditorWidget::setMimeType(const QString &mt)
= m_modelManager->cppEditorSupport(editor())->snapshotUpdater();
updater->setEditorDefines(additionalDirectives);
m_preprocessorButton->setProperty("highlightWidget", !additionalDirectives.trimmed().isEmpty());
m_preprocessorButton->update();
BaseTextEditorWidget::setMimeType(mt);
setObjCEnabled(mt == QLatin1String(CppTools::Constants::OBJECTIVE_C_SOURCE_MIMETYPE)
|| mt == QLatin1String(CppTools::Constants::OBJECTIVE_CPP_SOURCE_MIMETYPE));
......@@ -1990,8 +1993,12 @@ void CPPEditorWidget::showPreProcessorWidget()
if (preProcessorDialog.exec() == QDialog::Accepted) {
QSharedPointer<SnapshotUpdater> updater
= m_modelManager->cppEditorSupport(editor())->snapshotUpdater();
updater->setEditorDefines(preProcessorDialog.additionalPreProcessorDirectives().toUtf8());
const QString &additionals = preProcessorDialog.additionalPreProcessorDirectives();
updater->setEditorDefines(additionals.toUtf8());
updater->update(m_modelManager->workingCopy());
m_preprocessorButton->setProperty("highlightWidget", !additionals.trimmed().isEmpty());
m_preprocessorButton->update();
}
}
......
......@@ -1245,7 +1245,9 @@ bool CvsPlugin::managesDirectory(const QString &directory, QString *topLevel /*
* not have a "CVS" directory. The starting directory must be a managed
* one. Go up and try to find the first unmanaged parent dir. */
QDir lastDirectory = dir;
for (QDir parentDir = lastDirectory; parentDir.cdUp() ; lastDirectory = parentDir) {
for (QDir parentDir = lastDirectory;
!parentDir.isRoot() && parentDir.cdUp();
lastDirectory = parentDir) {
if (!checkCVSDirectory(parentDir)) {
*topLevel = lastDirectory.absolutePath();
break;
......
......@@ -106,13 +106,16 @@ DebuggerItem DebuggerItemConfigWidget::item() const
abiList << a;
}
item.setAbis(abiList);
item.setEngineType(m_engineType);
return item;
}
void DebuggerItemConfigWidget::store() const
{
m_model->updateDebugger(item());
DebuggerItem i = item();
if (i.isValid())
m_model->updateDebugger(i);
}
void DebuggerItemConfigWidget::setAbis(const QStringList &abiNames)
......@@ -157,6 +160,7 @@ void DebuggerItemConfigWidget::setItem(const DebuggerItem &item)
m_binaryChooser->setCommandVersionArguments(QStringList(versionCommand));
setAbis(item.abiNames());
m_engineType = item.engineType();
}
void DebuggerItemConfigWidget::apply()
......@@ -176,14 +180,20 @@ void DebuggerItemConfigWidget::commandWasChanged()
= DebuggerItemManager::findByCommand(m_binaryChooser->fileName());
if (existing) {
setAbis(existing->abiNames());
m_engineType = existing->engineType();
} else {
QFileInfo fi = QFileInfo(m_binaryChooser->path());
if (fi.isExecutable()) {
DebuggerItem tmp = item();
tmp.reinitializeFromFile();
setAbis(tmp.abiNames());
m_engineType = tmp.engineType();
} else {
setAbis(QStringList());
m_engineType = NoEngineType;
}
}
m_model->updateDebugger(item());
}
// --------------------------------------------------------------------------
......
......@@ -82,6 +82,7 @@ private:
QLineEdit *m_abis;
DebuggerItemModel *m_model;
bool m_autodetected;
DebuggerEngineType m_engineType;
QVariant m_id;
};
......
......@@ -210,9 +210,9 @@ GdbOptionsPageWidget::GdbOptionsPageWidget(QWidget *parent)
"You can load additional debugging helpers or modify existing ones here.</p>"
"%1</body></html>").arg(howToUsePython));
textEditCustomDumperCommands = new QTextEdit(groupBoxStartupCommands);
textEditCustomDumperCommands = new QTextEdit(groupBoxCustomDumperCommands);
textEditCustomDumperCommands->setAcceptRichText(false);
textEditCustomDumperCommands->setToolTip(groupBoxStartupCommands->toolTip());
textEditCustomDumperCommands->setToolTip(groupBoxCustomDumperCommands->toolTip());
/*
groupBoxPluginDebugging = new QGroupBox(q);
......
......@@ -979,7 +979,7 @@ QString GitClient::findRepositoryForDirectory(const QString &dir)
else if (directory.exists(QLatin1String(".git/config")))
return directory.absolutePath();
}
} while (directory.cdUp());
} while (!directory.isRoot() && directory.cdUp());
return QString();
}
......
......@@ -43,6 +43,7 @@
#include <QScopedArrayPointer>
#include <QProcessEnvironment>
#include <QFileInfo>
#include <QTimer>
#include <string.h>
#include <errno.h>
......@@ -149,12 +150,14 @@ public:
void subprocessError(QProcess::ProcessError error);
void subprocessFinished(int exitCode, QProcess::ExitStatus exitStatus);
void subprocessHasData();
void killProcess();
virtual bool expectsFileDescriptor() = 0;
protected:
void processXml();
IosToolHandler *q;
QProcess process;
QTimer killTimer;
QXmlStreamReader outputParser;
QString deviceId;
QString bundlePath;
......@@ -200,22 +203,28 @@ IosToolHandlerPrivate::IosToolHandlerPrivate(IosToolHandler::DeviceType devType,
q(q), state(NonStarted), devType(devType), iBegin(0), iEnd(0),
gdbSocket(-1)
{
killTimer.setSingleShot(true);
QProcessEnvironment env(QProcessEnvironment::systemEnvironment());
foreach (const QString &k, env.keys())
if (k.startsWith(QLatin1String("DYLD_")))
env.remove(k);
QStringList frameworkPaths;
QString xcPath = IosConfigurations::developerPath().appendPath(QLatin1String("../OtherFrameworks")).toFileInfo().canonicalFilePath();
env.insert(QLatin1String("DYLD_FALLBACK_FRAMEWORK_PATH"),
xcPath.isEmpty() ?
QString::fromLatin1("/System/Library/PrivateFrameworks")
: (xcPath + QLatin1String(":/System/Library/PrivateFrameworks")));
if (!xcPath.isEmpty())
frameworkPaths << xcPath;
frameworkPaths << QLatin1String("/System/Library/Frameworks")
<< QLatin1String("/System/Library/PrivateFrameworks");
env.insert(QLatin1String("DYLD_FALLBACK_FRAMEWORK_PATH"), frameworkPaths.join(QLatin1String(":")));
if (debugToolHandler)
qDebug() << "IosToolHandler runEnv:" << env.toStringList();
process.setProcessEnvironment(env);
QObject::connect(&process, SIGNAL(readyReadStandardOutput()), q, SLOT(subprocessHasData()));
QObject::connect(&process, SIGNAL(finished(int,QProcess::ExitStatus)),
q, SLOT(subprocessFinished(int,QProcess::ExitStatus)));
QObject::connect(&process, SIGNAL(error(QProcess::ProcessError)),
q, SLOT(subprocessError(QProcess::ProcessError)));
QObject::connect(&killTimer, SIGNAL(timeout()),
q, SLOT(killProcess()));
}
bool IosToolHandlerPrivate::isRunning()
......@@ -265,8 +274,10 @@ void IosToolHandlerPrivate::stop(int errorCode)
case Stopped:
return;
}
if (process.state() != QProcess::NotRunning)
process.kill();
if (process.state() != QProcess::NotRunning) {
process.terminate();
killTimer.start(1500);
}
}
// signals
......@@ -338,6 +349,7 @@ void IosToolHandlerPrivate::subprocessFinished(int exitCode, QProcess::ExitStatu
stop((exitStatus == QProcess::NormalExit) ? exitCode : -1 );
if (debugToolHandler)
qDebug() << "IosToolHandler::finished(" << this << ")";
killTimer.stop();
emit q->finished(q);
}
......@@ -690,6 +702,12 @@ void IosSimulatorToolHandlerPrivate::addDeviceArguments(QStringList &args) const
}
}
void IosToolHandlerPrivate::killProcess()
{
if (process.state() != QProcess::NotRunning)
process.kill();
}
} // namespace Internal
QString IosToolHandler::iosDeviceToolPath()
......@@ -760,4 +778,9 @@ void IosToolHandler::subprocessHasData()
d->subprocessHasData();
}
void IosToolHandler::killProcess()
{
d->killProcess();
}
} // namespace Ios
......@@ -99,6 +99,7 @@ private slots:
void subprocessError(QProcess::ProcessError error);
void subprocessFinished(int exitCode, QProcess::ExitStatus exitStatus);
void subprocessHasData();
void killProcess();
private:
friend class Ios::Internal::IosToolHandlerPrivate;
Ios::Internal::IosToolHandlerPrivate *d;
......
......@@ -117,6 +117,17 @@ QVariantMap DefaultPropertyProvider::properties(const ProjectExplorer::Kit *k, c
<< QLatin1String("llvm")
<< QLatin1String("gcc"));
}
} else {
// TODO: Factor out toolchain type setting.
data.insert(QLatin1String(QBS_TARGETOS), QStringList() << QLatin1String("unix"));
if (tc->type() != QLatin1String("clang")) {
data.insert(QLatin1String(QBS_TOOLCHAIN), QLatin1String("gcc"));
} else {
data.insert(QLatin1String(QBS_TOOLCHAIN),
QStringList() << QLatin1String("clang")
<< QLatin1String("llvm")
<< QLatin1String("gcc"));
}
}
Utils::FileName cxx = tc->compilerCommand();
data.insert(QLatin1String(CPP_TOOLCHAINPATH), cxx.toFileInfo().absolutePath());
......
......@@ -24,9 +24,6 @@
<layout class="QFormLayout" name="formLayout_4">
<item row="0" column="1">
<widget class="QCheckBox" name="designerShowDebuggerCheckBox">
<property name="toolTip">
<string>Warn about QML features which are not properly supported by the Qt Quick Designer</string>
</property>
<property name="text">
<string>Show the debugging view</string>
</property>
......@@ -34,9 +31,6 @@
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="designerEnableDebuggerCheckBox">
<property name="toolTip">
<string>Also warn in the code editor about QML features which are not properly supported by the Qt Quick Designer</string>
</property>
<property name="text">
<string>Enable the debugging view</string>
</property>
......
......@@ -76,19 +76,12 @@ Rectangle {
onRangeChanged: {
var startTime = zoomControl.startTime();
var endTime = zoomControl.endTime();
var duration = Math.abs(endTime - startTime);
mainviewTimePerPixel = duration / root.width;
mainviewTimePerPixel = Math.abs(endTime - startTime) / root.width;
backgroundMarks.updateMarks(startTime, endTime);
view.updateFlickRange(startTime, endTime);
if (duration > 0) {
var candidateWidth = qmlProfilerModelProxy.traceDuration() *
flick.width / duration;
if (flick.contentWidth !== candidateWidth)
flick.contentWidth = candidateWidth;
}
flick.setContentWidth();
}
}
......@@ -325,6 +318,12 @@ Rectangle {
}
Flickable {
function setContentWidth() {
var duration = Math.abs(zoomControl.endTime() - zoomControl.startTime());
if (duration > 0)
contentWidth = qmlProfilerModelProxy.traceDuration() * width / duration;
}
id: flick
anchors.top: parent.top
anchors.topMargin: labels.y
......@@ -336,6 +335,8 @@ Rectangle {
boundsBehavior: Flickable.StopAtBounds
onContentXChanged: view.updateZoomControl()
onWidthChanged: setContentWidth()
clip:true
SelectionRange {
......
......@@ -287,8 +287,12 @@ QString QnxUtils::qdeInstallProcess(const QString &ndkPath, const QString &optio
if (installerPath.isEmpty())
return QString();
return QString::fromLatin1("%1 -nosplash -application com.qnx.tools.ide.sdk.manager.core.SDKInstallerApplication "
"%2 %3 -vmargs -Dosgi.console=:none").arg(installerPath, option, version);
const QDir pluginDir(ndkPath + QLatin1String("/plugins"));
const QStringList installerPlugins = pluginDir.entryList(QStringList() << QLatin1String("com.qnx.tools.ide.sdk.installer.app_*.jar"));
const QString installerApplication = installerPlugins.size() >= 1 ? QLatin1String("com.qnx.tools.ide.sdk.installer.app.SDKInstallerApplication")
: QLatin1String("com.qnx.tools.ide.sdk.manager.core.SDKInstallerApplication");
return QString::fromLatin1("%1 -nosplash -application %2 "
"%3 %4 -vmargs -Dosgi.console=:none").arg(installerPath, installerApplication, option, version);
}
QList<Utils::EnvironmentItem> QnxUtils::qnxEnvironment(const QString &sdkPath)
......
......@@ -218,7 +218,7 @@ QString BaseQtVersion::defaultDisplayName(const QString &versionString, const Fi
&& dirName.compare(QLatin1String("qt"), Qt::CaseInsensitive)) {
break;
}
} while (dir.cdUp());
} while (!dir.isRoot() && dir.cdUp());
}
return fromPath ?
......
......@@ -1175,7 +1175,7 @@ bool SubversionPlugin::managesDirectory(const QString &directory, QString *topLe
* furthest parent containing ".svn/wc.db". Need to check for furthest parent as closer
* parents may be svn:externals. */
QDir parentDir = dir;
while (parentDir.cdUp()) {
while (!parentDir.isRoot() && parentDir.cdUp()) {
if (checkSVNSubDir(parentDir, QLatin1String("wc.db"))) {
if (topLevel)
*topLevel = parentDir.absolutePath();
......@@ -1191,7 +1191,9 @@ bool SubversionPlugin::managesDirectory(const QString &directory, QString *topLe
if (topLevel) {
QDir lastDirectory = dir;
for (parentDir = lastDirectory; parentDir.cdUp() ; lastDirectory = parentDir) {
for (parentDir = lastDirectory;
!parentDir.isRoot() && parentDir.cdUp();
lastDirectory = parentDir) {
if (!checkSVNSubDir(parentDir)) {
*topLevel = lastDirectory.absolutePath();
break;
......
......@@ -732,7 +732,7 @@ QString VcsBasePlugin::findRepositoryForDirectory(const QString &dirS,
qDebug() << "<VcsBasePlugin::findRepositoryForDirectory> " << absDirPath;
return absDirPath;
}
} while (directory.cdUp());
} while (!directory.isRoot() && directory.cdUp());
if (debugRepositorySearch)
qDebug() << "<VcsBasePlugin::findRepositoryForDirectory bailing out at " << directory.absolutePath();
return QString();
......
......@@ -27,19 +27,19 @@
**
****************************************************************************/
#include <AST.h>
#include <ASTVisitor.h>
#include <ASTPatternBuilder.h>
#include <ASTMatcher.h>
#include <Control.h>
#include <Scope.h>
#include <Bind.h>
#include <TranslationUnit.h>
#include <Literals.h>
#include <Symbols.h>
#include <Names.h>
#include <CoreTypes.h>
#include <SymbolVisitor.h>
#include <cplusplus/AST.h>
#include <cplusplus/ASTVisitor.h>
#include <cplusplus/ASTPatternBuilder.h>
#include <cplusplus/ASTMatcher.h>
#include <cplusplus/Control.h>
#include <cplusplus/Scope.h>
#include <cplusplus/Bind.h>
#include <cplusplus/TranslationUnit.h>
#include <cplusplus/Literals.h>
#include <cplusplus/Symbols.h>
#include <cplusplus/Names.h>
#include <cplusplus/CoreTypes.h>
#include <cplusplus/SymbolVisitor.h>
#include <cplusplus/CppDocument.h>
#include <cplusplus/Overview.h>
#include <cplusplus/LookupContext.h>
......
......@@ -125,7 +125,7 @@ typedef am_res_t (MDEV_API *AMDeviceInstallApplicationPtr)(ServiceSocket, CFStri
typedef am_res_t (MDEV_API *AMDeviceUninstallApplicationPtr)(ServiceSocket, CFStringRef, CFDictionaryRef,
AMDeviceInstallApplicationCallback,
void*);
typedef am_res_t (MDEV_API *AMDeviceLookupApplicationsPtr)(AMDeviceRef, unsigned int, CFDictionaryRef *);
typedef am_res_t (MDEV_API *AMDeviceLookupApplicationsPtr)(AMDeviceRef, CFDictionaryRef, CFDictionaryRef *);
} // extern C
QString CFStringRef2QString(CFStringRef s)
......@@ -204,7 +204,7 @@ public :
am_res_t deviceUninstallApplication(int, CFStringRef, CFDictionaryRef,
AMDeviceInstallApplicationCallback,
void*);
am_res_t deviceLookupApplications(AMDeviceRef, unsigned int, CFDictionaryRef *);
am_res_t deviceLookupApplications(AMDeviceRef, CFDictionaryRef, CFDictionaryRef *);
void addError(const QString &msg);
void addError(const char *msg);
......@@ -1063,6 +1063,8 @@ bool AppOpSession::installApp()
}
stopService(fd);
}
if (!failure)
sleep(5); // after installation the device needs a bit of quiet....
if (debugAll)
qDebug() << "AMDeviceInstallApplication finished request with " << failure;
IosDeviceManagerPrivate::instance()->didTransferApp(bundlePath, deviceId,
......@@ -1151,10 +1153,21 @@ QString AppOpSession::appPathOnDevice()
if (!connectDevice())
return QString();
CFDictionaryRef apps;
if (int err = lib()->deviceLookupApplications(device, 0, &apps)) {
CFDictionaryRef options;
const void *attributes[3] = { (const void*)(CFSTR("CFBundleIdentifier")),
(const void*)(CFSTR("Path")), (const void*)(CFSTR("CFBundleExecutable")) };
CFArrayRef lookupKeys = CFArrayCreate(kCFAllocatorDefault, (const void**)(&attributes[0]), 3,
&kCFTypeArrayCallBacks);
CFStringRef attrKey = CFSTR("ReturnAttributes");
options = CFDictionaryCreate(kCFAllocatorDefault, (const void**)(&attrKey),
(const void**)(&lookupKeys), 1,
&kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
CFRelease(lookupKeys);
if (int err = lib()->deviceLookupApplications(device, options, &apps)) {
addError(QString::fromLatin1("app lookup failed, AMDeviceLookupApplications returned %1")
.arg(err));
}
CFRelease(options);
if (debugAll)
CFShow(apps);
if (apps && CFGetTypeID(apps) == CFDictionaryGetTypeID()) {
......@@ -1509,11 +1522,11 @@ am_res_t MobileDeviceLib::deviceUninstallApplication(int serviceFd, CFStringRef
return -1;
}
am_res_t MobileDeviceLib::deviceLookupApplications(AMDeviceRef device, unsigned int i,
am_res_t MobileDeviceLib::deviceLookupApplications(AMDeviceRef device, CFDictionaryRef options,
CFDictionaryRef *res)
{
if (m_AMDeviceLookupApplications)
return m_AMDeviceLookupApplications(device, i, res);
return m_AMDeviceLookupApplications(device, options, res);
return -1;
}
......
......@@ -106,7 +106,7 @@ IosTool::IosTool(QObject *parent):
ipv6(false),
inAppOutput(false),
splitAppOutput(true),
appOp(Ios::IosDeviceManager::Install),
appOp(Ios::IosDeviceManager::None),
outFile(),
out(&outFile),
gdbFileDescriptor(-1),
......@@ -281,7 +281,7 @@ void IosTool::didTransferApp(const QString &bundlePath, const QString &deviceId,
//out.writeCharacters(QString()); // trigger a complete closing of the empty element
outFile.flush();
if (status != Ios::IosDeviceManager::Success || --opLeft == 0)
doExit(-1);
doExit((status == Ios::IosDeviceManager::Success) ? 0 : -1);
}
void IosTool::didStartApp(const QString &bundlePath, const QString &deviceId,
......
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