diff --git a/share/qtcreator/gdbmacros/gdbmacros.cpp b/share/qtcreator/gdbmacros/gdbmacros.cpp index 1a2bb67f54873954fed5620e24ff569091801308..d0e3d68c5cb3becaedb682e6d9c519f687cb4c90 100644 --- a/share/qtcreator/gdbmacros/gdbmacros.cpp +++ b/share/qtcreator/gdbmacros/gdbmacros.cpp @@ -63,10 +63,6 @@ int qtGhVersion = QT_VERSION; #include <set> #include <vector> -#include <ctype.h> -#include <stdio.h> -#include <unistd.h> - /*! \class QDumper \brief Helper class for producing "nice" output in Qt Creator's debugger. @@ -246,7 +242,7 @@ static const void *addOffset(const void *p, int offset) static const void *skipvtable(const void *p) { - return sizeof(void*) + reinterpret_cast<const char *>(p); + return sizeof(void *) + reinterpret_cast<const char *>(p); } static const void *deref(const void *p) @@ -266,7 +262,7 @@ static bool isEqual(const char *s, const char *t) static bool startsWith(const char *s, const char *t) { - return qstrncmp(s, t, strlen(t)) == 0; + return qstrncmp(s, t, qstrlen(t)) == 0; } // provoke segfault when address is not readable @@ -277,7 +273,7 @@ static bool startsWith(const char *s, const char *t) const char *stripNamespace(const char *type) { - static const size_t nslen = strlen(NS); + static const size_t nslen = qstrlen(NS); return startsWith(type, NS) ? type + nslen : type; } diff --git a/share/qtcreator/templates/qt4project/mywidget_form.cpp b/share/qtcreator/templates/qt4project/mywidget_form.cpp index 33b14afab8ea825fb7260ac7e23dac4e93233c7f..b7e3ae6200b06556ca1c278e38886339ba03e57e 100644 --- a/share/qtcreator/templates/qt4project/mywidget_form.cpp +++ b/share/qtcreator/templates/qt4project/mywidget_form.cpp @@ -2,7 +2,7 @@ #include "%UI_HDR%" %CLASS%::%CLASS%(QWidget *parent) - : %BASECLASS%(parent), ui(new Ui::%CLASS%Class) + : %BASECLASS%(parent), ui(new Ui::%CLASS%) { ui->setupUi(this); } diff --git a/share/qtcreator/templates/qt4project/mywidget_form.h b/share/qtcreator/templates/qt4project/mywidget_form.h index fd4d3732772ef138fb1fe7177df04d992d5cdaca..7293a8b17d6384763d214374a0217de8aabb478e 100644 --- a/share/qtcreator/templates/qt4project/mywidget_form.h +++ b/share/qtcreator/templates/qt4project/mywidget_form.h @@ -5,7 +5,7 @@ namespace Ui { - class %CLASS%Class; + class %CLASS%; } class %CLASS% : public %BASECLASS% @@ -17,7 +17,7 @@ public: ~%CLASS%(); private: - Ui::%CLASS%Class *ui; + Ui::%CLASS% *ui; }; #endif // %PRE_DEF% diff --git a/share/qtcreator/templates/qt4project/widget.ui b/share/qtcreator/templates/qt4project/widget.ui index 6c78aeebc497dbdc6024b0a041a7c421a327163a..f4e94939e46edcd6e9cecf706a21a2947c3de60a 100644 --- a/share/qtcreator/templates/qt4project/widget.ui +++ b/share/qtcreator/templates/qt4project/widget.ui @@ -1,9 +1,6 @@ -<ui version="4.0" stdsetdef="1" > +<ui version="4.0"> <class>%CLASS%Class</class> - <widget class="%BASECLASS%" name="%CLASS%Class" > - <property name="objectName" > - <cstring>%CLASS%Class</cstring> - </property> + <widget class="%BASECLASS%" name="%CLASS%" > <property name="geometry" > <rect> <x>0</x> diff --git a/src/plugins/cmakeprojectmanager/makestep.cpp b/src/plugins/cmakeprojectmanager/makestep.cpp index 33dcd1fe8a38ebd5623cc159965a3c1b0afa9ca0..fbfac0f08f6b64e052867cd0c06d83a677b93610 100644 --- a/src/plugins/cmakeprojectmanager/makestep.cpp +++ b/src/plugins/cmakeprojectmanager/makestep.cpp @@ -97,7 +97,10 @@ bool MakeStep::init(const QString &buildConfiguration) #else // Q_OS_WIN setCommand(buildConfiguration, "make"); // TODO give full path here? #endif // Q_OS_WIN - setArguments(buildConfiguration, value(buildConfiguration, "buildTargets").toStringList()); // TODO + + QStringList arguments = value(buildConfiguration, "buildTargets").toStringList(); + arguments << additionalArguments(buildConfiguration); + setArguments(buildConfiguration, arguments); // TODO setEnvironment(buildConfiguration, m_pro->environment(buildConfiguration)); return AbstractProcessStep::init(buildConfiguration); } @@ -219,15 +222,31 @@ void MakeStep::setBuildTarget(const QString &buildConfiguration, const QString & setValue(buildConfiguration, "buildTargets", old.removeOne(target)); } +QStringList MakeStep::additionalArguments(const QString &buildConfiguration) const +{ + return value(buildConfiguration, "additionalArguments").toStringList(); +} + +void MakeStep::setAdditionalArguments(const QString &buildConfiguration, const QStringList &list) +{ + setValue(buildConfiguration, "additionalArguments", list); +} + // // CMakeBuildStepConfigWidget // + MakeBuildStepConfigWidget::MakeBuildStepConfigWidget(MakeStep *makeStep) : m_makeStep(makeStep) { QFormLayout *fl = new QFormLayout(this); setLayout(fl); + m_additionalArguments = new QLineEdit(this); + fl->addRow("Additional arguments:", m_additionalArguments); + + connect(m_additionalArguments, SIGNAL(textEdited(const QString &)), this, SLOT(additionalArgumentsEdited())); + m_targetsList = new QListWidget; fl->addRow("Targets:", m_targetsList); @@ -238,9 +257,15 @@ MakeBuildStepConfigWidget::MakeBuildStepConfigWidget(MakeStep *makeStep) item->setFlags(item->flags() | Qt::ItemIsUserCheckable); item->setCheckState(Qt::Unchecked); } + connect(m_targetsList, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(itemChanged(QListWidgetItem*))); } +void MakeBuildStepConfigWidget::additionalArgumentsEdited() +{ + m_makeStep->setAdditionalArguments(m_buildConfiguration, ProjectExplorer::Environment::parseCombinedArgString(m_additionalArguments->text())); +} + void MakeBuildStepConfigWidget::itemChanged(QListWidgetItem *item) { m_makeStep->setBuildTarget(m_buildConfiguration, item->text(), item->checkState() & Qt::Checked); @@ -253,8 +278,6 @@ QString MakeBuildStepConfigWidget::displayName() const void MakeBuildStepConfigWidget::init(const QString &buildConfiguration) { - // TODO - // disconnect to make the changes to the items disconnect(m_targetsList, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(itemChanged(QListWidgetItem*))); m_buildConfiguration = buildConfiguration; @@ -265,6 +288,8 @@ void MakeBuildStepConfigWidget::init(const QString &buildConfiguration) } // and connect again connect(m_targetsList, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(itemChanged(QListWidgetItem*))); + + m_additionalArguments->setText(ProjectExplorer::Environment::joinArgumentList(m_makeStep->additionalArguments(m_buildConfiguration))); } // diff --git a/src/plugins/cmakeprojectmanager/makestep.h b/src/plugins/cmakeprojectmanager/makestep.h index 0ec1017ea2639c7356b758c323b374da97d0a38c..92126c6c3367032d6d88351c1960a01bbedc731f 100644 --- a/src/plugins/cmakeprojectmanager/makestep.h +++ b/src/plugins/cmakeprojectmanager/makestep.h @@ -60,6 +60,8 @@ public: CMakeProject *project() const; bool buildsTarget(const QString &buildConfiguration, const QString &target) const; void setBuildTarget(const QString &buildConfiguration, const QString &target, bool on); + QStringList additionalArguments(const QString &buildConfiguration) const; + void setAdditionalArguments(const QString &buildConfiguration, const QStringList &list); private slots: void slotAddToTaskWindow(const QString & fn, int type, int linenumber, const QString & description); void addDirectory(const QString &dir); @@ -82,10 +84,12 @@ public: virtual void init(const QString &buildConfiguration); private slots: void itemChanged(QListWidgetItem*); + void additionalArgumentsEdited(); private: QString m_buildConfiguration; MakeStep * m_makeStep; QListWidget *m_targetsList; + QLineEdit *m_additionalArguments; }; class MakeBuildStepFactory : public ProjectExplorer::IBuildStepFactory diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp index aea62962134d29867554cffb3f50fa0234052e55..5e2914df46d10bfd43b4a220146c8f019a9e2578 100644 --- a/src/plugins/coreplugin/mainwindow.cpp +++ b/src/plugins/coreplugin/mainwindow.cpp @@ -65,6 +65,7 @@ #include "basefilewizard.h" #include <coreplugin/findplaceholder.h> +#include <utils/pathchooser.h> #include <extensionsystem/pluginmanager.h> #include <QtCore/QDebug> @@ -836,10 +837,10 @@ QStringList MainWindow::showNewItemDialog(const QString &title, const QString &defaultLocation) { QString defaultDir = defaultLocation; - if (defaultDir.isEmpty()) { - if (!m_coreImpl->fileManager()->currentFile().isEmpty()) - defaultDir = QFileInfo(m_coreImpl->fileManager()->currentFile()).absolutePath(); - } + if (defaultDir.isEmpty() && !m_coreImpl->fileManager()->currentFile().isEmpty()) + defaultDir = QFileInfo(m_coreImpl->fileManager()->currentFile()).absolutePath(); + if (defaultDir.isEmpty()) + defaultDir = Core::Utils::PathChooser::homePath(); // Scan for wizards matching the filter and pick one. Don't show // dialog if there is only one. diff --git a/src/plugins/debugger/debuggermanager.cpp b/src/plugins/debugger/debuggermanager.cpp index 79cc59c601084665030664abf25e0b8b49514ef9..27109f952e87e4296aa9857343e39ffbe57c5e20 100644 --- a/src/plugins/debugger/debuggermanager.cpp +++ b/src/plugins/debugger/debuggermanager.cpp @@ -262,6 +262,8 @@ void DebuggerManager::init() this, SLOT(loadAllSymbols())); connect(modulesView, SIGNAL(fileOpenRequested(QString)), this, SLOT(fileOpen(QString))); + connect(modulesView, SIGNAL(newDockRequested(QWidget*)), + this, SLOT(createNewDock(QWidget*))); // Source Files //m_sourceFilesHandler = new SourceFilesHandler; @@ -508,6 +510,16 @@ void DebuggerManager::createDockWidgets() m_watchDock = createDockForWidget(localsAndWatchers); } +void DebuggerManager::createNewDock(QWidget *widget) +{ + QDockWidget *dockWidget = new QDockWidget(widget->windowTitle(), m_mainWindow); + dockWidget->setObjectName(widget->windowTitle()); + dockWidget->setFeatures(QDockWidget::DockWidgetClosable); + dockWidget->setWidget(widget); + m_mainWindow->addDockWidget(Qt::TopDockWidgetArea, dockWidget); + dockWidget->show(); +} + QDockWidget *DebuggerManager::createDockForWidget(QWidget *widget) { QDockWidget *dockWidget = new QDockWidget(widget->windowTitle(), m_mainWindow); diff --git a/src/plugins/debugger/debuggermanager.h b/src/plugins/debugger/debuggermanager.h index af89e332b45895dddcc503605142b985c42ad566..dd0b854503c57f6c1060a78bd744af62d3980e73 100644 --- a/src/plugins/debugger/debuggermanager.h +++ b/src/plugins/debugger/debuggermanager.h @@ -402,6 +402,7 @@ private: void init(); void setDebuggerType(DebuggerType type); QDockWidget *createDockForWidget(QWidget *widget); + Q_SLOT void createNewDock(QWidget *widget); void shutdown(); diff --git a/src/plugins/debugger/gdbengine.cpp b/src/plugins/debugger/gdbengine.cpp index 0c339d0e2e7d5448029e04e1fc2c8eac41a8f924..0280ce6ede2011e5b677838d827ca1c124fdcfb9 100644 --- a/src/plugins/debugger/gdbengine.cpp +++ b/src/plugins/debugger/gdbengine.cpp @@ -2428,6 +2428,8 @@ void GdbEngine::handleModulesList(const GdbResultRecord &record) { QList<Module> modules; if (record.resultClass == GdbResultDone) { + // that's console-based output, likely Linux or Windows, + // but we can avoid the #ifdef here QString data = record.data.findChild("consolestreamoutput").data(); QTextStream ts(&data, QIODevice::ReadOnly); while (!ts.atEnd()) { @@ -2442,6 +2444,21 @@ void GdbEngine::handleModulesList(const GdbResultRecord &record) module.symbolsRead = (symbolsRead == "Yes"); modules.append(module); } + if (modules.isEmpty()) { + // Mac has^done,shlib-info={num="1",name="dyld",kind="-", + // dyld-addr="0x8fe00000",reason="dyld",requested-state="Y", + // state="Y",path="/usr/lib/dyld",description="/usr/lib/dyld", + // loaded_addr="0x8fe00000",slide="0x0",prefix="__dyld_"}, + // shlib-info={...}... + foreach (const GdbMi &item, record.data.children()) { + Module module; + module.moduleName = item.findChild("path").data(); + module.symbolsRead = (item.findChild("state").data() == "Y"); + module.startAddress = item.findChild("loaded_addr").data(); + module.endAddress = "<unknown>"; + modules.append(module); + } + } } qq->modulesHandler()->setModules(modules); } diff --git a/src/plugins/debugger/moduleswindow.cpp b/src/plugins/debugger/moduleswindow.cpp index c8e7e41625e755d86d1b63d2a870f0f2d4a70fb8..8d87709eadc0d08c8501f89894eeba85c8e82af9 100644 --- a/src/plugins/debugger/moduleswindow.cpp +++ b/src/plugins/debugger/moduleswindow.cpp @@ -30,13 +30,23 @@ #include "moduleswindow.h" #include "moduleshandler.h" // for model roles -#include <QAction> -#include <QDebug> -#include <QHeaderView> -#include <QMenu> -#include <QResizeEvent> -#include <QToolButton> +#include <QtCore/QDebug> +#include <QtCore/QProcess> +#include <QtCore/QRegExp> +#include <QtGui/QAction> +#include <QtGui/QHeaderView> +#include <QtGui/QMenu> +#include <QtGui/QResizeEvent> +#include <QtGui/QToolButton> +#include <QtGui/QTreeWidget> + + +/////////////////////////////////////////////////////////////////////////// +// +// ModulesWindow +// +/////////////////////////////////////////////////////////////////////////// using Debugger::Internal::ModulesWindow; @@ -93,20 +103,28 @@ void ModulesWindow::contextMenuEvent(QContextMenuEvent *ev) QAction *act4 = new QAction(tr("Load symbols for all modules"), &menu); QAction *act5 = 0; QAction *act6 = 0; + QAction *act7 = 0; if (name.isEmpty()) { act5 = new QAction(tr("Load symbols for module"), &menu); act6 = new QAction(tr("Edit file"), &menu); + act7 = new QAction(tr("Show symbols"), &menu); } else { act5 = new QAction(tr("Load symbols for module \"%1\"").arg(name), &menu); act6 = new QAction(tr("Edit file \"%1\"").arg(name), &menu); + act7 = new QAction(tr("Show symbols in file \"%1\"").arg(name), &menu); } act5->setDisabled(name.isEmpty()); act6->setDisabled(name.isEmpty()); + act7->setDisabled(name.isEmpty()); + #ifndef Q_OS_LINUX + act7->setDisabled(true); + #endif menu.addAction(act0); menu.addAction(act4); menu.addAction(act5); menu.addAction(act6); + menu.addAction(act7); menu.addSeparator(); menu.addAction(act1); menu.addAction(act2); @@ -127,6 +145,8 @@ void ModulesWindow::contextMenuEvent(QContextMenuEvent *ev) emit loadSymbolsRequested(name); else if (act == act6) emit fileOpenRequested(name); + else if (act == act7) + showSymbols(name); } void ModulesWindow::resizeColumnsToContents() @@ -154,3 +174,32 @@ void ModulesWindow::setModel(QAbstractItemModel *model) setAlwaysResizeColumnsToContents(true); } +void ModulesWindow::showSymbols(const QString &name) +{ + if (name.isEmpty()) + return; + QProcess proc; + proc.start("nm", QStringList() << "-D" << name); + proc.waitForFinished(); + QTreeWidget *w = new QTreeWidget; + w->setColumnCount(3); + w->setRootIsDecorated(false); + w->setAlternatingRowColors(true); + //w->header()->hide(); + w->setHeaderLabels(QStringList() << tr("Address") << tr("Code") << tr("Symbol")); + w->setWindowTitle(tr("Symbols in \"%1\"").arg(name)); + QString contents = QString::fromLocal8Bit(proc.readAllStandardOutput()); + QRegExp re("([0-9a-f]+)?\\s+([^\\s]+)\\s+([^\\s]+)"); + foreach (QString line, contents.split('\n')) { + if (re.indexIn(line) != -1) { + QTreeWidgetItem *it = new QTreeWidgetItem; + it->setData(0, Qt::DisplayRole, re.cap(1)); + it->setData(1, Qt::DisplayRole, re.cap(2)); + it->setData(2, Qt::DisplayRole, re.cap(3)); + w->addTopLevelItem(it); + } else { + qDebug() << "UNHANDLED LINE" << line; + } + } + emit newDockRequested(w); +} diff --git a/src/plugins/debugger/moduleswindow.h b/src/plugins/debugger/moduleswindow.h index a2686141961787c5d22157a999768cd933b74be6..36377fb58eeb657f5c742020391627a8be70ff0a 100644 --- a/src/plugins/debugger/moduleswindow.h +++ b/src/plugins/debugger/moduleswindow.h @@ -48,11 +48,13 @@ signals: void loadSymbolsRequested(const QString &modulesName); void loadAllSymbolsRequested(); void fileOpenRequested(QString); + void newDockRequested(QWidget *w); public slots: void resizeColumnsToContents(); void setAlwaysResizeColumnsToContents(bool on); void moduleActivated(const QModelIndex &); + void showSymbols(const QString &name); private: void resizeEvent(QResizeEvent *ev); diff --git a/src/plugins/designer/formtemplatewizardpage.cpp b/src/plugins/designer/formtemplatewizardpage.cpp index 55729095391566fb6a66edbea5b07cd871920a92..6bb4dc1244f9af4ef41a56c52373842a9d55a2c1 100644 --- a/src/plugins/designer/formtemplatewizardpage.cpp +++ b/src/plugins/designer/formtemplatewizardpage.cpp @@ -29,6 +29,7 @@ #include "formtemplatewizardpage.h" #include "formeditorw.h" +#include "designerconstants.h" #include <qt_private/abstractnewformwidget_p.h> @@ -278,6 +279,8 @@ namespace { QString FormTemplateWizardPage::changeUiClassName(const QString &uiXml, const QString &newUiClassName) { + if (Designer::Constants::Internal::debug) + qDebug() << '>' << Q_FUNC_INFO << newUiClassName; QDomDocument domUi; if (!domUi.setContent(uiXml)) { qWarning("Failed to parse:\n%s", uiXml.toUtf8().constData()); @@ -320,6 +323,8 @@ QString FormTemplateWizardPage::changeUiClassName(const QString &uiXml, const QS } } const QString rc = domUi.toString(); + if (Designer::Constants::Internal::debug > 1) + qDebug() << '<' << Q_FUNC_INFO << newUiClassName << rc; return rc; } #endif // USE_XSLT diff --git a/src/plugins/designer/settingsmanager.cpp b/src/plugins/designer/settingsmanager.cpp index 588a69214881754861f2d4524058bd44b5459185..2eeaf1a1db8b3b2009acbca53162eb4972d44088 100644 --- a/src/plugins/designer/settingsmanager.cpp +++ b/src/plugins/designer/settingsmanager.cpp @@ -36,14 +36,14 @@ using namespace Designer::Internal; void SettingsManager::beginGroup(const QString &prefix) { - if (Designer::Constants::Internal::debug) + if (Designer::Constants::Internal::debug > 1) qDebug() << Q_FUNC_INFO << addPrefix(prefix); m_settings.beginGroup(addPrefix(prefix)); } void SettingsManager::endGroup() { - if (Designer::Constants::Internal::debug) + if (Designer::Constants::Internal::debug > 1) qDebug() << Q_FUNC_INFO; m_settings.endGroup(); } @@ -55,7 +55,7 @@ bool SettingsManager::contains(const QString &key) const void SettingsManager::setValue(const QString &key, const QVariant &value) { - if (Designer::Constants::Internal::debug) + if (Designer::Constants::Internal::debug > 1) qDebug() << Q_FUNC_INFO << addPrefix(key) << ": " << value; m_settings.setValue(addPrefix(key), value); } @@ -63,7 +63,7 @@ void SettingsManager::setValue(const QString &key, const QVariant &value) QVariant SettingsManager::value(const QString &key, const QVariant &defaultValue) const { QVariant result = m_settings.value(addPrefix(key), defaultValue); - if (Designer::Constants::Internal::debug) + if (Designer::Constants::Internal::debug > 1) qDebug() << Q_FUNC_INFO << addPrefix(key) << ": " << result; return result; } diff --git a/src/plugins/designer/workbenchintegration.cpp b/src/plugins/designer/workbenchintegration.cpp index 3f85d0117c41a550e8d2d063349d10ce0d9e5510..4e264e7a7193cad8b6e9b3add8d9cfabf9c2ae6c 100644 --- a/src/plugins/designer/workbenchintegration.cpp +++ b/src/plugins/designer/workbenchintegration.cpp @@ -125,6 +125,16 @@ static QList<Document::Ptr> findDocumentsIncluding(const CPlusPlus::Snapshot &do return docList; } +// Does klass inherit baseClass? +static bool inherits(const Overview &o, const Class *klass, const QString &baseClass) +{ + const int baseClassCount = klass->baseClassCount(); + for (int b = 0; b < baseClassCount; b++) + if (o.prettyName(klass->baseClassAt(b)->name()) == baseClass) + return true; + return false; +} + // Check for a class name where haystack is a member class of an object. // So, haystack can be shorter (can have some namespaces omitted because of a // "using namespace" declaration, for example, comparing @@ -141,7 +151,9 @@ static bool matchMemberClassName(const QString &needle, const QString &hayStack) return separatorPos > 1 && needle.at(separatorPos) == QLatin1Char(':'); } -// Find class definition in namespace +// Find class definition in namespace (that is, the outer class +// containing a member of the desired class type) or inheriting the desired class +// in case of forms using the Multiple Inheritance approach static const Class *findClass(const Namespace *parentNameSpace, const QString &className, QString *namespaceName) { if (Designer::Constants::Internal::debug) @@ -153,8 +165,9 @@ static const Class *findClass(const Namespace *parentNameSpace, const QString &c const Symbol *sym = parentNameSpace->memberAt(i); // we have found a class - we are interested in classes only if (const Class *cl = sym->asClass()) { + // 1) we go through class members const unsigned classMemberCount = cl->memberCount(); - for (unsigned j = 0; j < classMemberCount; j++) // we go through class members + for (unsigned j = 0; j < classMemberCount; j++) if (const Declaration *decl = cl->memberAt(j)->asDeclaration()) { // we want to know if the class contains a member (so we look into // a declaration) of uiClassName type @@ -166,6 +179,9 @@ static const Class *findClass(const Namespace *parentNameSpace, const QString &c if (nt && matchMemberClassName(className, o.prettyName(nt->name()))) return cl; } // decl + // 2) does it inherit the desired class + if (inherits(o, cl, className)) + return cl; } else { // Check namespaces if (const Namespace *ns = sym->asNamespace()) { @@ -386,8 +402,15 @@ static void addDeclaration(const QString &docFileName, const Class *cl, const QS // fun->column() returns always 0, what can cause trouble in case in one // line if there is: "private slots: void foo();" if (fun->isSlot() && fun->isPrivate()) { - if (ITextEditable *editable = editableAt(docFileName, fun->line(), fun->column())) - editable->insert(declaration + QLatin1String(" ")); + const int line = fun->line(); // [1..n] + const int column = fun->column(); + if (ITextEditable *editable = editableAt(docFileName, line, column)) { + // Figure out indentation (symbol - len("void ")) and insert after + editable->gotoLine(line + 1, 1); + editable->position(ITextEditor::StartOfLine); + const QString indentation = QString(qMax(0, column - 6), QLatin1Char(' ')); + editable->insert(indentation + declaration); + } return; } } @@ -483,7 +506,7 @@ static ClassDocumentPtrPair unsigned maxIncludeDepth, QString *namespaceName) { if (Designer::Constants::Internal::debug) - qDebug() << Q_FUNC_INFO << doc->fileName() << maxIncludeDepth; + qDebug() << Q_FUNC_INFO << doc->fileName() << className << maxIncludeDepth; // Check document if (const Class *cl = findClass(doc->globalNamespace(), className, namespaceName)) return ClassDocumentPtrPair(cl, doc); @@ -523,6 +546,9 @@ static inline QString uiClassName(QString formObjectName) return formObjectName; } +// Goto slot invoked by the designer context menu. Either navigates +// to an existing slot function or create a new one. + bool WorkbenchIntegration::navigateToSlot(const QString &objectName, const QString &signalSignature, const QStringList ¶meterNames, @@ -538,7 +564,7 @@ bool WorkbenchIntegration::navigateToSlot(const QString &objectName, const QFileInfo fi(currentUiFile); const QString uicedName = QLatin1String("ui_") + fi.baseName() + QLatin1String(".h"); - // take all docs + // 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 @@ -546,7 +572,7 @@ bool WorkbenchIntegration::navigateToSlot(const QString &objectName, if (Designer::Constants::Internal::debug) qDebug() << Q_FUNC_INFO << objectName << signalSignature << "Looking for " << uicedName << " returned " << docList.size(); if (docList.isEmpty()) { - *errorMessage = tr("No documents matching %1 could be found.").arg(uicedName); + *errorMessage = tr("No documents matching '%1' could be found.\nRebuilding the project might help.").arg(uicedName); return false; } @@ -557,8 +583,8 @@ bool WorkbenchIntegration::navigateToSlot(const QString &objectName, if (Designer::Constants::Internal::debug) qDebug() << "Checking docs for " << uiClass; - // Find the class definition in the file itself or in the directly - // included files (order 1). + // Find the class definition (ui class defined as member or base class) + // in the file itself or in the directly included files (order 1). QString namespaceName; const Class *cl = 0; Document::Ptr doc; @@ -578,6 +604,8 @@ bool WorkbenchIntegration::navigateToSlot(const QString &objectName, Overview o; const QString className = namespaceName + o.prettyName(cl->name()); + if (Designer::Constants::Internal::debug) + qDebug() << "Found class " << className << doc->fileName(); const QString functionName = QLatin1String("on_") + objectName + QLatin1Char('_') + signalSignature; const QString functionNameWithParameterNames = addParameterNames(functionName, parameterNames); diff --git a/src/plugins/fakevim/fakevimconstants.h b/src/plugins/fakevim/fakevimconstants.h index 516f97903548c30a7950452c055eaadf579a9de8..7c21750451df3158dc4efda3f1673d66d8521c02 100644 --- a/src/plugins/fakevim/fakevimconstants.h +++ b/src/plugins/fakevim/fakevimconstants.h @@ -36,12 +36,13 @@ namespace Constants { const char * const ConfigOn = "on"; const char * const ConfigOff = "off"; +const char * const ConfigAutoIndent = "autoindent"; +const char * const ConfigExpandTab = "expandtab"; +const char * const ConfigHlSearch = "hlsearch"; +const char * const ConfigShiftWidth = "shiftwidth"; +const char * const ConfigSmartTab = "smarttab"; const char * const ConfigStartOfLine = "startofline"; const char * const ConfigTabStop = "tabstop"; -const char * const ConfigSmartTab = "smarttab"; -const char * const ConfigShiftWidth = "shiftwidth"; -const char * const ConfigExpandTab = "expandtab"; -const char * const ConfigAutoIndent = "autoindent"; } // namespace Constants } // namespace FakeVim diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp index 073ddc000ec0d02e6a7954be57daba577f2e4c99..0d3dbcf7dc4edd1b6041054880edbad7d2b0e586 100644 --- a/src/plugins/fakevim/fakevimhandler.cpp +++ b/src/plugins/fakevim/fakevimhandler.cpp @@ -177,7 +177,7 @@ QDebug &operator<<(QDebug &ts, const EditOperation &op) ts << "\n EDIT BLOCK WITH " << op.itemCount << " ITEMS"; } else { ts << "\n EDIT AT " << op.position - << "\n FROM " << op.from << "\n TO " << op.to; + << " FROM " << op.from << " TO " << op.to; } return ts; } @@ -227,6 +227,7 @@ private: EventResult handleMiniBufferModes(int key, int unmodified, const QString &text); void finishMovement(const QString &text = QString()); void search(const QString &needle, bool forward); + void highlightMatches(const QString &needle); int mvCount() const { return m_mvcount.isEmpty() ? 1 : m_mvcount.toInt(); } int opCount() const { return m_opcount.isEmpty() ? 1 : m_opcount.toInt(); } @@ -294,6 +295,8 @@ private: void updateSelection(); void quit(); QWidget *editor() const; + QChar characterAtCursor() const + { return m_tc.document()->characterAt(m_tc.position()); } public: QTextEdit *m_textedit; @@ -389,6 +392,8 @@ public: void recordJump(); QList<int> m_jumpListUndo; QList<int> m_jumpListRedo; + + QList<QTextEdit::ExtraSelection> m_searchSelections; }; FakeVimHandler::Private::Private(FakeVimHandler *parent, QWidget *widget) @@ -414,6 +419,7 @@ FakeVimHandler::Private::Private(FakeVimHandler *parent, QWidget *widget) m_cursorWidth = EDITOR(cursorWidth()); m_config[ConfigStartOfLine] = ConfigOn; + m_config[ConfigHlSearch] = ConfigOn; m_config[ConfigTabStop] = "8"; m_config[ConfigSmartTab] = ConfigOff; m_config[ConfigShiftWidth] = "8"; @@ -657,7 +663,7 @@ void FakeVimHandler::Private::finishMovement(const QString &dotCommand) void FakeVimHandler::Private::updateSelection() { - QList<QTextEdit::ExtraSelection> selections; + QList<QTextEdit::ExtraSelection> selections = m_searchSelections; if (m_visualMode != NoVisualMode) { QTextEdit::ExtraSelection sel; sel.cursor = m_tc; @@ -859,7 +865,10 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified, m_semicolonKey = key; handleFfTt(key); m_subsubmode = NoSubSubMode; - finishMovement(); + finishMovement(QString("%1%2%3") + .arg(count()) + .arg(QChar(m_semicolonType)) + .arg(QChar(m_semicolonKey))); } else if (m_submode == ReplaceSubMode) { if (count() < rightDist() && text.size() == 1 && (text.at(0).isPrint() || text.at(0).isSpace())) { @@ -1073,8 +1082,13 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified, m_moveType = MoveInclusive; moveToWordBoundary(true, true); finishMovement(); - } else if (key == 'f' || key == 'F') { + } else if (key == 'f') { m_subsubmode = FtSubSubMode; + m_moveType = MoveInclusive; + m_subsubdata = key; + } else if (key == 'F') { + m_subsubmode = FtSubSubMode; + m_moveType = MoveExclusive; m_subsubdata = key; } else if (key == 'g') { if (m_gflag) { @@ -1146,6 +1160,8 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified, for (int i = qMax(count(), 2) - 1; --i >= 0; ) { moveToEndOfLine(); recordRemoveNextChar(); + while (characterAtCursor() == ' ') + recordRemoveNextChar(); if (!m_gflag) recordInsertText(" "); } @@ -1262,7 +1278,12 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified, m_opcount.clear(); m_mvcount.clear(); enterInsertMode(); - } else if (key == 't' || key == 'T') { + } else if (key == 't') { + m_moveType = MoveInclusive; + m_subsubmode = FtSubSubMode; + m_subsubdata = key; + } else if (key == 'T') { + m_moveType = MoveExclusive; m_subsubmode = FtSubSubMode; m_subsubdata = key; } else if (key == 'u') { @@ -1382,7 +1403,7 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified, EventResult FakeVimHandler::Private::handleInsertMode(int key, int, const QString &text) { - if (key == Key_Escape) { + if (key == Key_Escape || key == 27) { // start with '1', as one instance was already physically inserted // while typing QString data = m_lastInsertion; @@ -1395,6 +1416,7 @@ EventResult FakeVimHandler::Private::handleInsertMode(int key, int, //qDebug() << "UNDO: " << m_undoStack; moveLeft(qMin(1, leftDist())); m_dotCommand += m_lastInsertion; + m_dotCommand += QChar(27); enterCommandMode(); } else if (key == Key_Left) { moveLeft(count()); @@ -1770,6 +1792,16 @@ void FakeVimHandler::Private::handleExCommand(const QString &cmd0) } } +static void vimPatternToQtPattern(QString *needle, QTextDocument::FindFlags *flags) +{ + // FIXME: Rough mapping of a common case + if (needle->startsWith("\\<") && needle->endsWith("\\>")) + (*flags) |= QTextDocument::FindWholeWords; + needle->replace("\\<", ""); // start of word + needle->replace("\\>", ""); // end of word + //qDebug() << "NEEDLE " << needle0 << needle; +} + void FakeVimHandler::Private::search(const QString &needle0, bool forward) { showBlackMessage((forward ? '/' : '?') + needle0); @@ -1778,14 +1810,8 @@ void FakeVimHandler::Private::search(const QString &needle0, bool forward) if (!forward) flags |= QTextDocument::FindBackward; - // FIXME: Rough mapping of a common case QString needle = needle0; - if (needle.startsWith("\\<") && needle.endsWith("\\>")) - flags |= QTextDocument::FindWholeWords; - needle.replace("\\<", ""); // start of word - needle.replace("\\>", ""); // end of word - - //qDebug() << "NEEDLE " << needle0 << needle << "FORWARD" << forward << flags; + vimPatternToQtPattern(&needle, &flags); if (forward) m_tc.movePosition(Right, MoveAnchor, 1); @@ -1799,6 +1825,7 @@ void FakeVimHandler::Private::search(const QString &needle0, bool forward) // making this unconditional feels better, but is not "vim like" if (oldLine != cursorLineInDocument() - cursorLineOnScreen()) scrollToLineInDocument(cursorLineInDocument() - linesOnScreen() / 2); + highlightMatches(needle); return; } @@ -1813,12 +1840,41 @@ void FakeVimHandler::Private::search(const QString &needle0, bool forward) showRedMessage("search hit BOTTOM, continuing at TOP"); else showRedMessage("search hit TOP, continuing at BOTTOM"); + highlightMatches(needle); return; } m_tc = orig; } +void FakeVimHandler::Private::highlightMatches(const QString &needle0) +{ + if (m_config[ConfigHlSearch] == ConfigOff) + return; + + QTextCursor tc = m_tc; + tc.movePosition(QTextCursor::Start, MoveAnchor); + + QTextDocument::FindFlags flags = QTextDocument::FindCaseSensitively; + QString needle = needle0; + vimPatternToQtPattern(&needle, &flags); + + m_searchSelections.clear(); + + EDITOR(setTextCursor(tc)); + while (EDITOR(find(needle, flags))) { + tc = EDITOR(textCursor()); + QTextEdit::ExtraSelection sel; + sel.cursor = tc; + sel.format = tc.blockCharFormat(); + sel.format.setBackground(QColor(177, 177, 0)); + m_searchSelections.append(sel); + tc.movePosition(Right, MoveAnchor); + EDITOR(setTextCursor(tc)); + } + updateSelection(); +} + void FakeVimHandler::Private::moveToFirstNonBlankOnLine() { QTextBlock block = m_tc.block(); @@ -1980,11 +2036,6 @@ void FakeVimHandler::Private::handleFfTt(int key) --pos; else if (m_subsubdata == 'T') ++pos; - // FIXME: strange correction... - if (m_submode == DeleteSubMode && m_subsubdata == 'f') - ++pos; - if (m_submode == DeleteSubMode && m_subsubdata == 't') - ++pos; if (forward) m_tc.movePosition(Right, KeepAnchor, pos - m_tc.position()); @@ -1999,12 +2050,10 @@ void FakeVimHandler::Private::moveToNextWord(bool simple) { // FIXME: 'w' should stop on empty lines, too int repeat = count(); - QTextDocument *doc = m_tc.document(); int n = lastPositionInDocument() - 1; - QChar c = doc->characterAt(m_tc.position()); - int lastClass = charClass(c, simple); + int lastClass = charClass(characterAtCursor(), simple); while (true) { - c = doc->characterAt(m_tc.position()); + QChar c = characterAtCursor(); int thisClass = charClass(c, simple); if (thisClass != lastClass && thisClass != 0) --repeat; @@ -2265,13 +2314,14 @@ void FakeVimHandler::Private::recordPosition() op.position = m_tc.position(); m_undoStack.push(op); m_redoStack.clear(); - //qDebug() << "MOVE: " << op; - //qDebug() << "\nSTACK: " << m_undoStack; + UNDO_DEBUG("MOVE: " << op); + UNDO_DEBUG("\nUNDO STACK: " << m_undoStack << "\n"); + UNDO_DEBUG("\nREDO STACK: " << m_redoStack << "\n"); } void FakeVimHandler::Private::recordOperation(const EditOperation &op) { - UNDO_DEBUG("OP: " << op); + UNDO_DEBUG("RECORD OP: " << op); // No need to record operations that actually do not change anything. if (op.from.isEmpty() && op.to.isEmpty() && op.itemCount == 0) return; @@ -2280,7 +2330,8 @@ void FakeVimHandler::Private::recordOperation(const EditOperation &op) return; m_undoStack.push(op); m_redoStack.clear(); - UNDO_DEBUG("\nSTACK: " << m_undoStack); + UNDO_DEBUG("\nUNDO STACK: " << m_undoStack << "\n"); + UNDO_DEBUG("\nREDO STACK: " << m_redoStack << "\n"); } void FakeVimHandler::Private::recordInsert(int position, const QString &data) diff --git a/src/plugins/projectexplorer/compileoutputwindow.cpp b/src/plugins/projectexplorer/compileoutputwindow.cpp index 16310cd7c65a9a2d2afb959e5f58dd17c1c33094..56c294a2e06204ad5695935b07c8b62199a20a5f 100644 --- a/src/plugins/projectexplorer/compileoutputwindow.cpp +++ b/src/plugins/projectexplorer/compileoutputwindow.cpp @@ -42,7 +42,7 @@ using namespace ProjectExplorer::Internal; CompileOutputWindow::CompileOutputWindow(BuildManager * /*bm*/) { - m_textEdit = new QTextEdit(); + m_textEdit = new QPlainTextEdit(); m_textEdit->setWindowTitle(tr("Compile Output")); m_textEdit->setWindowIcon(QIcon(":/qt4projectmanager/images/window.png")); m_textEdit->setReadOnly(true); @@ -74,7 +74,7 @@ QWidget *CompileOutputWindow::outputWidget(QWidget *) void CompileOutputWindow::appendText(const QString &text) { - m_textEdit->append(text); + m_textEdit->appendHtml(text); } void CompileOutputWindow::clearContents() diff --git a/src/plugins/projectexplorer/compileoutputwindow.h b/src/plugins/projectexplorer/compileoutputwindow.h index 957178ba6e2ddb41937eca329396759a2095a339..4687bf3816b67ace2a98ca3854e7ad15615e7eb2 100644 --- a/src/plugins/projectexplorer/compileoutputwindow.h +++ b/src/plugins/projectexplorer/compileoutputwindow.h @@ -32,7 +32,7 @@ #include <coreplugin/ioutputpane.h> -#include <QtGui/QTextEdit> +#include <QtGui/QPlainTextEdit> namespace ProjectExplorer { @@ -58,7 +58,7 @@ public: void setFocus(); private: - QTextEdit *m_textEdit; + QPlainTextEdit *m_textEdit; }; } // namespace Internal diff --git a/src/plugins/projectexplorer/taskwindow.cpp b/src/plugins/projectexplorer/taskwindow.cpp index b0fec5a6847269e5bd024d24796b337785eeffcc..10f1a0328e748d9733d8f29811d01bd660494ed6 100644 --- a/src/plugins/projectexplorer/taskwindow.cpp +++ b/src/plugins/projectexplorer/taskwindow.cpp @@ -334,8 +334,9 @@ void TaskWindow::showTaskInFile(const QModelIndex &index) if (file.isEmpty() || line == -1) return; - if (QFileInfo(file).exists()) { - TextEditor::BaseTextEditor::openEditorAt(file, line); + QFileInfo fi(file); + if (fi.exists()) { + TextEditor::BaseTextEditor::openEditorAt(fi.canonicalFilePath(), line); Core::EditorManager::instance()->ensureEditorManagerVisible(); } else diff --git a/src/plugins/qt4projectmanager/qt4nodes.cpp b/src/plugins/qt4projectmanager/qt4nodes.cpp index 1a33bbf21527c2fa28e81d932da343ccaaf03e01..e2a9ea8d9d280e5d3f617825516264b313fed0ab 100644 --- a/src/plugins/qt4projectmanager/qt4nodes.cpp +++ b/src/plugins/qt4projectmanager/qt4nodes.cpp @@ -904,13 +904,19 @@ QStringList Qt4ProFileNode::subDirsPaths(ProFileReader *reader) const // Special case were subdir is just an identifier: // "SUBDIR = subid // subid.subdir = realdir" + // or + // "SUBDIR = subid + // subid.file = realdir/realfile.pro" QString realDir; QString realFile; const QString subDirKey = subDirVar + QLatin1String(".subdir"); + const QString subDirFileKey = subDirVar + QLatin1String(".file"); if (reader->contains(subDirKey)) realDir = QFileInfo(reader->value(subDirKey)).filePath(); - else + else if (reader->contains(subDirFileKey)) + realDir = QFileInfo(reader->value(subDirFileKey)).filePath(); + else realDir = subDirVar; QFileInfo info(realDir); if (!info.isAbsolute()) diff --git a/src/plugins/qt4projectmanager/qt4project.cpp b/src/plugins/qt4projectmanager/qt4project.cpp index 1557bb46127201bdddf6ed72cfe6e782eec10667..3549df23a6e7c04aa9fe313a6d86e679ca4c7d90 100644 --- a/src/plugins/qt4projectmanager/qt4project.cpp +++ b/src/plugins/qt4projectmanager/qt4project.cpp @@ -229,20 +229,13 @@ void Qt4ProjectFile::modified(Core::IFile::ReloadBehavior *) Qt4Project::Qt4Project(Qt4Manager *manager, const QString& fileName) : m_toolChain(0), m_manager(manager), - m_rootProjectNode(new Qt4ProFileNode(this, fileName, this)), + m_rootProjectNode(0), m_nodesWatcher(new Internal::Qt4NodesWatcher(this)), m_fileInfo(new Qt4ProjectFile(this, fileName, this)), m_isApplication(true), m_projectFiles(new Qt4ProjectFiles) { m_manager->registerProject(this); - m_rootProjectNode->registerWatcher(m_nodesWatcher); - connect(m_nodesWatcher, SIGNAL(foldersAdded()), this, SLOT(updateFileList())); - connect(m_nodesWatcher, SIGNAL(foldersRemoved()), this, SLOT(updateFileList())); - connect(m_nodesWatcher, SIGNAL(filesAdded()), this, SLOT(updateFileList())); - connect(m_nodesWatcher, SIGNAL(filesRemoved()), this, SLOT(updateFileList())); - connect(m_nodesWatcher, SIGNAL(proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode *)), - this, SLOT(scheduleUpdateCodeModel())); connect(qt4ProjectManager()->versionManager(), SIGNAL(defaultQtVersionChanged()), this, SLOT(defaultQtVersionChanged())); @@ -305,6 +298,15 @@ void Qt4Project::restoreSettingsImpl(PersistentSettingsReader &settingsReader) foreach (const QString &bc, buildConfigurations()) qtVersionId(bc); + m_rootProjectNode = new Qt4ProFileNode(this, m_fileInfo->fileName(), this); + m_rootProjectNode->registerWatcher(m_nodesWatcher); + connect(m_nodesWatcher, SIGNAL(foldersAdded()), this, SLOT(updateFileList())); + connect(m_nodesWatcher, SIGNAL(foldersRemoved()), this, SLOT(updateFileList())); + connect(m_nodesWatcher, SIGNAL(filesAdded()), this, SLOT(updateFileList())); + connect(m_nodesWatcher, SIGNAL(filesRemoved()), this, SLOT(updateFileList())); + connect(m_nodesWatcher, SIGNAL(proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode *)), + this, SLOT(scheduleUpdateCodeModel())); + update(); // restored old runconfigurations @@ -685,7 +687,7 @@ void Qt4Project::addDefaultBuild() insertBuildStep(0, gdbmacrostep); GdbMacrosBuildStep *gdbmacrosCleanStep = new GdbMacrosBuildStep(this); - gdbmacrosCleanStep ->setValue("clean", true); + gdbmacrosCleanStep->setValue("clean", true); insertCleanStep(0, gdbmacrosCleanStep ); break; } diff --git a/src/plugins/qt4projectmanager/qt4projectmanager.cpp b/src/plugins/qt4projectmanager/qt4projectmanager.cpp index e22f19278f5073989205d113ec1a25744699ab4d..df1d613dc309d89378894e7024f041e43246a4f7 100644 --- a/src/plugins/qt4projectmanager/qt4projectmanager.cpp +++ b/src/plugins/qt4projectmanager/qt4projectmanager.cpp @@ -130,13 +130,6 @@ QString Qt4Manager::mimeType() const ProjectExplorer::Project* Qt4Manager::openProject(const QString &fileName) { - typedef QMultiMap<QString, QString> DependencyMap; - const QString dotSubDir = QLatin1String(".subdir"); - const QString dotDepends = QLatin1String(".depends"); - const QChar slash = QLatin1Char('/'); - - QString errorMessage; - Core::MessageManager *messageManager = Core::ICore::instance()->messageManager(); messageManager->displayStatusBarMessage(tr("Loading project %1 ...").arg(fileName), 50000); diff --git a/src/plugins/quickopen/basefilefilter.cpp b/src/plugins/quickopen/basefilefilter.cpp index eed633036c04cd8871f70f123971e18d7e56a7a2..304f68e6f8bd129935cb0adac316fc2790c9d7c9 100644 --- a/src/plugins/quickopen/basefilefilter.cpp +++ b/src/plugins/quickopen/basefilefilter.cpp @@ -43,16 +43,17 @@ BaseFileFilter::BaseFileFilter() QList<FilterEntry> BaseFileFilter::matchesFor(const QString &origEntry) { - QList<FilterEntry> value; - QString entry = trimWildcards(origEntry); - QStringMatcher matcher(entry, Qt::CaseInsensitive); - const QRegExp regexp("*"+entry+"*", Qt::CaseInsensitive, QRegExp::Wildcard); + QList<FilterEntry> matches; + QList<FilterEntry> badMatches; + QString needle = trimWildcards(origEntry); + QStringMatcher matcher(needle, Qt::CaseInsensitive); + const QRegExp regexp("*"+needle+"*", Qt::CaseInsensitive, QRegExp::Wildcard); if (!regexp.isValid()) - return value; - bool hasWildcard = (entry.contains('*') || entry.contains('?')); + return matches; + bool hasWildcard = (needle.contains('*') || needle.contains('?')); QStringList searchListPaths; QStringList searchListNames; - if (!m_previousEntry.isEmpty() && !m_forceNewSearchList && entry.contains(m_previousEntry)) { + if (!m_previousEntry.isEmpty() && !m_forceNewSearchList && needle.contains(m_previousEntry)) { searchListPaths = m_previousResultPaths; searchListNames = m_previousResultNames; } else { @@ -62,7 +63,7 @@ QList<FilterEntry> BaseFileFilter::matchesFor(const QString &origEntry) m_previousResultPaths.clear(); m_previousResultNames.clear(); m_forceNewSearchList = false; - m_previousEntry = entry; + m_previousEntry = needle; QStringListIterator paths(searchListPaths); QStringListIterator names(searchListNames); while (paths.hasNext() && names.hasNext()) { @@ -74,12 +75,17 @@ QList<FilterEntry> BaseFileFilter::matchesFor(const QString &origEntry) FilterEntry entry(this, fi.fileName(), path); entry.extraInfo = QDir::toNativeSeparators(fi.path()); entry.resolveFileIcon = true; - value.append(entry); + if (name.startsWith(needle)) + matches.append(entry); + else + badMatches.append(entry); m_previousResultPaths.append(path); m_previousResultNames.append(name); } } - return value; + + matches.append(badMatches); + return matches; } void BaseFileFilter::accept(QuickOpen::FilterEntry selection) const diff --git a/src/qworkbench.pri b/src/qworkbench.pri index 8116de8600261486d79ed9945d757b8fd6bb08eb..deda9ae21f0ec8ed72248ce31370394dfc24af33 100644 --- a/src/qworkbench.pri +++ b/src/qworkbench.pri @@ -54,3 +54,9 @@ unix { RCC_DIR = $${OUT_PWD}/.rcc/ UI_DIR = $${OUT_PWD}/.uic/ } + +linux-g++-* { + # Bail out on non-selfcontained libraries. Just a security measure + # to prevent checking in code that does not compile on other platforms. + QMAKE_LFLAGS += -Wl,--allow-shlib-undefined -Wl,--no-undefined +}