forked from qt-creator/qt-creator
Merge commit origin/2.0 '1a985148340ff3b29c752036857446452cf0907f'
Conflicts: src/plugins/qmldesigner/settingspage.ui src/plugins/qt4projectmanager/qt-maemo/maemopackagecontents.cpp src/plugins/qt4projectmanager/qt-maemo/maemorunconfiguration.cpp src/plugins/qt4projectmanager/qt-s60/s60createpackagestep.cpp
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -53,8 +53,8 @@ Thumbs.db
|
||||
*.Release
|
||||
|
||||
# translation related:
|
||||
share/qtcreator/translations/extract-mimetypes.xq
|
||||
share/qtcreator/translations/extract-customwizards.xq
|
||||
share/qtcreator/translations/*_tr.h
|
||||
share/qtcreator/translations/qtcreator_untranslated.ts
|
||||
|
||||
# Directories to ignore
|
||||
# ---------------------
|
||||
|
||||
@@ -468,7 +468,7 @@
|
||||
\endlist
|
||||
|
||||
Certain actions in Qt Creator trigger a mode change. Clicking on
|
||||
\gui {Debug} > \gui {Start debugging} > \gui {Start debugging}
|
||||
\gui {Debug} > \gui {Start Debugging} > \gui {Start Debugging}
|
||||
automatically switches to \gui {Debug} mode.
|
||||
|
||||
|
||||
|
||||
87
share/qtcreator/translations/check-ts.pl
Executable file
87
share/qtcreator/translations/check-ts.pl
Executable file
@@ -0,0 +1,87 @@
|
||||
#! /usr/bin/perl -w
|
||||
#############################################################################
|
||||
##
|
||||
## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
||||
## All rights reserved.
|
||||
## Contact: Nokia Corporation (qt-info@nokia.com)
|
||||
##
|
||||
## This file is part of the translations module of the Qt Toolkit.
|
||||
##
|
||||
## $QT_BEGIN_LICENSE:LGPL$
|
||||
## 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.
|
||||
##
|
||||
##
|
||||
##
|
||||
##
|
||||
##
|
||||
##
|
||||
##
|
||||
##
|
||||
## $QT_END_LICENSE$
|
||||
##
|
||||
#############################################################################
|
||||
|
||||
|
||||
use strict;
|
||||
|
||||
my %scores = ();
|
||||
|
||||
my $files = join("\n", <*_??.ts>);
|
||||
my $res = `xmlpatterns -param files=\"$files\" check-ts.xq`;
|
||||
for my $i (split(/ /, $res)) {
|
||||
$i =~ /^(?:[^\/]+\/)*qtcreator_(..)\.ts:(.*)$/;
|
||||
my ($lang, $pc) = ($1, $2);
|
||||
$scores{$lang} = $pc;
|
||||
}
|
||||
|
||||
my $code = "";
|
||||
|
||||
for my $lang (sort(keys(%scores))) {
|
||||
my $pc = $scores{$lang};
|
||||
my $fail = "";
|
||||
if (int($pc) < 98) {
|
||||
$fail = " (excluded)";
|
||||
} else {
|
||||
$code .= " ".$lang;
|
||||
}
|
||||
printf "%-5s %3d%s\n", $lang, $pc, $fail;
|
||||
}
|
||||
|
||||
my $fn = "translations.pro";
|
||||
my $nfn = $fn."new";
|
||||
open IN, $fn or die;
|
||||
open OUT, ">".$nfn or die;
|
||||
while (1) {
|
||||
$_ = <IN>;
|
||||
last if (/^LANGUAGES /);
|
||||
print OUT $_;
|
||||
}
|
||||
while ($_ =~ /\\\n$/) {
|
||||
$_ = <IN>;
|
||||
}
|
||||
print OUT "LANGUAGES =".$code."\n";
|
||||
while (<IN>) {
|
||||
print OUT $_;
|
||||
}
|
||||
close OUT;
|
||||
close IN;
|
||||
rename $nfn, $fn;
|
||||
3
share/qtcreator/translations/check-ts.xq
Normal file
3
share/qtcreator/translations/check-ts.xq
Normal file
@@ -0,0 +1,3 @@
|
||||
for $file in tokenize($files, codepoints-to-string(10))
|
||||
let $fresh := doc($file)/TS/context/message[not (translation/@type = 'obsolete')]
|
||||
return concat($file, ":", count($fresh/translation[not (@type = 'unfinished')]) * 100 idiv count($fresh))
|
||||
@@ -1,9 +1,6 @@
|
||||
let $files := ( $$CUSTOMWIZARD_FILES )
|
||||
let $prefix := string(\"QT_TRANSLATE_NOOP("ProjectExplorer::CustomWizard", "\")
|
||||
let $suffix := concat(\"")\", codepoints-to-string(10))
|
||||
where empty($files)
|
||||
return
|
||||
for $file in $files
|
||||
let $prefix := string("QT_TRANSLATE_NOOP("ProjectExplorer::CustomWizard", "")
|
||||
let $suffix := concat("")", codepoints-to-string(10))
|
||||
for $file in tokenize($files, string("\|"))
|
||||
let $doc := doc($file)
|
||||
for $text in ($doc/*:wizard/*:description, $doc/*:wizard/*:displayname, $doc/*:wizard/*:displaycategory, $doc/*:wizard/*:fieldpagetitle, $doc/*:wizard/*:fields/*:field/*:fielddescription, $doc/*:wizard/*:fields/*:field/*:fieldcontrol/*:comboentries/*:comboentry/*:comboentrytext)
|
||||
return fn:concat($prefix, data($text), $suffix)
|
||||
5
share/qtcreator/translations/extract-mimetypes.xq
Normal file
5
share/qtcreator/translations/extract-mimetypes.xq
Normal file
@@ -0,0 +1,5 @@
|
||||
let $prefix := string("QT_TRANSLATE_NOOP("MimeType", "")
|
||||
let $suffix := concat("")", codepoints-to-string(10))
|
||||
for $file in tokenize($files, string("\|"))
|
||||
for $comment in doc($file)/*:mime-info/*:mime-type/*:comment
|
||||
return fn:concat($prefix, data($comment), $suffix)
|
||||
@@ -1,6 +0,0 @@
|
||||
let $files := ( $$MIMETYPES_FILES )
|
||||
let $prefix := string(\"QT_TRANSLATE_NOOP("MimeType", "\")
|
||||
let $suffix := concat(\"")\", codepoints-to-string(10))
|
||||
for $file in $files
|
||||
for $comment in doc($file)/*:mime-info/*:mime-type/*:comment
|
||||
return fn:concat($prefix, data($comment), $suffix)
|
||||
@@ -12,6 +12,7 @@ defineReplace(prependAll) {
|
||||
XMLPATTERNS = $$targetPath($$[QT_INSTALL_BINS]/xmlpatterns)
|
||||
LUPDATE = $$targetPath($$[QT_INSTALL_BINS]/lupdate) -locations relative -no-ui-lines -no-sort
|
||||
LRELEASE = $$targetPath($$[QT_INSTALL_BINS]/lrelease)
|
||||
LCONVERT = $$targetPath($$[QT_INSTALL_BINS]/lconvert)
|
||||
|
||||
TRANSLATIONS = $$prependAll(LANGUAGES, $$PWD/qtcreator_,.ts)
|
||||
|
||||
@@ -19,18 +20,54 @@ MIME_TR_H = $$OUT_PWD/mime_tr.h
|
||||
CUSTOMWIZARD_TR_H = $$OUT_PWD/customwizard_tr.h
|
||||
|
||||
for(dir, $$list($$files($$IDE_SOURCE_TREE/src/plugins/*))):MIMETYPES_FILES += $$files($$dir/*.mimetypes.xml)
|
||||
MIMETYPES_FILES = \"$$join(MIMETYPES_FILES, \", \")\"
|
||||
MIMETYPES_FILES = \"$$join(MIMETYPES_FILES, |)\"
|
||||
|
||||
for(dir, $$list($$files($$IDE_SOURCE_TREE/share/qtcreator/templates/wizards/*))):CUSTOMWIZARD_FILES += $$files($$dir/wizard.xml)
|
||||
CUSTOMWIZARD_FILES = \"$$join(CUSTOMWIZARD_FILES, \", \")\"
|
||||
CUSTOMWIZARD_FILES = \"$$join(CUSTOMWIZARD_FILES, |)\"
|
||||
|
||||
QMAKE_SUBSTITUTES += extract-mimetypes.xq.in
|
||||
QMAKE_SUBSTITUTES += extract-customwizards.xq.in
|
||||
ts.commands += \
|
||||
$$XMLPATTERNS -output $$MIME_TR_H $$PWD/extract-mimetypes.xq && \
|
||||
$$XMLPATTERNS -output $$CUSTOMWIZARD_TR_H $$PWD/extract-customwizards.xq && \
|
||||
(cd $$IDE_SOURCE_TREE && $$LUPDATE src share/qtcreator/qmldesigner $$MIME_TR_H $$CUSTOMWIZARD_TR_H -ts $$TRANSLATIONS) && \
|
||||
$$QMAKE_DEL_FILE $$MIME_TR_H
|
||||
extract.commands += \
|
||||
$$XMLPATTERNS -output $$MIME_TR_H -param files=$$MIMETYPES_FILES $$PWD/extract-mimetypes.xq $$escape_expand(\\n\\t) \
|
||||
$$XMLPATTERNS -output $$CUSTOMWIZARD_TR_H -param files=$$CUSTOMWIZARD_FILES $$PWD/extract-customwizards.xq
|
||||
QMAKE_EXTRA_TARGETS += extract
|
||||
|
||||
files = $$files($$PWD/*_??.ts) $$PWD/qtcreator_untranslated.ts
|
||||
for(file, files) {
|
||||
lang = $$replace(file, .*_(.*)\\.ts, \\1)
|
||||
v = ts-$${lang}.commands
|
||||
$$v = cd $$IDE_SOURCE_TREE && $$LUPDATE src share/qtcreator/qmldesigner $$MIME_TR_H $$CUSTOMWIZARD_TR_H -ts $$file
|
||||
v = ts-$${lang}.depends
|
||||
$$v = extract
|
||||
QMAKE_EXTRA_TARGETS += ts-$$lang
|
||||
}
|
||||
ts-all.commands = cd $$IDE_SOURCE_TREE && $$LUPDATE src share/qtcreator/qmldesigner $$MIME_TR_H $$CUSTOMWIZARD_TR_H -ts $$files
|
||||
ts-all.depends = extract
|
||||
QMAKE_EXTRA_TARGETS += ts-all
|
||||
|
||||
check-ts.commands = (cd $$PWD && perl check-ts.pl)
|
||||
check-ts.depends = ts-all
|
||||
QMAKE_EXTRA_TARGETS += check-ts
|
||||
|
||||
isEqual(QMAKE_DIR_SEP, /) {
|
||||
commit-ts.commands = \
|
||||
cd $$IDE_SOURCE_TREE; \
|
||||
for f in `git diff-files --name-only share/qtcreator/translations/*_??.ts`; do \
|
||||
$$LCONVERT -locations none -i \$\$f -o \$\$f; \
|
||||
done; \
|
||||
git add share/qtcreator/translations/*_??.ts && git commit
|
||||
} else {
|
||||
wd = $$replace(IDE_SOURCE_TREE, /, \\)
|
||||
commit-ts.commands = \
|
||||
cd $$wd && \
|
||||
for /f usebackq %%f in (`git diff-files --name-only share/qtcreator/translations/*_??.ts`) do \
|
||||
$$LCONVERT -locations none -i %%f -o %%f $$escape_expand(\\n\\t) \
|
||||
cd $$wd && git add share/qtcreator/translations/*_??.ts && git commit
|
||||
}
|
||||
QMAKE_EXTRA_TARGETS += commit-ts
|
||||
|
||||
ts.commands = \
|
||||
@echo \"The \'ts\' target has been removed in favor of more fine-grained targets.\" && \
|
||||
echo \"Use \'ts-<lang>\' instead. To add a language, use \'ts-untranslated\',\" && \
|
||||
echo \"rename the file and re-run \'qmake\'.\"
|
||||
QMAKE_EXTRA_TARGETS += ts
|
||||
|
||||
TEMPLATE = app
|
||||
|
||||
@@ -215,13 +215,12 @@ public:
|
||||
&& file.open(QIODevice::ReadOnly)) {
|
||||
m_fileName = fileName;
|
||||
qint64 maxRange = 64 * 1024 * 1024;
|
||||
if (file.size() <= maxRange) {
|
||||
if (file.size() <= maxRange)
|
||||
m_editor->setData(file.readAll());
|
||||
} else {
|
||||
else
|
||||
m_editor->setLazyData(offset, maxRange);
|
||||
m_editor->editorInterface()->
|
||||
setDisplayName(QFileInfo(fileName).fileName());
|
||||
}
|
||||
m_editor->editorInterface()->
|
||||
setDisplayName(QFileInfo(fileName).fileName());
|
||||
file.close();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -99,6 +99,7 @@ private:
|
||||
#else
|
||||
QTextCodec *m_outputCodec;
|
||||
QTextCodec::ConverterState m_outputCodecState;
|
||||
QTextCodec::ConverterState m_errorCodecState;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
@@ -151,7 +151,7 @@ void ApplicationLauncher::readStandardError()
|
||||
{
|
||||
QByteArray data = m_guiProcess->readAllStandardError();
|
||||
emit appendOutput(m_outputCodec->toUnicode(
|
||||
data.constData(), data.length(), &m_outputCodecState),
|
||||
data.constData(), data.length(), &m_errorCodecState),
|
||||
true);
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ DesignerSettings SettingsPageWidget::settings() const
|
||||
DesignerSettings ds;
|
||||
ds.itemSpacing = m_ui.spinItemSpacing->value();
|
||||
ds.snapMargin = m_ui.spinSnapMargin->value();
|
||||
ds.enableContextPane = m_ui.textEditHelperCheckBox->isChecked();
|
||||
ds.enableContextPane = false;
|
||||
return ds;
|
||||
}
|
||||
|
||||
@@ -57,7 +57,6 @@ void SettingsPageWidget::setSettings(const DesignerSettings &s)
|
||||
{
|
||||
m_ui.spinItemSpacing->setValue(s.itemSpacing);
|
||||
m_ui.spinSnapMargin->setValue(s.snapMargin);
|
||||
m_ui.textEditHelperCheckBox->setChecked(s.enableContextPane);
|
||||
}
|
||||
|
||||
QString SettingsPageWidget::searchKeywords() const
|
||||
|
||||
@@ -110,7 +110,7 @@ MaemoDeviceConfig::MaemoDeviceConfig(const QSettings &settings,
|
||||
: name(settings.value(NameKey).toString()),
|
||||
type(static_cast<DeviceType>(settings.value(TypeKey, DefaultDeviceType).toInt())),
|
||||
gdbServerPort(settings.value(GdbServerPortKey, defaultGdbServerPort(type)).toInt()),
|
||||
internalId(settings.value(InternalIdKey, nextId).toInt())
|
||||
internalId(settings.value(InternalIdKey, nextId).toULongLong())
|
||||
{
|
||||
if (internalId == nextId)
|
||||
++nextId;
|
||||
@@ -222,7 +222,7 @@ MaemoDeviceConfig MaemoDeviceConfigurations::find(const QString &name) const
|
||||
return resultIt == m_devConfigs.constEnd() ? MaemoDeviceConfig() : *resultIt;
|
||||
}
|
||||
|
||||
MaemoDeviceConfig MaemoDeviceConfigurations::find(int id) const
|
||||
MaemoDeviceConfig MaemoDeviceConfigurations::find(quint64 id) const
|
||||
{
|
||||
QList<MaemoDeviceConfig>::ConstIterator resultIt =
|
||||
std::find_if(m_devConfigs.constBegin(), m_devConfigs.constEnd(),
|
||||
|
||||
@@ -96,7 +96,7 @@ public:
|
||||
QList<MaemoDeviceConfig> devConfigs() const { return m_devConfigs; }
|
||||
void setDevConfigs(const QList<MaemoDeviceConfig> &devConfigs);
|
||||
MaemoDeviceConfig find(const QString &name) const;
|
||||
MaemoDeviceConfig find(int id) const;
|
||||
MaemoDeviceConfig find(quint64 id) const;
|
||||
|
||||
signals:
|
||||
void updated();
|
||||
|
||||
@@ -144,9 +144,16 @@ bool MaemoPackageCreationStep::createPackage()
|
||||
colon = QLatin1String(";");
|
||||
env.insert(key, path % QLatin1String("bin") % colon % env.value(key));
|
||||
#endif
|
||||
|
||||
env.insert(key, targetRoot() % "/bin" % colon % env.value(key));
|
||||
env.insert(key, path % QLatin1String("madbin") % colon % env.value(key));
|
||||
env.insert(QLatin1String("PERL5LIB"), path % QLatin1String("madlib/perl5"));
|
||||
|
||||
QString perlLib = QDir::fromNativeSeparators(path % QLatin1String("madlib/perl5"));
|
||||
#ifdef Q_OS_WIN
|
||||
perlLib = perlLib.remove(QLatin1Char(':'));
|
||||
perlLib = perlLib.prepend(QLatin1Char('/'));
|
||||
#endif
|
||||
env.insert(QLatin1String("PERL5LIB"), perlLib);
|
||||
|
||||
const QString buildDir = buildDirectory();
|
||||
env.insert(QLatin1String("PWD"), buildDir);
|
||||
|
||||
@@ -109,6 +109,10 @@ QemuRuntimeManager::QemuRuntimeManager(QObject *parent)
|
||||
SLOT(qemuProcessError(QProcess::ProcessError)));
|
||||
connect(m_qemuProcess, SIGNAL(finished(int, QProcess::ExitStatus)), this,
|
||||
SLOT(qemuProcessFinished()));
|
||||
connect(m_qemuProcess, SIGNAL(readyReadStandardOutput()), this,
|
||||
SLOT(qemuOutput()));
|
||||
connect(m_qemuProcess, SIGNAL(readyReadStandardError()), this,
|
||||
SLOT(qemuOutput()));
|
||||
connect(this, SIGNAL(qemuProcessStatus(QemuStatus, QString)),
|
||||
this, SLOT(qemuStatusChanged(QemuStatus, QString)));
|
||||
}
|
||||
@@ -290,7 +294,7 @@ void QemuRuntimeManager::runConfigurationRemoved(ProjectExplorer::RunConfigurati
|
||||
void QemuRuntimeManager::runConfigurationChanged(ProjectExplorer::RunConfiguration *rc)
|
||||
{
|
||||
if (rc)
|
||||
m_qemuAction->setEnabled(targetUsesRuntimeConfig(rc->target()));
|
||||
m_qemuAction->setEnabled(targetUsesMatchingRuntimeConfig(rc->target()));
|
||||
}
|
||||
|
||||
void QemuRuntimeManager::buildConfigurationAdded(ProjectExplorer::BuildConfiguration *bc)
|
||||
@@ -326,7 +330,7 @@ void QemuRuntimeManager::environmentChanged()
|
||||
|
||||
void QemuRuntimeManager::deviceConfigurationChanged(ProjectExplorer::Target *target)
|
||||
{
|
||||
m_qemuAction->setEnabled(targetUsesRuntimeConfig(target));
|
||||
m_qemuAction->setEnabled(targetUsesMatchingRuntimeConfig(target));
|
||||
}
|
||||
|
||||
void QemuRuntimeManager::startRuntime()
|
||||
@@ -335,52 +339,52 @@ void QemuRuntimeManager::startRuntime()
|
||||
Project *p = ProjectExplorerPlugin::instance()->session()->startupProject();
|
||||
if (!p)
|
||||
return;
|
||||
|
||||
Qt4Target *qt4Target = qobject_cast<Qt4Target*> (p->activeTarget());
|
||||
if (!qt4Target)
|
||||
QtVersion *version;
|
||||
if (!targetUsesMatchingRuntimeConfig(p->activeTarget(), &version)) {
|
||||
qWarning("Strange: Qemu button was enabled, but target does not match.");
|
||||
return;
|
||||
}
|
||||
|
||||
Qt4BuildConfiguration *bc = qt4Target->activeBuildConfiguration();
|
||||
if (!bc)
|
||||
return;
|
||||
|
||||
QtVersion *version = bc->qtVersion();
|
||||
if (version && m_runtimes.contains(version->uniqueId())) {
|
||||
m_runningQtId = version->uniqueId();
|
||||
const QString root =
|
||||
QDir::toNativeSeparators(maddeRoot(version->qmakeCommand())
|
||||
m_runningQtId = version->uniqueId();
|
||||
const QString root
|
||||
= QDir::toNativeSeparators(maddeRoot(version->qmakeCommand())
|
||||
+ QLatin1Char('/'));
|
||||
const Runtime rt = m_runtimes.value(version->uniqueId());
|
||||
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
|
||||
const Runtime rt = m_runtimes.value(version->uniqueId());
|
||||
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
|
||||
#ifdef Q_OS_WIN
|
||||
const QLatin1Char colon(';');
|
||||
const QLatin1String key("PATH");
|
||||
env.insert(key, env.value(key) % colon % root % QLatin1String("bin"));
|
||||
env.insert(key, env.value(key) % colon % root % QLatin1String("madlib"));
|
||||
const QLatin1Char colon(';');
|
||||
const QLatin1String key("PATH");
|
||||
env.insert(key, env.value(key) % colon % root % QLatin1String("bin"));
|
||||
env.insert(key, env.value(key) % colon % root % QLatin1String("madlib"));
|
||||
#elif defined(Q_OS_UNIX)
|
||||
const QLatin1String key("LD_LIBRARY_PATH");
|
||||
env.insert(key, env.value(key) % QLatin1Char(':') % rt.m_libPath);
|
||||
const QLatin1String key("LD_LIBRARY_PATH");
|
||||
env.insert(key, env.value(key) % QLatin1Char(':') % rt.m_libPath);
|
||||
#endif
|
||||
m_qemuProcess->setProcessEnvironment(env);
|
||||
m_qemuProcess->setWorkingDirectory(rt.m_root);
|
||||
m_qemuProcess->setProcessEnvironment(env);
|
||||
m_qemuProcess->setWorkingDirectory(rt.m_root);
|
||||
|
||||
const QString app = root + (QFileInfo(rt.m_bin).isRelative()
|
||||
// This is complex because of extreme MADDE weirdness.
|
||||
const bool pathIsRelative = QFileInfo(rt.m_bin).isRelative();
|
||||
const QString app =
|
||||
#ifdef Q_OS_WIN
|
||||
root % (pathIsRelative
|
||||
? QLatin1String("madlib/") % rt.m_bin // Fremantle.
|
||||
: rt.m_bin) // Haramattan.
|
||||
#ifdef Q_OS_WIN
|
||||
% QLatin1String(".exe")
|
||||
% QLatin1String(".exe");
|
||||
#else
|
||||
pathIsRelative
|
||||
? root % QLatin1String("madlib/") % rt.m_bin // Fremantle.
|
||||
: rt.m_bin; // Haramattan.
|
||||
#endif
|
||||
; // keep
|
||||
|
||||
m_qemuProcess->start(app % QLatin1Char(' ') % rt.m_args,
|
||||
QIODevice::ReadWrite);
|
||||
if (!m_qemuProcess->waitForStarted())
|
||||
return;
|
||||
m_qemuProcess->start(app % QLatin1Char(' ') % rt.m_args,
|
||||
QIODevice::ReadWrite);
|
||||
if (!m_qemuProcess->waitForStarted())
|
||||
return;
|
||||
|
||||
emit qemuProcessStatus(QemuStarting);
|
||||
connect(m_qemuAction, SIGNAL(triggered()), this, SLOT(terminateRuntime()));
|
||||
disconnect(m_qemuAction, SIGNAL(triggered()), this, SLOT(startRuntime()));
|
||||
}
|
||||
emit qemuProcessStatus(QemuStarting);
|
||||
connect(m_qemuAction, SIGNAL(triggered()), this, SLOT(terminateRuntime()));
|
||||
disconnect(m_qemuAction, SIGNAL(triggered()), this, SLOT(startRuntime()));
|
||||
}
|
||||
|
||||
void QemuRuntimeManager::terminateRuntime()
|
||||
@@ -400,14 +404,20 @@ void QemuRuntimeManager::qemuProcessFinished()
|
||||
{
|
||||
m_runningQtId = -1;
|
||||
QemuStatus status = QemuFinished;
|
||||
QString error;
|
||||
|
||||
if (!m_userTerminated) {
|
||||
status = m_qemuProcess->exitStatus() == QProcess::CrashExit
|
||||
? QemuCrashed : QemuFinished;
|
||||
if (m_qemuProcess->exitStatus() == QProcess::CrashExit) {
|
||||
status = QemuCrashed;
|
||||
error = m_qemuProcess->errorString();
|
||||
} else if (m_qemuProcess->exitCode() != 0) {
|
||||
error = tr("Qemu finished with error: Exit code was %1.")
|
||||
.arg(m_qemuProcess->exitCode());
|
||||
}
|
||||
}
|
||||
|
||||
m_userTerminated = false;
|
||||
emit qemuProcessStatus(status);
|
||||
emit qemuProcessStatus(status, error);
|
||||
}
|
||||
|
||||
void QemuRuntimeManager::qemuProcessError(QProcess::ProcessError error)
|
||||
@@ -432,6 +442,7 @@ void QemuRuntimeManager::qemuStatusChanged(QemuStatus status, const QString &err
|
||||
message = tr("Qemu crashed");
|
||||
break;
|
||||
case QemuFinished:
|
||||
message = error;
|
||||
break;
|
||||
case QemuUserReason:
|
||||
message = error;
|
||||
@@ -445,6 +456,12 @@ void QemuRuntimeManager::qemuStatusChanged(QemuStatus status, const QString &err
|
||||
updateStarterIcon(running);
|
||||
}
|
||||
|
||||
void QemuRuntimeManager::qemuOutput()
|
||||
{
|
||||
qDebug("%s", m_qemuProcess->readAllStandardOutput().data());
|
||||
qDebug("%s", m_qemuProcess->readAllStandardError().data());
|
||||
}
|
||||
|
||||
// -- private
|
||||
|
||||
void QemuRuntimeManager::setupRuntimes()
|
||||
@@ -497,7 +514,7 @@ void QemuRuntimeManager::toggleStarterButton(Target *target)
|
||||
isRunning = false;
|
||||
|
||||
m_qemuAction->setEnabled(m_runtimes.contains(uniqueId)
|
||||
&& targetUsesRuntimeConfig(target) && !isRunning);
|
||||
&& targetUsesMatchingRuntimeConfig(target) && !isRunning);
|
||||
}
|
||||
|
||||
bool QemuRuntimeManager::sessionHasMaemoTarget() const
|
||||
@@ -510,19 +527,28 @@ bool QemuRuntimeManager::sessionHasMaemoTarget() const
|
||||
return result;
|
||||
}
|
||||
|
||||
bool QemuRuntimeManager::targetUsesRuntimeConfig(Target *target)
|
||||
bool QemuRuntimeManager::targetUsesMatchingRuntimeConfig(Target *target,
|
||||
QtVersion **qtVersion)
|
||||
{
|
||||
if (!target)
|
||||
return false;
|
||||
|
||||
MaemoRunConfiguration *mrc =
|
||||
qobject_cast<MaemoRunConfiguration *> (target->activeRunConfiguration());
|
||||
if (mrc) {
|
||||
const MaemoDeviceConfig &config = mrc->deviceConfig();
|
||||
if (config.isValid() && config.type == MaemoDeviceConfig::Simulator)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
if (!mrc)
|
||||
return false;
|
||||
Qt4BuildConfiguration *bc
|
||||
= qobject_cast<Qt4BuildConfiguration *>(target->activeBuildConfiguration());
|
||||
if (!bc)
|
||||
return false;
|
||||
QtVersion *version = bc->qtVersion();
|
||||
if (!version || !m_runtimes.contains(version->uniqueId()))
|
||||
return false;
|
||||
|
||||
if (qtVersion)
|
||||
*qtVersion = version;
|
||||
const MaemoDeviceConfig &config = mrc->deviceConfig();
|
||||
return config.isValid() && config.type == MaemoDeviceConfig::Simulator;
|
||||
}
|
||||
|
||||
QString QemuRuntimeManager::maddeRoot(const QString &qmake) const
|
||||
|
||||
@@ -107,6 +107,7 @@ private slots:
|
||||
void qemuProcessFinished();
|
||||
void qemuProcessError(QProcess::ProcessError error);
|
||||
void qemuStatusChanged(QemuStatus status, const QString &error);
|
||||
void qemuOutput();
|
||||
|
||||
private:
|
||||
QemuRuntimeManager(QObject *parent);
|
||||
@@ -117,7 +118,8 @@ private:
|
||||
|
||||
void updateStarterIcon(bool running);
|
||||
void toggleStarterButton(ProjectExplorer::Target *target);
|
||||
bool targetUsesRuntimeConfig(ProjectExplorer::Target *target);
|
||||
bool targetUsesMatchingRuntimeConfig(ProjectExplorer::Target *target,
|
||||
QtVersion **qtVersion = 0);
|
||||
|
||||
QString maddeRoot(const QString &qmake) const;
|
||||
QString targetRoot(const QString &qmake) const;
|
||||
|
||||
Reference in New Issue
Block a user