forked from qt-creator/qt-creator
Merge branch '2.6'
Conflicts: src/libs/utils/consoleprocess_unix.cpp Change-Id: I196f61e882bfce94e165d9c724bffee9df1011b7
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
include(qtcreator.pri)
|
||||
|
||||
#version check qt
|
||||
!minQtVersion(4, 7, 4) {
|
||||
!minQtVersion(4, 8, 0) {
|
||||
message("Cannot build Qt Creator with Qt version $${QT_VERSION}.")
|
||||
error("Use at least Qt 4.7.4.")
|
||||
error("Use at least Qt 4.8.0.")
|
||||
}
|
||||
|
||||
include(doc/doc.pri)
|
||||
@@ -32,7 +32,7 @@ macx {
|
||||
deployqt.commands ~= s,/,\\\\,g
|
||||
deployartifacts.depends = install
|
||||
PLATFORM="windows"
|
||||
deployartifacts.commands = git clone "git://gitorious.org/qt-creator/binary-artifacts.git"&& xcopy /s /q /y /i "binary-artifacts\\win32" $(INSTALL_ROOT)&& rmdir /s binary-artifacts
|
||||
deployartifacts.commands = git clone "git://gitorious.org/qt-creator/binary-artifacts.git"&& xcopy /s /q /y /i "binary-artifacts\\win32" $(INSTALL_ROOT)&& rmdir /s /q binary-artifacts
|
||||
QMAKE_EXTRA_TARGETS += deployartifacts
|
||||
}
|
||||
else:linux-*:PLATFORM="linux-$${QT_ARCH}"
|
||||
|
@@ -1472,7 +1472,10 @@ class Dumper:
|
||||
self.putType(typeName)
|
||||
self.putNumChild(1)
|
||||
format = self.currentItemFormat()
|
||||
if format == 0:
|
||||
if format == None and str(targetType.unqualified()) == "char":
|
||||
# Use Latin1 as default for char [].
|
||||
self.putValue(encodeCharArray(value), Hex2EncodedLatin1)
|
||||
elif format == 0:
|
||||
# Explicitly requested Latin1 formatting.
|
||||
self.putValue(encodeCharArray(value), Hex2EncodedLatin1)
|
||||
elif format == 1:
|
||||
|
2
src/libs/3rdparty/botan/botan.pri
vendored
2
src/libs/3rdparty/botan/botan.pri
vendored
@@ -1,2 +1,2 @@
|
||||
INCLUDEPATH *= $$PWD/..
|
||||
LIBS += -lBotan # Don't use qtLibraryName. Botan is always built in release mode.
|
||||
LIBS *= -l$$qtLibraryName(Botan)
|
||||
|
7
src/libs/3rdparty/botan/botan.pro
vendored
7
src/libs/3rdparty/botan/botan.pro
vendored
@@ -3,15 +3,12 @@ TARGET = Botan
|
||||
|
||||
PRECOMPILED_HEADER = ../precompiled_headers/botan_pch.h
|
||||
|
||||
QT =
|
||||
|
||||
CONFIG += exceptions
|
||||
CONFIG += release
|
||||
CONFIG -= debug debug_and_release
|
||||
|
||||
include(../../../qtcreatorlibrary.pri)
|
||||
|
||||
DEPENDPATH += .
|
||||
INCLUDEPATH += . $$[QT_INSTALL_HEADERS] $$[QT_INSTALL_HEADERS]/QtCore
|
||||
INCLUDEPATH += .
|
||||
|
||||
DEFINES += BOTAN_DLL=Q_DECL_EXPORT
|
||||
unix:DEFINES += BOTAN_TARGET_OS_HAS_GETTIMEOFDAY BOTAN_HAS_ALLOC_MMAP \
|
||||
|
22
src/libs/3rdparty/cplusplus/Keywords.cpp
vendored
22
src/libs/3rdparty/cplusplus/Keywords.cpp
vendored
@@ -424,19 +424,6 @@ static inline int classify6(const char *s, bool q, bool) {
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (q && s[0] == 'Q') {
|
||||
if (s[1] == '_') {
|
||||
if (s[2] == 'E') {
|
||||
if (s[3] == 'M') {
|
||||
if (s[4] == 'I') {
|
||||
if (s[5] == 'T') {
|
||||
return T_Q_EMIT;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (s[0] == 'r') {
|
||||
if (s[1] == 'e') {
|
||||
if (s[2] == 't') {
|
||||
@@ -545,6 +532,15 @@ static inline int classify6(const char *s, bool q, bool) {
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (s[2] == 'E') {
|
||||
if (s[3] == 'M') {
|
||||
if (s[4] == 'I') {
|
||||
if (s[5] == 'T') {
|
||||
return T_Q_EMIT;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return T_IDENTIFIER;
|
||||
|
@@ -626,24 +626,14 @@ ClassOrNamespace *ClassOrNamespace::nestedType(const Name *name, ClassOrNamespac
|
||||
// are templates. We need to collect them now. First, we track the bases which are already
|
||||
// part of the binding so we can identify the missings ones later.
|
||||
|
||||
QSet<const Name *> knownBases;
|
||||
foreach (ClassOrNamespace *con, reference->usings()) {
|
||||
foreach (Symbol *s, con->symbols()) {
|
||||
if (Class *c = s->asClass()) {
|
||||
knownBases.insert(c->name());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Class *referenceClass = 0;
|
||||
QList<const Name *> missingBases;
|
||||
QList<const Name *> allBases;
|
||||
foreach (Symbol *s, reference->symbols()) {
|
||||
if (Class *clazz = s->asClass()) {
|
||||
for (unsigned i = 0; i < clazz->baseClassCount(); ++i) {
|
||||
BaseClass *baseClass = clazz->baseClassAt(i);
|
||||
if (baseClass->name() && !knownBases.contains(baseClass->name()))
|
||||
missingBases.append(baseClass->name());
|
||||
if (baseClass->name())
|
||||
allBases.append(baseClass->name());
|
||||
}
|
||||
referenceClass = clazz;
|
||||
break;
|
||||
@@ -653,6 +643,8 @@ ClassOrNamespace *ClassOrNamespace::nestedType(const Name *name, ClassOrNamespac
|
||||
if (!referenceClass)
|
||||
return reference;
|
||||
|
||||
QSet<ClassOrNamespace *> knownUsings = reference->usings().toSet();
|
||||
|
||||
// If we are dealling with a template type, more work is required, since we need to
|
||||
// construct all instantiation data.
|
||||
if (const TemplateNameId *templId = name->asTemplateNameId()) {
|
||||
@@ -673,7 +665,7 @@ ClassOrNamespace *ClassOrNamespace::nestedType(const Name *name, ClassOrNamespac
|
||||
for (unsigned i = 0; i < templ->templateParameterCount(); ++i)
|
||||
templParams.insert(templ->templateParameterAt(i)->name(), i);
|
||||
|
||||
foreach (const Name *baseName, missingBases) {
|
||||
foreach (const Name *baseName, allBases) {
|
||||
ClassOrNamespace *baseBinding = 0;
|
||||
|
||||
if (const Identifier *nameId = baseName->asNameId()) {
|
||||
@@ -721,7 +713,7 @@ ClassOrNamespace *ClassOrNamespace::nestedType(const Name *name, ClassOrNamespac
|
||||
}
|
||||
}
|
||||
|
||||
if (baseBinding)
|
||||
if (baseBinding && !knownUsings.contains(baseBinding))
|
||||
instantiation->addUsing(baseBinding);
|
||||
}
|
||||
}
|
||||
@@ -731,7 +723,7 @@ ClassOrNamespace *ClassOrNamespace::nestedType(const Name *name, ClassOrNamespac
|
||||
|
||||
// Find the missing bases for regular (non-template) types.
|
||||
// Ex.: class A : public B<Some>::Type {};
|
||||
foreach (const Name *baseName, missingBases) {
|
||||
foreach (const Name *baseName, allBases) {
|
||||
ClassOrNamespace *binding = this;
|
||||
if (const QualifiedNameId *qBaseName = baseName->asQualifiedNameId()) {
|
||||
if (const Name *qualification = qBaseName->base())
|
||||
@@ -741,7 +733,7 @@ ClassOrNamespace *ClassOrNamespace::nestedType(const Name *name, ClassOrNamespac
|
||||
|
||||
if (binding) {
|
||||
ClassOrNamespace * baseBinding = binding->lookupType(baseName);
|
||||
if (baseBinding)
|
||||
if (baseBinding && !knownUsings.contains(baseBinding))
|
||||
reference->addUsing(baseBinding);
|
||||
}
|
||||
}
|
||||
|
@@ -1417,9 +1417,9 @@ void Preprocessor::handlePreprocessorDirective(PPToken *tk)
|
||||
handleElseDirective(tk, poundToken);
|
||||
else if (directive == ppElif)
|
||||
handleElifDirective(tk, poundToken);
|
||||
|
||||
skipPreprocesorDirective(tk);
|
||||
}
|
||||
|
||||
skipPreprocesorDirective(tk);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -87,6 +87,7 @@ public:
|
||||
#else
|
||||
void setSettings(QSettings *settings);
|
||||
static QString defaultTerminalEmulator();
|
||||
static QStringList availableTerminalEmulators();
|
||||
static QString terminalEmulator(const QSettings *settings);
|
||||
static void setTerminalEmulator(QSettings *settings, const QString &term);
|
||||
#endif
|
||||
|
@@ -281,19 +281,69 @@ void ConsoleProcess::stubExited()
|
||||
emit wrapperStopped();
|
||||
}
|
||||
|
||||
struct Terminal {
|
||||
const char *binary;
|
||||
const char *options;
|
||||
};
|
||||
|
||||
static const Terminal knownTerminals[] =
|
||||
{
|
||||
{"xterm", "-e"},
|
||||
{"aterm", "-e"},
|
||||
{"Eterm", "-e"},
|
||||
{"rxvt", "-e"},
|
||||
{"urxvt", "-e"},
|
||||
{"xfce4-terminal", "-x"},
|
||||
{"konsole", "--nofork -e"},
|
||||
{"gnome-terminal", "-x"}
|
||||
};
|
||||
|
||||
QString ConsoleProcess::defaultTerminalEmulator()
|
||||
{
|
||||
if (Utils::HostOsInfo::isMacHost())
|
||||
return QLatin1String("/usr/X11/bin/xterm");
|
||||
return QLatin1String("xterm");
|
||||
|
||||
const Environment env = Environment::systemEnvironment();
|
||||
const int terminalCount = int(sizeof(knownTerminals) / sizeof(knownTerminals[0]));
|
||||
for (int i = 0; i < terminalCount; ++i) {
|
||||
QString result = env.searchInPath(QLatin1String(knownTerminals[i].binary));
|
||||
if (!result.isEmpty()) {
|
||||
result += QLatin1Char(' ');
|
||||
result += QLatin1String(knownTerminals[i].options);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
return QLatin1String("xterm -e");
|
||||
}
|
||||
|
||||
QStringList ConsoleProcess::availableTerminalEmulators()
|
||||
{
|
||||
if (Utils::HostOsInfo::isMacHost())
|
||||
return QStringList(defaultTerminalEmulator());
|
||||
|
||||
QStringList result;
|
||||
const Environment env = Environment::systemEnvironment();
|
||||
const int terminalCount = int(sizeof(knownTerminals) / sizeof(knownTerminals[0]));
|
||||
for (int i = 0; i < terminalCount; ++i) {
|
||||
QString terminal = env.searchInPath(QLatin1String(knownTerminals[i].binary));
|
||||
if (!terminal.isEmpty()) {
|
||||
terminal += QLatin1Char(' ');
|
||||
terminal += QLatin1String(knownTerminals[i].options);
|
||||
result.push_back(terminal);
|
||||
}
|
||||
}
|
||||
result.sort();
|
||||
return result;
|
||||
}
|
||||
|
||||
QString ConsoleProcess::terminalEmulator(const QSettings *settings)
|
||||
{
|
||||
const QString dflt = defaultTerminalEmulator() + QLatin1String(" -e");
|
||||
if (!settings)
|
||||
return dflt;
|
||||
return settings->value(QLatin1String("General/TerminalEmulator"), dflt).toString();
|
||||
if (settings) {
|
||||
const QString value = settings->value(QLatin1String("General/TerminalEmulator")).toString();
|
||||
if (!value.isEmpty())
|
||||
return value;
|
||||
}
|
||||
return defaultTerminalEmulator();
|
||||
}
|
||||
|
||||
void ConsoleProcess::setTerminalEmulator(QSettings *settings, const QString &term)
|
||||
|
@@ -50,7 +50,7 @@ static QSettings *theSettings = 0;
|
||||
class HistoryCompleterPrivate : public QAbstractListModel
|
||||
{
|
||||
public:
|
||||
HistoryCompleterPrivate() : maxLines(30) {}
|
||||
HistoryCompleterPrivate() : maxLines(30), lineEdit(0) {}
|
||||
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
|
||||
@@ -62,6 +62,7 @@ public:
|
||||
QStringList list;
|
||||
QString historyKey;
|
||||
int maxLines;
|
||||
QLineEdit *lineEdit;
|
||||
};
|
||||
|
||||
class HistoryLineDelegate : public QItemDelegate
|
||||
@@ -166,12 +167,15 @@ HistoryCompleter::HistoryCompleter(QLineEdit *lineEdit, const QString &historyKe
|
||||
|
||||
d->historyKey = QLatin1String("CompleterHistory/") + historyKey;
|
||||
d->list = theSettings->value(d->historyKey).toStringList();
|
||||
d->lineEdit = lineEdit;
|
||||
if (d->list.count())
|
||||
lineEdit->setText(d->list.at(0));
|
||||
|
||||
setModel(d);
|
||||
setPopup(new HistoryLineView(d));
|
||||
lineEdit->installEventFilter(this);
|
||||
|
||||
connect(lineEdit, SIGNAL(editingFinished()), this, SLOT(saveHistory()));
|
||||
}
|
||||
|
||||
HistoryCompleter::~HistoryCompleter()
|
||||
@@ -181,9 +185,9 @@ HistoryCompleter::~HistoryCompleter()
|
||||
|
||||
bool HistoryCompleter::eventFilter(QObject *obj, QEvent *event)
|
||||
{
|
||||
if (event->type() == QEvent::KeyPress &&
|
||||
static_cast<QKeyEvent *>(event)->key() == Qt::Key_Down &&
|
||||
static_cast<QLineEdit *>(widget())->text().isEmpty()) {
|
||||
if (event->type() == QEvent::KeyPress
|
||||
&& static_cast<QKeyEvent *>(event)->key() == Qt::Key_Down
|
||||
&& !popup()->isVisible()) {
|
||||
setCompletionPrefix(QString());
|
||||
complete();
|
||||
}
|
||||
@@ -212,7 +216,7 @@ void HistoryCompleter::clearHistory()
|
||||
|
||||
void HistoryCompleter::saveHistory()
|
||||
{
|
||||
d->saveEntry(completionPrefix());
|
||||
d->saveEntry(d->lineEdit->text());
|
||||
}
|
||||
|
||||
void HistoryCompleter::setSettings(QSettings *settings)
|
||||
|
@@ -154,6 +154,12 @@ int main(int argc, char *argv[])
|
||||
env[count] = 0;
|
||||
}
|
||||
|
||||
|
||||
/* Ignore SIGTTOU. Without this, calling tcsetpgrp() from a background
|
||||
* process group (in which we will be, once as child and once as parent)
|
||||
* generates the mentioned signal and stops the concerned process. */
|
||||
signal(SIGTTOU, SIG_IGN);
|
||||
|
||||
/* Create execution result notification pipe. */
|
||||
if (pipe(chldPipe)) {
|
||||
perror("Cannot create status pipe");
|
||||
|
@@ -113,10 +113,13 @@ QWidget *GeneralSettings::createPage(QWidget *parent)
|
||||
m_page->colorButton->setColor(StyleHelper::requestedBaseColor());
|
||||
m_page->reloadBehavior->setCurrentIndex(EditorManager::instance()->reloadSetting());
|
||||
#ifdef Q_OS_UNIX
|
||||
m_page->terminalEdit->setText(ConsoleProcess::terminalEmulator(settings));
|
||||
const QStringList availableTerminals = ConsoleProcess::availableTerminalEmulators();
|
||||
const QString currentTerminal = ConsoleProcess::terminalEmulator(settings);
|
||||
m_page->terminalComboBox->addItems(availableTerminals);
|
||||
m_page->terminalComboBox->lineEdit()->setText(currentTerminal);
|
||||
#else
|
||||
m_page->terminalLabel->hide();
|
||||
m_page->terminalEdit->hide();
|
||||
m_page->terminalComboBox->hide();
|
||||
m_page->resetTerminalButton->hide();
|
||||
#endif
|
||||
|
||||
@@ -175,7 +178,7 @@ void GeneralSettings::apply()
|
||||
EditorManager::instance()->setReloadSetting(IDocument::ReloadSetting(m_page->reloadBehavior->currentIndex()));
|
||||
#ifdef Q_OS_UNIX
|
||||
ConsoleProcess::setTerminalEmulator(Core::ICore::settings(),
|
||||
m_page->terminalEdit->text());
|
||||
m_page->terminalComboBox->lineEdit()->text());
|
||||
#ifndef Q_OS_MAC
|
||||
Utils::UnixUtils::setFileBrowser(Core::ICore::settings(), m_page->externalFileBrowserEdit->text());
|
||||
#endif
|
||||
@@ -200,7 +203,7 @@ void GeneralSettings::resetInterfaceColor()
|
||||
void GeneralSettings::resetTerminal()
|
||||
{
|
||||
#if defined(Q_OS_UNIX)
|
||||
m_page->terminalEdit->setText(ConsoleProcess::defaultTerminalEmulator() + QLatin1String(" -e"));
|
||||
m_page->terminalComboBox->lineEdit()->setText(ConsoleProcess::defaultTerminalEmulator());
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@@ -124,7 +124,11 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="terminalEdit"/>
|
||||
<widget class="QComboBox" name="terminalComboBox">
|
||||
<property name="editable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="externalFileBrowserLabel">
|
||||
@@ -305,7 +309,7 @@
|
||||
<tabstop>colorButton</tabstop>
|
||||
<tabstop>resetButton</tabstop>
|
||||
<tabstop>languageBox</tabstop>
|
||||
<tabstop>terminalEdit</tabstop>
|
||||
<tabstop>terminalComboBox</tabstop>
|
||||
<tabstop>resetTerminalButton</tabstop>
|
||||
<tabstop>externalFileBrowserEdit</tabstop>
|
||||
<tabstop>resetFileBrowserButton</tabstop>
|
||||
|
@@ -78,6 +78,7 @@ struct ModeManagerPrivate
|
||||
QSignalMapper *m_signalMapper;
|
||||
Context m_addedContexts;
|
||||
int m_oldCurrent;
|
||||
bool m_saveSettingsOnModeChange;
|
||||
};
|
||||
|
||||
static ModeManagerPrivate *d;
|
||||
@@ -104,10 +105,13 @@ ModeManager::ModeManager(Internal::MainWindow *mainWindow,
|
||||
d->m_oldCurrent = -1;
|
||||
d->m_actionBar = new Internal::FancyActionBar(modeStack);
|
||||
d->m_modeStack->addCornerWidget(d->m_actionBar);
|
||||
d->m_saveSettingsOnModeChange = false;
|
||||
|
||||
connect(d->m_modeStack, SIGNAL(currentAboutToShow(int)), SLOT(currentTabAboutToChange(int)));
|
||||
connect(d->m_modeStack, SIGNAL(currentChanged(int)), SLOT(currentTabChanged(int)));
|
||||
connect(d->m_signalMapper, SIGNAL(mapped(int)), this, SLOT(slotActivateMode(int)));
|
||||
connect(ExtensionSystem::PluginManager::instance(), SIGNAL(initializationDone()), this, SLOT(handleStartup()));
|
||||
connect(ICore::instance(), SIGNAL(coreAboutToClose()), this, SLOT(handleShutdown()));
|
||||
}
|
||||
|
||||
void ModeManager::init()
|
||||
@@ -252,6 +256,12 @@ void ModeManager::enabledStateChanged()
|
||||
}
|
||||
}
|
||||
|
||||
void ModeManager::handleStartup()
|
||||
{ d->m_saveSettingsOnModeChange = true; }
|
||||
|
||||
void ModeManager::handleShutdown()
|
||||
{ d->m_saveSettingsOnModeChange = false; }
|
||||
|
||||
void ModeManager::aboutToRemoveObject(QObject *obj)
|
||||
{
|
||||
IMode *mode = Aggregation::query<IMode>(obj);
|
||||
@@ -290,8 +300,11 @@ void ModeManager::currentTabAboutToChange(int index)
|
||||
{
|
||||
if (index >= 0) {
|
||||
IMode *mode = d->m_modes.at(index);
|
||||
if (mode)
|
||||
if (mode) {
|
||||
if (d->m_saveSettingsOnModeChange)
|
||||
ICore::saveSettings();
|
||||
emit currentModeAboutToChange(mode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -85,6 +85,8 @@ private slots:
|
||||
void currentTabChanged(int index);
|
||||
void updateModeToolTip();
|
||||
void enabledStateChanged();
|
||||
void handleStartup();
|
||||
void handleShutdown();
|
||||
};
|
||||
|
||||
} // namespace Core
|
||||
|
@@ -1765,8 +1765,8 @@ void CPPEditorWidget::setFontSettings(const TextEditor::FontSettings &fs)
|
||||
fs.toTextCharFormat(TextEditor::C_LOCAL);
|
||||
m_semanticHighlightFormatMap[SemanticInfo::FieldUse] =
|
||||
fs.toTextCharFormat(TextEditor::C_FIELD);
|
||||
m_semanticHighlightFormatMap[SemanticInfo::StaticUse] =
|
||||
fs.toTextCharFormat(TextEditor::C_STATIC);
|
||||
m_semanticHighlightFormatMap[SemanticInfo::EnumerationUse] =
|
||||
fs.toTextCharFormat(TextEditor::C_ENUMERATION);
|
||||
m_semanticHighlightFormatMap[SemanticInfo::VirtualMethodUse] =
|
||||
fs.toTextCharFormat(TextEditor::C_VIRTUAL_METHOD);
|
||||
m_semanticHighlightFormatMap[SemanticInfo::LabelUse] =
|
||||
|
@@ -196,46 +196,24 @@ void CppTypeHierarchyWidget::perform()
|
||||
m_inspectedClass->setup(cppClass);
|
||||
QStandardItem *bases = new QStandardItem(tr("Bases"));
|
||||
m_model->invisibleRootItem()->appendRow(bases);
|
||||
QVector<CppClass> v;
|
||||
v.push_back(*cppClass);
|
||||
buildBaseHierarchy(&v);
|
||||
m_treeView->expand(m_model->indexFromItem(bases));
|
||||
buildHierarchy(*cppClass, bases, true, &CppClass::bases);
|
||||
QStandardItem *derived = new QStandardItem(tr("Derived"));
|
||||
m_model->invisibleRootItem()->appendRow(derived);
|
||||
foreach (const CppClass &derivedClass, sortClasses(cppClass->derived()))
|
||||
buildDerivedHierarchy(derivedClass, derived);
|
||||
buildHierarchy(*cppClass, derived, true, &CppClass::derived);
|
||||
m_treeView->expandAll();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CppTypeHierarchyWidget::buildBaseHierarchy(QVector<CppClass> *s)
|
||||
void CppTypeHierarchyWidget::buildHierarchy(const CppClass &cppClass, QStandardItem *parent, bool isRoot, HierarchyFunc func)
|
||||
{
|
||||
const CppClass ¤t = s->back();
|
||||
const QList<CppClass> &bases = sortClasses(current.bases());
|
||||
if (!bases.isEmpty()) {
|
||||
foreach (const CppClass &base, bases) {
|
||||
s->push_back(base);
|
||||
buildBaseHierarchy(s);
|
||||
s->pop_back();
|
||||
}
|
||||
} else {
|
||||
QStandardItem *parent = m_model->item(0, 0);
|
||||
for (int i = s->size() - 1; i > 0; --i) {
|
||||
QStandardItem *item = itemForClass(s->at(i));
|
||||
parent->appendRow(item);
|
||||
m_treeView->expand(m_model->indexFromItem(parent));
|
||||
parent = item;
|
||||
}
|
||||
if (!isRoot) {
|
||||
QStandardItem *item = itemForClass(cppClass);
|
||||
parent->appendRow(item);
|
||||
parent = item;
|
||||
}
|
||||
}
|
||||
|
||||
void CppTypeHierarchyWidget::buildDerivedHierarchy(const CppClass &cppClass, QStandardItem *parent)
|
||||
{
|
||||
QStandardItem *item = itemForClass(cppClass);
|
||||
parent->appendRow(item);
|
||||
foreach (const CppClass &derived, sortClasses(cppClass.derived()))
|
||||
buildDerivedHierarchy(derived, item);
|
||||
m_treeView->expand(m_model->indexFromItem(parent));
|
||||
foreach (const CppClass &klass, sortClasses((cppClass.*func)()))
|
||||
buildHierarchy(klass, parent, false, func);
|
||||
}
|
||||
|
||||
void CppTypeHierarchyWidget::onItemClicked(const QModelIndex &index)
|
||||
|
@@ -43,6 +43,7 @@ class QStandardItem;
|
||||
class QModelIndex;
|
||||
class QLabel;
|
||||
template <class> class QVector;
|
||||
template <class> class QList;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Core {
|
||||
@@ -77,8 +78,8 @@ private slots:
|
||||
void onItemClicked(const QModelIndex &index);
|
||||
|
||||
private:
|
||||
void buildDerivedHierarchy(const CppClass &cppClass, QStandardItem *parent);
|
||||
void buildBaseHierarchy(QVector<CppClass> *s);
|
||||
typedef const QList<CppClass> &(CppClass::* HierarchyFunc)() const;
|
||||
void buildHierarchy(const CppClass &cppClass, QStandardItem *parent, bool isRoot, HierarchyFunc func);
|
||||
|
||||
CPPEditorWidget *m_cppEditor;
|
||||
Utils::NavigationTreeView *m_treeView;
|
||||
|
@@ -485,7 +485,7 @@ bool CheckSymbols::visit(UsingDirectiveAST *)
|
||||
|
||||
bool CheckSymbols::visit(EnumeratorAST *ast)
|
||||
{
|
||||
addUse(ast->identifier_token, SemanticInfo::StaticUse);
|
||||
addUse(ast->identifier_token, SemanticInfo::EnumerationUse);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1163,7 +1163,7 @@ bool CheckSymbols::maybeAddTypeOrStatic(const QList<LookupItem> &candidates, Nam
|
||||
|
||||
UseKind kind = SemanticInfo::TypeUse;
|
||||
if (c->enclosingEnum() != 0)
|
||||
kind = SemanticInfo::StaticUse;
|
||||
kind = SemanticInfo::EnumerationUse;
|
||||
|
||||
const Use use(line, column, length, kind);
|
||||
addUse(use);
|
||||
|
@@ -48,7 +48,7 @@ public:
|
||||
TypeUse,
|
||||
LocalUse,
|
||||
FieldUse,
|
||||
StaticUse,
|
||||
EnumerationUse,
|
||||
VirtualMethodUse,
|
||||
LabelUse,
|
||||
MacroUse,
|
||||
|
@@ -775,12 +775,59 @@ void CdbEngine::setupInferior()
|
||||
postExtensionCommand("pid", QByteArray(), 0, &CdbEngine::handlePid);
|
||||
}
|
||||
|
||||
static QByteArray msvcRunTime(const Abi::OSFlavor flavour)
|
||||
{
|
||||
switch (flavour) {
|
||||
case Abi::WindowsMsvc2005Flavor:
|
||||
return "MSVCR80";
|
||||
case Abi::WindowsMsvc2008Flavor:
|
||||
return "MSVCR90";
|
||||
case Abi::WindowsMsvc2010Flavor:
|
||||
return "MSVCR100";
|
||||
case Abi::WindowsMsvc2012Flavor:
|
||||
return "MSVCR110"; // #FIXME: VS2012 beta, will probably be 12 in final?
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return "MSVCRT"; // MinGW, others.
|
||||
}
|
||||
|
||||
static QByteArray breakAtFunctionCommand(const QByteArray &function,
|
||||
const QByteArray &module = QByteArray())
|
||||
{
|
||||
QByteArray result = "bu ";
|
||||
if (!module.isEmpty()) {
|
||||
result += module;
|
||||
result += '!';
|
||||
}
|
||||
result += function;
|
||||
return result;
|
||||
}
|
||||
|
||||
void CdbEngine::runEngine()
|
||||
{
|
||||
if (debug)
|
||||
qDebug("runEngine");
|
||||
foreach (const QString &breakEvent, m_options->breakEvents)
|
||||
postCommand(QByteArray("sxe ") + breakEvent.toAscii(), 0);
|
||||
// Break functions: each function must be fully qualified,
|
||||
// else the debugger will slow down considerably.
|
||||
foreach (const QString &breakFunctionS, m_options->breakFunctions) {
|
||||
const QByteArray breakFunction = breakFunctionS.toLatin1();
|
||||
if (breakFunction == CdbOptions::crtDbgReport) {
|
||||
// CrtDbgReport(): Add MSVC runtime (debug, release)
|
||||
// and stop at Wide character version as well
|
||||
const QByteArray module = msvcRunTime(startParameters().toolChainAbi.osFlavor());
|
||||
const QByteArray debugModule = module + 'D';
|
||||
const QByteArray wideFunc = breakFunction + 'W';
|
||||
postCommand(breakAtFunctionCommand(breakFunction, module), 0);
|
||||
postCommand(breakAtFunctionCommand(wideFunc, module), 0);
|
||||
postCommand(breakAtFunctionCommand(breakFunction, debugModule), 0);
|
||||
postCommand(breakAtFunctionCommand(wideFunc, debugModule), 0);
|
||||
} else {
|
||||
postCommand(breakAtFunctionCommand(breakFunction), 0);
|
||||
}
|
||||
}
|
||||
if (startParameters().startMode == AttachCore) {
|
||||
QTC_ASSERT(!m_coreStopReason.isNull(), return; );
|
||||
notifyInferiorUnrunnable();
|
||||
@@ -2990,6 +3037,8 @@ void CdbEngine::handleBreakPoints(const GdbMi &value)
|
||||
qPrintable(reportedResponse.toString()));
|
||||
if (reportedResponse.id.isValid() && !reportedResponse.pending) {
|
||||
const BreakpointModelId mid = handler->findBreakpointByResponseId(reportedResponse.id);
|
||||
if (!mid.isValid() && reportedResponse.type == BreakpointByFunction)
|
||||
continue; // Breakpoints from options, CrtDbgReport() and others.
|
||||
QTC_ASSERT(mid.isValid(), continue);
|
||||
const PendingBreakPointMap::iterator it = m_pendingBreakpointMap.find(mid);
|
||||
if (it != m_pendingBreakpointMap.end()) {
|
||||
|
@@ -36,6 +36,7 @@ static const char settingsGroupC[] = "CDB2";
|
||||
static const char symbolPathsKeyC[] = "SymbolPaths";
|
||||
static const char sourcePathsKeyC[] = "SourcePaths";
|
||||
static const char breakEventKeyC[] = "BreakEvent";
|
||||
static const char breakFunctionsKeyC[] = "BreakFunctions";
|
||||
static const char additionalArgumentsKeyC[] = "AdditionalArguments";
|
||||
static const char cdbConsoleKeyC[] = "CDB_Console";
|
||||
static const char breakpointCorrectionKeyC[] = "BreakpointCorrection";
|
||||
@@ -43,6 +44,8 @@ static const char breakpointCorrectionKeyC[] = "BreakpointCorrection";
|
||||
namespace Debugger {
|
||||
namespace Internal {
|
||||
|
||||
const char *CdbOptions::crtDbgReport = "CrtDbgReport";
|
||||
|
||||
CdbOptions::CdbOptions() : cdbConsole(false), breakpointCorrection(true)
|
||||
{
|
||||
}
|
||||
@@ -57,6 +60,8 @@ void CdbOptions::clear()
|
||||
symbolPaths.clear();
|
||||
sourcePaths.clear();
|
||||
cdbConsole = false;
|
||||
breakEvents.clear();
|
||||
breakFunctions.clear();
|
||||
}
|
||||
|
||||
QStringList CdbOptions::oldEngineSymbolPaths(const QSettings *s)
|
||||
@@ -72,6 +77,7 @@ void CdbOptions::fromSettings(QSettings *s)
|
||||
symbolPaths = s->value(keyRoot + QLatin1String(symbolPathsKeyC), QStringList()).toStringList();
|
||||
sourcePaths = s->value(keyRoot + QLatin1String(sourcePathsKeyC), QStringList()).toStringList();
|
||||
breakEvents = s->value(keyRoot + QLatin1String(breakEventKeyC), QStringList()).toStringList();
|
||||
breakFunctions = s->value(keyRoot + QLatin1String(breakFunctionsKeyC), QStringList()).toStringList();
|
||||
cdbConsole = s->value(keyRoot + QLatin1String(cdbConsoleKeyC), QVariant(false)).toBool();
|
||||
breakpointCorrection = s->value(keyRoot + QLatin1String(breakpointCorrectionKeyC), QVariant(true)).toBool();
|
||||
}
|
||||
@@ -82,6 +88,7 @@ void CdbOptions::toSettings(QSettings *s) const
|
||||
s->setValue(QLatin1String(symbolPathsKeyC), symbolPaths);
|
||||
s->setValue(QLatin1String(sourcePathsKeyC), sourcePaths);
|
||||
s->setValue(QLatin1String(breakEventKeyC), breakEvents);
|
||||
s->setValue(QLatin1String(breakFunctionsKeyC), breakFunctions);
|
||||
s->setValue(QLatin1String(additionalArgumentsKeyC), additionalArguments);
|
||||
s->setValue(QLatin1String(cdbConsoleKeyC), QVariant(cdbConsole));
|
||||
s->setValue(QLatin1String(breakpointCorrectionKeyC), QVariant(breakpointCorrection));
|
||||
@@ -95,7 +102,8 @@ bool CdbOptions::equals(const CdbOptions &rhs) const
|
||||
&& additionalArguments == rhs.additionalArguments
|
||||
&& symbolPaths == rhs.symbolPaths
|
||||
&& sourcePaths == rhs.sourcePaths
|
||||
&& breakEvents == rhs.breakEvents;
|
||||
&& breakEvents == rhs.breakEvents
|
||||
&& breakFunctions == rhs.breakFunctions;
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
|
@@ -62,10 +62,13 @@ public:
|
||||
QStringList sourcePaths;
|
||||
// Events to break on (Command 'sxe' with abbreviation and optional parameter)
|
||||
QStringList breakEvents;
|
||||
QStringList breakFunctions;
|
||||
// Launch CDB's own console instead of Qt Creator's
|
||||
bool cdbConsole;
|
||||
// Perform code-model based correction of breakpoint location.
|
||||
bool breakpointCorrection;
|
||||
|
||||
static const char *crtDbgReport;
|
||||
};
|
||||
|
||||
inline bool operator==(const CdbOptions &s1, const CdbOptions &s2)
|
||||
|
@@ -30,6 +30,7 @@
|
||||
|
||||
#include "cdboptionspage.h"
|
||||
#include "cdboptions.h"
|
||||
#include "commonoptionspage.h"
|
||||
#include "debuggerinternalconstants.h"
|
||||
#include "cdbengine.h"
|
||||
|
||||
@@ -176,6 +177,11 @@ CdbOptionsPageWidget::CdbOptionsPageWidget(QWidget *parent) :
|
||||
eventLayout->setContentsMargins(margins);
|
||||
eventLayout->addWidget(m_breakEventWidget);
|
||||
m_ui.eventGroupBox->setLayout(eventLayout);
|
||||
m_ui.breakCrtDbgReportCheckBox
|
||||
->setText(CommonOptionsPage::msgSetBreakpointAtFunction(CdbOptions::crtDbgReport));
|
||||
const QString hint = tr("This is useful to catch runtime error messages, for example caused by assert().");
|
||||
m_ui.breakCrtDbgReportCheckBox
|
||||
->setToolTip(CommonOptionsPage::msgSetBreakpointAtFunctionToolTip(CdbOptions::crtDbgReport, hint));
|
||||
}
|
||||
|
||||
void CdbOptionsPageWidget::setOptions(CdbOptions &o)
|
||||
@@ -186,6 +192,7 @@ void CdbOptionsPageWidget::setOptions(CdbOptions &o)
|
||||
m_breakEventWidget->setBreakEvents(o.breakEvents);
|
||||
m_ui.consoleCheckBox->setChecked(o.cdbConsole);
|
||||
m_ui.breakpointCorrectionCheckBox->setChecked(o.breakpointCorrection);
|
||||
m_ui.breakCrtDbgReportCheckBox->setChecked(o.breakFunctions.contains(QLatin1String(CdbOptions::crtDbgReport)));
|
||||
}
|
||||
|
||||
CdbOptions CdbOptionsPageWidget::options() const
|
||||
@@ -197,6 +204,8 @@ CdbOptions CdbOptionsPageWidget::options() const
|
||||
rc.breakEvents = m_breakEventWidget->breakEvents();
|
||||
rc.cdbConsole = m_ui.consoleCheckBox->isChecked();
|
||||
rc.breakpointCorrection = m_ui.breakpointCorrectionCheckBox->isChecked();
|
||||
if (m_ui.breakCrtDbgReportCheckBox->isChecked())
|
||||
rc.breakFunctions.push_back(QLatin1String(CdbOptions::crtDbgReport));
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
@@ -120,6 +120,18 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="breakFunctionGroupBox">
|
||||
<property name="title">
|
||||
<string>Break on functions:</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="breakCrtDbgReportCheckBox"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
|
@@ -200,6 +200,24 @@ bool CommonOptionsPage::matches(const QString &s) const
|
||||
return m_searchKeywords.contains(s, Qt::CaseInsensitive);
|
||||
}
|
||||
|
||||
QString CommonOptionsPage::msgSetBreakpointAtFunction(const char *function)
|
||||
{
|
||||
return tr("Stop when %1() is called").arg(QLatin1String(function));
|
||||
}
|
||||
|
||||
QString CommonOptionsPage::msgSetBreakpointAtFunctionToolTip(const char *function,
|
||||
const QString &hint)
|
||||
{
|
||||
QString result = QLatin1String("<html><head/><body>");
|
||||
result += tr("Always add a breakpoint on the <i>%1()</i> function.").arg(QLatin1String(function));
|
||||
if (!hint.isEmpty()) {
|
||||
result += QLatin1String("<br>");
|
||||
result += hint;
|
||||
}
|
||||
result += QLatin1String("</body></html>");
|
||||
return result;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// LocalsAndExpressionsOptionsPage
|
||||
|
@@ -79,6 +79,10 @@ public:
|
||||
void finish();
|
||||
bool matches(const QString &s) const;
|
||||
|
||||
static QString msgSetBreakpointAtFunction(const char *function);
|
||||
static QString msgSetBreakpointAtFunctionToolTip(const char *function,
|
||||
const QString &hint = QString());
|
||||
|
||||
private:
|
||||
const QSharedPointer<GlobalDebuggerOptions> m_options;
|
||||
QSharedPointer<Utils::SavedActionSet> m_group;
|
||||
|
@@ -272,15 +272,6 @@ QtcPlugin {
|
||||
]
|
||||
}
|
||||
|
||||
Group {
|
||||
prefix: "../../shared/json/"
|
||||
files: [
|
||||
"json_global.h",
|
||||
"json.cpp",
|
||||
"json.h"
|
||||
]
|
||||
}
|
||||
|
||||
Group {
|
||||
condition: qbs.targetOS == "windows"
|
||||
files: [
|
||||
|
@@ -52,6 +52,10 @@ namespace Utils {
|
||||
class SavedAction;
|
||||
}
|
||||
|
||||
namespace ProjectExplorer {
|
||||
class RunControl;
|
||||
}
|
||||
|
||||
namespace Debugger {
|
||||
|
||||
class DebuggerEngine;
|
||||
@@ -122,6 +126,9 @@ public:
|
||||
|
||||
virtual DebuggerToolTipManager *toolTipManager() const = 0;
|
||||
virtual QSharedPointer<GlobalDebuggerOptions> globalDebuggerOptions() const = 0;
|
||||
|
||||
public slots:
|
||||
virtual void attachExternalApplication(ProjectExplorer::RunControl *rc) = 0;
|
||||
};
|
||||
|
||||
// This is the only way to access the global object.
|
||||
|
@@ -244,7 +244,7 @@ StartApplicationDialog::StartApplicationDialog(QWidget *parent)
|
||||
d->debuginfoPathChooser = new PathChooser(this);
|
||||
d->debuginfoPathChooser->setPromptDialogTitle(tr("Select Location of Debugging Information"));
|
||||
d->debuginfoPathChooser->setToolTip(tr(
|
||||
"Base path for external debug information and debug sources."
|
||||
"Base path for external debug information and debug sources. "
|
||||
"If empty, $SYSROOT/usr/lib/debug will be chosen."));
|
||||
|
||||
QFrame *line = new QFrame(this);
|
||||
|
@@ -369,8 +369,8 @@ void DebuggerMainWindowPrivate::activateQmlCppLayout()
|
||||
Context qmlCppContext = m_contextsForLanguage.value(QmlLanguage);
|
||||
qmlCppContext.add(m_contextsForLanguage.value(CppLanguage));
|
||||
if (m_toolBars.value(QmlLanguage)) {
|
||||
m_toolBars.value(QmlLanguage)->show();
|
||||
m_debugToolBarLayout->insertWidget(1, m_toolBars.value(QmlLanguage));
|
||||
m_toolBars.value(QmlLanguage)->show();
|
||||
}
|
||||
|
||||
if (m_previousDebugLanguages & QmlLanguage) {
|
||||
|
@@ -889,6 +889,7 @@ public slots:
|
||||
void attachToRemoteServer();
|
||||
void attachToProcess(bool startServerOnly);
|
||||
void attachToRunningApplication();
|
||||
void attachExternalApplication(ProjectExplorer::RunControl *rc);
|
||||
void attachToQmlPort();
|
||||
void startRemoteEngine();
|
||||
void runScheduled();
|
||||
@@ -1685,6 +1686,18 @@ void DebuggerPluginPrivate::attachToProcess(bool startServerOnly)
|
||||
}
|
||||
}
|
||||
|
||||
void DebuggerPluginPrivate::attachExternalApplication(ProjectExplorer::RunControl *rc)
|
||||
{
|
||||
DebuggerStartParameters sp;
|
||||
fillParameters(&sp);
|
||||
sp.attachPID = rc->applicationProcessHandle().pid();
|
||||
sp.displayName = tr("Process %1").arg(sp.attachPID);
|
||||
sp.startMode = AttachExternal;
|
||||
sp.closeMode = DetachAtClose;
|
||||
sp.toolChainAbi = rc->abi();
|
||||
DebuggerRunControlFactory::createAndScheduleRun(sp);
|
||||
}
|
||||
|
||||
void DebuggerPluginPrivate::attachToQmlPort()
|
||||
{
|
||||
DebuggerStartParameters sp;
|
||||
|
@@ -106,7 +106,7 @@ DebuggerProfileConfigWidget::DebuggerProfileConfigWidget(ProjectExplorer::Profil
|
||||
|
||||
QString DebuggerProfileConfigWidget::displayName() const
|
||||
{
|
||||
return tr("Debugger command:");
|
||||
return tr("Debugger:");
|
||||
}
|
||||
|
||||
void DebuggerProfileConfigWidget::makeReadOnly()
|
||||
|
@@ -259,7 +259,7 @@ GdbEngine::GdbEngine(const DebuggerStartParameters &startParameters)
|
||||
m_stackNeeded = false;
|
||||
m_preparedForQmlBreak = false;
|
||||
m_disassembleUsesComma = false;
|
||||
m_actingOnExpectedStop = false;
|
||||
m_terminalTrap = startParameters.useTerminal;
|
||||
m_fullStartDone = false;
|
||||
m_forceAsyncModel = false;
|
||||
|
||||
@@ -467,9 +467,10 @@ void GdbEngine::handleResponse(const QByteArray &buff)
|
||||
m_pendingLogStreamOutput.clear();
|
||||
m_pendingConsoleStreamOutput.clear();
|
||||
} else if (asyncClass == "running") {
|
||||
if (state() == InferiorRunOk) {
|
||||
// We get multiple *running after thread creation.
|
||||
showMessage(_("NOTE: INFERIOR STILL RUNNING."));
|
||||
if (state() == InferiorRunOk || state() == InferiorSetupRequested) {
|
||||
// We get multiple *running after thread creation and in Windows terminals.
|
||||
showMessage(QString::fromLatin1("NOTE: INFERIOR STILL RUNNING IN STATE %1.").
|
||||
arg(QLatin1String(DebuggerEngine::stateName(state()))));
|
||||
} else {
|
||||
notifyInferiorRunOk();
|
||||
}
|
||||
@@ -1376,9 +1377,15 @@ void GdbEngine::handleAqcuiredInferior()
|
||||
|
||||
void GdbEngine::handleStopResponse(const GdbMi &data)
|
||||
{
|
||||
// Ignore trap on Windows terminals, which results in
|
||||
// spurious "* stopped" message.
|
||||
if (!data.isValid() && m_terminalTrap && Abi::hostAbi().os() == Abi::WindowsOS) {
|
||||
m_terminalTrap = false;
|
||||
showMessage(_("IGNORING TERMINAL SIGTRAP"), LogMisc);
|
||||
return;
|
||||
}
|
||||
// This is gdb 7+'s initial *stopped in response to attach.
|
||||
// For consistency, we just discard it.
|
||||
m_actingOnExpectedStop = false;
|
||||
if (state() == InferiorSetupRequested)
|
||||
return;
|
||||
|
||||
@@ -1421,11 +1428,19 @@ void GdbEngine::handleStopResponse(const GdbMi &data)
|
||||
BreakpointResponseId rid(data.findChild("bkptno").data());
|
||||
const GdbMi frame = data.findChild("frame");
|
||||
|
||||
const int lineNumber = frame.findChild("line").data().toInt();
|
||||
QString fullName = cleanupFullName(QString::fromLocal8Bit(frame.findChild("fullname").data()));
|
||||
|
||||
if (fullName.isEmpty())
|
||||
fullName = QString::fromLocal8Bit(frame.findChild("file").data());
|
||||
int lineNumber = 0;
|
||||
QString fullName;
|
||||
if (frame.isValid()) {
|
||||
const GdbMi lineNumberG = frame.findChild("line");
|
||||
if (lineNumberG.isValid()) {
|
||||
lineNumber = lineNumberG.data().toInt();
|
||||
fullName = cleanupFullName(QString::fromLocal8Bit(frame.findChild("fullname").data()));
|
||||
if (fullName.isEmpty())
|
||||
fullName = QString::fromLocal8Bit(frame.findChild("file").data());
|
||||
} // found line number
|
||||
} else {
|
||||
showMessage(_("INVALID STOPPED REASON"), LogWarning);
|
||||
}
|
||||
|
||||
if (rid.isValid() && frame.isValid()
|
||||
&& !isQmlStepBreakpoint(rid)
|
||||
@@ -1456,7 +1471,6 @@ void GdbEngine::handleStopResponse(const GdbMi &data)
|
||||
|
||||
if (!m_commandsToRunOnTemporaryBreak.isEmpty()) {
|
||||
QTC_ASSERT(state() == InferiorStopRequested, qDebug() << state());
|
||||
m_actingOnExpectedStop = true;
|
||||
notifyInferiorStopOk();
|
||||
flushQueuedCommands();
|
||||
if (state() == InferiorStopOk) {
|
||||
@@ -1489,7 +1503,6 @@ void GdbEngine::handleStopResponse(const GdbMi &data)
|
||||
// That's expected.
|
||||
} else {
|
||||
QTC_ASSERT(state() == InferiorStopRequested, qDebug() << state());
|
||||
m_actingOnExpectedStop = true;
|
||||
notifyInferiorStopOk();
|
||||
}
|
||||
|
||||
@@ -1656,12 +1669,6 @@ void GdbEngine::handleStop2(const GdbMi &data)
|
||||
&& reason == "signal-received"
|
||||
&& data.findChild("signal-name").data() == "SIGTRAP")
|
||||
{
|
||||
if (!m_actingOnExpectedStop) {
|
||||
// Ignore signals from command line start up traps.
|
||||
showMessage(_("INTERNAL CONTINUE AFTER SIGTRAP"), LogMisc);
|
||||
continueInferiorInternal();
|
||||
return;
|
||||
}
|
||||
// This is the stopper thread. That also means that the
|
||||
// reported thread is not the one we'd like to expose
|
||||
// to the user.
|
||||
@@ -3771,9 +3778,23 @@ void GdbEngine::handleRegisterListNames(const GdbResponse &response)
|
||||
}
|
||||
|
||||
Registers registers;
|
||||
foreach (const GdbMi &item, response.data.findChild("register-names").children())
|
||||
if (!item.data().isEmpty())
|
||||
int gdbRegisterNumber = 0, internalIndex = 0;
|
||||
|
||||
// This both handles explicitly having space for all the registers and
|
||||
// initializes all indices to 0, giving missing registers a sane default
|
||||
// in the event of something wacky.
|
||||
GdbMi names = response.data.findChild("register-names");
|
||||
m_registerNumbers.resize(names.childCount());
|
||||
foreach (const GdbMi &item, names.children()) {
|
||||
// Since we throw away missing registers to eliminate empty rows
|
||||
// we need to maintain a mapping of GDB register numbers to their
|
||||
// respective indices in the register list.
|
||||
if (!item.data().isEmpty()) {
|
||||
m_registerNumbers[gdbRegisterNumber] = internalIndex++;
|
||||
registers.append(Register(item.data()));
|
||||
}
|
||||
gdbRegisterNumber++;
|
||||
}
|
||||
|
||||
registerHandler()->setRegisters(registers);
|
||||
}
|
||||
@@ -3785,14 +3806,15 @@ void GdbEngine::handleRegisterListValues(const GdbResponse &response)
|
||||
|
||||
Registers registers = registerHandler()->registers();
|
||||
const int registerCount = registers.size();
|
||||
const int gdbRegisterCount = m_registerNumbers.size();
|
||||
|
||||
// 24^done,register-values=[{number="0",value="0xf423f"},...]
|
||||
const GdbMi values = response.data.findChild("register-values");
|
||||
QTC_ASSERT(registerCount == values.children().size(), return);
|
||||
foreach (const GdbMi &item, values.children()) {
|
||||
const int number = item.findChild("number").data().toInt();
|
||||
if (number >= 0 && number < registerCount)
|
||||
registers[number].value = item.findChild("value").data();
|
||||
if (number >= 0 && number < gdbRegisterCount)
|
||||
registers[m_registerNumbers[number]].value = item.findChild("value").data();
|
||||
}
|
||||
registerHandler()->setAndMarkRegisters(registers);
|
||||
}
|
||||
@@ -5217,7 +5239,9 @@ bool GdbEngine::attemptQuickStart() const
|
||||
|
||||
void GdbEngine::checkForReleaseBuild()
|
||||
{
|
||||
QString binary = startParameters().executable;
|
||||
const QString binary = startParameters().executable;
|
||||
if (binary.isEmpty())
|
||||
return;
|
||||
ElfReader reader(binary);
|
||||
ElfData elfData = reader.readHeaders();
|
||||
QString error = reader.errorString();
|
||||
|
@@ -495,6 +495,7 @@ private: ////////// View & Data Stuff //////////
|
||||
void setRegisterValue(int nr, const QString &value);
|
||||
void handleRegisterListNames(const GdbResponse &response);
|
||||
void handleRegisterListValues(const GdbResponse &response);
|
||||
QVector<int> m_registerNumbers; // Map GDB register numbers to indices
|
||||
|
||||
//
|
||||
// Disassembler specific stuff
|
||||
@@ -685,7 +686,7 @@ protected:
|
||||
QString m_lastWinException;
|
||||
QString m_lastMissingDebugInfo;
|
||||
BreakpointResponseId m_qFatalBreakpointResponseId;
|
||||
bool m_actingOnExpectedStop;
|
||||
bool m_terminalTrap;
|
||||
|
||||
bool usesExecInterrupt() const;
|
||||
|
||||
|
@@ -29,6 +29,7 @@
|
||||
**************************************************************************/
|
||||
|
||||
#include "gdboptionspage.h"
|
||||
#include "commonoptionspage.h"
|
||||
#include "debuggeractions.h"
|
||||
#include "debuggercore.h"
|
||||
#include "debuggerinternalconstants.h"
|
||||
@@ -181,22 +182,16 @@ GdbOptionsPageWidget::GdbOptionsPageWidget(QWidget *parent)
|
||||
"when starting GDB.</body></html>"));
|
||||
|
||||
checkBoxBreakOnWarning = new QCheckBox(groupBoxGeneral);
|
||||
checkBoxBreakOnWarning->setText(GdbOptionsPage::tr("Stop when qWarning() is called"));
|
||||
checkBoxBreakOnWarning->setToolTip(GdbOptionsPage::tr(
|
||||
"<html><head/><body>Always add a breakpoint on the <i>qWarning()</i> function."
|
||||
"</body></html>"));
|
||||
checkBoxBreakOnWarning->setText(CommonOptionsPage::msgSetBreakpointAtFunction("qWarning"));
|
||||
checkBoxBreakOnWarning->setToolTip(CommonOptionsPage::msgSetBreakpointAtFunctionToolTip("qWarning"));
|
||||
|
||||
checkBoxBreakOnFatal = new QCheckBox(groupBoxGeneral);
|
||||
checkBoxBreakOnFatal->setText(GdbOptionsPage::tr("Stop when qFatal() is called"));
|
||||
checkBoxBreakOnFatal->setToolTip(GdbOptionsPage::tr(
|
||||
"<html><head/><body>Always add a breakpoint on the <i>qFatal()</i> function."
|
||||
"</body></html>"));
|
||||
checkBoxBreakOnFatal->setText(CommonOptionsPage::msgSetBreakpointAtFunction("qFatal"));
|
||||
checkBoxBreakOnFatal->setToolTip(CommonOptionsPage::msgSetBreakpointAtFunctionToolTip("qFatal"));
|
||||
|
||||
checkBoxBreakOnAbort = new QCheckBox(groupBoxGeneral);
|
||||
checkBoxBreakOnAbort->setText(GdbOptionsPage::tr("Stop when abort() is called"));
|
||||
checkBoxBreakOnAbort->setToolTip(GdbOptionsPage::tr(
|
||||
"<html><head/><body><p>Always add a breakpoint on the <i>abort()</i> function."
|
||||
"</p></body></html>"));
|
||||
checkBoxBreakOnAbort->setText(CommonOptionsPage::msgSetBreakpointAtFunction("abort"));
|
||||
checkBoxBreakOnAbort->setToolTip(CommonOptionsPage::msgSetBreakpointAtFunctionToolTip("abort"));
|
||||
|
||||
checkBoxEnableReverseDebugging = new QCheckBox(groupBoxGeneral);
|
||||
checkBoxEnableReverseDebugging->setText(GdbOptionsPage::tr("Enable reverse debugging"));
|
||||
|
@@ -280,16 +280,59 @@ bool hasSideEffects(const QString &exp)
|
||||
bool isKeyWord(const QString &exp)
|
||||
{
|
||||
// FIXME: incomplete
|
||||
return exp == QLatin1String("class")
|
||||
|| exp == QLatin1String("const")
|
||||
|| exp == QLatin1String("do")
|
||||
|| exp == QLatin1String("if")
|
||||
|| exp == QLatin1String("return")
|
||||
|| exp == QLatin1String("struct")
|
||||
|| exp == QLatin1String("template")
|
||||
|| exp == QLatin1String("void")
|
||||
|| exp == QLatin1String("volatile")
|
||||
|| exp == QLatin1String("while");
|
||||
QTC_ASSERT(!exp.isEmpty(), return false);
|
||||
switch (exp.at(0).toAscii()) {
|
||||
case 'a':
|
||||
return exp == QLatin1String("auto");
|
||||
case 'b':
|
||||
return exp == QLatin1String("break");
|
||||
case 'c':
|
||||
return exp == QLatin1String("case") || exp == QLatin1String("class")
|
||||
|| exp == QLatin1String("const") || exp == QLatin1String("constexpr")
|
||||
|| exp == QLatin1String("catch") || exp == QLatin1String("continue")
|
||||
|| exp == QLatin1String("const_cast");
|
||||
case 'd':
|
||||
return exp == QLatin1String("do") || exp == QLatin1String("default")
|
||||
|| exp == QLatin1String("delete") || exp == QLatin1String("decltype")
|
||||
|| exp == QLatin1String("dynamic_cast");
|
||||
case 'e':
|
||||
return exp == QLatin1String("else") || exp == QLatin1String("extern")
|
||||
|| exp == QLatin1String("enum") || exp == QLatin1String("explicit");
|
||||
case 'f':
|
||||
return exp == QLatin1String("for") || exp == QLatin1String("friend"); // 'final'?
|
||||
case 'g':
|
||||
return exp == QLatin1String("goto");
|
||||
case 'i':
|
||||
return exp == QLatin1String("if") || exp == QLatin1String("inline");
|
||||
case 'n':
|
||||
return exp == QLatin1String("new") || exp == QLatin1String("namespace")
|
||||
|| exp == QLatin1String("noexcept");
|
||||
case 'm':
|
||||
return exp == QLatin1String("mutable");
|
||||
case 'o':
|
||||
return exp == QLatin1String("operator"); // 'override'?
|
||||
case 'p':
|
||||
return exp == QLatin1String("public") || exp == QLatin1String("protected")
|
||||
|| exp == QLatin1String("private");
|
||||
case 'r':
|
||||
return exp == QLatin1String("return") || exp == QLatin1String("register")
|
||||
|| exp == QLatin1String("reinterpret_cast");
|
||||
case 's':
|
||||
return exp == QLatin1String("struct") || exp == QLatin1String("switch")
|
||||
|| exp == QLatin1String("static_cast");
|
||||
case 't':
|
||||
return exp == QLatin1String("template") || exp == QLatin1String("typename")
|
||||
|| exp == QLatin1String("try") || exp == QLatin1String("throw")
|
||||
|| exp == QLatin1String("typedef");
|
||||
case 'u':
|
||||
return exp == QLatin1String("union") || exp == QLatin1String("using");
|
||||
case 'v':
|
||||
return exp == QLatin1String("void") || exp == QLatin1String("volatile")
|
||||
|| exp == QLatin1String("virtual");
|
||||
case 'w':
|
||||
return exp == QLatin1String("while");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool startsWithDigit(const QString &str)
|
||||
|
@@ -279,10 +279,15 @@ bool FindToolBar::eventFilter(QObject *obj, QEvent *event)
|
||||
if (event->type() == QEvent::KeyPress) {
|
||||
QKeyEvent *ke = static_cast<QKeyEvent *>(event);
|
||||
if (ke->key() == Qt::Key_Down) {
|
||||
if (obj == m_ui.findEdit)
|
||||
if (obj == m_ui.findEdit) {
|
||||
if (m_ui.findEdit->text().isEmpty())
|
||||
m_findCompleter->setCompletionPrefix(QString());
|
||||
m_findCompleter->complete();
|
||||
else if (obj == m_ui.replaceEdit)
|
||||
} else if (obj == m_ui.replaceEdit) {
|
||||
if (m_ui.replaceEdit->text().isEmpty())
|
||||
m_replaceCompleter->setCompletionPrefix(QString());
|
||||
m_replaceCompleter->complete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -242,8 +242,8 @@ void SearchResultWidget::addResults(const QList<SearchResultItem> &items, Search
|
||||
m_sizeWarningActive = true;
|
||||
emit paused(true);
|
||||
Core::InfoBarEntry info(QLatin1String(SIZE_WARNING_ID),
|
||||
tr("The search resulted in more than %1 items, do you still want to continue?")
|
||||
.arg(SEARCHRESULT_WARNING_LIMIT));
|
||||
tr("The search resulted in more than %n items, do you still want to continue?",
|
||||
0, SEARCHRESULT_WARNING_LIMIT));
|
||||
info.setCancelButtonInfo(tr("Cancel"), this, SLOT(cancelAfterSizeWarning()));
|
||||
info.setCustomButtonInfo(tr("Continue"), this, SLOT(continueAfterSizeWarning()));
|
||||
m_infoBar.addInfo(info);
|
||||
|
@@ -507,7 +507,8 @@ bool DebianManager::setPackageManagerName(const Utils::FileName &debianDir, Core
|
||||
|
||||
QIcon DebianManager::packageManagerIcon(const Utils::FileName &debianDir, QString *error)
|
||||
{
|
||||
const QByteArray &base64Icon = controlFileFieldValue(debianDir, IconFieldName, true);
|
||||
const QByteArray &base64Icon
|
||||
= controlFileFieldValue(controlFilePath(debianDir), IconFieldName, true);
|
||||
if (base64Icon.isEmpty())
|
||||
return QIcon();
|
||||
QPixmap pixmap;
|
||||
@@ -695,7 +696,7 @@ void DebianManager::controlWasChanged()
|
||||
WatchableFile *file = qobject_cast<WatchableFile *>(sender());
|
||||
if (!file)
|
||||
return;
|
||||
emit controlChanged(Utils::FileName::fromString(file->fileName()));
|
||||
emit controlChanged(Utils::FileName::fromString(file->fileName()).parentDir());
|
||||
}
|
||||
|
||||
void DebianManager::changelogWasChanged()
|
||||
@@ -703,7 +704,7 @@ void DebianManager::changelogWasChanged()
|
||||
WatchableFile *file = qobject_cast<WatchableFile *>(sender());
|
||||
if (!file)
|
||||
return;
|
||||
emit changelogChanged(Utils::FileName::fromString(file->fileName()));
|
||||
emit changelogChanged(Utils::FileName::fromString(file->fileName()).parentDir());
|
||||
}
|
||||
|
||||
Utils::FileName DebianManager::changelogFilePath(const Utils::FileName &debianDir)
|
||||
|
@@ -48,7 +48,8 @@ HEADERS += \
|
||||
maddedevicetester.h \
|
||||
maddedeviceconfigurationfactory.h \
|
||||
maddedevice.h \
|
||||
maemoapplicationrunnerhelperactions.h
|
||||
maemoapplicationrunnerhelperactions.h \
|
||||
maddeqemustartstep.h
|
||||
|
||||
SOURCES += \
|
||||
maddeplugin.cpp \
|
||||
@@ -90,7 +91,8 @@ SOURCES += \
|
||||
maddedevicetester.cpp \
|
||||
maemorunconfiguration.cpp \
|
||||
maddedevice.cpp \
|
||||
maemoapplicationrunnerhelperactions.cpp
|
||||
maemoapplicationrunnerhelperactions.cpp \
|
||||
maddeqemustartstep.cpp
|
||||
|
||||
FORMS += \
|
||||
maemopackagecreationwidget.ui \
|
||||
|
@@ -30,6 +30,8 @@ QtcPlugin {
|
||||
"maddeplugin.h",
|
||||
"maddeuploadandinstallpackagesteps.cpp",
|
||||
"maddeuploadandinstallpackagesteps.h",
|
||||
"maddeqemustartstep.cpp",
|
||||
"maddeqemustartstep.h",
|
||||
"maemoconstants.h",
|
||||
"maemodeploybymountsteps.cpp",
|
||||
"maemodeploybymountsteps.h",
|
||||
|
128
src/plugins/madde/maddeqemustartstep.cpp
Normal file
128
src/plugins/madde/maddeqemustartstep.cpp
Normal file
@@ -0,0 +1,128 @@
|
||||
/**************************************************************************
|
||||
**
|
||||
** This file is part of Qt Creator
|
||||
**
|
||||
** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies).
|
||||
**
|
||||
** Contact: http://www.qt-project.org/
|
||||
**
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
**
|
||||
** 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.
|
||||
**
|
||||
** Other Usage
|
||||
**
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
**
|
||||
**************************************************************************/
|
||||
#include "maddeqemustartstep.h"
|
||||
|
||||
#include "maemoqemumanager.h"
|
||||
|
||||
#include <qtsupport/baseqtversion.h>
|
||||
#include <qtsupport/qtprofileinformation.h>
|
||||
#include <remotelinux/abstractremotelinuxdeployservice.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
using namespace RemoteLinux;
|
||||
|
||||
namespace Madde {
|
||||
namespace Internal {
|
||||
class MaddeQemuStartService : public AbstractRemoteLinuxDeployService
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
MaddeQemuStartService(QObject *parent = 0) : AbstractRemoteLinuxDeployService(parent) {}
|
||||
|
||||
private:
|
||||
bool isDeploymentNecessary() const { return true; }
|
||||
|
||||
void doDeviceSetup()
|
||||
{
|
||||
emit progressMessage(tr("Checking whether to start Qemu..."));
|
||||
if (deviceConfiguration()->machineType() == IDevice::Hardware) {
|
||||
emit progressMessage(tr("Target device is not an emulator. Nothing to do."));
|
||||
handleDeviceSetupDone(true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (MaemoQemuManager::instance().qemuIsRunning()) {
|
||||
emit progressMessage(tr("Qemu is already running. Nothing to do."));
|
||||
handleDeviceSetupDone(true);
|
||||
return;
|
||||
}
|
||||
|
||||
MaemoQemuRuntime rt;
|
||||
const int qtId = QtSupport::QtProfileInformation::qtVersionId(profile());
|
||||
if (MaemoQemuManager::instance().runtimeForQtVersion(qtId, &rt)) {
|
||||
MaemoQemuManager::instance().startRuntime();
|
||||
emit errorMessage(tr("Cannot deploy: Qemu was not running. "
|
||||
"It has now been started up for you, but it will take "
|
||||
"a bit of time until it is ready. Please try again then."));
|
||||
} else {
|
||||
emit errorMessage(tr("Cannot deploy: You want to deploy to Qemu, but it is not enabled "
|
||||
"for this Qt version."));
|
||||
}
|
||||
handleDeviceSetupDone(false);
|
||||
}
|
||||
|
||||
void stopDeviceSetup() { handleDeviceSetupDone(false); }
|
||||
void doDeploy() { handleDeploymentDone(); }
|
||||
void stopDeployment() { handleDeploymentDone(); }
|
||||
};
|
||||
|
||||
MaddeQemuStartStep::MaddeQemuStartStep(BuildStepList *bsl)
|
||||
: AbstractRemoteLinuxDeployStep(bsl, stepId())
|
||||
{
|
||||
ctor();
|
||||
setDefaultDisplayName(stepDisplayName());
|
||||
}
|
||||
|
||||
MaddeQemuStartStep::MaddeQemuStartStep(BuildStepList *bsl, MaddeQemuStartStep *other)
|
||||
: AbstractRemoteLinuxDeployStep(bsl, other)
|
||||
{
|
||||
ctor();
|
||||
}
|
||||
|
||||
AbstractRemoteLinuxDeployService *MaddeQemuStartStep::deployService() const
|
||||
{
|
||||
return m_service;
|
||||
}
|
||||
|
||||
bool MaddeQemuStartStep::initInternal(QString *error)
|
||||
{
|
||||
return deployService()->isDeploymentPossible(error);
|
||||
}
|
||||
|
||||
void MaddeQemuStartStep::ctor()
|
||||
{
|
||||
m_service = new MaddeQemuStartService(this);
|
||||
}
|
||||
|
||||
Core::Id MaddeQemuStartStep::stepId()
|
||||
{
|
||||
return Core::Id("Madde.MaddeQemuCheckStep");
|
||||
}
|
||||
|
||||
QString MaddeQemuStartStep::stepDisplayName()
|
||||
{
|
||||
return tr("Start Qemu, if necessary");
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Madde
|
||||
|
||||
#include "maddeqemustartstep.moc"
|
@@ -27,18 +27,35 @@
|
||||
**
|
||||
**
|
||||
**************************************************************************/
|
||||
#ifndef MAEMOQEMUCHECKSTEP_H
|
||||
#define MAEMOQEMUCHECKSTEP_H
|
||||
|
||||
#ifndef JSON_GLOBAL_H
|
||||
#define JSON_GLOBAL_H
|
||||
#include <remotelinux/abstractremotelinuxdeploystep.h>
|
||||
|
||||
#include <qglobal.h>
|
||||
namespace Madde {
|
||||
namespace Internal {
|
||||
class MaddeQemuStartService;
|
||||
|
||||
#if defined(JSON_BUILD_LIB)
|
||||
# define JSON_EXPORT Q_DECL_EXPORT
|
||||
#elif defined(JSON_BUILD_STATIC_LIB) || defined(JSON_INCLUDE_PRI)
|
||||
# define JSON_EXPORT
|
||||
#else
|
||||
# define JSON_EXPORT Q_DECL_IMPORT
|
||||
#endif
|
||||
class MaddeQemuStartStep : public RemoteLinux::AbstractRemoteLinuxDeployStep
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
MaddeQemuStartStep(ProjectExplorer::BuildStepList *bsl);
|
||||
MaddeQemuStartStep(ProjectExplorer::BuildStepList *bsl, MaddeQemuStartStep *other);
|
||||
|
||||
#endif // JSON_GLOBAL_H
|
||||
static Core::Id stepId();
|
||||
static QString stepDisplayName();
|
||||
|
||||
private:
|
||||
void ctor();
|
||||
|
||||
RemoteLinux::AbstractRemoteLinuxDeployService *deployService() const;
|
||||
bool initInternal(QString *error = 0);
|
||||
|
||||
MaddeQemuStartService *m_service;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Madde
|
||||
|
||||
#endif // MAEMOQEMUCHECKSTEP_H
|
@@ -35,7 +35,6 @@
|
||||
#include "maemoqemumanager.h"
|
||||
|
||||
#include <projectexplorer/target.h>
|
||||
#include <qtsupport/baseqtversion.h>
|
||||
#include <qtsupport/qtprofileinformation.h>
|
||||
#include <remotelinux/abstractuploadandinstallpackageservice.h>
|
||||
#include <remotelinux/remotelinuxdeployconfiguration.h>
|
||||
@@ -57,32 +56,6 @@ protected:
|
||||
{
|
||||
}
|
||||
|
||||
void doDeviceSetup()
|
||||
{
|
||||
if (deviceConfiguration()->machineType() == IDevice::Hardware) {
|
||||
handleDeviceSetupDone(true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (MaemoQemuManager::instance().qemuIsRunning()) {
|
||||
handleDeviceSetupDone(true);
|
||||
return;
|
||||
}
|
||||
|
||||
MaemoQemuRuntime rt;
|
||||
const int qtId = QtSupport::QtProfileInformation::qtVersionId(profile());
|
||||
if (MaemoQemuManager::instance().runtimeForQtVersion(qtId, &rt)) {
|
||||
MaemoQemuManager::instance().startRuntime();
|
||||
emit errorMessage(tr("Cannot deploy: Qemu was not running. "
|
||||
"It has now been started up for you, but it will take "
|
||||
"a bit of time until it is ready. Please try again then."));
|
||||
} else {
|
||||
emit errorMessage(tr("Cannot deploy: You want to deploy to Qemu, but it is not enabled "
|
||||
"for this Qt version."));
|
||||
}
|
||||
handleDeviceSetupDone(false);
|
||||
}
|
||||
|
||||
private:
|
||||
QString uploadDir() const
|
||||
{
|
||||
|
@@ -41,8 +41,6 @@
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/target.h>
|
||||
#include <qt4projectmanager/qt4buildconfiguration.h>
|
||||
#include <qtsupport/baseqtversion.h>
|
||||
#include <qtsupport/qtprofileinformation.h>
|
||||
#include <remotelinux/abstractremotelinuxdeployservice.h>
|
||||
#include <remotelinux/linuxdevice.h>
|
||||
#include <utils/hostosinfo.h>
|
||||
@@ -156,28 +154,7 @@ void AbstractMaemoDeployByMountService::doDeviceSetup()
|
||||
{
|
||||
QTC_ASSERT(m_state == Inactive, return);
|
||||
|
||||
if (deviceConfiguration()->machineType() == IDevice::Hardware) {
|
||||
handleDeviceSetupDone(true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (MaemoQemuManager::instance().qemuIsRunning()) {
|
||||
handleDeviceSetupDone(true);
|
||||
return;
|
||||
}
|
||||
|
||||
MaemoQemuRuntime rt;
|
||||
const int qtId = QtSupport::QtProfileInformation::qtVersionId(profile());
|
||||
if (MaemoQemuManager::instance().runtimeForQtVersion(qtId, &rt)) {
|
||||
MaemoQemuManager::instance().startRuntime();
|
||||
emit errorMessage(tr("Cannot deploy: Qemu was not running. "
|
||||
"It has now been started up for you, but it will take "
|
||||
"a bit of time until it is ready. Please try again then."));
|
||||
} else {
|
||||
emit errorMessage(tr("Cannot deploy: You want to deploy to Qemu, but it is not enabled "
|
||||
"for this Qt version."));
|
||||
}
|
||||
handleDeviceSetupDone(false);
|
||||
handleDeviceSetupDone(true);
|
||||
}
|
||||
|
||||
void AbstractMaemoDeployByMountService::stopDeviceSetup()
|
||||
|
@@ -31,6 +31,7 @@
|
||||
#include "maemodeploystepfactory.h"
|
||||
|
||||
#include "maemoconstants.h"
|
||||
#include "maddeqemustartstep.h"
|
||||
#include "maddeuploadandinstallpackagesteps.h"
|
||||
#include "maemodeploybymountsteps.h"
|
||||
#include "maemoinstalltosysrootstep.h"
|
||||
@@ -73,16 +74,18 @@ QList<Core::Id> MaemoDeployStepFactory::availableCreationIds(BuildStepList *pare
|
||||
platform = version->platformName();
|
||||
|
||||
if (platform == QtSupport::Constants::MAEMO_FREMANTLE_PLATFORM) {
|
||||
ids << Core::Id(MaemoMakeInstallToSysrootStep::Id)
|
||||
<< Core::Id(MaemoInstallDebianPackageToSysrootStep::Id)
|
||||
<< Core::Id(MaemoUploadAndInstallPackageStep::stepId())
|
||||
<< Core::Id(MaemoInstallPackageViaMountStep::stepId())
|
||||
<< Core::Id(MaemoCopyFilesViaMountStep::stepId());
|
||||
ids << MaemoMakeInstallToSysrootStep::Id
|
||||
<< MaemoInstallDebianPackageToSysrootStep::Id
|
||||
<< MaemoUploadAndInstallPackageStep::stepId()
|
||||
<< MaemoInstallPackageViaMountStep::stepId()
|
||||
<< MaemoCopyFilesViaMountStep::stepId()
|
||||
<< MaddeQemuStartStep::stepId();
|
||||
} else if (platform == QtSupport::Constants::MEEGO_HARMATTAN_PLATFORM) {
|
||||
ids << Core::Id(MaemoMakeInstallToSysrootStep::Id)
|
||||
<< Core::Id(MaemoInstallDebianPackageToSysrootStep::Id)
|
||||
<< Core::Id(MaemoUploadAndInstallPackageStep::stepId())
|
||||
<< Core::Id(GenericDirectUploadStep::stepId());
|
||||
ids << MaemoMakeInstallToSysrootStep::Id
|
||||
<< MaemoInstallDebianPackageToSysrootStep::Id
|
||||
<< MaemoUploadAndInstallPackageStep::stepId()
|
||||
<< GenericDirectUploadStep::stepId()
|
||||
<< MaddeQemuStartStep::stepId();
|
||||
}
|
||||
|
||||
return ids;
|
||||
@@ -106,6 +109,8 @@ QString MaemoDeployStepFactory::displayNameForId(const Core::Id id) const
|
||||
return GenericDirectUploadStep::displayName();
|
||||
if (id == RemoteLinuxCheckForFreeDiskSpaceStep::stepId())
|
||||
return RemoteLinuxCheckForFreeDiskSpaceStep::stepDisplayName();
|
||||
if (id == MaddeQemuStartStep::stepId())
|
||||
return MaddeQemuStartStep::stepDisplayName();
|
||||
return QString();
|
||||
}
|
||||
|
||||
@@ -136,7 +141,8 @@ BuildStep *MaemoDeployStepFactory::create(BuildStepList *parent, const Core::Id
|
||||
return new GenericDirectUploadStep(parent, id);
|
||||
if (id == RemoteLinuxCheckForFreeDiskSpaceStep::stepId())
|
||||
return new RemoteLinuxCheckForFreeDiskSpaceStep(parent);
|
||||
|
||||
if (id == MaddeQemuStartStep::stepId())
|
||||
return new MaddeQemuStartStep(parent);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -187,6 +193,8 @@ BuildStep *MaemoDeployStepFactory::clone(BuildStepList *parent, BuildStep *produ
|
||||
qobject_cast<GenericDirectUploadStep *>(product));
|
||||
} else if (RemoteLinuxCheckForFreeDiskSpaceStep * const other = qobject_cast<RemoteLinuxCheckForFreeDiskSpaceStep *>(product)) {
|
||||
return new RemoteLinuxCheckForFreeDiskSpaceStep(parent, other);
|
||||
} else if (MaddeQemuStartStep * const other = qobject_cast<MaddeQemuStartStep *>(product)) {
|
||||
return new MaddeQemuStartStep(parent, other);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@@ -30,6 +30,7 @@
|
||||
#include "qt4maemodeployconfiguration.h"
|
||||
|
||||
#include "debianmanager.h"
|
||||
#include "maddeqemustartstep.h"
|
||||
#include "maddeuploadandinstallpackagesteps.h"
|
||||
#include "maemoconstants.h"
|
||||
#include "maemodeploybymountsteps.h"
|
||||
@@ -123,12 +124,18 @@ void Qt4MaemoDeployConfiguration::setupDebianPackaging()
|
||||
Utils::FileName debianDir = DebianManager::debianDirectory(target());
|
||||
DebianManager::ActionStatus status = DebianManager::createTemplate(bc, debianDir);
|
||||
|
||||
if (status == DebianManager::NoActionRequired ||
|
||||
status == DebianManager::ActionFailed)
|
||||
if (status == DebianManager::ActionFailed)
|
||||
return;
|
||||
|
||||
DebianManager * const dm = DebianManager::instance();
|
||||
dm->monitor(debianDir);
|
||||
connect(dm, SIGNAL(debianDirectoryChanged(Utils::FileName)), this,
|
||||
SLOT(debianDirChanged(Utils::FileName)));
|
||||
|
||||
if (status == DebianManager::NoActionRequired)
|
||||
return;
|
||||
|
||||
Core::Id deviceType = ProjectExplorer::DeviceTypeProfileInformation::deviceTypeId(target()->profile());
|
||||
DebianManager *dm = DebianManager::instance();
|
||||
QString projectName = target()->project()->displayName();
|
||||
|
||||
if (!DebianManager::hasPackageManagerIcon(debianDir)) {
|
||||
@@ -139,11 +146,6 @@ void Qt4MaemoDeployConfiguration::setupDebianPackaging()
|
||||
dm->setPackageManagerIcon(debianDir, deviceType, iconPath);
|
||||
}
|
||||
|
||||
|
||||
|
||||
dm->monitor(debianDir);
|
||||
connect(dm, SIGNAL(debianDirectoryChanged(Utils::FileName)), this, SLOT(debianDirChanged(Utils::FileName)));
|
||||
|
||||
// Set up aegis manifest on harmattan:
|
||||
if (deviceType == HarmattanOsType) {
|
||||
Utils::FileName manifest = debianDir;
|
||||
@@ -254,18 +256,21 @@ DeployConfiguration *Qt4MaemoDeployConfigurationFactory::create(Target *parent,
|
||||
|
||||
if (id == Qt4MaemoDeployConfiguration::fremantleWithoutPackagingId()) {
|
||||
dc->stepList()->insertStep(0, new MaemoMakeInstallToSysrootStep(dc->stepList()));
|
||||
dc->stepList()->insertStep(1, new RemoteLinuxCheckForFreeDiskSpaceStep(dc->stepList()));
|
||||
dc->stepList()->insertStep(2, new MaemoCopyFilesViaMountStep(dc->stepList()));
|
||||
dc->stepList()->insertStep(1, new MaddeQemuStartStep(dc->stepList()));
|
||||
dc->stepList()->insertStep(2, new RemoteLinuxCheckForFreeDiskSpaceStep(dc->stepList()));
|
||||
dc->stepList()->insertStep(3, new MaemoCopyFilesViaMountStep(dc->stepList()));
|
||||
} else if (id == Qt4MaemoDeployConfiguration::fremantleWithPackagingId()) {
|
||||
dc->stepList()->insertStep(0, new MaemoDebianPackageCreationStep(dc->stepList()));
|
||||
dc->stepList()->insertStep(1, new MaemoInstallDebianPackageToSysrootStep(dc->stepList()));
|
||||
dc->stepList()->insertStep(2, new RemoteLinuxCheckForFreeDiskSpaceStep(dc->stepList()));
|
||||
dc->stepList()->insertStep(3, new MaemoInstallPackageViaMountStep(dc->stepList()));
|
||||
dc->stepList()->insertStep(2, new MaddeQemuStartStep(dc->stepList()));
|
||||
dc->stepList()->insertStep(3, new RemoteLinuxCheckForFreeDiskSpaceStep(dc->stepList()));
|
||||
dc->stepList()->insertStep(4, new MaemoInstallPackageViaMountStep(dc->stepList()));
|
||||
} else if (id == Qt4MaemoDeployConfiguration::harmattanId()) {
|
||||
dc->stepList()->insertStep(0, new MaemoDebianPackageCreationStep(dc->stepList()));
|
||||
dc->stepList()->insertStep(1, new MaemoInstallDebianPackageToSysrootStep(dc->stepList()));
|
||||
dc->stepList()->insertStep(2, new RemoteLinuxCheckForFreeDiskSpaceStep(dc->stepList()));
|
||||
dc->stepList()->insertStep(3, new MaemoUploadAndInstallPackageStep(dc->stepList()));
|
||||
dc->stepList()->insertStep(2, new MaddeQemuStartStep(dc->stepList()));
|
||||
dc->stepList()->insertStep(3, new RemoteLinuxCheckForFreeDiskSpaceStep(dc->stepList()));
|
||||
dc->stepList()->insertStep(4, new MaemoUploadAndInstallPackageStep(dc->stepList()));
|
||||
}
|
||||
return dc;
|
||||
}
|
||||
|
@@ -40,7 +40,6 @@ SUBDIRS = plugin_coreplugin \
|
||||
plugin_qmljstools \
|
||||
plugin_macros \
|
||||
debugger/dumper.pro \
|
||||
plugin_qmlprofiler \
|
||||
plugin_remotelinux \
|
||||
plugin_android \
|
||||
plugin_madde \
|
||||
@@ -63,24 +62,19 @@ include(../../qtcreator.pri)
|
||||
|
||||
contains(QT_CONFIG, declarative)|contains(QT_CONFIG, quick1) {
|
||||
SUBDIRS += \
|
||||
plugin_qmlprojectmanager
|
||||
plugin_qmlprojectmanager \
|
||||
plugin_qmlprofiler
|
||||
|
||||
include(../private_headers.pri)
|
||||
exists($${QT_PRIVATE_HEADERS}/QtDeclarative/private/qdeclarativecontext_p.h) {
|
||||
|
||||
minQtVersion(4, 7, 1) {
|
||||
SUBDIRS += plugin_qmldesigner
|
||||
} else {
|
||||
warning()
|
||||
warning("QmlDesigner plugin has been disabled.")
|
||||
warning("QmlDesigner requires Qt 4.7.1 or later.")
|
||||
}
|
||||
} else {
|
||||
warning()
|
||||
warning("QmlDesigner plugin has been disabled.")
|
||||
warning("The plugin depends on private headers from QtDeclarative module.")
|
||||
warning("To enable it, pass 'QT_PRIVATE_HEADERS=$QTDIR/include' to qmake, where $QTDIR is the source directory of qt.")
|
||||
}
|
||||
} else {
|
||||
warning("QmlProjectManager, QmlProfiler and QmlDesigner plugins have been disabled: The plugins require QtDeclarative (Qt 4.x) or QtQuick1 (Qt 5.x)");
|
||||
}
|
||||
|
||||
include (debugger/lldb/guest/qtcreator-lldb.pri)
|
||||
|
@@ -625,10 +625,10 @@ void MiniProjectTargetSelector::setActiveRunConfiguration(ProjectExplorer::Proje
|
||||
void MiniProjectTargetSelector::projectAdded(ProjectExplorer::Project *project)
|
||||
{
|
||||
connect(project, SIGNAL(addedTarget(ProjectExplorer::Target*)),
|
||||
this, SLOT(addedTarget(ProjectExplorer::Target*)));
|
||||
this, SLOT(slotAddedTarget(ProjectExplorer::Target*)));
|
||||
|
||||
connect(project, SIGNAL(removedTarget(ProjectExplorer::Target*)),
|
||||
this, SLOT(removedTarget(ProjectExplorer::Target*)));
|
||||
this, SLOT(slotRemovedTarget(ProjectExplorer::Target*)));
|
||||
|
||||
foreach (Target *t, project->targets())
|
||||
addedTarget(t);
|
||||
@@ -643,10 +643,10 @@ void MiniProjectTargetSelector::projectAdded(ProjectExplorer::Project *project)
|
||||
void MiniProjectTargetSelector::projectRemoved(ProjectExplorer::Project *project)
|
||||
{
|
||||
disconnect(project, SIGNAL(addedTarget(ProjectExplorer::Target*)),
|
||||
this, SLOT(addedTarget(ProjectExplorer::Target*)));
|
||||
this, SLOT(slotAddedTarget(ProjectExplorer::Target*)));
|
||||
|
||||
disconnect(project, SIGNAL(removedTarget(ProjectExplorer::Target*)),
|
||||
this, SLOT(removedTarget(ProjectExplorer::Target*)));
|
||||
this, SLOT(slotRemovedTarget(ProjectExplorer::Target*)));
|
||||
|
||||
foreach (Target *t, project->targets())
|
||||
removedTarget(t);
|
||||
@@ -661,19 +661,19 @@ void MiniProjectTargetSelector::projectRemoved(ProjectExplorer::Project *project
|
||||
void MiniProjectTargetSelector::addedTarget(ProjectExplorer::Target *target)
|
||||
{
|
||||
connect(target, SIGNAL(addedBuildConfiguration(ProjectExplorer::BuildConfiguration*)),
|
||||
this, SLOT(addedBuildConfiguration(ProjectExplorer::BuildConfiguration*)));
|
||||
this, SLOT(slotAddedBuildConfiguration(ProjectExplorer::BuildConfiguration*)));
|
||||
connect(target, SIGNAL(removedBuildConfiguration(ProjectExplorer::BuildConfiguration*)),
|
||||
this, SLOT(removedBuildConfiguration(ProjectExplorer::BuildConfiguration*)));
|
||||
this, SLOT(slotRemovedBuildConfiguration(ProjectExplorer::BuildConfiguration*)));
|
||||
|
||||
connect(target, SIGNAL(addedDeployConfiguration(ProjectExplorer::DeployConfiguration*)),
|
||||
this, SLOT(addedDeployConfiguration(ProjectExplorer::DeployConfiguration*)));
|
||||
this, SLOT(slotAddedDeployConfiguration(ProjectExplorer::DeployConfiguration*)));
|
||||
connect(target, SIGNAL(removedDeployConfiguration(ProjectExplorer::DeployConfiguration*)),
|
||||
this, SLOT(removedDeployConfiguration(ProjectExplorer::DeployConfiguration*)));
|
||||
this, SLOT(slotRemovedDeployConfiguration(ProjectExplorer::DeployConfiguration*)));
|
||||
|
||||
connect(target, SIGNAL(addedRunConfiguration(ProjectExplorer::RunConfiguration*)),
|
||||
this, SLOT(addedRunConfiguration(ProjectExplorer::RunConfiguration*)));
|
||||
this, SLOT(slotAddedRunConfiguration(ProjectExplorer::RunConfiguration*)));
|
||||
connect(target, SIGNAL(removedRunConfiguration(ProjectExplorer::RunConfiguration*)),
|
||||
this, SLOT(removedRunConfiguration(ProjectExplorer::RunConfiguration*)));
|
||||
this, SLOT(slotRemovedRunConfiguration(ProjectExplorer::RunConfiguration*)));
|
||||
|
||||
if (target->project() == m_project)
|
||||
m_listWidgets[TARGET]->addProjectConfiguration(target);
|
||||
@@ -684,7 +684,11 @@ void MiniProjectTargetSelector::addedTarget(ProjectExplorer::Target *target)
|
||||
addedDeployConfiguration(dc);
|
||||
foreach (RunConfiguration *rc, target->runConfigurations())
|
||||
addedRunConfiguration(rc);
|
||||
}
|
||||
|
||||
void MiniProjectTargetSelector::slotAddedTarget(ProjectExplorer::Target *target)
|
||||
{
|
||||
addedTarget(target);
|
||||
updateTargetListVisible();
|
||||
updateBuildListVisible();
|
||||
updateDeployListVisible();
|
||||
@@ -694,19 +698,19 @@ void MiniProjectTargetSelector::addedTarget(ProjectExplorer::Target *target)
|
||||
void MiniProjectTargetSelector::removedTarget(ProjectExplorer::Target *target)
|
||||
{
|
||||
disconnect(target, SIGNAL(addedBuildConfiguration(ProjectExplorer::BuildConfiguration*)),
|
||||
this, SLOT(addedBuildConfiguration(ProjectExplorer::BuildConfiguration*)));
|
||||
this, SLOT(slotAddedBuildConfiguration(ProjectExplorer::BuildConfiguration*)));
|
||||
disconnect(target, SIGNAL(removedBuildConfiguration(ProjectExplorer::BuildConfiguration*)),
|
||||
this, SLOT(removedBuildConfiguration(ProjectExplorer::BuildConfiguration*)));
|
||||
this, SLOT(slotRemovedBuildConfiguration(ProjectExplorer::BuildConfiguration*)));
|
||||
|
||||
disconnect(target, SIGNAL(addedDeployConfiguration(ProjectExplorer::DeployConfiguration*)),
|
||||
this, SLOT(addedDeployConfiguration(ProjectExplorer::DeployConfiguration*)));
|
||||
this, SLOT(slotAddedDeployConfiguration(ProjectExplorer::DeployConfiguration*)));
|
||||
disconnect(target, SIGNAL(removedDeployConfiguration(ProjectExplorer::DeployConfiguration*)),
|
||||
this, SLOT(removedDeployConfiguration(ProjectExplorer::DeployConfiguration*)));
|
||||
this, SLOT(slotRemovedDeployConfiguration(ProjectExplorer::DeployConfiguration*)));
|
||||
|
||||
disconnect(target, SIGNAL(addedRunConfiguration(ProjectExplorer::RunConfiguration*)),
|
||||
this, SLOT(addedRunConfiguration(ProjectExplorer::RunConfiguration*)));
|
||||
this, SLOT(slotAddedRunConfiguration(ProjectExplorer::RunConfiguration*)));
|
||||
disconnect(target, SIGNAL(removedRunConfiguration(ProjectExplorer::RunConfiguration*)),
|
||||
this, SLOT(removedRunConfiguration(ProjectExplorer::RunConfiguration*)));
|
||||
this, SLOT(slotRemovedRunConfiguration(ProjectExplorer::RunConfiguration*)));
|
||||
|
||||
if (target->project() == m_project)
|
||||
m_listWidgets[TARGET]->removeProjectConfiguration(target);
|
||||
@@ -717,6 +721,11 @@ void MiniProjectTargetSelector::removedTarget(ProjectExplorer::Target *target)
|
||||
removedDeployConfiguration(dc);
|
||||
foreach (RunConfiguration *rc, target->runConfigurations())
|
||||
removedRunConfiguration(rc);
|
||||
}
|
||||
|
||||
void MiniProjectTargetSelector::slotRemovedTarget(ProjectExplorer::Target *target)
|
||||
{
|
||||
removedTarget(target);
|
||||
|
||||
updateTargetListVisible();
|
||||
updateBuildListVisible();
|
||||
@@ -724,7 +733,14 @@ void MiniProjectTargetSelector::removedTarget(ProjectExplorer::Target *target)
|
||||
updateRunListVisible();
|
||||
}
|
||||
|
||||
|
||||
void MiniProjectTargetSelector::addedBuildConfiguration(ProjectExplorer::BuildConfiguration *bc)
|
||||
{
|
||||
if (bc->target() == m_target)
|
||||
m_listWidgets[BUILD]->addProjectConfiguration(bc);
|
||||
}
|
||||
|
||||
void MiniProjectTargetSelector::slotAddedBuildConfiguration(ProjectExplorer::BuildConfiguration *bc)
|
||||
{
|
||||
if (bc->target() == m_target)
|
||||
m_listWidgets[BUILD]->addProjectConfiguration(bc);
|
||||
@@ -732,6 +748,12 @@ void MiniProjectTargetSelector::addedBuildConfiguration(ProjectExplorer::BuildCo
|
||||
}
|
||||
|
||||
void MiniProjectTargetSelector::removedBuildConfiguration(ProjectExplorer::BuildConfiguration *bc)
|
||||
{
|
||||
if (bc->target() == m_target)
|
||||
m_listWidgets[BUILD]->removeProjectConfiguration(bc);
|
||||
}
|
||||
|
||||
void MiniProjectTargetSelector::slotRemovedBuildConfiguration(ProjectExplorer::BuildConfiguration *bc)
|
||||
{
|
||||
if (bc->target() == m_target)
|
||||
m_listWidgets[BUILD]->removeProjectConfiguration(bc);
|
||||
@@ -739,6 +761,12 @@ void MiniProjectTargetSelector::removedBuildConfiguration(ProjectExplorer::Build
|
||||
}
|
||||
|
||||
void MiniProjectTargetSelector::addedDeployConfiguration(ProjectExplorer::DeployConfiguration *dc)
|
||||
{
|
||||
if (dc->target() == m_target)
|
||||
m_listWidgets[DEPLOY]->addProjectConfiguration(dc);
|
||||
}
|
||||
|
||||
void MiniProjectTargetSelector::slotAddedDeployConfiguration(ProjectExplorer::DeployConfiguration *dc)
|
||||
{
|
||||
if (dc->target() == m_target)
|
||||
m_listWidgets[DEPLOY]->addProjectConfiguration(dc);
|
||||
@@ -746,6 +774,12 @@ void MiniProjectTargetSelector::addedDeployConfiguration(ProjectExplorer::Deploy
|
||||
}
|
||||
|
||||
void MiniProjectTargetSelector::removedDeployConfiguration(ProjectExplorer::DeployConfiguration *dc)
|
||||
{
|
||||
if (dc->target() == m_target)
|
||||
m_listWidgets[DEPLOY]->removeProjectConfiguration(dc);
|
||||
}
|
||||
|
||||
void MiniProjectTargetSelector::slotRemovedDeployConfiguration(ProjectExplorer::DeployConfiguration *dc)
|
||||
{
|
||||
if (dc->target() == m_target)
|
||||
m_listWidgets[DEPLOY]->removeProjectConfiguration(dc);
|
||||
@@ -753,6 +787,12 @@ void MiniProjectTargetSelector::removedDeployConfiguration(ProjectExplorer::Depl
|
||||
}
|
||||
|
||||
void MiniProjectTargetSelector::addedRunConfiguration(ProjectExplorer::RunConfiguration *rc)
|
||||
{
|
||||
if (rc->target() == m_target)
|
||||
m_listWidgets[RUN]->addProjectConfiguration(rc);
|
||||
}
|
||||
|
||||
void MiniProjectTargetSelector::slotAddedRunConfiguration(ProjectExplorer::RunConfiguration *rc)
|
||||
{
|
||||
if (rc->target() == m_target)
|
||||
m_listWidgets[RUN]->addProjectConfiguration(rc);
|
||||
@@ -760,6 +800,12 @@ void MiniProjectTargetSelector::addedRunConfiguration(ProjectExplorer::RunConfig
|
||||
}
|
||||
|
||||
void MiniProjectTargetSelector::removedRunConfiguration(ProjectExplorer::RunConfiguration *rc)
|
||||
{
|
||||
if (rc->target() == m_target)
|
||||
m_listWidgets[RUN]->removeProjectConfiguration(rc);
|
||||
}
|
||||
|
||||
void MiniProjectTargetSelector::slotRemovedRunConfiguration(ProjectExplorer::RunConfiguration *rc)
|
||||
{
|
||||
if (rc->target() == m_target)
|
||||
m_listWidgets[RUN]->removeProjectConfiguration(rc);
|
||||
|
@@ -62,6 +62,7 @@ public:
|
||||
void keyPressEvent(QKeyEvent *event);
|
||||
void keyReleaseEvent(QKeyEvent *event);
|
||||
void setMaxCount(int maxCount);
|
||||
|
||||
private:
|
||||
int m_maxCount;
|
||||
};
|
||||
@@ -122,14 +123,14 @@ public slots:
|
||||
private slots:
|
||||
void projectAdded(ProjectExplorer::Project *project);
|
||||
void projectRemoved(ProjectExplorer::Project *project);
|
||||
void addedTarget(ProjectExplorer::Target *target);
|
||||
void removedTarget(ProjectExplorer::Target *target);
|
||||
void addedBuildConfiguration(ProjectExplorer::BuildConfiguration* bc);
|
||||
void removedBuildConfiguration(ProjectExplorer::BuildConfiguration* bc);
|
||||
void addedDeployConfiguration(ProjectExplorer::DeployConfiguration *dc);
|
||||
void removedDeployConfiguration(ProjectExplorer::DeployConfiguration *dc);
|
||||
void addedRunConfiguration(ProjectExplorer::RunConfiguration *rc);
|
||||
void removedRunConfiguration(ProjectExplorer::RunConfiguration *rc);
|
||||
void slotAddedTarget(ProjectExplorer::Target *target);
|
||||
void slotRemovedTarget(ProjectExplorer::Target *target);
|
||||
void slotAddedBuildConfiguration(ProjectExplorer::BuildConfiguration *bc);
|
||||
void slotRemovedBuildConfiguration(ProjectExplorer::BuildConfiguration *bc);
|
||||
void slotAddedDeployConfiguration(ProjectExplorer::DeployConfiguration *dc);
|
||||
void slotRemovedDeployConfiguration(ProjectExplorer::DeployConfiguration *dc);
|
||||
void slotAddedRunConfiguration(ProjectExplorer::RunConfiguration *rc);
|
||||
void slotRemovedRunConfiguration(ProjectExplorer::RunConfiguration *rc);
|
||||
|
||||
void changeStartupProject(ProjectExplorer::Project *project);
|
||||
void activeTargetChanged(ProjectExplorer::Target *target);
|
||||
@@ -147,6 +148,15 @@ private slots:
|
||||
void updateActionAndSummary();
|
||||
void switchToProjectsMode();
|
||||
private:
|
||||
void addedTarget(ProjectExplorer::Target *target);
|
||||
void removedTarget(ProjectExplorer::Target *target);
|
||||
void addedBuildConfiguration(ProjectExplorer::BuildConfiguration* bc);
|
||||
void removedBuildConfiguration(ProjectExplorer::BuildConfiguration* bc);
|
||||
void addedDeployConfiguration(ProjectExplorer::DeployConfiguration *dc);
|
||||
void removedDeployConfiguration(ProjectExplorer::DeployConfiguration *dc);
|
||||
void addedRunConfiguration(ProjectExplorer::RunConfiguration *rc);
|
||||
void removedRunConfiguration(ProjectExplorer::RunConfiguration *rc);
|
||||
|
||||
void updateProjectListVisible();
|
||||
void updateTargetListVisible();
|
||||
void updateBuildListVisible();
|
||||
|
@@ -76,15 +76,12 @@ ProfileManagerConfigWidget::ProfileManagerConfigWidget(Profile *p, QWidget *pare
|
||||
iconLayout->addWidget(m_iconButton);
|
||||
iconLayout->addStretch();
|
||||
|
||||
QHBoxLayout *spacer = new QHBoxLayout;
|
||||
spacer->addItem(new QSpacerItem(1, 1, QSizePolicy::Fixed, QSizePolicy::MinimumExpanding));
|
||||
|
||||
QGridLayout *masterLayout = new QGridLayout(widget);
|
||||
masterLayout->setMargin(0);
|
||||
masterLayout->setContentsMargins(6, 0, 6, 0);
|
||||
masterLayout->addLayout(iconLayout, 0, 0);
|
||||
masterLayout->addLayout(m_layout, 0, 1);
|
||||
masterLayout->addLayout(spacer, 1, 0);
|
||||
masterLayout->setRowStretch(1, 1);
|
||||
|
||||
discard();
|
||||
|
||||
|
@@ -80,6 +80,7 @@ QWidget *ProfileOptionsPage::createPage(QWidget *parent)
|
||||
m_makeDefaultButton = new QPushButton(tr("Make Default"), m_configWidget);
|
||||
|
||||
QVBoxLayout *buttonLayout = new QVBoxLayout();
|
||||
buttonLayout->setSpacing(6);
|
||||
buttonLayout->setContentsMargins(0, 0, 0, 0);
|
||||
buttonLayout->addWidget(m_addButton);
|
||||
buttonLayout->addWidget(m_cloneButton);
|
||||
|
@@ -64,6 +64,9 @@ BlackBerryRunConfiguration::BlackBerryRunConfiguration(ProjectExplorer::Target *
|
||||
void BlackBerryRunConfiguration::init()
|
||||
{
|
||||
updateDisplayName();
|
||||
|
||||
connect(deployConfiguration()->deploymentInfo(), SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SIGNAL(targetInformationChanged()));
|
||||
connect(deployConfiguration()->deploymentInfo(), SIGNAL(modelReset()), this, SIGNAL(targetInformationChanged()));
|
||||
}
|
||||
|
||||
void BlackBerryRunConfiguration::updateDisplayName()
|
||||
|
@@ -65,7 +65,7 @@ TargetSetupPage::TargetSetupPage(QWidget *parent) :
|
||||
m_ignoreUpdates(false),
|
||||
m_firstWidget(0),
|
||||
m_ui(new Internal::Ui::TargetSetupPage),
|
||||
m_importWidget(new Internal::ImportWidget),
|
||||
m_importWidget(new Internal::ImportWidget(this)),
|
||||
m_spacer(new QSpacerItem(0,0, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding))
|
||||
{
|
||||
setObjectName(QLatin1String("TargetSetupPage"));
|
||||
|
@@ -757,10 +757,7 @@ void BaseQtVersion::ensureMkSpecParsed() const
|
||||
ProFileCacheManager::instance()->incRefCount();
|
||||
QMakeParser parser(ProFileCacheManager::instance()->cache(), &msgHandler);
|
||||
ProFileEvaluator evaluator(&option, &parser, &msgHandler);
|
||||
if (ProFile *pro = parser.parsedProFile(mkspecPath().toString() + QLatin1String("/qmake.conf"))) {
|
||||
evaluator.accept(pro, QMakeEvaluator::LoadProOnly);
|
||||
pro->deref();
|
||||
}
|
||||
evaluator.loadNamedSpec(mkspecPath().toString(), false);
|
||||
|
||||
parseMkSpec(&evaluator);
|
||||
|
||||
|
@@ -69,10 +69,7 @@ BaseQtVersion *QtVersionFactory::createQtVersionFromQMakePath(const Utils::FileN
|
||||
ProFileCacheManager::instance()->incRefCount();
|
||||
QMakeParser parser(ProFileCacheManager::instance()->cache(), &msgHandler);
|
||||
ProFileEvaluator evaluator(&globals, &parser, &msgHandler);
|
||||
if (ProFile *pro = parser.parsedProFile(mkspec.toString() + QLatin1String("/qmake.conf"))) {
|
||||
evaluator.accept(pro, QMakeEvaluator::LoadProOnly);
|
||||
pro->deref();
|
||||
}
|
||||
evaluator.loadNamedSpec(mkspec.toString(), false);
|
||||
|
||||
QList<QtVersionFactory *> factories = ExtensionSystem::PluginManager::getObjects<QtVersionFactory>();
|
||||
qSort(factories.begin(), factories.end(), &sortByPriority);
|
||||
|
@@ -115,6 +115,9 @@ public:
|
||||
font.setItalic(m_scheme->formatFor(description.id()).italic());
|
||||
return font;
|
||||
}
|
||||
case Qt::ToolTipRole: {
|
||||
return description.tooltipText();
|
||||
}
|
||||
}
|
||||
return QVariant();
|
||||
}
|
||||
|
@@ -228,17 +228,19 @@ FontSettingsPagePrivate::~FontSettingsPagePrivate()
|
||||
|
||||
|
||||
// ------- FormatDescription
|
||||
FormatDescription::FormatDescription(TextStyle id, const QString &displayName, const QColor &color) :
|
||||
m_id(id),
|
||||
m_displayName(displayName)
|
||||
{
|
||||
m_format.setForeground(color);
|
||||
}
|
||||
|
||||
FormatDescription::FormatDescription(TextStyle id, const QString &displayName, const Format &format) :
|
||||
FormatDescription::FormatDescription(TextStyle id, const QString &displayName, const QString &tooltipText, const QColor &foreground) :
|
||||
m_id(id),
|
||||
m_displayName(displayName),
|
||||
m_format(format)
|
||||
m_tooltipText(tooltipText)
|
||||
{
|
||||
m_format.setForeground(foreground);
|
||||
}
|
||||
|
||||
FormatDescription::FormatDescription(TextStyle id, const QString &displayName, const QString &tooltipText, const Format &format) :
|
||||
m_id(id),
|
||||
m_displayName(displayName),
|
||||
m_format(format),
|
||||
m_tooltipText(tooltipText)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -56,9 +56,9 @@ class FontSettingsPagePrivate;
|
||||
class TEXTEDITOR_EXPORT FormatDescription
|
||||
{
|
||||
public:
|
||||
FormatDescription(TextStyle id, const QString &displayName,
|
||||
FormatDescription(TextStyle id, const QString &displayName, const QString &tooltipText,
|
||||
const QColor &foreground = Qt::black);
|
||||
FormatDescription(TextStyle id, const QString &displayName,
|
||||
FormatDescription(TextStyle id, const QString &displayName, const QString &tooltipText,
|
||||
const Format &format);
|
||||
|
||||
TextStyle id() const { return m_id; }
|
||||
@@ -72,10 +72,14 @@ public:
|
||||
const Format &format() const { return m_format; }
|
||||
Format &format() { return m_format; }
|
||||
|
||||
QString tooltipText() const
|
||||
{ return m_tooltipText; }
|
||||
|
||||
private:
|
||||
TextStyle m_id; // Name of the category
|
||||
QString m_displayName; // Displayed name of the category
|
||||
Format m_format; // Default format
|
||||
QString m_tooltipText; // Description text for category
|
||||
};
|
||||
|
||||
typedef QList<FormatDescription> FormatDescriptions;
|
||||
|
@@ -57,7 +57,9 @@ const char *nameForStyle(TextStyle style)
|
||||
case C_TYPE: return "Type";
|
||||
case C_LOCAL: return "Local";
|
||||
case C_FIELD: return "Field";
|
||||
case C_STATIC: return "Static";
|
||||
// TODO: Rename "Static" to "Enumeration" in next major update,
|
||||
// because renaming here would break styles defined by the user.
|
||||
case C_ENUMERATION: return "Static";
|
||||
case C_VIRTUAL_METHOD: return "VirtualMethod";
|
||||
case C_FUNCTION: return "Function";
|
||||
case C_KEYWORD: return "Keyword";
|
||||
|
@@ -56,7 +56,7 @@ enum TextStyle {
|
||||
C_TYPE,
|
||||
C_LOCAL,
|
||||
C_FIELD,
|
||||
C_STATIC,
|
||||
C_ENUMERATION,
|
||||
C_VIRTUAL_METHOD,
|
||||
C_FUNCTION,
|
||||
C_KEYWORD,
|
||||
|
@@ -112,84 +112,151 @@ TextEditorSettings::TextEditorSettings(QObject *parent)
|
||||
// Note: default background colors are coming from FormatDescription::background()
|
||||
|
||||
// Add font preference page
|
||||
FormatDescriptions formatDescriptions;
|
||||
formatDescriptions.append(FormatDescription(C_TEXT, tr("Text")));
|
||||
FormatDescriptions formatDescr;
|
||||
formatDescr.append(FormatDescription(C_TEXT, tr("Text"), tr("Generic text.\nApplied for "
|
||||
"text, if no other "
|
||||
"rules matching.")));
|
||||
|
||||
// Special categories
|
||||
const QPalette p = QApplication::palette();
|
||||
formatDescriptions.append(FormatDescription(C_LINK, tr("Link"), Qt::blue));
|
||||
formatDescriptions.append(FormatDescription(C_SELECTION, tr("Selection"), p.color(QPalette::HighlightedText)));
|
||||
formatDescriptions.append(FormatDescription(C_LINE_NUMBER, tr("Line Number")));
|
||||
formatDescriptions.append(FormatDescription(C_SEARCH_RESULT, tr("Search Result")));
|
||||
formatDescriptions.append(FormatDescription(C_SEARCH_SCOPE, tr("Search Scope")));
|
||||
formatDescriptions.append(FormatDescription(C_PARENTHESES, tr("Parentheses")));
|
||||
formatDescriptions.append(FormatDescription(C_CURRENT_LINE, tr("Current Line")));
|
||||
formatDescr.append(FormatDescription(C_LINK, tr("Link"),
|
||||
tr("Links that follow symbol under cursor."), Qt::blue));
|
||||
formatDescr.append(FormatDescription(C_SELECTION, tr("Selection"), tr("Selected text."),
|
||||
p.color(QPalette::HighlightedText)));
|
||||
formatDescr.append(FormatDescription(C_LINE_NUMBER, tr("Line Number"),
|
||||
tr("Line numbers located on the "
|
||||
"left side of the editor.")));
|
||||
formatDescr.append(FormatDescription(C_SEARCH_RESULT, tr("Search Result"),
|
||||
tr("Highlighted search results inside the editor.")));
|
||||
formatDescr.append(FormatDescription(C_SEARCH_SCOPE, tr("Search Scope"),
|
||||
tr("Section where the pattern is searched in.")));
|
||||
formatDescr.append(FormatDescription(C_PARENTHESES, tr("Parentheses"),
|
||||
tr("Displayed when matching parantheses, square brackets "
|
||||
"or curly brackets are found.")));
|
||||
formatDescr.append(FormatDescription(C_CURRENT_LINE, tr("Current Line"),
|
||||
tr("Line where the cursor is placed in.")));
|
||||
|
||||
FormatDescription currentLineNumber = FormatDescription(C_CURRENT_LINE_NUMBER, tr("Current Line Number"), Qt::darkGray);
|
||||
FormatDescription currentLineNumber =
|
||||
FormatDescription(C_CURRENT_LINE_NUMBER, tr("Current Line Number"),
|
||||
tr("Line number located on the left side of the "
|
||||
"editor where the cursor is placed in."), Qt::darkGray);
|
||||
currentLineNumber.format().setBold(true);
|
||||
formatDescriptions.append(currentLineNumber);
|
||||
formatDescr.append(currentLineNumber);
|
||||
|
||||
formatDescriptions.append(FormatDescription(C_OCCURRENCES, tr("Occurrences")));
|
||||
formatDescriptions.append(FormatDescription(C_OCCURRENCES_UNUSED, tr("Unused Occurrence")));
|
||||
formatDescriptions.append(FormatDescription(C_OCCURRENCES_RENAME, tr("Renaming Occurrence")));
|
||||
|
||||
formatDescr.append(FormatDescription(C_OCCURRENCES, tr("Occurrences"),
|
||||
tr("Occurences of the symbol under the cursor.\n"
|
||||
"(Only the backgroud will be applied.)")));
|
||||
formatDescr.append(FormatDescription(C_OCCURRENCES_UNUSED, tr("Unused Occurrence"),
|
||||
tr("Occurences of unused variables.")));
|
||||
formatDescr.append(FormatDescription(C_OCCURRENCES_RENAME, tr("Renaming Occurrence"),
|
||||
tr("Occurences of a symbol that will be renamed.")));
|
||||
|
||||
// Standard categories
|
||||
formatDescriptions.append(FormatDescription(C_NUMBER, tr("Number"), Qt::darkBlue));
|
||||
formatDescriptions.append(FormatDescription(C_STRING, tr("String"), Qt::darkGreen));
|
||||
formatDescriptions.append(FormatDescription(C_TYPE, tr("Type"), Qt::darkMagenta));
|
||||
formatDescriptions.append(FormatDescription(C_LOCAL, tr("Local")));
|
||||
formatDescriptions.append(FormatDescription(C_FIELD, tr("Field"), Qt::darkRed));
|
||||
formatDescriptions.append(FormatDescription(C_STATIC, tr("Static"), Qt::darkMagenta));
|
||||
formatDescr.append(FormatDescription(C_NUMBER, tr("Number"), tr("Number literal."),
|
||||
Qt::darkBlue));
|
||||
formatDescr.append(FormatDescription(C_STRING, tr("String"),
|
||||
tr("Character and string literals."), Qt::darkGreen));
|
||||
formatDescr.append(FormatDescription(C_TYPE, tr("Type"), tr("Name of a type."),
|
||||
Qt::darkMagenta));
|
||||
formatDescr.append(FormatDescription(C_LOCAL, tr("Local"), tr("Local variables.")));
|
||||
formatDescr.append(FormatDescription(C_FIELD, tr("Field"),
|
||||
tr("Class' data members."), Qt::darkRed));
|
||||
formatDescr.append(FormatDescription(C_ENUMERATION, tr("Enumeration"),
|
||||
tr("Applied for Enumeration Items."), Qt::darkMagenta));
|
||||
|
||||
Format functionFormat;
|
||||
formatDescriptions.append(FormatDescription(C_FUNCTION, tr("Function"), functionFormat));
|
||||
formatDescr.append(FormatDescription(C_FUNCTION, tr("Function"), tr("Name of a function."),
|
||||
functionFormat));
|
||||
functionFormat.setItalic(true);
|
||||
formatDescriptions.append(FormatDescription(C_VIRTUAL_METHOD, tr("Virtual Method"), functionFormat));
|
||||
formatDescr.append(FormatDescription(C_VIRTUAL_METHOD, tr("Virtual Method"),
|
||||
tr("Name of method declared as virtual."),
|
||||
functionFormat));
|
||||
|
||||
formatDescriptions.append(FormatDescription(C_BINDING, tr("QML Binding"), Qt::darkRed));
|
||||
formatDescr.append(FormatDescription(C_BINDING, tr("QML Binding"),
|
||||
tr("QML item property, that allows a "
|
||||
"binding to another property."),
|
||||
Qt::darkRed));
|
||||
|
||||
Format qmlLocalNameFormat;
|
||||
qmlLocalNameFormat.setItalic(true);
|
||||
formatDescriptions.append(FormatDescription(C_QML_LOCAL_ID, tr("QML Local Id"), qmlLocalNameFormat));
|
||||
formatDescriptions.append(FormatDescription(C_QML_ROOT_OBJECT_PROPERTY, tr("QML Root Object Property"), qmlLocalNameFormat));
|
||||
formatDescriptions.append(FormatDescription(C_QML_SCOPE_OBJECT_PROPERTY, tr("QML Scope Object Property"), qmlLocalNameFormat));
|
||||
formatDescriptions.append(FormatDescription(C_QML_STATE_NAME, tr("QML State Name"), qmlLocalNameFormat));
|
||||
formatDescr.append(FormatDescription(C_QML_LOCAL_ID, tr("QML Local Id"),
|
||||
tr("QML item id within a QML file."), qmlLocalNameFormat));
|
||||
formatDescr.append(FormatDescription(C_QML_ROOT_OBJECT_PROPERTY,
|
||||
tr("QML root Object Property"),
|
||||
tr("QML property of a parent item."), qmlLocalNameFormat));
|
||||
formatDescr.append(FormatDescription(C_QML_SCOPE_OBJECT_PROPERTY,
|
||||
tr("QML scope Object Property"),
|
||||
tr("Property of the same QML item."), qmlLocalNameFormat));
|
||||
formatDescr.append(FormatDescription(C_QML_STATE_NAME, tr("QML State Name"),
|
||||
tr("Name of a QML state."), qmlLocalNameFormat));
|
||||
|
||||
formatDescriptions.append(FormatDescription(C_QML_TYPE_ID, tr("QML Type Name"), Qt::darkMagenta));
|
||||
formatDescr.append(FormatDescription(C_QML_TYPE_ID, tr("QML Type Name"),
|
||||
tr("Name of a QML type."), Qt::darkMagenta));
|
||||
|
||||
Format qmlExternalNameFormat = qmlLocalNameFormat;
|
||||
qmlExternalNameFormat.setForeground(Qt::darkBlue);
|
||||
formatDescriptions.append(FormatDescription(C_QML_EXTERNAL_ID, tr("QML External Id"), qmlExternalNameFormat));
|
||||
formatDescriptions.append(FormatDescription(C_QML_EXTERNAL_OBJECT_PROPERTY, tr("QML External Object Property"), qmlExternalNameFormat));
|
||||
formatDescr.append(FormatDescription(C_QML_EXTERNAL_ID, tr("QML External Id"),
|
||||
tr("QML id defined in another QML file."),
|
||||
qmlExternalNameFormat));
|
||||
formatDescr.append(FormatDescription(C_QML_EXTERNAL_OBJECT_PROPERTY,
|
||||
tr("QML External Object Property"),
|
||||
tr("QML property defined in another QML file."),
|
||||
qmlExternalNameFormat));
|
||||
|
||||
Format jsLocalFormat;
|
||||
jsLocalFormat.setForeground(QColor(41, 133, 199)); // very light blue
|
||||
jsLocalFormat.setItalic(true);
|
||||
formatDescriptions.append(FormatDescription(C_JS_SCOPE_VAR, tr("JavaScript Scope Var"), jsLocalFormat));
|
||||
formatDescr.append(FormatDescription(C_JS_SCOPE_VAR, tr("JavaScript Scope Var"),
|
||||
tr("Variables defined inside the JavaScript file."),
|
||||
jsLocalFormat));
|
||||
|
||||
Format jsGlobalFormat;
|
||||
jsGlobalFormat.setForeground(QColor(0, 85, 175)); // light blue
|
||||
jsGlobalFormat.setItalic(true);
|
||||
formatDescriptions.append(FormatDescription(C_JS_IMPORT_VAR, tr("JavaScript Import"), jsGlobalFormat));
|
||||
formatDescriptions.append(FormatDescription(C_JS_GLOBAL_VAR, tr("JavaScript Global Variable"), jsGlobalFormat));
|
||||
formatDescr.append(FormatDescription(C_JS_IMPORT_VAR, tr("JavaScript Import"),
|
||||
tr("Name of a JavaScript import inside a QML file."),
|
||||
jsGlobalFormat));
|
||||
formatDescr.append(FormatDescription(C_JS_GLOBAL_VAR, tr("JavaScript Global Variable"),
|
||||
tr("Variables defined outside the script."),
|
||||
jsGlobalFormat));
|
||||
|
||||
formatDescriptions.append(FormatDescription(C_KEYWORD, tr("Keyword"), Qt::darkYellow));
|
||||
formatDescriptions.append(FormatDescription(C_OPERATOR, tr("Operator")));
|
||||
formatDescriptions.append(FormatDescription(C_PREPROCESSOR, tr("Preprocessor"), Qt::darkBlue));
|
||||
formatDescriptions.append(FormatDescription(C_LABEL, tr("Label"), Qt::darkRed));
|
||||
formatDescriptions.append(FormatDescription(C_COMMENT, tr("Comment"), Qt::darkGreen));
|
||||
formatDescriptions.append(FormatDescription(C_DOXYGEN_COMMENT, tr("Doxygen Comment"), Qt::darkBlue));
|
||||
formatDescriptions.append(FormatDescription(C_DOXYGEN_TAG, tr("Doxygen Tag"), Qt::blue));
|
||||
formatDescriptions.append(FormatDescription(C_VISUAL_WHITESPACE, tr("Visual Whitespace"), Qt::lightGray));
|
||||
formatDescriptions.append(FormatDescription(C_DISABLED_CODE, tr("Disabled Code")));
|
||||
formatDescr.append(FormatDescription(C_KEYWORD, tr("Keyword"),
|
||||
tr("Reserved keywords of the programming language."),
|
||||
Qt::darkYellow));
|
||||
formatDescr.append(FormatDescription(C_OPERATOR, tr("Operator"),
|
||||
tr("Operators. (for example operator++ operator-=)")));
|
||||
formatDescr.append(FormatDescription(C_PREPROCESSOR, tr("Preprocessor"),
|
||||
tr("Preprocessor directives."), Qt::darkBlue));
|
||||
formatDescr.append(FormatDescription(C_LABEL, tr("Label"), tr("Labels for goto steatments."),
|
||||
Qt::darkRed));
|
||||
formatDescr.append(FormatDescription(C_COMMENT, tr("Comment"),
|
||||
tr("All style of comments except Doxygen comments."),
|
||||
Qt::darkGreen));
|
||||
formatDescr.append(FormatDescription(C_DOXYGEN_COMMENT, tr("Doxygen Comment"),
|
||||
tr("Doxygen comments."), Qt::darkBlue));
|
||||
formatDescr.append(FormatDescription(C_DOXYGEN_TAG, tr("Doxygen Tag"), tr("Doxygen tags"),
|
||||
Qt::blue));
|
||||
formatDescr.append(FormatDescription(C_VISUAL_WHITESPACE, tr("Visual Whitespace"),
|
||||
tr("Whitespace\nWill not be applied for whitespace "
|
||||
"in comments and strings."), Qt::lightGray));
|
||||
formatDescr.append(FormatDescription(C_DISABLED_CODE, tr("Disabled Code"),
|
||||
tr("Code disabled by preprocessor directives.")));
|
||||
|
||||
// Diff categories
|
||||
formatDescriptions.append(FormatDescription(C_ADDED_LINE, tr("Added Line"), QColor(0, 170, 0)));
|
||||
formatDescriptions.append(FormatDescription(C_REMOVED_LINE, tr("Removed Line"), Qt::red));
|
||||
formatDescriptions.append(FormatDescription(C_DIFF_FILE, tr("Diff File"), Qt::darkBlue));
|
||||
formatDescriptions.append(FormatDescription(C_DIFF_LOCATION, tr("Diff Location"), Qt::blue));
|
||||
formatDescr.append(FormatDescription(C_ADDED_LINE, tr("Added Line"),
|
||||
tr("Applied for added lines in differences "
|
||||
"(in diff editor)."), QColor(0, 170, 0)));
|
||||
formatDescr.append(FormatDescription(C_REMOVED_LINE, tr("Removed Line"),
|
||||
tr("Applied for removed lines "
|
||||
"in differences (in diff editor)."), Qt::red));
|
||||
formatDescr.append(FormatDescription(C_DIFF_FILE, tr("Diff File"),
|
||||
tr("Compared files (in diff editor)."), Qt::darkBlue));
|
||||
formatDescr.append(FormatDescription(C_DIFF_LOCATION, tr("Diff Location"),
|
||||
tr("Location in the files where the difference is "
|
||||
"(in diff editor)."), Qt::blue));
|
||||
|
||||
m_d->m_fontSettingsPage = new FontSettingsPage(formatDescriptions,
|
||||
m_d->m_fontSettingsPage = new FontSettingsPage(formatDescr,
|
||||
QLatin1String(Constants::TEXT_EDITOR_FONT_SETTINGS),
|
||||
this);
|
||||
ExtensionSystem::PluginManager::addObject(m_d->m_fontSettingsPage);
|
||||
|
@@ -1,549 +0,0 @@
|
||||
/**************************************************************************
|
||||
**
|
||||
** This file is part of Qt Creator
|
||||
**
|
||||
** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies).
|
||||
**
|
||||
** Contact: http://www.qt-project.org/
|
||||
**
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
**
|
||||
** 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.
|
||||
**
|
||||
** Other Usage
|
||||
**
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#include "json.h"
|
||||
|
||||
#ifdef TODO_USE_CREATOR
|
||||
#include <utils/qtcassert.h>
|
||||
#endif // TODO_USE_CREATOR
|
||||
|
||||
#include <QByteArray>
|
||||
#include <QTextStream>
|
||||
#include <QDebug>
|
||||
#include <QStringList>
|
||||
#include <QVariant>
|
||||
|
||||
#include <ctype.h>
|
||||
|
||||
#ifdef DEBUG_JASON
|
||||
#define JDEBUG(s) qDebug() << s
|
||||
#else
|
||||
#define JDEBUG(s)
|
||||
#endif
|
||||
|
||||
using namespace Json;
|
||||
|
||||
static void skipSpaces(const char *&from, const char *to)
|
||||
{
|
||||
while (from != to && isspace(*from))
|
||||
++from;
|
||||
}
|
||||
|
||||
QTextStream &operator<<(QTextStream &os, const JsonValue &mi)
|
||||
{
|
||||
return os << mi.toString();
|
||||
}
|
||||
|
||||
void JsonValue::parsePair(const char *&from, const char *to)
|
||||
{
|
||||
skipSpaces(from, to);
|
||||
JDEBUG("parsePair: " << QByteArray(from, to - from));
|
||||
m_name = parseCString(from, to);
|
||||
skipSpaces(from, to);
|
||||
while (from < to && *from != ':') {
|
||||
JDEBUG("not a colon" << *from);
|
||||
++from;
|
||||
}
|
||||
++from;
|
||||
parseValue(from, to);
|
||||
skipSpaces(from, to);
|
||||
}
|
||||
|
||||
QByteArray JsonValue::parseNumber(const char *&from, const char *to)
|
||||
{
|
||||
QByteArray result;
|
||||
if (from < to && *from == '-') // Leading '-'.
|
||||
result.append(*from++);
|
||||
while (from < to && *from >= '0' && *from <= '9')
|
||||
result.append(*from++);
|
||||
return result;
|
||||
}
|
||||
|
||||
QByteArray JsonValue::parseCString(const char *&from, const char *to)
|
||||
{
|
||||
QByteArray result;
|
||||
const char * const fromSaved = from;
|
||||
JDEBUG("parseCString: " << QByteArray(from, to - from));
|
||||
if (*from != '"') {
|
||||
qDebug() << "JSON Parse Error, double quote expected";
|
||||
++from; // So we don't hang
|
||||
return QByteArray();
|
||||
}
|
||||
const char *ptr = from;
|
||||
++ptr;
|
||||
while (ptr < to) {
|
||||
if (*ptr == '"') {
|
||||
++ptr;
|
||||
result = QByteArray(from + 1, ptr - from - 2);
|
||||
break;
|
||||
}
|
||||
if (*ptr == '\\') {
|
||||
++ptr;
|
||||
if (ptr == to) {
|
||||
qWarning("JSON Parse Error, unterminated backslash escape in '%s'",
|
||||
QByteArray(fromSaved, to - fromSaved).constData());
|
||||
from = ptr; // So we don't hang
|
||||
return QByteArray();
|
||||
}
|
||||
}
|
||||
++ptr;
|
||||
}
|
||||
from = ptr;
|
||||
|
||||
int idx = result.indexOf('\\');
|
||||
if (idx >= 0) {
|
||||
char *dst = result.data() + idx;
|
||||
const char *src = dst + 1, *end = result.data() + result.length();
|
||||
do {
|
||||
char c = *src++;
|
||||
switch (c) {
|
||||
case 'a': *dst++ = '\a'; break;
|
||||
case 'b': *dst++ = '\b'; break;
|
||||
case 'f': *dst++ = '\f'; break;
|
||||
case 'n': *dst++ = '\n'; break;
|
||||
case 'r': *dst++ = '\r'; break;
|
||||
case 't': *dst++ = '\t'; break;
|
||||
case 'v': *dst++ = '\v'; break;
|
||||
case '"': *dst++ = '"'; break;
|
||||
case '\\': *dst++ = '\\'; break;
|
||||
case 'u': { // 4 digit hex escape as in '\u000a'
|
||||
if (end - src < 4) {
|
||||
qWarning("JSON Parse Error, too few hex digits in \\u-escape in '%s' obtained from '%s'",
|
||||
result.constData(), QByteArray(fromSaved, to - fromSaved).constData());
|
||||
return QByteArray();
|
||||
}
|
||||
bool ok;
|
||||
const uchar prod = QByteArray(src, 4).toUInt(&ok, 16);
|
||||
if (!ok) {
|
||||
qWarning("JSON Parse Error, invalid hex digits in \\u-escape in '%s' obtained from '%s'",
|
||||
result.constData(), QByteArray(fromSaved, to - fromSaved).constData());
|
||||
return QByteArray();
|
||||
}
|
||||
*dst++ = prod;
|
||||
src += 4;
|
||||
}
|
||||
break;
|
||||
default: { // Up to 3 decimal digits: Not sure if this is supported in JSON?
|
||||
int chars = 0;
|
||||
uchar prod = 0;
|
||||
forever {
|
||||
if (c < '0' || c > '7') {
|
||||
--src;
|
||||
break;
|
||||
}
|
||||
prod = prod * 8 + c - '0';
|
||||
if (++chars == 3 || src == end)
|
||||
break;
|
||||
c = *src++;
|
||||
}
|
||||
if (!chars) {
|
||||
qWarning("JSON Parse Error, unrecognized backslash escape in string '%s' obtained from '%s'",
|
||||
result.constData(), QByteArray(fromSaved, to - fromSaved).constData());
|
||||
return QByteArray();
|
||||
}
|
||||
*dst++ = prod;
|
||||
}
|
||||
}
|
||||
while (src != end) {
|
||||
char c = *src++;
|
||||
if (c == '\\')
|
||||
break;
|
||||
*dst++ = c;
|
||||
}
|
||||
} while (src != end);
|
||||
*dst = 0;
|
||||
result.truncate(dst - result.data());
|
||||
}
|
||||
|
||||
JDEBUG("parseCString, got " << result);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void JsonValue::parseValue(const char *&from, const char *to)
|
||||
{
|
||||
JDEBUG("parseValue: " << QByteArray(from, to - from));
|
||||
switch (*from) {
|
||||
case '{':
|
||||
parseObject(from, to);
|
||||
break;
|
||||
case 't':
|
||||
if (to - from >= 4 && qstrncmp(from, "true", 4) == 0) {
|
||||
m_data = QByteArray(from, 4);
|
||||
from += m_data.size();
|
||||
m_type = Boolean;
|
||||
}
|
||||
break;
|
||||
case 'f':
|
||||
if (to - from >= 5 && qstrncmp(from, "false", 5) == 0) {
|
||||
m_data = QByteArray(from, 5);
|
||||
from += m_data.size();
|
||||
m_type = Boolean;
|
||||
}
|
||||
break;
|
||||
case 'n':
|
||||
if (to - from >= 4 && qstrncmp(from, "null", 4) == 0) {
|
||||
m_data = QByteArray(from, 4);
|
||||
from += m_data.size();
|
||||
m_type = NullObject;
|
||||
}
|
||||
break;
|
||||
case '[':
|
||||
parseArray(from, to);
|
||||
break;
|
||||
case '"':
|
||||
m_type = String;
|
||||
m_data = parseCString(from, to);
|
||||
break;
|
||||
case '0': case '1': case '2': case '3': case '4':
|
||||
case '5': case '6': case '7': case '8': case '9':
|
||||
case '-':
|
||||
m_type = Number;
|
||||
m_data = parseNumber(from, to);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void JsonValue::parseObject(const char *&from, const char *to)
|
||||
{
|
||||
JDEBUG("parseObject: " << QByteArray(from, to - from));
|
||||
#ifdef TODO_USE_CREATOR
|
||||
QTC_CHECK(*from == '{');
|
||||
#endif
|
||||
++from;
|
||||
m_type = Object;
|
||||
while (from < to) {
|
||||
if (*from == '}') {
|
||||
++from;
|
||||
break;
|
||||
}
|
||||
JsonValue child;
|
||||
child.parsePair(from, to);
|
||||
if (!child.isValid())
|
||||
return;
|
||||
m_children += child;
|
||||
if (*from == ',')
|
||||
++from;
|
||||
}
|
||||
}
|
||||
|
||||
void JsonValue::parseArray(const char *&from, const char *to)
|
||||
{
|
||||
JDEBUG("parseArray: " << QByteArray(from, to - from));
|
||||
#ifdef TODO_USE_CREATOR
|
||||
QTC_CHECK(*from == '[');
|
||||
#endif
|
||||
++from;
|
||||
m_type = Array;
|
||||
while (from < to) {
|
||||
if (*from == ']') {
|
||||
++from;
|
||||
break;
|
||||
}
|
||||
JsonValue child;
|
||||
child.parseValue(from, to);
|
||||
if (child.isValid())
|
||||
m_children += child;
|
||||
if (*from == ',')
|
||||
++from;
|
||||
}
|
||||
}
|
||||
|
||||
void JsonValue::setStreamOutput(const QByteArray &name, const QByteArray &content)
|
||||
{
|
||||
if (content.isEmpty())
|
||||
return;
|
||||
JsonValue child;
|
||||
child.m_type = String;
|
||||
child.m_name = name;
|
||||
child.m_data = content;
|
||||
m_children += child;
|
||||
if (m_type == Invalid)
|
||||
m_type = Object;
|
||||
}
|
||||
|
||||
static QByteArray ind(int indent)
|
||||
{
|
||||
return QByteArray(2 * indent, ' ');
|
||||
}
|
||||
|
||||
void JsonValue::dumpChildren(QByteArray * str, bool multiline, int indent) const
|
||||
{
|
||||
for (int i = 0; i < m_children.size(); ++i) {
|
||||
if (i != 0) {
|
||||
*str += ',';
|
||||
if (multiline)
|
||||
*str += '\n';
|
||||
}
|
||||
if (multiline)
|
||||
*str += ind(indent);
|
||||
*str += m_children.at(i).toString(multiline, indent);
|
||||
}
|
||||
}
|
||||
|
||||
class MyString : public QString {
|
||||
public:
|
||||
ushort at(int i) const { return constData()[i].unicode(); }
|
||||
};
|
||||
|
||||
template<class ST, typename CT>
|
||||
inline ST escapeCStringTpl(const ST &ba)
|
||||
{
|
||||
ST ret;
|
||||
ret.reserve(ba.length() * 2);
|
||||
for (int i = 0; i < ba.length(); ++i) {
|
||||
CT c = ba.at(i);
|
||||
switch (c) {
|
||||
case '\\': ret += "\\\\"; break;
|
||||
case '\a': ret += "\\a"; break;
|
||||
case '\b': ret += "\\b"; break;
|
||||
case '\f': ret += "\\f"; break;
|
||||
case '\n': ret += "\\n"; break;
|
||||
case '\r': ret += "\\r"; break;
|
||||
case '\t': ret += "\\t"; break;
|
||||
case '\v': ret += "\\v"; break;
|
||||
case '"': ret += "\\\""; break;
|
||||
default:
|
||||
if (c < 32 || c == 127) {
|
||||
ret += '\\';
|
||||
ret += '0' + (c >> 6);
|
||||
ret += '0' + ((c >> 3) & 7);
|
||||
ret += '0' + (c & 7);
|
||||
} else {
|
||||
ret += c;
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
QString JsonValue::escapeCString(const QString &ba)
|
||||
{
|
||||
return escapeCStringTpl<MyString, ushort>(static_cast<const MyString &>(ba));
|
||||
}
|
||||
|
||||
QByteArray JsonValue::escapeCString(const QByteArray &ba)
|
||||
{
|
||||
return escapeCStringTpl<QByteArray, uchar>(ba);
|
||||
}
|
||||
|
||||
QByteArray JsonValue::toString(bool multiline, int indent) const
|
||||
{
|
||||
QByteArray result;
|
||||
switch (m_type) {
|
||||
case Invalid:
|
||||
if (multiline)
|
||||
result += ind(indent) + "Invalid\n";
|
||||
else
|
||||
result += "Invalid";
|
||||
break;
|
||||
case String:
|
||||
if (!m_name.isEmpty())
|
||||
result += m_name + '=';
|
||||
result += '"' + escapeCString(m_data) + '"';
|
||||
break;
|
||||
case Number:
|
||||
if (!m_name.isEmpty())
|
||||
result += '"' + m_name + "\":";
|
||||
result += m_data;
|
||||
break;
|
||||
case Boolean:
|
||||
case NullObject:
|
||||
if (!m_name.isEmpty())
|
||||
result += '"' + m_name + "\":";
|
||||
result += m_data;
|
||||
break;
|
||||
case Object:
|
||||
if (!m_name.isEmpty())
|
||||
result += m_name + '=';
|
||||
if (multiline) {
|
||||
result += "{\n";
|
||||
dumpChildren(&result, multiline, indent + 1);
|
||||
result += '\n' + ind(indent) + '}';
|
||||
} else {
|
||||
result += '{';
|
||||
dumpChildren(&result, multiline, indent + 1);
|
||||
result += '}';
|
||||
}
|
||||
break;
|
||||
case Array:
|
||||
if (!m_name.isEmpty())
|
||||
result += m_name + '=';
|
||||
if (multiline) {
|
||||
result += "[\n";
|
||||
dumpChildren(&result, multiline, indent + 1);
|
||||
result += '\n' + ind(indent) + ']';
|
||||
} else {
|
||||
result += '[';
|
||||
dumpChildren(&result, multiline, indent + 1);
|
||||
result += ']';
|
||||
}
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
QVariant JsonValue::toVariant() const
|
||||
{
|
||||
switch (m_type) {
|
||||
case String:
|
||||
return QString(m_data);
|
||||
case Number: {
|
||||
bool ok;
|
||||
qint64 val = QString(m_data).toLongLong(&ok);
|
||||
if (ok)
|
||||
return val;
|
||||
return QVariant();
|
||||
}
|
||||
case Object: {
|
||||
QHash<QString, QVariant> hash;
|
||||
for (int i = 0; i < m_children.size(); ++i) {
|
||||
QString name(m_children[i].name());
|
||||
QVariant val = m_children[i].toVariant();
|
||||
hash.insert(name, val);
|
||||
}
|
||||
return hash;
|
||||
}
|
||||
case Array: {
|
||||
QList<QVariant> list;
|
||||
for (int i = 0; i < m_children.size(); ++i) {
|
||||
list.append(m_children[i].toVariant());
|
||||
}
|
||||
return list;
|
||||
}
|
||||
case Boolean:
|
||||
return data() == QByteArray("true");
|
||||
case Invalid:
|
||||
case NullObject:
|
||||
default:
|
||||
return QVariant();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void JsonValue::fromString(const QByteArray &ba)
|
||||
{
|
||||
const char *from = ba.constBegin();
|
||||
const char *to = ba.constEnd();
|
||||
parseValue(from, to);
|
||||
}
|
||||
|
||||
JsonValue JsonValue::findChild(const char *name) const
|
||||
{
|
||||
for (int i = 0; i < m_children.size(); ++i)
|
||||
if (m_children.at(i).m_name == name)
|
||||
return m_children.at(i);
|
||||
return JsonValue();
|
||||
}
|
||||
|
||||
void JsonInputStream::appendCString(const char *s)
|
||||
{
|
||||
m_target.append('"');
|
||||
for (const char *p = s; *p; p++) {
|
||||
if (*p == '"' || *p == '\\')
|
||||
m_target.append('\\');
|
||||
m_target.append(*p);
|
||||
}
|
||||
m_target.append('"');
|
||||
}
|
||||
|
||||
void JsonInputStream::appendString(const QString &in)
|
||||
{
|
||||
if (in.isEmpty()) {
|
||||
m_target.append("\"\"");
|
||||
return;
|
||||
}
|
||||
|
||||
const QChar doubleQuote('"');
|
||||
const QChar backSlash('\\');
|
||||
QString rc;
|
||||
const int inSize = in.size();
|
||||
rc.reserve(in.size() + 5);
|
||||
rc.append(doubleQuote);
|
||||
for (int i = 0; i < inSize; i++) {
|
||||
const QChar c = in.at(i);
|
||||
if (c == doubleQuote || c == backSlash)
|
||||
rc.append(backSlash);
|
||||
rc.append(c);
|
||||
}
|
||||
rc.append(doubleQuote);
|
||||
m_target.append(rc.toUtf8());
|
||||
return;
|
||||
}
|
||||
|
||||
JsonInputStream &JsonInputStream::operator<<(const QStringList &in)
|
||||
{
|
||||
m_target.append('[');
|
||||
const int count = in.size();
|
||||
for (int i = 0 ; i < count; i++) {
|
||||
if (i)
|
||||
m_target.append(',');
|
||||
appendString(in.at(i));
|
||||
}
|
||||
m_target.append(']');
|
||||
return *this;
|
||||
}
|
||||
|
||||
JsonInputStream &JsonInputStream::operator<<(const QVector<QByteArray> &ba)
|
||||
{
|
||||
m_target.append('[');
|
||||
const int count = ba.size();
|
||||
for (int i = 0 ; i < count; i++) {
|
||||
if (i)
|
||||
m_target.append(',');
|
||||
appendCString(ba.at(i).constData());
|
||||
}
|
||||
m_target.append(']');
|
||||
return *this;
|
||||
}
|
||||
|
||||
JsonInputStream &JsonInputStream::operator<<(const QList<int> &in)
|
||||
{
|
||||
m_target.append('[');
|
||||
const int count = in.size();
|
||||
for (int i = 0 ; i < count; i++) {
|
||||
if (i)
|
||||
m_target.append(',');
|
||||
m_target.append(QByteArray::number(in.at(i)));
|
||||
}
|
||||
m_target.append(']');
|
||||
return *this;
|
||||
}
|
||||
|
||||
JsonInputStream &JsonInputStream::operator<<(bool b)
|
||||
{
|
||||
m_target.append(b ? "true" : "false");
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
@@ -1,143 +0,0 @@
|
||||
/**************************************************************************
|
||||
**
|
||||
** This file is part of Qt Creator
|
||||
**
|
||||
** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies).
|
||||
**
|
||||
** Contact: http://www.qt-project.org/
|
||||
**
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
**
|
||||
** 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.
|
||||
**
|
||||
** Other Usage
|
||||
**
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef JSON_H
|
||||
#define JSON_H
|
||||
|
||||
#include "json_global.h"
|
||||
|
||||
#include <QByteArray>
|
||||
#include <QStringList>
|
||||
#include <QVector>
|
||||
|
||||
namespace Json {
|
||||
|
||||
class JSON_EXPORT JsonValue
|
||||
{
|
||||
public:
|
||||
JsonValue() : m_type(Invalid) {}
|
||||
explicit JsonValue(const QByteArray &str) { fromString(str); }
|
||||
|
||||
QByteArray m_name;
|
||||
QByteArray m_data;
|
||||
QList<JsonValue> m_children;
|
||||
|
||||
enum Type {
|
||||
Invalid,
|
||||
String,
|
||||
Number,
|
||||
Boolean,
|
||||
Object,
|
||||
NullObject,
|
||||
Array
|
||||
};
|
||||
|
||||
Type m_type;
|
||||
|
||||
inline Type type() const { return m_type; }
|
||||
inline QByteArray name() const { return m_name; }
|
||||
inline bool hasName(const char *name) const { return m_name == name; }
|
||||
|
||||
inline bool isValid() const { return m_type != Invalid; }
|
||||
inline bool isNumber() const { return m_type == Number; }
|
||||
inline bool isString() const { return m_type == String; }
|
||||
inline bool isObject() const { return m_type == Object; }
|
||||
inline bool isArray() const { return m_type == Array; }
|
||||
|
||||
|
||||
inline QByteArray data() const { return m_data; }
|
||||
inline const QList<JsonValue> &children() const { return m_children; }
|
||||
inline int childCount() const { return m_children.size(); }
|
||||
|
||||
const JsonValue &childAt(int index) const { return m_children[index]; }
|
||||
JsonValue &childAt(int index) { return m_children[index]; }
|
||||
JsonValue findChild(const char *name) const;
|
||||
|
||||
QByteArray toString(bool multiline = false, int indent = 0) const;
|
||||
void fromString(const QByteArray &str);
|
||||
void setStreamOutput(const QByteArray &name, const QByteArray &content);
|
||||
|
||||
QVariant toVariant() const;
|
||||
|
||||
private:
|
||||
static QByteArray parseCString(const char *&from, const char *to);
|
||||
static QByteArray parseNumber(const char *&from, const char *to);
|
||||
static QByteArray escapeCString(const QByteArray &ba);
|
||||
static QString escapeCString(const QString &ba);
|
||||
void parsePair(const char *&from, const char *to);
|
||||
void parseValue(const char *&from, const char *to);
|
||||
void parseObject(const char *&from, const char *to);
|
||||
void parseArray(const char *&from, const char *to);
|
||||
|
||||
void dumpChildren(QByteArray *str, bool multiline, int indent) const;
|
||||
};
|
||||
|
||||
/* Thin wrapper around QByteArray for formatting JSON input. Use as in:
|
||||
* JsonInputStream(byteArray) << '{' << "bla" << ':' << "blup" << '}';
|
||||
* Note that strings get double quotes and JSON-escaping, characters should be
|
||||
* used for the array/hash delimiters.
|
||||
* */
|
||||
class JSON_EXPORT JsonInputStream {
|
||||
public:
|
||||
explicit JsonInputStream(QByteArray &a) : m_target(a) {}
|
||||
|
||||
JsonInputStream &operator<<(char c) { m_target.append(c); return *this; }
|
||||
JsonInputStream &operator<<(const char *c) { appendCString(c); return *this; }
|
||||
JsonInputStream &operator<<(const QByteArray &a) { appendCString(a.constData()); return *this; }
|
||||
JsonInputStream &operator<<(const QString &c) { appendString(c); return *this; }
|
||||
|
||||
// Format as array
|
||||
JsonInputStream &operator<<(const QStringList &c);
|
||||
|
||||
// Format as array
|
||||
JsonInputStream &operator<<(const QVector<QByteArray> &ba);
|
||||
|
||||
//Format as array
|
||||
JsonInputStream &operator<<(const QList<int> &in);
|
||||
|
||||
JsonInputStream &operator<<(bool b);
|
||||
|
||||
JsonInputStream &operator<<(int i)
|
||||
{ m_target.append(QByteArray::number(i)); return *this; }
|
||||
JsonInputStream &operator<<(unsigned i)
|
||||
{ m_target.append(QByteArray::number(i)); return *this; }
|
||||
JsonInputStream &operator<<(quint64 i)
|
||||
{ m_target.append(QByteArray::number(i)); return *this; }
|
||||
|
||||
private:
|
||||
void appendString(const QString &);
|
||||
void appendCString(const char *c);
|
||||
|
||||
QByteArray &m_target;
|
||||
};
|
||||
|
||||
} //namespace Json
|
||||
|
||||
#endif // JSON_H
|
@@ -1,7 +0,0 @@
|
||||
INCLUDEPATH *= $$PWD
|
||||
|
||||
# Input
|
||||
HEADERS += $$PWD/json_global.h \
|
||||
$$PWD/json.h
|
||||
|
||||
SOURCES += $$PWD/json.cpp
|
@@ -184,6 +184,15 @@ ProFileEvaluator::TemplateType ProFileEvaluator::templateType() const
|
||||
return TT_Unknown;
|
||||
}
|
||||
|
||||
bool ProFileEvaluator::loadNamedSpec(const QString &specDir, bool hostSpec)
|
||||
{
|
||||
d->m_qmakespec = specDir;
|
||||
d->m_hostBuild = hostSpec;
|
||||
|
||||
d->updateMkspecPaths();
|
||||
return d->loadSpecInternal();
|
||||
}
|
||||
|
||||
bool ProFileEvaluator::accept(ProFile *pro, QMakeEvaluator::LoadFlags flags)
|
||||
{
|
||||
return d->visitProFile(pro, QMakeHandler::EvalProjectFile, flags) == QMakeEvaluator::ReturnTrue;
|
||||
|
@@ -69,6 +69,8 @@ public:
|
||||
#endif
|
||||
void setOutputDir(const QString &dir); // Default is empty
|
||||
|
||||
bool loadNamedSpec(const QString &specDir, bool hostSpec);
|
||||
|
||||
bool accept(ProFile *pro, QMakeEvaluator::LoadFlags flags = QMakeEvaluator::LoadAll);
|
||||
|
||||
bool contains(const QString &variableName) const;
|
||||
|
@@ -1032,6 +1032,33 @@ bool QMakeEvaluator::prepareProject(const QString &inDir)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool QMakeEvaluator::loadSpecInternal()
|
||||
{
|
||||
if (!evaluateFeatureFile(QLatin1String("spec_pre.prf")))
|
||||
return false;
|
||||
QString spec = m_qmakespec + QLatin1String("/qmake.conf");
|
||||
if (!evaluateFileDirect(spec, QMakeHandler::EvalConfigFile, LoadProOnly)) {
|
||||
evalError(fL1S("Could not read qmake configuration file %1.").arg(spec));
|
||||
return false;
|
||||
}
|
||||
#ifdef Q_OS_UNIX
|
||||
m_qmakespecFull = QFileInfo(m_qmakespec).canonicalFilePath();
|
||||
#else
|
||||
// We can't resolve symlinks as they do on Unix, so configure.exe puts
|
||||
// the source of the qmake.conf at the end of the default/qmake.conf in
|
||||
// the QMAKESPEC_ORIGINAL variable.
|
||||
const ProString &orig_spec = first(ProKey("QMAKESPEC_ORIGINAL"));
|
||||
m_qmakespecFull = orig_spec.isEmpty() ? m_qmakespec : orig_spec.toQString();
|
||||
#endif
|
||||
valuesRef(ProKey("QMAKESPEC")) << ProString(m_qmakespecFull);
|
||||
m_qmakespecName = IoUtils::fileName(m_qmakespecFull).toString();
|
||||
if (!evaluateFeatureFile(QLatin1String("spec_post.prf")))
|
||||
return false;
|
||||
// The MinGW and x-build specs may change the separator; $$shell_{path,quote}() need it
|
||||
m_dirSep = first(ProKey("QMAKE_DIR_SEP"));
|
||||
return true;
|
||||
}
|
||||
|
||||
bool QMakeEvaluator::loadSpec()
|
||||
{
|
||||
QString qmakespec = m_option->expandEnvVars(
|
||||
@@ -1085,29 +1112,9 @@ bool QMakeEvaluator::loadSpec()
|
||||
&& !evaluateFileDirect(m_superfile, QMakeHandler::EvalConfigFile, LoadProOnly)) {
|
||||
return false;
|
||||
}
|
||||
if (!evaluateFeatureFile(QLatin1String("spec_pre.prf")))
|
||||
return false;
|
||||
QString spec = m_qmakespec + QLatin1String("/qmake.conf");
|
||||
if (!evaluateFileDirect(spec, QMakeHandler::EvalConfigFile, LoadProOnly)) {
|
||||
evalError(fL1S("Could not read qmake configuration file %1.").arg(spec));
|
||||
return false;
|
||||
}
|
||||
#ifdef Q_OS_UNIX
|
||||
m_qmakespecFull = QFileInfo(m_qmakespec).canonicalFilePath();
|
||||
#else
|
||||
// We can't resolve symlinks as they do on Unix, so configure.exe puts
|
||||
// the source of the qmake.conf at the end of the default/qmake.conf in
|
||||
// the QMAKESPEC_ORIGINAL variable.
|
||||
const ProString &orig_spec = first(ProKey("QMAKESPEC_ORIGINAL"));
|
||||
m_qmakespecFull = orig_spec.isEmpty() ? m_qmakespec : orig_spec.toQString();
|
||||
#endif
|
||||
valuesRef(ProKey("QMAKESPEC")) << ProString(m_qmakespecFull);
|
||||
m_qmakespecName = IoUtils::fileName(m_qmakespecFull).toString();
|
||||
if (!evaluateFeatureFile(QLatin1String("spec_post.prf")))
|
||||
if (!loadSpecInternal())
|
||||
return false;
|
||||
updateFeaturePaths(); // The spec extends the feature search path, so rebuild the cache.
|
||||
// The MinGW and x-build specs may change the separator; $$shell_{path,quote}() need it
|
||||
m_dirSep = first(ProKey("QMAKE_DIR_SEP"));
|
||||
if (!m_conffile.isEmpty()
|
||||
&& !evaluateFileDirect(m_conffile, QMakeHandler::EvalConfigFile, LoadProOnly)) {
|
||||
return false;
|
||||
|
@@ -116,6 +116,7 @@ public:
|
||||
|
||||
void loadDefaults();
|
||||
bool prepareProject(const QString &inDir);
|
||||
bool loadSpecInternal();
|
||||
bool loadSpec();
|
||||
void initFrom(const QMakeEvaluator &other);
|
||||
void setupProject();
|
||||
|
@@ -338,6 +338,8 @@ private slots:
|
||||
void multitokens_argument_data();
|
||||
void multiline_strings();
|
||||
void multiline_strings_data();
|
||||
void skip_unknown_directives();
|
||||
void skip_unknown_directives_data();
|
||||
};
|
||||
|
||||
// Remove all #... lines, and 'simplify' string, to allow easily comparing the result
|
||||
@@ -1394,6 +1396,30 @@ void tst_Preprocessor::multiline_strings_data()
|
||||
QTest::newRow("case 1") << original << expected;
|
||||
}
|
||||
|
||||
void tst_Preprocessor::skip_unknown_directives()
|
||||
{
|
||||
compare_input_output();
|
||||
}
|
||||
|
||||
void tst_Preprocessor::skip_unknown_directives_data()
|
||||
{
|
||||
QTest::addColumn<QByteArray>("input");
|
||||
QTest::addColumn<QByteArray>("output");
|
||||
|
||||
QByteArray original;
|
||||
QByteArray expected;
|
||||
|
||||
// We should skip "weird" things when preprocessing. Particularly useful when we preprocess
|
||||
// a particular expression from a document which has already been processed.
|
||||
|
||||
original = "# foo\n"
|
||||
"# 10 \"file.cpp\"\n"
|
||||
"# ()\n"
|
||||
"#\n";
|
||||
expected = "# 1 \"<stdin>\"\n";
|
||||
QTest::newRow("case 1") << original << expected;
|
||||
}
|
||||
|
||||
void tst_Preprocessor::compare_input_output(bool keepComments)
|
||||
{
|
||||
QFETCH(QByteArray, input);
|
||||
|
@@ -1,11 +1,9 @@
|
||||
greaterThan(QT_MAJOR_VERSION, 4): QT += core-private
|
||||
include(../qttest.pri)
|
||||
include($$IDE_SOURCE_TREE/src/shared/json/json.pri)
|
||||
include($$IDE_SOURCE_TREE/src/libs/utils/utils.pri)
|
||||
DEFINES += JSON_INCLUDE_PRI
|
||||
|
||||
DEBUGGERDIR = $$IDE_SOURCE_TREE/src/plugins/debugger
|
||||
UTILSDIR = $$IDE_SOURCE_TREE/src/libs
|
||||
UTILSDIR = $$IDE_SOURCE_TREE/src/libs/utils
|
||||
MACROSDIR = $$IDE_SOURCE_TREE/share/qtcreator/dumper
|
||||
|
||||
SOURCES += \
|
||||
|
@@ -164,7 +164,7 @@ public:
|
||||
|
||||
void testJson(const char* input)
|
||||
{
|
||||
QCOMPARE('\n' + QString::fromLatin1(Json::JsonValue(input).toString(false)),
|
||||
QCOMPARE('\n' + Utils::JsonStringValue(QLatin1String(input)).value(),
|
||||
'\n' + QString(input));
|
||||
}
|
||||
|
||||
|
@@ -675,6 +675,23 @@ namespace catchthrow {
|
||||
} // namespace catchthrow
|
||||
|
||||
|
||||
namespace undefined {
|
||||
|
||||
void testUndefined()
|
||||
{
|
||||
int *i = new int;
|
||||
delete i;
|
||||
BREAK_HERE;
|
||||
// Manual: Uncomment the following line. Step.
|
||||
// On Linux, a SIGABRT should be received.
|
||||
//delete i;
|
||||
// Continue.
|
||||
dummyStatement(&i);
|
||||
}
|
||||
|
||||
} // namespace undefined
|
||||
|
||||
|
||||
namespace qdatetime {
|
||||
|
||||
void testQDate()
|
||||
@@ -4933,8 +4950,8 @@ namespace basic {
|
||||
// Check s "Foo" QString.
|
||||
// Continue.
|
||||
|
||||
// Select "Open Memory View" from Locals and Expressions
|
||||
// context menu for item 'd'.
|
||||
// Select "Open Memory Editor->Open Memory Editor Showing Stack Layout"
|
||||
// from Locals and Expressions context menu.
|
||||
// Check that the opened memory view contains coloured items
|
||||
// for 'i', 'd', and 's'.
|
||||
dummyStatement(&i, &d, &s);
|
||||
@@ -6545,6 +6562,7 @@ int main(int argc, char *argv[])
|
||||
text::testText();
|
||||
io::testIO();
|
||||
catchthrow::testCatchThrow();
|
||||
undefined::testUndefined();
|
||||
plugin::testPlugin();
|
||||
valgrind::testValgrind();
|
||||
namespc::testNamespace();
|
||||
|
@@ -210,7 +210,6 @@ class JIRA:
|
||||
self.__bugs__= {
|
||||
'QTCREATORBUG-6853':self._workaroundCreator6853_,
|
||||
'QTCREATORBUG-6918':self._workaroundCreator_MacEditorFocus_,
|
||||
'QTCREATORBUG-6953':self._workaroundCreator_MacEditorFocus_,
|
||||
'QTCREATORBUG-6994':self._workaroundCreator6994_
|
||||
}
|
||||
# helper function - will be called if no workaround for the requested bug is deposited
|
||||
|
@@ -27,7 +27,6 @@ def main():
|
||||
# - Press F2 or select from the menu: Tools / C++ / Follow Symbol under Cursor
|
||||
# Creator will show you the declaration of the variable.
|
||||
|
||||
JIRA.performWorkaroundIfStillOpen(6953, JIRA.Bug.CREATOR, cppwindow)
|
||||
type(cppwindow, "<Ctrl+F>")
|
||||
type(waitForObject(":*Qt Creator.findEdit_Utils::FilterLineEdit"), " xi")
|
||||
type(waitForObject(":*Qt Creator.findEdit_Utils::FilterLineEdit"), "<Return>")
|
||||
|
@@ -6926,7 +6926,7 @@
|
||||
"genericlinuxdeviceconfigurationwizard.h" "4"
|
||||
"genericlinuxdeviceconfigurationwizardpages.h" "4"
|
||||
"genericremotelinuxdeploystepfactory.h" "4"
|
||||
"linuxdevice.h" "4"
|
||||
"linuxdeviceconfiguration.h" "4"
|
||||
"linuxdevicetestdialog.h" "4"
|
||||
"linuxdevicetester.h" "4"
|
||||
"packageuploader.h" "4"
|
||||
|
|
Reference in New Issue
Block a user