Commit 913f6161 authored by Oswald Buddenhagen's avatar Oswald Buddenhagen
Browse files

Merge remote branch 'origin/1.3'

Conflicts:
	src/plugins/cpptools/cppcodecompletion.cpp
	src/plugins/help/helpplugin.cpp
	src/plugins/projectexplorer/projectexplorer.cpp
parents 43cca5c4 2e82c14a
......@@ -77,6 +77,7 @@
#if USE_QT_GUI
# include <QtGui/QApplication>
# include <QtGui/QImage>
# include <QtGui/QRegion>
# include <QtGui/QPixmap>
# include <QtGui/QWidget>
# include <QtGui/QFont>
......@@ -478,6 +479,7 @@ struct QDumper
void putHash(const char *name, QChar value);
void putHash(const char *name, float value);
void putHash(const char *name, double value);
void putStringValue(const QString &value);
void beginHash(); // start of data hash output
void endHash(); // start of data hash output
......@@ -710,6 +712,16 @@ void QDumper::putBase64Encoded(const char *buf, int n)
}
}
void QDumper::putStringValue(const QString &str)
{
if (str.isNull()) {
putItem("value", "\"\" (null)");
} else {
putItem("value", str);
putItem("valueencoded", "2");
}
}
void QDumper::disarm()
{
success = true;
......@@ -784,10 +796,9 @@ void QDumper::putHash(const char *name, const QString &value)
{
beginHash();
putItem("name", name);
putItem("value", value);
putStringValue(value);
putItem("type", NS"QString");
putItem("numchild", "0");
putItem("valueencoded", "2");
endHash();
}
......@@ -859,9 +870,8 @@ void QDumper::putHash(const char *name, QChar value)
{
beginHash();
putItem("name", name);
putItem("value", QString(QLatin1String("'%1' (%2, 0x%3)"))
putStringValue(QString(QLatin1String("'%1' (%2, 0x%3)"))
.arg(value).arg(value.unicode()).arg(value.unicode(), 0, 16));
putItem("valueencoded", "2");
putItem("type", NS"QChar");
putItem("numchild", "0");
endHash();
......@@ -2850,8 +2860,7 @@ static void qDumpQString(QDumper &d)
return;
}
d.putItem("value", str);
d.putItem("valueencoded", "2");
d.putStringValue(str);
d.putItem("type", NS"QString");
//d.putItem("editvalue", str); // handled generically below
d.putItem("numchild", "0");
......@@ -2880,8 +2889,7 @@ static void qDumpQStringList(QDumper &d)
d.beginChildren(n ? NS"QString" : 0);
for (int i = 0; i != n; ++i) {
d.beginHash();
d.putItem("value", list[i]);
d.putItem("valueencoded", "2");
d.putStringValue(list.at(i));
d.endHash();
}
if (n < list.size())
......
......@@ -1512,7 +1512,7 @@ Sollen sie überschrieben werden?</translation>
<message>
<location line="+8"/>
<source>Could not set permissions to writable.</source>
<translation>Die Datei konnte schreibbar gemacht werden.</translation>
<translation>Die Datei konnte nicht schreibbar gemacht werden.</translation>
</message>
<message>
<location line="+92"/>
......@@ -14657,7 +14657,7 @@ Die folgenden Encodings scheinen der Datei zu entsprechen:</translation>
</message>
<message>
<location line="+92"/>
<source> &lt;line number&gt;</source>
<source>&lt;line number&gt;</source>
<translation>&lt;Zeilennummer&gt;</translation>
</message>
</context>
......
......@@ -13301,7 +13301,7 @@ The following encodings are likely to fit:</source>
</message>
<message>
<location line="+92"/>
<source> &lt;line number&gt;</source>
<source>&lt;line number&gt;</source>
<translation>&lt;número de línea&gt;</translation>
</message>
</context>
......
......@@ -13272,7 +13272,7 @@ Queste codifiche dovrebbero andare bene:</translation>
</message>
<message>
<location line="+92"/>
<source> &lt;line number&gt;</source>
<source>&lt;line number&gt;</source>
<translation>&lt;numero di riga&gt;</translation>
</message>
</context>
......
......@@ -14757,7 +14757,7 @@ Następujące kodowania będą najprawdopodobniej pasowały:</translation>
</message>
<message>
<location line="+92"/>
<source> &lt;line number&gt;</source>
<source>&lt;line number&gt;</source>
<translation> &lt;numer linii&gt;</translation>
</message>
</context>
......
......@@ -12694,7 +12694,7 @@ Naslednji nabori znakov so verjetno ustrezni:</translation>
</message>
<message>
<location line="+92"/>
<source> &lt;line number&gt;</source>
<source>&lt;line number&gt;</source>
<translation>&lt;številka vrstice&gt;</translation>
</message>
</context>
......
......@@ -1201,10 +1201,12 @@ IEditor *EditorManager::openEditorWithContents(const QString &editorKind,
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
IEditor *edt = createEditor(editorKind);
if (!edt)
if (!edt) {
QApplication::restoreOverrideCursor();
return 0;
}
if (!edt || !edt->createNew(contents)) {
if (!edt->createNew(contents)) {
QApplication::restoreOverrideCursor();
delete edt;
edt = 0;
......
......@@ -89,6 +89,14 @@ public:
{
setFocusPolicy(Qt::NoFocus);
setAttribute(Qt::WA_DeleteOnClose);
// Set the window and button text to the tooltip text color, since this
// widget draws the background as a tooltip.
QPalette p = palette();
const QColor toolTipTextColor = p.color(QPalette::Inactive, QPalette::ToolTipText);
p.setColor(QPalette::Inactive, QPalette::WindowText, toolTipTextColor);
p.setColor(QPalette::Inactive, QPalette::ButtonText, toolTipTextColor);
setPalette(p);
}
protected:
......@@ -1019,7 +1027,8 @@ bool CppCodeCompletion::completeConstructorOrFunction(const QList<LookupItem> &r
if (doc->parse(Document::ParseDeclaration)) {
doc->check();
if (SimpleDeclarationAST *sd = doc->translationUnit()->ast()->asSimpleDeclaration()) {
if (sd->declarator_list && sd->declarator_list->value->postfix_declarator_list
if (sd->declarator_list &&
sd->declarator_list && sd->declarator_list->value->postfix_declarator_list
&& sd->declarator_list->value->postfix_declarator_list->value->asFunctionDeclarator()) {
autocompleteSignature = true;
}
......
......@@ -44,6 +44,8 @@
#include <utils/qtcassert.h>
#include <QtCore/QDebug>
#include <QtGui/QMessageBox>
#include <QtGui/QPlainTextEdit>
#include <QtGui/QTextCursor>
#include <QtGui/QSyntaxHighlighter>
......@@ -68,13 +70,13 @@ namespace Internal {
*/
MemoryViewAgent::MemoryViewAgent(DebuggerManager *manager, quint64 addr)
: QObject(manager), m_engine(manager->currentEngine())
: QObject(manager), m_engine(manager->currentEngine()), m_manager(manager)
{
init(addr);
}
MemoryViewAgent::MemoryViewAgent(DebuggerManager *manager, const QString &addr)
: QObject(manager), m_engine(manager->currentEngine())
: QObject(manager), m_engine(manager->currentEngine()), m_manager(manager)
{
bool ok = true;
init(addr.toULongLong(&ok, 0));
......@@ -94,11 +96,19 @@ void MemoryViewAgent::init(quint64 addr)
m_editor = editorManager->openEditorWithContents(
Core::Constants::K_DEFAULT_BINARY_EDITOR,
&titlePattern);
connect(m_editor->widget(), SIGNAL(lazyDataRequested(quint64,bool)),
this, SLOT(fetchLazyData(quint64,bool)));
editorManager->activateEditor(m_editor);
QMetaObject::invokeMethod(m_editor->widget(), "setLazyData",
Q_ARG(quint64, addr), Q_ARG(int, 1024 * 1024), Q_ARG(int, BinBlockSize));
if (m_editor) {
connect(m_editor->widget(), SIGNAL(lazyDataRequested(quint64,bool)),
this, SLOT(fetchLazyData(quint64,bool)));
editorManager->activateEditor(m_editor);
QMetaObject::invokeMethod(m_editor->widget(), "setLazyData",
Q_ARG(quint64, addr), Q_ARG(int, 1024 * 1024), Q_ARG(int, BinBlockSize));
} else {
m_manager->showMessageBox(QMessageBox::Warning,
tr("No memory viewer available"),
tr("The memory contents cannot be shown as no viewer plugin not "
"the BinEditor plugin could be loaded."));
deleteLater();
}
}
void MemoryViewAgent::fetchLazyData(quint64 block, bool sync)
......
......@@ -70,6 +70,7 @@ private:
QPointer<IDebuggerEngine> m_engine;
QPointer<Core::IEditor> m_editor;
QPointer<DebuggerManager> m_manager;
};
......
......@@ -4497,17 +4497,19 @@ void GdbEngine::handleInferiorPrepared()
{
const QString qtInstallPath = m_startParameters->qtInstallPath;
if (!qtInstallPath.isEmpty()) {
QString qtBuildPath =
#if defined(Q_OS_WIN)
_("C:/qt-greenhouse/Trolltech/Code_less_create_more/Trolltech/Code_less_create_more/Troll/4.6/qt");
#elif defined(Q_OS_MAC)
QString();
#else
_("/var/tmp/qt-x11-src-4.6.0");
#endif
if (!qtBuildPath.isEmpty())
QString qtBuildPath;
#if defined(Q_OS_WIN)
qtBuildPath = _("C:/qt-greenhouse/Trolltech/Code_less_create_more/Trolltech/Code_less_create_more/Troll/4.6/qt");
postCommand(_("set substitute-path %1 %2")
.arg(qtBuildPath).arg(qtInstallPath));
.arg(qtBuildPath).arg(qtInstallPath));
qtBuildPath = _("C:/iwmake/build_mingw_opensource");
postCommand(_("set substitute-path %1 %2")
.arg(qtBuildPath).arg(qtInstallPath));
#elif defined(Q_OS_UNIX) && !defined (Q_OS_MAC)
qtBuildPath = _("/var/tmp/qt-x11-src-4.6.0");
postCommand(_("set substitute-path %1 %2")
.arg(qtBuildPath).arg(qtInstallPath));
#endif
}
// Initial attempt to set breakpoints
......
......@@ -47,6 +47,8 @@
#include <extensionsystem/pluginmanager.h>
#include <texteditor/basetexteditor.h>
#include <texteditor/itexteditable.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/session.h>
#include <QtDesigner/QDesignerFormWindowInterface>
......@@ -577,9 +579,22 @@ bool QtCreatorIntegration::navigateToSlot(const QString &objectName,
const QFileInfo fi(currentUiFile);
const QString uicedName = QLatin1String("ui_") + fi.completeBaseName() + QLatin1String(".h");
// Retrieve code model snapshot restricted to project of ui file.
const ProjectExplorer::Project *uiProject = ProjectExplorer::ProjectExplorerPlugin::instance()->session()->projectForFile(currentUiFile);
if (!uiProject) {
*errorMessage = tr("Internal error: No project could be found for %1.").arg(currentUiFile);
return false;
}
CPlusPlus::Snapshot docTable = cppModelManagerInstance()->snapshot();
for (CPlusPlus::Snapshot::iterator it = docTable.begin(); it != docTable.end(); ) {
const ProjectExplorer::Project *project = ProjectExplorer::ProjectExplorerPlugin::instance()->session()->projectForFile(it.key());
if (project == uiProject) {
++it;
} else {
it = docTable.erase(it);
}
}
// take all docs, find the ones that include the ui_xx.h.
const CPlusPlus::Snapshot docTable = cppModelManagerInstance()->snapshot();
QList<Document::Ptr> docList = findDocumentsIncluding(docTable, uicedName, true); // change to false when we know the absolute path to generated ui_<>.h file
if (Designer::Constants::Internal::debug)
......
......@@ -1178,7 +1178,7 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
m_passing = !m_passing;
updateMiniBuffer();
} else if (key == '.') {
//qDebug() << "REPEATING" << quoteUnprintable(m_dotCommand);
//qDebug() << "REPEATING" << quoteUnprintable(m_dotCommand) << count();
QString savedCommand = m_dotCommand;
m_dotCommand.clear();
replay(savedCommand, count());
......@@ -1366,6 +1366,8 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
}
finishMovement("j");
} else if (key == 'J') {
setDotCommand("%1J", count());
beginEditBlock();
if (m_submode == NoSubMode) {
for (int i = qMax(count(), 2) - 1; --i >= 0; ) {
moveToEndOfLine();
......@@ -1380,6 +1382,8 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
if (!m_gflag)
moveLeft();
}
endEditBlock();
finishMovement();
} else if (key == 'k' || key == Key_Up) {
if (m_submode == NoSubMode || m_submode == ZSubMode
|| m_submode == CapitalZSubMode || m_submode == RegisterSubMode) {
......
......@@ -418,7 +418,7 @@ bool HelpPlugin::initialize(const QStringList &arguments, QString *error)
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl++")));
connect(a, SIGNAL(triggered()), m_centralWidget, SLOT(zoomIn()));
advancedMenu->addAction(cmd, Core::Constants::G_EDIT_FONT);
a = new QAction(tr("Decrease Font Size"), this);
cmd = am->registerAction(a, TextEditor::Constants::DECREASE_FONT_SIZE,
modecontext);
......@@ -572,7 +572,6 @@ void HelpPlugin::extensionsInitialized()
return;
}
bool needsSetup = false;
bool assistantInternalDocRegistered = false;
QStringList documentationToRemove;
QStringList filtersToRemove;
......@@ -601,12 +600,10 @@ void HelpPlugin::extensionsInitialized()
QHelpEngineCore hc(m_helpEngine->collectionFile());
hc.setupData();
foreach (const QString &ns, documentationToRemove) {
if (hc.unregisterDocumentation(ns))
needsSetup = true;
hc.unregisterDocumentation(ns);
}
foreach (const QString &filter, filtersToRemove) {
if (hc.removeCustomFilter(filter))
needsSetup = true;
hc.removeCustomFilter(filter);
}
if (!assistantInternalDocRegistered) {
......@@ -619,38 +616,46 @@ void HelpPlugin::extensionsInitialized()
#endif
if (!hc.registerDocumentation(qchFileName))
qDebug() << qPrintable(hc.error());
needsSetup = true;
}
}
QLatin1String key("UnfilteredFilterInserted");
int i = m_helpEngine->customValue(key).toInt();
if (i != 1) {
{
QHelpEngineCore hc(m_helpEngine->collectionFile());
hc.setupData();
hc.addCustomFilter(tr("Unfiltered"), QStringList());
hc.setCustomValue(key, 1);
const QLatin1String weAddedFilterKey("UnfilteredFilterInserted");
const QLatin1String previousFilterNameKey("UnfilteredFilterName");
int i = m_helpEngine->customValue(weAddedFilterKey).toInt();
const QString filterName = tr("Unfiltered");
if (i == 1) { // we added a filter at some point
// remove previously added filter
QHelpEngineCore hc(m_helpEngine->collectionFile());
hc.setupData();
QString previousFilterName = hc.customValue(previousFilterNameKey).toString();
if (!previousFilterName.isEmpty()) { // we noted down the name of the previously added filter
hc.removeCustomFilter(previousFilterName);
}
if (previousFilterName != filterName) { // potentially remove a filter with new name
hc.removeCustomFilter(filterName);
}
bool blocked = m_helpEngine->blockSignals(true);
m_helpEngine->setCurrentFilter(tr("Unfiltered"));
m_helpEngine->blockSignals(blocked);
needsSetup = true;
}
{
QHelpEngineCore hc(m_helpEngine->collectionFile());
hc.setupData();
hc.addCustomFilter(filterName, QStringList());
hc.setCustomValue(weAddedFilterKey, 1);
hc.setCustomValue(previousFilterNameKey, filterName);
}
bool blocked = m_helpEngine->blockSignals(true);
m_helpEngine->setCurrentFilter(filterName);
m_helpEngine->blockSignals(blocked);
QString addedDocs = m_helpEngine->customValue(QLatin1String("AddedDocs")).toString();
if (!addedDocs.isEmpty()) {
QStringList documentationToAdd = addedDocs.split(";");
foreach(QString item, documentationToAdd) {
needsSetup = true;
foreach (QString item, documentationToAdd)
m_helpEngine->registerDocumentation(item);
}
m_helpEngine->removeCustomValue(QLatin1String("AddedDocs"));
}
if (needsSetup)
m_helpEngine->setupData();
m_helpEngine->setupData();
updateFilterComboBox();
m_bookmarkManager->setupBookmarkModels();
......@@ -662,7 +667,7 @@ void HelpPlugin::extensionsInitialized()
font = qVariantValue<QFont>(m_helpEngine->customValue(QLatin1String("font"),
font));
webSettings->setFontFamily(QWebSettings::StandardFont, font.family());
webSettings->setFontSize(QWebSettings::DefaultFontSize, font.pointSize());
#endif
......
......@@ -234,15 +234,21 @@ int EnvironmentModel::findInResultInsertPosition(const QString &name) const
bool EnvironmentModel::setData(const QModelIndex &index, const QVariant &value, int role)
{
if (role == Qt::EditRole && index.isValid()) {
// ignore changes to already set values:
if (data(index, role) == value)
return true;
if (index.column() == 0) {
//fail if a variable with the same name already exists
#ifdef Q_OS_WIN
if (findInChanges(value.toString().toUpper()) != -1)
return false;
const QString &newName = value.toString().toUpper();
#else
if (findInChanges(value.toString()) != -1)
return false;
const QString &newName = value.toString();
#endif
if (findInChanges(newName) != -1)
return false;
EnvironmentItem old("", "");
if (m_mergedEnvironments) {
int pos = findInChanges(indexToVariable(index));
......@@ -256,11 +262,7 @@ bool EnvironmentModel::setData(const QModelIndex &index, const QVariant &value,
} else {
old = m_items.at(index.row());
}
#ifdef Q_OS_WIN
const QString &newName = value.toString().toUpper();
#else
const QString &newName = value.toString();
#endif
if (changes(old.name))
removeVariable(old.name);
old.name = newName;
......
......@@ -2006,17 +2006,15 @@ void ProjectExplorerPlugin::populateRunConfigurationMenu()
foreach (const Project *pro, d->m_session->projects()) {
foreach (RunConfiguration *runConfiguration, pro->runConfigurations()) {
if (runConfiguration->isEnabled()) {
const QString title = QString("%1 (%2)").arg(pro->name(), runConfiguration->name());
QAction *act = new QAction(title, d->m_runConfigurationActionGroup);
act->setCheckable(true);
act->setData(qVariantFromValue(runConfiguration));
act->setChecked(runConfiguration == activeRunConfiguration);
d->m_runConfigurationMenu->addAction(act);
if (debug)
qDebug() << "RunConfiguration" << runConfiguration << "project:" << pro->name()
<< "active:" << (runConfiguration == activeRunConfiguration);
}
const QString title = QString("%1 (%2)").arg(pro->name(), runConfiguration->name());
QAction *act = new QAction(title, d->m_runConfigurationActionGroup);
act->setCheckable(true);
act->setData(qVariantFromValue(runConfiguration));
act->setChecked(runConfiguration == activeRunConfiguration);
d->m_runConfigurationMenu->addAction(act);
if (debug)
qDebug() << "RunConfiguration" << runConfiguration << "project:" << pro->name()
<< "active:" << (runConfiguration == activeRunConfiguration);
}
}
......
......@@ -65,10 +65,13 @@
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
<width>0</width>
<height>10</height>
</size>
</property>
</spacer>
......@@ -92,8 +95,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>601</width>
<height>154</height>
<width>611</width>
<height>305</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment