Commit d6c73653 authored by Eike Ziller's avatar Eike Ziller
Browse files

Merge remote-tracking branch 'origin/3.2'

Conflicts:
	qtcreator.pri
	qtcreator.qbs
	src/plugins/cpptools/cppmodelmanager.cpp
	src/plugins/texteditor/basetexteditor.cpp
	src/plugins/texteditor/basetexteditor.h

Change-Id: I556a7661872b90b329a46694e335e18cddc28677
parents 205de01a faeac783
......@@ -84,4 +84,20 @@
However, this automatic dumping is a fallback mechanism with many points of
failure and you cannot rely upon it.
\section1 Running QML Modules in Qt Quick Designer
\QMLD uses a QML emulation layer (also called QML Puppet) to render and
preview images and to collect data. To be able to render custom types
correctly from QML modules, the emulation layer must be built with the same
Qt version as the QML modules.
By default, the emulation layer is provided by \QC and built with the same
Qt version as \QC. Therefore, your QML modules will mostly not work out of
the box.
To use an emulation layer that is built with the Qt
configured in the build and run kit for the project, deselect the
\gui {Always use the QML emulation layer provided by Qt Creator} check box.
\QC builds the emulation layer when you select the \gui Design mode.
*/
......@@ -66,15 +66,15 @@
\section2 Configuring Qt Designer Plugins on OS X
On the Mac, a GUI application must be built and run from a bundle. A bundle
On OS X, a GUI application must be built and run from a bundle. A bundle
is a directory structure that appears as a single entity when viewed in the
Finder. A bundle for an application typcially contains the executable and
all the resources it needs.
\QC uses its own set of Qt Libraries located in the bundle, and therefore,
you need to configure the \QD plugins that you want to use with \QC.
Fore more information about how to deploy applications to Mac OS, see
\l{Qt for Mac OS X - Deployment}.
Fore more information about how to deploy applications to OS X, see
\l{Qt for OS X - Deployment}.
The following example illustrates how to configure version 5.2.1 of the
\l{http://qwt.sourceforge.net/}{Qwt - Qt Widgets for Technical Applications}
......
......@@ -10514,6 +10514,18 @@ Sie können die Änderungen in einem Stash ablegen oder zurücksetzen.</translat
<source>Always save when leaving subcomponent in bread crumb</source>
<translation>Immer speichern, wenn eine Subkomponente per Breadcrumb Navigation verlassen wird</translation>
</message>
<message>
<source>QML Emulation Layer</source>
<translation>QML-Emulationsschicht</translation>
</message>
<message>
<source>If you do not select this checkbox, Qt Quick Designer uses the QML emulation layer (QML Puppet) built with the Qt configured in the build and run kit for the project.</source>
<translation>Wenn Sie diese Option nicht aktivieren, benutzt Qt Quick Designer die QML-Emulationsschicht (QML Puppet), die mit dem für das Projekt eingestellten Kit erstellt wurde.</translation>
</message>
<message>
<source>Always use the QML emulation layer provided by Qt Creator</source>
<translation>Immer die von Qt Creator bereitgestellte QML-Emulationsschicht verwenden</translation>
</message>
</context>
<context>
<name>Utils::UnixTools</name>
......@@ -15506,10 +15518,6 @@ Qt Creator kann sich nicht anhängen.</translation>
<source>Reset Debugger</source>
<translation>Debugger zurücksetzen</translation>
</message>
<message>
<source>Shift+Ctrl+R</source>
<translation>Shift+Ctrl+R</translation>
</message>
<message>
<source>Ctrl+Shift+O</source>
<translation>Ctrl+Shift+O</translation>
......@@ -28511,6 +28519,10 @@ Entfernt: %4</translation>
<source>Use %1 instead of &apos;var&apos; or &apos;variant&apos; to improve performance.</source>
<translation>Zur Steigerung der Ausführungsgeschwindigkeit sollte %1 an Stelle von &apos;var&apos; oder &apos;variant&apos; verwendet werden.</translation>
</message>
<message>
<source>This type is not supported as a root element by Qt Quick Designer %1.</source>
<translation>Dieser Typ wird von Qt Quick Designer %1 nicht als Wurzelelement unterstützt.</translation>
</message>
<message>
<source>Do not use &quot;%1&quot; as a constructor.</source>
<translation>&quot;%1&quot; darf nicht als Konstruktor verwendet werden.</translation>
......@@ -31330,6 +31342,14 @@ Kurznamen können verwendet werden, sofern sie eindeutig sind.</translation>
<source>Qt Quick 2.2</source>
<translation>Qt Quick 2.2</translation>
</message>
<message>
<source>Creates a Qt Quick 2 UI project with a single QML file that contains the main view. You can review Qt Quick 2 UI projects in the QML Scene and you need not build them. You do not need to have the development environment installed on your computer to create and run this type of project. Requires Qt 5.3 or newer.</source>
<translation>Erstellt ein Qt Quick 2-UI-Projekt mit einer einzigen QML-Datei, die die Hauptansicht enthält. Sie können Qt Quick 2-UI-Projekte mit QML-Scene ohne Erstellung betrachten. Sie benötigen keine Entwicklungsumgebung auf Ihrem Computer, um solche Projekte zu erstellen und auszuführen. Erfordert Qt 5.3 oder neuer.</translation>
</message>
<message>
<source>Qt Quick 2.3</source>
<translation>Qt Quick 2.3</translation>
</message>
<message>
<source>Creates a Qt Quick 2 UI project with a single QML file that contains the main view and uses Qt Quick Controls. You can review Qt Quick 2 UI projects in the QML Scene and you need not build them. This project requires that you have installed Qt Quick Controls for your Qt version. Requires Qt 5.2 or newer.</source>
<translation>Erstellt ein Qt Quick 2-UI-Projekt mit einer einzigen QML-Datei, die die Hauptansicht enthält und Qt Quick Controls verwendet. Sie können Qt Quick 2-UI-Projekte mit QML-Scene ohne Erstellung betrachten. Dieses Projekt erfordert, dass die Qt Quick Controls für die Qt-Version installiert sind. Erfordert Qt 5.2 oder neuer.</translation>
......@@ -31338,6 +31358,14 @@ Kurznamen können verwendet werden, sofern sie eindeutig sind.</translation>
<source>Qt Quick Controls 1.1</source>
<translation>Qt Quick Controls 1.1</translation>
</message>
<message>
<source>Creates a Qt Quick 2 UI project with a single QML file that contains the main view and uses Qt Quick Controls. You can review Qt Quick 2 UI projects in the QML Scene and you need not build them. This project requires that you have installed Qt Quick Controls for your Qt version. Requires Qt 5.3 or newer.</source>
<translation>Erstellt ein Qt Quick 2-UI-Projekt mit einer einzigen QML-Datei, die die Hauptansicht enthält und Qt Quick Controls verwendet. Sie können Qt Quick 2-UI-Projekte mit QML-Scene ohne Erstellung betrachten. Dieses Projekt erfordert, dass die Qt Quick Controls für die Qt-Version installiert sind. Erfordert Qt 5.3 oder neuer.</translation>
</message>
<message>
<source>Qt Quick Controls 1.2</source>
<translation>Qt Quick Controls 1.2</translation>
</message>
<message>
<source>Creates a Qt Quick 2 UI project with a single QML file that contains the main view and uses Qt Quick Controls. You can review Qt Quick 2 UI projects in the QML Scene and you need not build them. This project requires that you have installed Qt Quick Controls for your Qt version. Requires Qt 5.1 or newer.</source>
<translation>Erstellt ein Qt Quick 2-UI-Projekt mit einer einzigen QML-Datei, die die Hauptansicht enthält und Qt Quick Controls verwendet. Sie können Qt Quick 2-UI-Projekte mit QML-Scene ohne Erstellung betrachten. Dieses Projekt erfordert, dass die Qt Quick Controls für die Qt-Version installiert sind. Erfordert Qt 5.1 oder neuer.</translation>
......@@ -35188,6 +35216,14 @@ Wählt eine für Desktop-Entwicklung geeignete Qt-Version aus, sofern sie verfü
<source>Qt Quick 2.2</source>
<translation>Qt Quick 2.2</translation>
</message>
<message>
<source>Creates a deployable Qt Quick 2 application using the QtQuick 2.3 import. Requires Qt 5.3 or newer.</source>
<translation>Erstellt eine zum Deployment geeignete Qt Quick 2-Anwendung unter Verwendung des Imports QtQuick 2.3. Erfordert Qt 5.3 oder neuer.</translation>
</message>
<message>
<source>Qt Quick 2.3</source>
<translation>Qt Quick 2.3</translation>
</message>
<message>
<source>Creates a deployable Qt Quick 2 application using Qt Quick Controls. Requires Qt 5.2 or newer.</source>
<translation>Erstellt eine zum Deployment geeignete Qt Quick 2-Anwendung unter Verwendung der Qt Quick Controls. Erfordert Qt 5.2 oder neuer.</translation>
......@@ -35196,6 +35232,14 @@ Wählt eine für Desktop-Entwicklung geeignete Qt-Version aus, sofern sie verfü
<source>Qt Quick Controls 1.1</source>
<translation>Qt Quick Controls 1.1</translation>
</message>
<message>
<source>Creates a deployable Qt Quick 2 application using Qt Quick Controls. Requires Qt 5.3 or newer.</source>
<translation>Erstellt eine zum Deployment geeignete Qt Quick 2-Anwendung unter Verwendung der Qt Quick Controls. Erfordert Qt 5.3 oder neuer.</translation>
</message>
<message>
<source>Qt Quick Controls 1.2</source>
<translation>Qt Quick Controls 1.2</translation>
</message>
<message>
<source>Creates a deployable Qt Quick 2 application using Qt Quick Controls. Requires Qt 5.1 or newer.</source>
<translation>Erstellt eine zum Deployment geeignete Qt Quick 2-Anwendung unter Verwendung der Qt Quick Controls. Erfordert Qt 5.1 oder neuer.</translation>
......@@ -37290,8 +37334,8 @@ Dieser Assistent führt Sie durch die wesentlichen Schritte, die zum Deployment
<context>
<name>TabViewSpecifics</name>
<message>
<source>TabView</source>
<translation>TabView</translation>
<source>Tab View</source>
<translation>Tab View</translation>
</message>
<message>
<source>Current index</source>
......@@ -39148,4 +39192,86 @@ Möchten Sie, dass Qt Creator sie für Ihr Projekt (%1) anlegt?</translation>
<translation>&apos;%1&apos; kann nicht geöffnet werden.</translation>
</message>
</context>
<context>
<name>SliderSpecifics</name>
<message>
<source>Value</source>
<translation>Wert</translation>
</message>
<message>
<source>Current value of the Slider. The default value is 0.0.</source>
<translation>Aktueller Wert des Sliders. Die Voreinstellung ist 0,0.</translation>
</message>
<message>
<source>Maximum value</source>
<translation>Maximalwert</translation>
</message>
<message>
<source>Maximum value of the slider. The default value is 1.0.</source>
<translation>Maximalwert des Sliders. Die Voreinstellung ist 1,0.</translation>
</message>
<message>
<source>Minimum value</source>
<translation>Minimalwert</translation>
</message>
<message>
<source>Minimum value of the slider. The default value is 0.0.</source>
<translation>Der Minimalwert des Sliders. Die Voreinstellung ist 0,0.</translation>
</message>
<message>
<source>Orientation</source>
<translation>Ausrichtung</translation>
</message>
<message>
<source>Layout orientation of the slider.</source>
<translation>Ausrichtung des Sliders.</translation>
</message>
<message>
<source>Step size</source>
<translation>Schrittweite</translation>
</message>
<message>
<source>Indicates the slider step size.</source>
<translation>Legt die Größe der Schritte fest.</translation>
</message>
<message>
<source>Active focus on press</source>
<translation>Fokussieren durch Betätigen</translation>
</message>
<message>
<source>Indicates whether the slider should receive active focus when pressed.</source>
<translation>Legt fest, ob der Slider durch Betätigen den Fokus erhalten soll.</translation>
</message>
<message>
<source>Tick marks enabled</source>
<translation>Skalenmarkierungen aktiviert</translation>
</message>
<message>
<source>Indicates whether the slider should display tick marks at step intervals.</source>
<translation>Legt fest, ob der Slider Skalenmarkierungen an den möglichen Werten anzeigen soll.</translation>
</message>
<message>
<source>Update value while dragging</source>
<translation>Wert beim Ziehen aktualisieren</translation>
</message>
<message>
<source>Determines whether the current value should be updated while the user is moving the slider handle, or only when the button has been released.</source>
<translation>Legt fest, ob der aktuelle Wert aktualisiert werden soll, während der Benutzer den Slider verschiebt, oder nur aktulisiert wird, wenn er losgelassen wird.</translation>
</message>
</context>
<context>
<name>SplitViewSpecifics</name>
<message>
<source>Split View</source>
<translation>Split View</translation>
</message>
<message>
<source>Orientation</source>
<translation>Ausrichtung</translation>
</message>
<message>
<source>Orientation of the split view.</source>
<translation>Ausrichtung des Split View.</translation>
</message>
</context>
</TS>
......@@ -479,12 +479,18 @@ QList<ILocatorFilter *> LocatorWidget::filtersFor(const QString &text, QString &
void LocatorWidget::updateCompletionList(const QString &text)
{
m_updateRequested = true;
if (m_entriesWatcher->future().isRunning()) {
// Cancel the old future. We may not just block the UI thread to wait for the search to
// actually cancel, so try again when the finshed signal of the watcher ends up in
// updateEntries() (which will call updateCompletionList again with the
// requestedCompletionText)
m_requestedCompletionText = text;
m_entriesWatcher->future().cancel();
return;
}
QString searchText;
const QList<ILocatorFilter *> filters = filtersFor(text, searchText);
// cancel the old future
m_entriesWatcher->future().cancel();
QFuture<LocatorFilterEntry> future = QtConcurrent::run(runSearch, filters, searchText);
m_entriesWatcher->setFuture(future);
}
......@@ -493,8 +499,9 @@ void LocatorWidget::updateEntries()
{
m_updateRequested = false;
if (m_entriesWatcher->future().isCanceled()) {
// reset to usable state
m_acceptRequested = false;
const QString text = m_requestedCompletionText;
m_requestedCompletionText.clear();
updateCompletionList(text);
return;
}
......
......@@ -94,6 +94,7 @@ private:
QTimer *m_showPopupTimer;
QFutureWatcher<LocatorFilterEntry> *m_entriesWatcher;
QMap<Core::Id, QAction *> m_filterActionMap;
QString m_requestedCompletionText;
bool m_updateRequested;
bool m_acceptRequested;
bool m_possibleToolTipRequest;
......
......@@ -117,7 +117,7 @@ bool isOwnershipRAIIType(CPlusPlus::Symbol *symbol, const LookupContext &context
bool isValidAsciiIdentifierChar(const QChar &ch)
{
return ch.isLetterOrNumber() || ch == QLatin1Char(' ');
return ch.isLetterOrNumber() || ch == QLatin1Char('_');
}
bool isValidFirstIdentifierChar(const QChar &ch)
......
......@@ -131,6 +131,16 @@
using namespace Core;
using namespace Utils;
static QString QString_toUpper(const QString &str)
{
return str.toUpper();
}
static QString QString_toLower(const QString &str)
{
return str.toLower();
}
namespace TextEditor {
namespace Internal {
......
This diff is collapsed.
#import "../coresimulator/coresimulator.h"
//
// Generated by class-dump 3.5 (64 bit).
//
......@@ -242,6 +244,8 @@ typedef void (^CDUnknownBlockType)(void); // return type and parameters are unkn
@property(copy) DTiPhoneSimulatorSystemRoot *simulatedSystemRoot; // @synthesize simulatedSystemRoot=_simulatedSystemRoot;
@property(copy) NSString *localizedClientName; // @synthesize localizedClientName=_localizedClientName;
@property BOOL launchForBackgroundFetch; // @synthesize launchForBackgroundFetch=_launchForBackgroundFetch;
@property(retain) SimDevice *device; // @synthesize device=_device;
@property(retain) SimRuntime *runtime; // @synthesize runtime=_runtime;
- (id)description;
- (id)copyWithZone:(struct _NSZone *)arg1;
- (id)init;
......@@ -263,6 +267,7 @@ typedef void (^CDUnknownBlockType)(void); // return type and parameters are unkn
@property(copy) NSString *sdkDisplayName; // @synthesize sdkDisplayName;
@property(copy) NSString *sdkVersion; // @synthesize sdkVersion;
@property(copy) NSString *sdkRootPath; // @synthesize sdkRootPath;
@property(readonly) SimRuntime *runtime; // @synthesize runtime=_runtime;
- (id)description;
- (long long)compare:(id)arg1;
- (id)copyWithZone:(struct _NSZone *)arg1;
......@@ -287,4 +292,4 @@ typedef void (^CDUnknownBlockType)(void); // return type and parameters are unkn
- (id)description;
- (id)copyWithZone:(struct _NSZone *)arg1;
@end
\ No newline at end of file
@end
......@@ -50,7 +50,8 @@ HEADERS += \
nsprintf.h \
nsstringexpandpath.h \
version.h \
dvtiphonesimulatorremoteclient/dvtiphonesimulatorremoteclient.h
dvtiphonesimulatorremoteclient/dvtiphonesimulatorremoteclient.h \
coresimulator/coresimulator.h
DISTFILES = IOSSIM_LICENSE \
Info.plist
......@@ -24,6 +24,8 @@
BOOL alreadyPrintedData;
BOOL retinaDevice;
BOOL tallDevice;
BOOL is64BitDevice;
NSString *deviceTypeId;
}
- (id)init;
......@@ -34,6 +36,7 @@
- (void)removeStdioFIFO:(NSFileHandle *)fileHandle atPath:(NSString *)path;
- (void)stop;
- (void)doExit:(int)errorCode;
- (NSString*)changeDeviceType:(NSString *)family retina:(BOOL)retina isTallDevice:(BOOL)isTallDevice;
- (SimDevice*) findDeviceWithFamily:(NSString *)family retina:(BOOL)retina isTallDevice:(BOOL)isTallDevice is64Bit:(BOOL)is64Bit;
- (NSString*)changeDeviceType:(NSString *)family retina:(BOOL)retina isTallDevice:(BOOL)isTallDevice is64Bit:(BOOL)is64Bit;
@end
......@@ -18,15 +18,30 @@ NSString *simulatorPrefrencesName = @"com.apple.iphonesimulator";
NSString *deviceProperty = @"SimulateDevice";
NSString *deviceIphoneRetina3_5Inch = @"iPhone Retina (3.5-inch)";
NSString *deviceIphoneRetina4_0Inch = @"iPhone Retina (4-inch)";
NSString *deviceIphoneRetina4_0Inch_64bit = @"iPhone Retina (4-inch 64-bit)";
NSString *deviceIphone = @"iPhone";
NSString *deviceIpad = @"iPad";
NSString *deviceIpadRetina = @"iPad Retina";
NSString *deviceIpadRetina_64bit = @"iPad Retina (64-bit)";
NSString* deviceTypeIdIphone4s = @"com.apple.CoreSimulator.SimDeviceType.iPhone-4s";
NSString* deviceTypeIdIphone5 = @"com.apple.CoreSimulator.SimDeviceType.iPhone-5";
NSString* deviceTypeIdIphone5s = @"com.apple.CoreSimulator.SimDeviceType.iPhone-5s";
NSString* deviceTypeIdIpad2 = @"com.apple.CoreSimulator.SimDeviceType.iPad-2";
NSString* deviceTypeIdIpadRetina = @"com.apple.CoreSimulator.SimDeviceType.iPad-Retina";
NSString* deviceTypeIdIpadAir = @"com.apple.CoreSimulator.SimDeviceType.iPad-Air";
NSString* deviceTypeIdResizableIphone = @"com.apple.CoreSimulator.SimDeviceType.Resizable-iPhone";
NSString* deviceTypeIdResizeableIpad = @"com.apple.CoreSimulator.SimDeviceType.Resizable-iPad";
// The path within the developer dir of the private Simulator frameworks.
NSString* const kSimulatorFrameworkRelativePath = @"Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks/DVTiPhoneSimulatorRemoteClient.framework";
NSString* const kSimulatorFrameworkRelativePathLegacy = @"Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks/DVTiPhoneSimulatorRemoteClient.framework";
NSString* const kSimulatorFrameworkRelativePath = @"../SharedFrameworks/DVTiPhoneSimulatorRemoteClient.framework";
NSString* const kDVTFoundationRelativePath = @"../SharedFrameworks/DVTFoundation.framework";
NSString* const kDevToolsFoundationRelativePath = @"../OtherFrameworks/DevToolsFoundation.framework";
//NSString* const kSimulatorRelativePath = @"Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone Simulator.app";
NSString* const kCoreSimulatorRelativePath = @"Library/PrivateFrameworks/CoreSimulator.framework";
static pid_t gDebuggerProcessId;
static const char *gDevDir = 0;
......@@ -88,6 +103,14 @@ static const char *gDevDir = 0;
nsprintf(@"Unable to devToolsFoundationPath. Error: ");
return ;
}
NSString* coreSimulatorPath = [developerDir stringByAppendingPathComponent:kCoreSimulatorRelativePath];
if ([[NSFileManager defaultManager] fileExistsAtPath:coreSimulatorPath]) {
NSBundle* coreSimulatorBundle = [NSBundle bundleWithPath:coreSimulatorPath];
if (![coreSimulatorBundle load]){
nsprintf(@"Unable to coreSimulatorPath. Error: ");
return ;
}
}
// Prime DVTPlatform.
NSError* error;
Class DVTPlatformClass = [self FindClassByName:@"DVTPlatform"];
......@@ -95,7 +118,10 @@ static const char *gDevDir = 0;
nsprintf(@"Unable to loadAllPlatformsReturningError. Error: %@",[error localizedDescription]);
return ;
}
NSString* simBundlePath = [developerDir stringByAppendingPathComponent:kSimulatorFrameworkRelativePath];
NSString* simBundlePath = [developerDir stringByAppendingPathComponent:kSimulatorFrameworkRelativePathLegacy];
if (![[NSFileManager defaultManager] fileExistsAtPath:simBundlePath]){
simBundlePath = [developerDir stringByAppendingPathComponent:kSimulatorFrameworkRelativePath];
}
NSBundle* simBundle = [NSBundle bundleWithPath:simBundlePath];
if (![simBundle load]){
nsprintf(@"Unable to load simulator framework. Error: %@",[error localizedDescription]);
......@@ -115,20 +141,20 @@ NSString* FindDeveloperDir() {
NSString* developerDir = [env objectForKey:@"DEVELOPER_DIR"];
if ([developerDir length] > 0)
return developerDir;
// Go look for it via xcode-select.
NSTask* xcodeSelectTask = [[[NSTask alloc] init] autorelease];
[xcodeSelectTask setLaunchPath:@"/usr/bin/xcode-select"];
[xcodeSelectTask setArguments:[NSArray arrayWithObject:@"-print-path"]];
NSPipe* outputPipe = [NSPipe pipe];
[xcodeSelectTask setStandardOutput:outputPipe];
NSFileHandle* outputFile = [outputPipe fileHandleForReading];
[xcodeSelectTask launch];
NSData* outputData = [outputFile readDataToEndOfFile];
[xcodeSelectTask terminate];
NSString* output =
[[[NSString alloc] initWithData:outputData
encoding:NSUTF8StringEncoding] autorelease];
......@@ -143,6 +169,7 @@ NSString* FindDeveloperDir() {
fprintf(stdout, "\n");
fprintf(stdout, "Commands:\n");
fprintf(stdout, " showsdks List the available iOS SDK versions\n");
fprintf(stdout, " showdevicetypes List the available device types (Xcode6+)\n");
fprintf(stdout, " launch &lt;application path&gt; Launch the application at the specified path on the iOS Simulator\n");
fprintf(stdout, " start Launch iOS Simulator without an app\n");
fprintf(stdout, "\n");
......@@ -156,9 +183,11 @@ NSString* FindDeveloperDir() {
fprintf(stdout, " --debug Attach LLDB to the application on startup\n");
fprintf(stdout, " --use-gdb Use GDB instead of LLDB. (Requires --debug)\n");
fprintf(stdout, " --sdk &lt;sdkversion&gt; The iOS SDK version to run the application on (defaults to the latest)\n");
fprintf(stdout, " --devicetypeid <device type> The id of the device type that should be simulated (Xcode6+)\n");
fprintf(stdout, " --family &lt;device family&gt; The device type that should be simulated (defaults to `iphone')\n");
fprintf(stdout, " --retina Start a retina device\n");
fprintf(stdout, " --tall In combination with --retina flag, start the tall version of the retina device (e.g. iPhone 5 (4-inch))\n");
fprintf(stdout, " --64bit In combination with --retina flag and the --tall flag, start the 64bit version of the tall retina device (e.g. iPhone 5S (4-inch 64bit))\n");
fprintf(stdout, " --uuid &lt;uuid&gt; A UUID identifying the session (is that correct?)\n");
fprintf(stdout, " --env &lt;environment file path&gt; A plist file containing environment key-value pairs that should be set\n");
fprintf(stdout, " --setenv NAME=VALUE Set an environment variable\n");
......@@ -187,6 +216,18 @@ NSString* FindDeveloperDir() {
return EXIT_SUCCESS;
}
- (int) showDeviceTypes {
Class simDeviceSet = NSClassFromString(@"SimDeviceSet");
if (simDeviceSet) {
SimDeviceSet* deviceSet = [simDeviceSet defaultSet];
NSArray* devices = [deviceSet availableDevices];
for (SimDevice* device in devices) {
nsfprintf(stderr, @"%@", device.deviceType.identifier);
}
}
return EXIT_SUCCESS;
}
- (void)session:(DTiPhoneSimulatorSession *)session didEndWithError:(NSError *)error {
if (verbose) {
......@@ -210,6 +251,14 @@ NSString* FindDeveloperDir() {
[self doExit:EXIT_SUCCESS];
}
static void IgnoreSignal(int /*arg*/) {
}
static void ChildSignal(int /*arg*/) {
int status;
waitpid(gDebuggerProcessId, &status, 0);
exit(EXIT_SUCCESS);
}
- (void)session:(DTiPhoneSimulatorSession *)session didStart:(BOOL)started withError:(NSError *)error {
if (startOnly && session) {
......@@ -242,6 +291,9 @@ NSString* FindDeveloperDir() {
[self doExit:EXIT_FAILURE];
return;
}
gDebuggerProcessId = child_pid;
signal(SIGINT, IgnoreSignal);
signal(SIGCHLD, ChildSignal);
}
if (verbose) {
msgprintf(@"Session started");
......@@ -400,9 +452,15 @@ NSString* FindDeveloperDir() {
[config setSimulatedDeviceFamily:[NSNumber numberWithInt:1]];
}
}
NSString* devicePropertyValue = [self changeDeviceType:family retina:retinaDevice isTallDevice:tallDevice];
[config setSimulatedDeviceInfoName:devicePropertyValue];
if ([config respondsToSelector:@selector(setDevice:)]) {
// Xcode6+
config.device = [self findDeviceWithFamily:family retina:retinaDevice isTallDevice:tallDevice is64Bit:is64BitDevice];
} else {
// Xcode5 or older
NSString* devicePropertyValue = [self changeDeviceType:family retina:retinaDevice isTallDevice:tallDevice is64Bit:is64BitDevice];
[config setSimulatedDeviceInfoName:devicePropertyValue];
}
/* Start the session */
session = [[[[self FindClassByName:@"DTiPhoneSimulatorSession"] alloc] init] autorelease];
......@@ -420,18 +478,70 @@ NSString* FindDeveloperDir() {
return EXIT_SUCCESS;
}
- (NSString*) changeDeviceType:(NSString *)family retina:(BOOL)retina isTallDevice:(BOOL)isTallDevice {
- (SimDevice*) findDeviceWithFamily:(NSString *)family retina:(BOOL)retina isTallDevice:(BOOL)isTallDevice is64Bit:(BOOL)is64Bit {
NSString* devTypeId = self->deviceTypeId;
if (!devTypeId) {
devTypeId = deviceTypeIdIphone5;
if (retina) {
if ([family isEqualToString:@"ipad"]) {
if (is64Bit) {
devTypeId = deviceTypeIdIpadAir;
} else {
devTypeId = deviceTypeIdIpadRetina;
}
} else {
if (isTallDevice) {
if (is64Bit) {
devTypeId = deviceTypeIdIphone5s;
} else {
devTypeId = deviceTypeIdIphone5;
}
} else {
devTypeId = deviceTypeIdIphone4s;
}
}
} else {
if ([family isEqualToString:@"ipad"]) {
devTypeId = deviceTypeIdIpad2;
} else {
devTypeId = deviceTypeIdIphone4s;
}
}
}
SimDeviceSet* deviceSet = [[self FindClassByName:@"SimDeviceSet"] defaultSet];
NSArray* devices = [deviceSet availableDevices];
for (SimDevice* device in devices) {
SimDeviceType* type = device.deviceType;
if ([type.identifier isEqualToString:devTypeId]) {
return device;
}
}
// Default to whatever is the first device
return [devices count] > 0 ? [devices objectAtIndex:0] : nil;
}
- (NSString*) changeDeviceType:(NSString *)family retina:(BOOL)retina isTallDevice:(BOOL)isTallDevice is64Bit:(BOOL)is64Bit {
NSString *devicePropertyValue;
if (retina) {
if (verbose) {
msgprintf(@"using retina");
}
if ([family isEqualToString:@"ipad"]) {
devicePropertyValue = deviceIpadRetina;
if (is64Bit) {
devicePropertyValue = deviceIpadRetina_64bit;
} else {
devicePropertyValue = deviceIpadRetina;
}
}
else {
if (isTallDevice) {
devicePropertyValue = deviceIphoneRetina4_0Inch;
if (is64Bit) {
devicePropertyValue = deviceIphoneRetina4_0Inch_64bit;
} else {
devicePropertyValue = deviceIphoneRetina4_0Inch;
}