From db20c44d4099ebafb053455634befec7df083099 Mon Sep 17 00:00:00 2001 From: dt Date: Wed, 21 Jan 2009 16:25:21 +0100 Subject: [PATCH 01/42] Fixes: Add a settings page to the cmake plugin. Details: There's a linedit on there, we restore and save the settings, only thing missing is actually using it. --- .../cmakeprojectmanager/cmakeproject.h | 1 + .../cmakeprojectmanager.cpp | 105 +++++++++++++++++- .../cmakeprojectmanager/cmakeprojectmanager.h | 30 ++++- .../cmakeprojectmanager.pro | 1 + .../cmakeprojectplugin.cpp | 4 +- src/plugins/projectexplorer/environment.cpp | 4 - 6 files changed, 138 insertions(+), 7 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.h b/src/plugins/cmakeprojectmanager/cmakeproject.h index a71ca7c8b00..e07c4106d4b 100644 --- a/src/plugins/cmakeprojectmanager/cmakeproject.h +++ b/src/plugins/cmakeprojectmanager/cmakeproject.h @@ -105,6 +105,7 @@ public: CMakeStep *cmakeStep() const; QStringList targets() const; + private: void parseCMakeLists(const QDir &directory); QString findCbpFile(const QDir &); diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp index 966c0144355..fb19dbdbf9b 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp @@ -39,16 +39,25 @@ #include #include #include +#include +#include +#include using namespace CMakeProjectManager::Internal; -CMakeManager::CMakeManager() +CMakeManager::CMakeManager(CMakeSettingsPage *cmakeSettingsPage) + : m_settingsPage(cmakeSettingsPage) { Core::ICore *core = Core::ICore::instance(); m_projectContext = core->uniqueIDManager()->uniqueIdentifier(CMakeProjectManager::Constants::PROJECTCONTEXT); m_projectLanguage = core->uniqueIDManager()->uniqueIdentifier(ProjectExplorer::Constants::LANG_CXX); } +CMakeSettingsPage::~CMakeSettingsPage() +{ + +} + int CMakeManager::projectContext() const { return m_projectContext; @@ -62,6 +71,14 @@ int CMakeManager::projectLanguage() const ProjectExplorer::Project *CMakeManager::openProject(const QString &fileName) { // TODO check wheter this project is already opened + // Check that we have a cmake executable first + // Look at the settings first + QString cmakeExecutable = m_settingsPage->cmakeExecutable(); + if (cmakeExecutable.isNull()) + m_settingsPage->askUserForCMakeExecutable(); + cmakeExecutable = m_settingsPage->cmakeExecutable(); + if (cmakeExecutable.isNull()) + return 0; return new CMakeProject(this, fileName); } @@ -69,3 +86,89 @@ QString CMakeManager::mimeType() const { return Constants::CMAKEMIMETYPE; } + +///// +// CMakeSettingsPage +//// + +CMakeSettingsPage::CMakeSettingsPage() +{ + Core::ICore *core = Core::ICore::instance(); + QSettings * settings = core->settings(); + settings->beginGroup("CMakeSettings"); + m_cmakeExecutable = settings->value("cmakeExecutable").toString(); + settings->endGroup(); +} + +QString CMakeSettingsPage::findCmakeExecutable() const +{ + ProjectExplorer::Environment env = ProjectExplorer::Environment::systemEnvironment(); + return env.searchInPath("cmake"); +} + + +QString CMakeSettingsPage::name() const +{ + return "CMake"; +} + +QString CMakeSettingsPage::category() const +{ + return "CMake"; +} + +QString CMakeSettingsPage::trCategory() const +{ + return tr("CMake"); +} + +QWidget *CMakeSettingsPage::createPage(QWidget *parent) +{ + QWidget *w = new QWidget(parent); + QFormLayout *fl = new QFormLayout(w); + m_pathchooser = new Core::Utils::PathChooser(w); + m_pathchooser->setExpectedKind(Core::Utils::PathChooser::Command); + fl->addRow("CMake executable", m_pathchooser); + m_pathchooser->setPath(cmakeExecutable()); + return w; +} + +void CMakeSettingsPage::saveSettings() const +{ + QSettings *settings = Core::ICore::instance()->settings(); + settings->beginGroup("CMakeSettings"); + settings->setValue("cmakeExecutable", m_cmakeExecutable); + settings->endGroup(); +} + +void CMakeSettingsPage::apply() +{ + m_cmakeExecutable = m_pathchooser->path(); + saveSettings(); +} + +void CMakeSettingsPage::finish() +{ + +} + +QString CMakeSettingsPage::cmakeExecutable() const +{ + if (m_cmakeExecutable.isEmpty()) { + m_cmakeExecutable = findCmakeExecutable(); + if (!m_cmakeExecutable.isEmpty()) { + saveSettings(); + } + } + return m_cmakeExecutable; +} + +void CMakeSettingsPage::askUserForCMakeExecutable() +{ + // TODO implement + // That is ideally add a label to the settings page, which says something + // to the effect: please configure the cmake executable + // and show the settings page + // ensure that we rehide the label in the finish() function + // But to test that i need an environment without cmake, e.g. windows +} diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.h b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.h index 34d97f1cc7c..f0481c51498 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.h +++ b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.h @@ -34,16 +34,20 @@ #ifndef CMAKEPROJECTMANAGER_H #define CMAKEPROJECTMANAGER_H +#include #include +#include namespace CMakeProjectManager { namespace Internal { +class CMakeSettingsPage; + class CMakeManager : public ProjectExplorer::IProjectManager { Q_OBJECT public: - CMakeManager(); + CMakeManager(CMakeSettingsPage *cmakeSettingsPage); virtual int projectContext() const; virtual int projectLanguage() const; @@ -55,6 +59,30 @@ public: private: int m_projectContext; int m_projectLanguage; + CMakeSettingsPage *m_settingsPage; +}; + +class CMakeSettingsPage : public Core::IOptionsPage +{ + Q_OBJECT +public: + CMakeSettingsPage(); + virtual ~CMakeSettingsPage(); + virtual QString name() const; + virtual QString category() const; + virtual QString trCategory() const; + + virtual QWidget *createPage(QWidget *parent); + virtual void apply(); + virtual void finish(); + + QString cmakeExecutable() const; + void askUserForCMakeExecutable(); +private: + void saveSettings() const; + QString findCmakeExecutable() const; + mutable QString m_cmakeExecutable; + Core::Utils::PathChooser *m_pathchooser; }; } // namespace Internal diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.pro b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.pro index 74f69fea4ab..688d16b0a97 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.pro +++ b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.pro @@ -18,3 +18,4 @@ SOURCES = cmakeproject.cpp \ makestep.cpp \ cmakerunconfiguration.cpp RESOURCES += cmakeproject.qrc +FORMS += cmakesettingspage.ui diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp index 29ad08ec5f1..4c16e0d997b 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp @@ -59,7 +59,9 @@ bool CMakeProjectPlugin::initialize(const QStringList & /*arguments*/, QString * Core::ICore *core = Core::ICore::instance(); if (!core->mimeDatabase()->addMimeTypes(QLatin1String(":cmakeproject/CMakeProject.mimetypes.xml"), errorMessage)) return false; - addAutoReleasedObject(new CMakeManager()); + CMakeSettingsPage *cmp = new CMakeSettingsPage(); + addAutoReleasedObject(cmp); + addAutoReleasedObject(new CMakeManager(cmp)); addAutoReleasedObject(new CMakeBuildStepFactory()); addAutoReleasedObject(new MakeBuildStepFactory()); addAutoReleasedObject(new CMakeRunConfigurationFactory()); diff --git a/src/plugins/projectexplorer/environment.cpp b/src/plugins/projectexplorer/environment.cpp index 7a767d75b2e..38f35af9727 100644 --- a/src/plugins/projectexplorer/environment.cpp +++ b/src/plugins/projectexplorer/environment.cpp @@ -183,10 +183,6 @@ void Environment::clear() m_values.clear(); } -// currently it returns the string that was passed in, except -// under windows and if the executable does not end in .exe -// then it returns executable appended with .exe -// that is clearly wrong QString Environment::searchInPath(QString executable) { // qDebug()<<"looking for "< Date: Wed, 21 Jan 2009 17:21:59 +0100 Subject: [PATCH 02/42] Fixes: Run cmake to get the version and check for the QtCreator generator Details: We don't act on that information yet. --- .../cmakeprojectmanager.cpp | 26 +++++++++++++++++++ .../cmakeprojectmanager/cmakeprojectmanager.h | 3 +++ 2 files changed, 29 insertions(+) diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp index fb19dbdbf9b..96170439d4e 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp @@ -98,6 +98,30 @@ CMakeSettingsPage::CMakeSettingsPage() settings->beginGroup("CMakeSettings"); m_cmakeExecutable = settings->value("cmakeExecutable").toString(); settings->endGroup(); + updateCachedInformation(); +} + +void CMakeSettingsPage::updateCachedInformation() const +{ + // We find out two things: + // Does this cmake version support a QtCreator generator + // and the version + QFileInfo fi(m_cmakeExecutable); + if (!fi.exists()) { + m_version.clear(); + m_supportsQtCreator = false; + } + QProcess cmake; + cmake.start(m_cmakeExecutable, QStringList()<<"--help"); + cmake.waitForFinished(); + QString response = cmake.readAll(); + QRegExp versionRegexp("^cmake version ([*\\d\\.]*)-(|patch (\\d*))(|\\r)\\n"); + versionRegexp.indexIn(response); + + m_supportsQtCreator = response.contains("QtCreator"); + m_version = versionRegexp.cap(1); + if (!versionRegexp.capturedTexts().size()>3) + m_version += "." + versionRegexp.cap(3); } QString CMakeSettingsPage::findCmakeExecutable() const @@ -144,6 +168,7 @@ void CMakeSettingsPage::saveSettings() const void CMakeSettingsPage::apply() { m_cmakeExecutable = m_pathchooser->path(); + updateCachedInformation(); saveSettings(); } @@ -157,6 +182,7 @@ QString CMakeSettingsPage::cmakeExecutable() const if (m_cmakeExecutable.isEmpty()) { m_cmakeExecutable = findCmakeExecutable(); if (!m_cmakeExecutable.isEmpty()) { + updateCachedInformation(); saveSettings(); } } diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.h b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.h index f0481c51498..49e6ac8846e 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.h +++ b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.h @@ -79,9 +79,12 @@ public: QString cmakeExecutable() const; void askUserForCMakeExecutable(); private: + void updateCachedInformation() const; void saveSettings() const; QString findCmakeExecutable() const; mutable QString m_cmakeExecutable; + mutable QString m_version; + mutable bool m_supportsQtCreator; Core::Utils::PathChooser *m_pathchooser; }; From e97889c782b1ffc0983046bcaeeab992c07e902b Mon Sep 17 00:00:00 2001 From: dt Date: Thu, 22 Jan 2009 11:56:52 +0100 Subject: [PATCH 03/42] Fixes: Remove ui file from pro file. --- src/plugins/cmakeprojectmanager/cmakeprojectmanager.pro | 1 - 1 file changed, 1 deletion(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.pro b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.pro index 688d16b0a97..74f69fea4ab 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.pro +++ b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.pro @@ -18,4 +18,3 @@ SOURCES = cmakeproject.cpp \ makestep.cpp \ cmakerunconfiguration.cpp RESOURCES += cmakeproject.qrc -FORMS += cmakesettingspage.ui From 02ea86b5c27186d2a41ac14c2d0c3df94fb639fd Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 23 Jan 2009 15:12:04 +0100 Subject: [PATCH 04/42] Fixes: fakevim: use one handler per editor --- src/plugins/fakevim/fakevimhandler.cpp | 135 +++++++++++++-------- src/plugins/fakevim/fakevimhandler.h | 31 ++--- src/plugins/fakevim/fakevimplugin.cpp | 155 +++++++++++++------------ tests/manual/fakevim/main.cpp | 37 +++--- 4 files changed, 205 insertions(+), 153 deletions(-) diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp index 9236b8930bb..88ada7f325c 100644 --- a/src/plugins/fakevim/fakevimhandler.cpp +++ b/src/plugins/fakevim/fakevimhandler.cpp @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -166,11 +167,14 @@ int lineCount(const QString &text) class FakeVimHandler::Private { public: - Private(FakeVimHandler *parent); + Private(FakeVimHandler *parent, QWidget *widget); bool handleEvent(QKeyEvent *ev); void handleExCommand(const QString &cmd); + void setupWidget(); + void restoreWidget(); + private: friend class FakeVimHandler; static int shift(int key) { return key + 32; } @@ -238,7 +242,6 @@ private: int readLineCode(QString &cmd); void selectRange(int beginLine, int endLine); - void setWidget(QWidget *ob); void enterInsertMode(); void enterCommandMode(); void showRedMessage(const QString &msg); @@ -328,12 +331,17 @@ public: // for restoring cursor position int m_savedYankPosition; int m_desiredColumn; + + QPointer m_extraData; }; -FakeVimHandler::Private::Private(FakeVimHandler *parent) +FakeVimHandler::Private::Private(FakeVimHandler *parent, QWidget *widget) { q = parent; + m_textedit = qobject_cast(widget); + m_plaintextedit = qobject_cast(widget); + m_mode = CommandMode; m_submode = NoSubMode; m_subsubmode = NoSubSubMode; @@ -341,8 +349,6 @@ FakeVimHandler::Private::Private(FakeVimHandler *parent) m_lastSearchForward = true; m_register = '"'; m_gflag = false; - m_textedit = 0; - m_plaintextedit = 0; m_visualMode = NoVisualMode; m_desiredColumn = 0; m_moveType = MoveInclusive; @@ -403,6 +409,37 @@ bool FakeVimHandler::Private::handleEvent(QKeyEvent *ev) return handled; } +void FakeVimHandler::Private::setupWidget() +{ + enterCommandMode(); + if (m_textedit) { + m_textedit->installEventFilter(q); + //m_textedit->setCursorWidth(QFontMetrics(ed->font()).width(QChar('x'))); + m_textedit->setLineWrapMode(QTextEdit::NoWrap); + m_wasReadOnly = m_textedit->isReadOnly(); + } else if (m_plaintextedit) { + m_plaintextedit->installEventFilter(q); + //plaintextedit->setCursorWidth(QFontMetrics(ed->font()).width(QChar('x'))); + m_plaintextedit->setLineWrapMode(QPlainTextEdit::NoWrap); + m_wasReadOnly = m_plaintextedit->isReadOnly(); + } + showBlackMessage("vi emulation mode."); + updateMiniBuffer(); +} + +void FakeVimHandler::Private::restoreWidget() +{ + //showBlackMessage(QString()); + //updateMiniBuffer(); + if (m_textedit) { + m_textedit->removeEventFilter(q); + m_textedit->setReadOnly(m_wasReadOnly); + } else if (m_plaintextedit) { + m_plaintextedit->removeEventFilter(q); + m_plaintextedit->setReadOnly(m_wasReadOnly); + } +} + bool FakeVimHandler::Private::handleKey(int key, int unmodified, const QString &text) { //qDebug() << "KEY: " << key << text << "POS: " << m_tc.position(); @@ -529,7 +566,7 @@ void FakeVimHandler::Private::updateSelection() } } } - emit q->selectionChanged(editor(), selections); + emit q->selectionChanged(selections); } void FakeVimHandler::Private::updateMiniBuffer() @@ -1329,7 +1366,7 @@ void FakeVimHandler::Private::handleExCommand(const QString &cmd0) beginLine = 0; if (endLine == -1) endLine = linesInDocument(); - //qDebug() << "LINES: " << beginLine << endLine; + qDebug() << "LINES: " << beginLine << endLine; bool forced = cmd.startsWith("w!"); QString fileName = reWrite.cap(2); if (fileName.isEmpty()) @@ -1339,9 +1376,20 @@ void FakeVimHandler::Private::handleExCommand(const QString &cmd0) if (exists && !forced && !noArgs) { showRedMessage(tr("File '%1' exists (add ! to override)").arg(fileName)); } else if (file.open(QIODevice::ReadWrite)) { + file.close(); selectRange(beginLine, endLine); - emit q->writeFile(fileName, selectedText()); - // check by reading back + QString contents = selectedText(); + bool handled = false; + emit q->writeFileRequested(&handled, fileName, contents); + // nobody cared, so act ourselves + if (!handled) { + qDebug() << "HANDLING MANUAL SAVE"; + QFile file(fileName); + file.open(QIODevice::ReadWrite); + { QTextStream ts(&file); ts << contents; } + file.close(); + } + // check result by reading back file.open(QIODevice::ReadOnly); QByteArray ba = file.readAll(); showBlackMessage(tr("\"%1\" %2 %3L, %4C written") @@ -1401,7 +1449,7 @@ void FakeVimHandler::Private::handleExCommand(const QString &cmd0) QString info; foreach (const QString &key, m_config.keys()) info += key + ": " + m_config.value(key) + "\n"; - emit q->extraInformationChanged(editor(), info); + emit q->extraInformationChanged(info); } else { notImplementedYet(); } @@ -1417,7 +1465,7 @@ void FakeVimHandler::Private::handleExCommand(const QString &cmd0) ++i; info += QString("%1 %2\n").arg(i, -8).arg(item); } - emit q->extraInformationChanged(editor(), info); + emit q->extraInformationChanged(info); } else { notImplementedYet(); } @@ -1735,7 +1783,9 @@ QString FakeVimHandler::Private::selectedText() const { QTextCursor tc = m_tc; tc.setPosition(m_anchor, KeepAnchor); - return tc.selection().toPlainText(); + QString text = tc.selection().toPlainText(); + tc.clearSelection(); + return text; } int FakeVimHandler::Private::positionForLine(int line) const @@ -1942,16 +1992,10 @@ void FakeVimHandler::Private::enterCommandMode() void FakeVimHandler::Private::quit() { - showBlackMessage(QString()); EDITOR(setOverwriteMode(false)); - q->quitRequested(editor()); + q->quitRequested(); } -void FakeVimHandler::Private::setWidget(QWidget *ob) -{ - m_textedit = qobject_cast(ob); - m_plaintextedit = qobject_cast(ob); -} /////////////////////////////////////////////////////////////////////// // @@ -1959,12 +2003,13 @@ void FakeVimHandler::Private::setWidget(QWidget *ob) // /////////////////////////////////////////////////////////////////////// -FakeVimHandler::FakeVimHandler(QObject *parent) - : QObject(parent), d(new Private(this)) +FakeVimHandler::FakeVimHandler(QWidget *widget, QObject *parent) + : QObject(parent), d(new Private(this, widget)) {} FakeVimHandler::~FakeVimHandler() { + qDebug() << "DELETING HANDLER" << this; delete d; } @@ -1993,40 +2038,18 @@ bool FakeVimHandler::eventFilter(QObject *ob, QEvent *ev) return QObject::eventFilter(ob, ev); } -void FakeVimHandler::addWidget(QWidget *widget) +void FakeVimHandler::setupWidget() { - widget->installEventFilter(this); - d->setWidget(widget); - d->enterCommandMode(); - if (QTextEdit *ed = qobject_cast(widget)) { - //ed->setCursorWidth(QFontMetrics(ed->font()).width(QChar('x'))); - ed->setLineWrapMode(QTextEdit::NoWrap); - d->m_wasReadOnly = ed->isReadOnly(); - } else if (QPlainTextEdit *ed = qobject_cast(widget)) { - //ed->setCursorWidth(QFontMetrics(ed->font()).width(QChar('x'))); - ed->setLineWrapMode(QPlainTextEdit::NoWrap); - d->m_wasReadOnly = ed->isReadOnly(); - } - d->showBlackMessage("vi emulation mode."); - d->updateMiniBuffer(); + d->setupWidget(); } -void FakeVimHandler::removeWidget(QWidget *widget) +void FakeVimHandler::restoreWidget() { - d->setWidget(widget); - d->showBlackMessage(QString()); - d->updateMiniBuffer(); - widget->removeEventFilter(this); - if (QTextEdit *ed = qobject_cast(widget)) { - ed->setReadOnly(d->m_wasReadOnly); - } else if (QPlainTextEdit *ed = qobject_cast(widget)) { - ed->setReadOnly(d->m_wasReadOnly); - } + d->restoreWidget(); } -void FakeVimHandler::handleCommand(QWidget *widget, const QString &cmd) +void FakeVimHandler::handleCommand(const QString &cmd) { - d->setWidget(widget); d->handleExCommand(cmd); } @@ -2044,3 +2067,19 @@ void FakeVimHandler::setCurrentFileName(const QString &fileName) { d->m_currentFileName = fileName; } + +QWidget *FakeVimHandler::widget() +{ + return d->editor(); +} + +void FakeVimHandler::setExtraData(QObject *data) +{ + d->m_extraData = data; +} + +QObject *FakeVimHandler::extraData() const +{ + return d->m_extraData; +} + diff --git a/src/plugins/fakevim/fakevimhandler.h b/src/plugins/fakevim/fakevimhandler.h index bbd58781e7f..a083f346dd4 100644 --- a/src/plugins/fakevim/fakevimhandler.h +++ b/src/plugins/fakevim/fakevimhandler.h @@ -50,30 +50,35 @@ class FakeVimHandler : public QObject Q_OBJECT public: - FakeVimHandler(QObject *parent = 0); + FakeVimHandler(QWidget *widget, QObject *parent = 0); ~FakeVimHandler(); + QWidget *widget(); + + void setExtraData(QObject *data); + QObject *extraData() const; + public slots: - // The same handler can be installed on several widgets - // FIXME: good idea? - void addWidget(QWidget *widget); - void removeWidget(QWidget *widget); void setCurrentFileName(const QString &fileName); // This executes an "ex" style command taking context - // information from \p widget; - void handleCommand(QWidget *widget, const QString &cmd); - void quit(); + // information from widget; + void handleCommand(const QString &cmd); void setConfigValue(const QString &key, const QString &value); + void quit(); + + // Convenience + void setupWidget(); + void restoreWidget(); signals: void commandBufferChanged(const QString &msg); void statusDataChanged(const QString &msg); - void extraInformationChanged(QWidget *widget, const QString &msg); - void quitRequested(QWidget *widget); - void selectionChanged(QWidget *widget, - const QList &selection); - void writeFile(const QString &fileName, const QString &contents); + void extraInformationChanged(const QString &msg); + void quitRequested(); + void selectionChanged(const QList &selection); + void writeFileRequested(bool *handled, + const QString &fileName, const QString &contents); private: bool eventFilter(QObject *ob, QEvent *ev); diff --git a/src/plugins/fakevim/fakevimplugin.cpp b/src/plugins/fakevim/fakevimplugin.cpp index a00e3878e8e..dcd3f662f0b 100644 --- a/src/plugins/fakevim/fakevimplugin.cpp +++ b/src/plugins/fakevim/fakevimplugin.cpp @@ -106,27 +106,26 @@ public: ~FakeVimPluginPrivate(); friend class FakeVimPlugin; - bool initialize(const QStringList &arguments, QString *error_message); + bool initialize(); void shutdown(); private slots: - void installHandler(); - void installHandler(QWidget *widget); - void removeHandler(QWidget *widget); - void showCommandBuffer(const QString &contents); - void showExtraInformation(QWidget *, const QString &msg); void editorOpened(Core::IEditor *); void editorAboutToClose(Core::IEditor *); - void changeSelection(QWidget *widget, - const QList &selections); - void writeFile(const QString &fileName, const QString &contents); + + void installHandler(); + void installHandler(Core::IEditor *editor); + void removeHandler(); + + void showCommandBuffer(const QString &contents); + void showExtraInformation(const QString &msg); + void changeSelection(const QList &selections); + void writeFile(bool *handled, const QString &fileName, const QString &contents); private: FakeVimPlugin *q; - FakeVimHandler *m_handler; QAction *m_installHandlerAction; Core::ICore *m_core; - Core::IFile *m_currentFile; }; } // namespace Internal @@ -135,10 +134,8 @@ private: FakeVimPluginPrivate::FakeVimPluginPrivate(FakeVimPlugin *plugin) { q = plugin; - m_handler = 0; m_installHandlerAction = 0; m_core = 0; - m_currentFile = 0; } FakeVimPluginPrivate::~FakeVimPluginPrivate() @@ -147,17 +144,10 @@ FakeVimPluginPrivate::~FakeVimPluginPrivate() void FakeVimPluginPrivate::shutdown() { - delete m_handler; - m_handler = 0; } -bool FakeVimPluginPrivate::initialize(const QStringList &arguments, QString *error_message) +bool FakeVimPluginPrivate::initialize() { - Q_UNUSED(arguments); - Q_UNUSED(error_message); - - m_handler = new FakeVimHandler; - m_core = Core::ICore::instance(); QTC_ASSERT(m_core, return false); @@ -195,102 +185,113 @@ bool FakeVimPluginPrivate::initialize(const QStringList &arguments, QString *err void FakeVimPluginPrivate::installHandler() { if (Core::IEditor *editor = m_core->editorManager()->currentEditor()) - installHandler(editor->widget()); + installHandler(editor); } -void FakeVimPluginPrivate::installHandler(QWidget *widget) +void FakeVimPluginPrivate::installHandler(Core::IEditor *editor) { - connect(m_handler, SIGNAL(extraInformationChanged(QWidget *, QString)), - this, SLOT(showExtraInformation(QWidget *, QString))); - connect(m_handler, SIGNAL(commandBufferChanged(QString)), + QWidget *widget = editor->widget(); + + FakeVimHandler *handler = new FakeVimHandler(widget, this); + + connect(handler, SIGNAL(extraInformationChanged(QString)), + this, SLOT(showExtraInformation(QString))); + connect(handler, SIGNAL(commandBufferChanged(QString)), this, SLOT(showCommandBuffer(QString))); - connect(m_handler, SIGNAL(quitRequested(QWidget *)), - this, SLOT(removeHandler(QWidget *))); - connect(m_handler, - SIGNAL(selectionChanged(QWidget*,QList)), - this, SLOT(changeSelection(QWidget*,QList))); + connect(handler, SIGNAL(quitRequested()), + this, SLOT(removeHandler()), Qt::QueuedConnection); + connect(handler, SIGNAL(writeFileRequested(bool*,QString,QString)), + this, SLOT(writeFile(bool*,QString,QString))); + connect(handler, SIGNAL(selectionChanged(QList)), + this, SLOT(changeSelection(QList))); - m_handler->addWidget(widget); - TextEditor::BaseTextEditor* editor = - qobject_cast(widget); - if (editor) { - m_currentFile = editor->file(); - m_handler->setCurrentFileName(editor->file()->fileName()); - } + handler->setupWidget(); + handler->setExtraData(editor); - BaseTextEditor *bt = qobject_cast(widget); - if (bt) { + if (BaseTextEditor *bt = qobject_cast(widget)) { using namespace TextEditor; using namespace FakeVim::Constants; + handler->setCurrentFileName(editor->file()->fileName()); TabSettings settings = bt->tabSettings(); - m_handler->setConfigValue(ConfigTabStop, + handler->setConfigValue(ConfigTabStop, QString::number(settings.m_tabSize)); - m_handler->setConfigValue(ConfigShiftWidth, + handler->setConfigValue(ConfigShiftWidth, QString::number(settings.m_indentSize)); - m_handler->setConfigValue(ConfigExpandTab, + handler->setConfigValue(ConfigExpandTab, settings.m_spacesForTabs ? ConfigOn : ConfigOff); - m_handler->setConfigValue(ConfigSmartTab, + handler->setConfigValue(ConfigSmartTab, settings.m_smartBackspace ? ConfigOn : ConfigOff); - m_handler->setConfigValue(ConfigAutoIndent, + handler->setConfigValue(ConfigAutoIndent, settings.m_autoIndent ? ConfigOn : ConfigOff); } } -void FakeVimPluginPrivate::writeFile(const QString &fileName, - const QString &contents) +void FakeVimPluginPrivate::writeFile(bool *handled, + const QString &fileName, const QString &contents) { - if (m_currentFile && fileName == m_currentFile->fileName()) { + //qDebug() << "HANDLING WRITE FILE" << fileName << sender(); + FakeVimHandler *handler = qobject_cast(sender()); + if (!handler) + return; + + Core::IEditor *editor = qobject_cast(handler->extraData()); + if (editor && editor->file()->fileName() == fileName) { + //qDebug() << "HANDLING CORE SAVE"; // Handle that as a special case for nicer interaction with core - m_core->fileManager()->blockFileChange(m_currentFile); - m_currentFile->save(fileName); - m_core->fileManager()->unblockFileChange(m_currentFile); - } else { - QFile file(fileName); - file.open(QIODevice::ReadWrite); - { QTextStream ts(&file); ts << contents; } - file.close(); - } + Core::IFile *file = editor->file(); + m_core->fileManager()->blockFileChange(file); + file->save(fileName); + m_core->fileManager()->unblockFileChange(file); + *handled = true; + } } -void FakeVimPluginPrivate::removeHandler(QWidget *widget) +void FakeVimPluginPrivate::removeHandler() { - Q_UNUSED(widget); - m_handler->removeWidget(widget); + if (FakeVimHandler *handler = qobject_cast(sender())) { + handler->restoreWidget(); + handler->deleteLater(); + } Core::EditorManager::instance()->hideEditorInfoBar( QLatin1String(Constants::MINI_BUFFER)); - m_currentFile = 0; } void FakeVimPluginPrivate::editorOpened(Core::IEditor *editor) { - Q_UNUSED(editor); //qDebug() << "OPENING: " << editor << editor->widget(); - //installHandler(editor->widget()); + installHandler(editor); } void FakeVimPluginPrivate::editorAboutToClose(Core::IEditor *editor) { - //qDebug() << "CLOSING: " << editor << editor->widget(); - removeHandler(editor->widget()); + Q_UNUSED(editor); + //qDebug() << "CLOSING: " << editor; } void FakeVimPluginPrivate::showCommandBuffer(const QString &contents) { - Core::EditorManager::instance()->showEditorInfoBar( - QLatin1String(Constants::MINI_BUFFER), contents, - tr("Quit FakeVim"), m_handler, SLOT(quit())); + //qDebug() << "SHOW COMMAND BUFFER" << contents; + FakeVimHandler *handler = qobject_cast(sender()); + if (handler) { + Core::EditorManager::instance()->showEditorInfoBar( + QLatin1String(Constants::MINI_BUFFER), contents, + tr("Quit FakeVim"), handler, SLOT(quit())); + } } -void FakeVimPluginPrivate::showExtraInformation(QWidget *widget, const QString &text) +void FakeVimPluginPrivate::showExtraInformation(const QString &text) { - QMessageBox::information(widget, tr("FakeVim Information"), text); + FakeVimHandler *handler = qobject_cast(sender()); + if (handler) + QMessageBox::information(handler->widget(), tr("FakeVim Information"), text); } -void FakeVimPluginPrivate::changeSelection(QWidget *widget, - const QList &selection) +void FakeVimPluginPrivate::changeSelection + (const QList &selection) { - if (BaseTextEditor *bt = qobject_cast(widget)) - bt->setExtraSelections(BaseTextEditor::FakeVimSelection, selection); + if (FakeVimHandler *handler = qobject_cast(sender())) + if (BaseTextEditor *bt = qobject_cast(handler->widget())) + bt->setExtraSelections(BaseTextEditor::FakeVimSelection, selection); } @@ -309,9 +310,11 @@ FakeVimPlugin::~FakeVimPlugin() delete d; } -bool FakeVimPlugin::initialize(const QStringList &arguments, QString *error_message) +bool FakeVimPlugin::initialize(const QStringList &arguments, QString *errorMessage) { - return d->initialize(arguments, error_message); + Q_UNUSED(arguments); + Q_UNUSED(errorMessage); + return d->initialize(); } void FakeVimPlugin::shutdown() diff --git a/tests/manual/fakevim/main.cpp b/tests/manual/fakevim/main.cpp index dfa1350e559..c67187a773b 100644 --- a/tests/manual/fakevim/main.cpp +++ b/tests/manual/fakevim/main.cpp @@ -17,21 +17,26 @@ class Proxy : public QObject Q_OBJECT public: - Proxy() : QObject(0) {} + Proxy(QWidget *widget, QObject *parent = 0) + : QObject(parent), m_widget(widget) + {} public slots: - void changeSelection(QWidget *w, const QList &s) + void changeSelection(const QList &s) { - if (QPlainTextEdit *ed = qobject_cast(w)) + if (QPlainTextEdit *ed = qobject_cast(sender())) ed->setExtraSelections(s); - else if (QTextEdit *ed = qobject_cast(w)) + else if (QTextEdit *ed = qobject_cast(sender())) ed->setExtraSelections(s); } - void changeExtraInformation(QWidget *w, const QString &info) + void changeExtraInformation(const QString &info) { - QMessageBox::information(w, "Information", info); + QMessageBox::information(m_widget, "Information", info); } + +private: + QWidget *m_widget; }; int main(int argc, char *argv[]) @@ -51,13 +56,13 @@ int main(int argc, char *argv[]) widget = new QTextEdit; title = "TextEdit"; } + widget->setObjectName("Editor"); widget->resize(450, 350); widget->setFocus(); - Proxy proxy; + Proxy proxy(widget); - - FakeVimHandler handler; + FakeVimHandler handler(widget, 0); QMainWindow mw; mw.setWindowTitle("Fakevim (" + title + ")"); @@ -77,18 +82,18 @@ int main(int argc, char *argv[]) QObject::connect(&handler, SIGNAL(commandBufferChanged(QString)), mw.statusBar(), SLOT(showMessage(QString))); - QObject::connect(&handler, SIGNAL(quitRequested(QWidget *)), + QObject::connect(&handler, SIGNAL(quitRequested()), &app, SLOT(quit())); QObject::connect(&handler, - SIGNAL(selectionChanged(QWidget*,QList)), - &proxy, SLOT(changeSelection(QWidget*,QList))); + SIGNAL(selectionChanged(QList)), + &proxy, SLOT(changeSelection(QList))); QObject::connect(&handler, - SIGNAL(extraInformationChanged(QWidget*,QString)), - &proxy, SLOT(changeExtraInformation(QWidget*,QString))); + SIGNAL(extraInformationChanged(QString)), + &proxy, SLOT(changeExtraInformation(QString))); - handler.addWidget(widget); + handler.setupWidget(); if (args.size() >= 1) - handler.handleCommand(widget, "r " + args.at(0)); + handler.handleCommand("r " + args.at(0)); return app.exec(); } From 153fd8a87bd6e5d0c32d382d81ef45697a98ec0c Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 23 Jan 2009 15:40:43 +0100 Subject: [PATCH 05/42] Fixes: fakevim: 'w' broken again. Details: exclusive motions seem to require extra thought --- src/plugins/fakevim/fakevimhandler.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp index 88ada7f325c..ba7d10196bd 100644 --- a/src/plugins/fakevim/fakevimhandler.cpp +++ b/src/plugins/fakevim/fakevimhandler.cpp @@ -480,6 +480,8 @@ void FakeVimHandler::Private::finishMovement(const QString &dotCommand) m_mode = InsertMode; m_submode = NoSubMode; } else if (m_submode == DeleteSubMode) { + //if (m_moveType == MoveExclusive) + // moveLeft(); // correct if (!dotCommand.isEmpty()) m_dotCommand = "d" + dotCommand; m_registers[m_register] = recordRemoveSelectedText(); @@ -504,10 +506,8 @@ void FakeVimHandler::Private::finishMovement(const QString &dotCommand) m_tc.setPosition(startBlock.position()); moveToFirstNonBlankOnLine(); m_submode = NoSubMode; - } else if (m_moveType == MoveExclusive) { - moveLeft(); // correct - m_moveType = MoveInclusive; } + m_moveType = MoveInclusive; m_mvcount.clear(); m_opcount.clear(); m_gflag = false; From 4f1dd94945dd3f256b586941b3c82e7529857851 Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 23 Jan 2009 16:04:53 +0100 Subject: [PATCH 06/42] Fixes: fakevim: work on 'e', 'w', 'b'... --- src/plugins/fakevim/fakevimhandler.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp index ba7d10196bd..525fed41479 100644 --- a/src/plugins/fakevim/fakevimhandler.cpp +++ b/src/plugins/fakevim/fakevimhandler.cpp @@ -480,8 +480,8 @@ void FakeVimHandler::Private::finishMovement(const QString &dotCommand) m_mode = InsertMode; m_submode = NoSubMode; } else if (m_submode == DeleteSubMode) { - //if (m_moveType == MoveExclusive) - // moveLeft(); // correct + if (m_moveType == MoveInclusive) + moveRight(); // correct if (!dotCommand.isEmpty()) m_dotCommand = "d" + dotCommand; m_registers[m_register] = recordRemoveSelectedText(); @@ -807,9 +807,11 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified, recordBeginGroup(); m_lastInsertion.clear(); } else if (key == 'b') { + m_moveType = MoveExclusive; moveToWordBoundary(false, false); finishMovement(); } else if (key == 'B') { + m_moveType = MoveExclusive; moveToWordBoundary(true, false); finishMovement(); } else if (key == 'c') { @@ -846,10 +848,11 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified, moveRight(rightDist()); finishMovement(); } else if (key == 'e') { + m_moveType = MoveInclusive; moveToWordBoundary(false, true); - m_moveType = MoveExclusive; finishMovement(); } else if (key == 'E') { + m_moveType = MoveInclusive; moveToWordBoundary(true, true); finishMovement(); } else if (key == 'f' || key == 'F') { @@ -1614,8 +1617,7 @@ void FakeVimHandler::Private::moveToWordBoundary(bool simple, bool forward) int n = forward ? lastPositionInDocument() - 1 : 0; int lastClass = -1; while (true) { - forward ? moveRight() : moveLeft(); - QChar c = doc->characterAt(m_tc.position()); + QChar c = doc->characterAt(m_tc.position() + (forward ? 1 : -1)); int thisClass = charClass(c, simple); if (thisClass != lastClass && lastClass != 0) --repeat; @@ -1624,6 +1626,7 @@ void FakeVimHandler::Private::moveToWordBoundary(bool simple, bool forward) lastClass = thisClass; if (m_tc.position() == n) break; + forward ? moveRight() : moveLeft(); } } From 8867568cb746fa5bedd70134f15fbfa26e6938c8 Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 23 Jan 2009 16:22:29 +0100 Subject: [PATCH 07/42] Fixes: fakevim: implement first approximation of Ctrl-D and Ctrl-U --- src/plugins/fakevim/fakevimhandler.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp index 525fed41479..142d2291e6d 100644 --- a/src/plugins/fakevim/fakevimhandler.cpp +++ b/src/plugins/fakevim/fakevimhandler.cpp @@ -1076,6 +1076,20 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified, } recordInsertText(str); recordEndGroup(); + } else if (key == control('d')) { + int sline = cursorLineOnScreen(); + // FIXME: this should use the "scroll" option, and "count" + moveDown(linesOnScreen() / 2); + moveToFirstNonBlankOnLine(); + scrollToLineInDocument(cursorLineInDocument() - sline); + finishMovement(); + } else if (key == control('u')) { + int sline = cursorLineOnScreen(); + // FIXME: this should use the "scroll" option, and "count" + moveUp(linesOnScreen() / 2); + moveToFirstNonBlankOnLine(); + scrollToLineInDocument(cursorLineInDocument() - sline); + finishMovement(); } else if (key == Key_PageDown || key == control('f')) { moveDown(count() * (linesOnScreen() - 2)); finishMovement(); From ab8c038ed7ae2f8fbdb899c88d195b69a806e705 Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 23 Jan 2009 16:37:32 +0100 Subject: [PATCH 08/42] Fixes: fakwvim: fix recently broken selection in standalone application --- src/plugins/fakevim/fakevimhandler.cpp | 19 ++++++++++++++++--- src/plugins/fakevim/fakevimplugin.cpp | 3 ++- tests/manual/fakevim/main.cpp | 4 ++-- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp index 142d2291e6d..def7aca21bf 100644 --- a/src/plugins/fakevim/fakevimhandler.cpp +++ b/src/plugins/fakevim/fakevimhandler.cpp @@ -158,6 +158,13 @@ QDebug &operator<<(QDebug &ts, const EditOperation &op) return ts; } +QDebug &operator<<(QDebug &ts, const QList &sels) +{ + foreach (QTextEdit::ExtraSelection sel, sels) + ts << "SEL: " << sel.cursor.anchor() << sel.cursor.position(); + return ts; +} + int lineCount(const QString &text) { //return text.count(QChar(ParagraphSeparator)); @@ -456,6 +463,7 @@ bool FakeVimHandler::Private::handleKey(int key, int unmodified, const QString & void FakeVimHandler::Private::finishMovement(const QString &dotCommand) { + //qDebug() << "ANCHOR: " << m_anchor; if (m_submode == FilterSubMode) { int beginLine = lineForPosition(anchor()); int endLine = lineForPosition(position()); @@ -526,10 +534,13 @@ void FakeVimHandler::Private::updateSelection() QTextEdit::ExtraSelection sel; sel.cursor = m_tc; sel.format = m_tc.blockCharFormat(); - //sel.format.setFontWeight(QFont::Bold); - //sel.format.setFontUnderline(true); +#if 0 + sel.format.setFontWeight(QFont::Bold); + sel.format.setFontUnderline(true); +#else sel.format.setForeground(Qt::white); sel.format.setBackground(Qt::black); +#endif int cursorPos = m_tc.position(); int anchorPos = m_marks['<']; //qDebug() << "POS: " << cursorPos << " ANCHOR: " << anchorPos; @@ -566,6 +577,7 @@ void FakeVimHandler::Private::updateSelection() } } } + //qDebug() << "SELECTION: " << selections; emit q->selectionChanged(selections); } @@ -834,7 +846,7 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified, m_mvcount.clear(); m_submode = DeleteSubMode; } else if (key == 'd') { - setAnchor(); + //setAnchor(); leaveVisualMode(); int beginLine = lineForPosition(m_marks['<']); int endLine = lineForPosition(m_marks['>']); @@ -1819,6 +1831,7 @@ int FakeVimHandler::Private::lineForPosition(int pos) const void FakeVimHandler::Private::enterVisualMode(VisualMode visualMode) { + setAnchor(); m_visualMode = visualMode; m_marks['<'] = m_tc.position(); m_marks['>'] = m_tc.position(); diff --git a/src/plugins/fakevim/fakevimplugin.cpp b/src/plugins/fakevim/fakevimplugin.cpp index dcd3f662f0b..0b35c4fb815 100644 --- a/src/plugins/fakevim/fakevimplugin.cpp +++ b/src/plugins/fakevim/fakevimplugin.cpp @@ -258,8 +258,9 @@ void FakeVimPluginPrivate::removeHandler() void FakeVimPluginPrivate::editorOpened(Core::IEditor *editor) { + Q_UNUSED(editor); //qDebug() << "OPENING: " << editor << editor->widget(); - installHandler(editor); + //installHandler(editor); } void FakeVimPluginPrivate::editorAboutToClose(Core::IEditor *editor) diff --git a/tests/manual/fakevim/main.cpp b/tests/manual/fakevim/main.cpp index c67187a773b..9400fcf998f 100644 --- a/tests/manual/fakevim/main.cpp +++ b/tests/manual/fakevim/main.cpp @@ -24,9 +24,9 @@ public: public slots: void changeSelection(const QList &s) { - if (QPlainTextEdit *ed = qobject_cast(sender())) + if (QPlainTextEdit *ed = qobject_cast(m_widget)) ed->setExtraSelections(s); - else if (QTextEdit *ed = qobject_cast(sender())) + else if (QTextEdit *ed = qobject_cast(m_widget)) ed->setExtraSelections(s); } From 2d67b9a0a153d3de19b2b5cad885b615e89d3e28 Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 23 Jan 2009 16:42:45 +0100 Subject: [PATCH 09/42] Fixes: fakevim: clear selection after :w --- src/plugins/fakevim/fakevimhandler.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp index def7aca21bf..7172e50f0ae 100644 --- a/src/plugins/fakevim/fakevimhandler.cpp +++ b/src/plugins/fakevim/fakevimhandler.cpp @@ -1406,13 +1406,15 @@ void FakeVimHandler::Private::handleExCommand(const QString &cmd0) showRedMessage(tr("File '%1' exists (add ! to override)").arg(fileName)); } else if (file.open(QIODevice::ReadWrite)) { file.close(); + QTextCursor tc = m_tc; selectRange(beginLine, endLine); QString contents = selectedText(); + m_tc = tc; bool handled = false; emit q->writeFileRequested(&handled, fileName, contents); // nobody cared, so act ourselves if (!handled) { - qDebug() << "HANDLING MANUAL SAVE"; + //qDebug() << "HANDLING MANUAL SAVE"; QFile file(fileName); file.open(QIODevice::ReadWrite); { QTextStream ts(&file); ts << contents; } From 874922edad6b16e912ca9f967287f2e01c638faa Mon Sep 17 00:00:00 2001 From: dt Date: Fri, 23 Jan 2009 16:48:06 +0100 Subject: [PATCH 10/42] Fixes: Make the run settings combo box adjust to contents. Details: Little tweak improves readeability for the cmake support, since that currently names the runconfigurations according to their full path. Which is suboptimal and will surely change. But adjusting to contents is better regardless. --- src/plugins/projectexplorer/runsettingspropertiespage.ui | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/projectexplorer/runsettingspropertiespage.ui b/src/plugins/projectexplorer/runsettingspropertiespage.ui index a973085873d..93070ce9da1 100644 --- a/src/plugins/projectexplorer/runsettingspropertiespage.ui +++ b/src/plugins/projectexplorer/runsettingspropertiespage.ui @@ -6,7 +6,7 @@ 0 0 - 521 + 551 300 @@ -35,7 +35,7 @@ - QComboBox::AdjustToMinimumContentsLength + QComboBox::AdjustToContents 30 From e8e2e4f45d8a878eca8b3397cbeb1604da7f24e6 Mon Sep 17 00:00:00 2001 From: dt Date: Fri, 23 Jan 2009 16:57:38 +0100 Subject: [PATCH 11/42] Fixes: Progress to the cmake plugin Details: Add a dialog asking for command line options and build directory. This dialog pops up if you don't have a .user file. Note, though that it also pops up if there is already a in source build. (The build directory lineedit should be read only then.) The cmake button in that dialog and the output pane need more polish to make them better. With those changes you can now build and run marble from Qt Creator. (For marble you need to pass a few options to cmake.) Also add a configuration page to the Tools/Options dialog, where you can specify the cmake executable path. And add a class which runs cmake in the background to find out which version and wheter that cmake version has Qt Creator generator. (Which I did begin to write.) --- .../cmakeconfigurewidget.cpp | 90 ++++++++++ .../cmakeconfigurewidget.h | 48 ++++++ .../cmakeprojectmanager/cmakeproject.cpp | 59 +++---- .../cmakeprojectmanager/cmakeproject.h | 4 +- .../cmakeprojectmanager.cpp | 160 ++++++++++++++---- .../cmakeprojectmanager/cmakeprojectmanager.h | 34 +++- .../cmakeprojectmanager.pro | 7 +- src/plugins/cmakeprojectmanager/cmakestep.cpp | 18 +- src/plugins/cmakeprojectmanager/cmakestep.h | 4 +- 9 files changed, 342 insertions(+), 82 deletions(-) create mode 100644 src/plugins/cmakeprojectmanager/cmakeconfigurewidget.cpp create mode 100644 src/plugins/cmakeprojectmanager/cmakeconfigurewidget.h diff --git a/src/plugins/cmakeprojectmanager/cmakeconfigurewidget.cpp b/src/plugins/cmakeprojectmanager/cmakeconfigurewidget.cpp new file mode 100644 index 00000000000..41b6a7e0db5 --- /dev/null +++ b/src/plugins/cmakeprojectmanager/cmakeconfigurewidget.cpp @@ -0,0 +1,90 @@ +#include "cmakeconfigurewidget.h" +#include "cmakeprojectmanager.h" +#include +#include +#include +#include + +using namespace CMakeProjectManager; +using namespace CMakeProjectManager::Internal; + +CMakeConfigureWidget::CMakeConfigureWidget(QWidget *parent, CMakeManager *manager, const QString &sourceDirectory) + : QWidget(parent), m_configureSucceded(false), m_cmakeManager(manager), m_sourceDirectory(sourceDirectory) +{ + m_ui.setupUi(this); + m_ui.buildDirectoryLineEdit->setPath(sourceDirectory + "/qtcreator-build"); + + connect(m_ui.configureButton, SIGNAL(clicked()), this, SLOT(runCMake())); + // TODO make the configure button do stuff + // TODO set initial settings + // TODO note if there's already a build in that directory + // detect which generators we have + // let the user select generator +} + +QString CMakeConfigureWidget::buildDirectory() +{ + return m_ui.buildDirectoryLineEdit->path(); +} + +QStringList CMakeConfigureWidget::arguments() +{ + return ProjectExplorer::Environment::parseCombinedArgString(m_ui.cmakeArgumentsLineEdit->text()); +} + +bool CMakeConfigureWidget::configureSucceded() +{ + return m_configureSucceded; +} + +void CMakeConfigureWidget::runCMake() +{ + // TODO run project createCbp() + // get output and display it + + // TODO analyse wheter this worked out + m_ui.cmakeOutput->setPlainText(tr("Waiting for cmake...")); + QString string = m_cmakeManager->createXmlFile(arguments(), m_sourceDirectory, buildDirectory()); + m_ui.cmakeOutput->setPlainText(string); +} + +////// +// CMakeConfigureDialog +///// + +CMakeConfigureDialog::CMakeConfigureDialog(QWidget *parent, CMakeManager *manager, const QString &sourceDirectory) + : QDialog(parent) +{ + QVBoxLayout *vbox = new QVBoxLayout(this); + setLayout(vbox); + + m_cmakeConfigureWidget = new CMakeConfigureWidget(this, manager, sourceDirectory); + vbox->addWidget(m_cmakeConfigureWidget); + + QHBoxLayout *hboxlayout = new QHBoxLayout(this); + hboxlayout->addSpacerItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Fixed)); + + + QPushButton *okButton = new QPushButton(this); + okButton->setText(tr("Ok")); + okButton->setDefault(true); + connect(okButton, SIGNAL(clicked()), this, SLOT(accept())); + + hboxlayout->addWidget(okButton); + vbox->addLayout(hboxlayout); +} + +QString CMakeConfigureDialog::buildDirectory() +{ + return m_cmakeConfigureWidget->buildDirectory(); +} + +QStringList CMakeConfigureDialog::arguments() +{ + return m_cmakeConfigureWidget->arguments(); +} + +bool CMakeConfigureDialog::configureSucceded() +{ + return m_cmakeConfigureWidget->configureSucceded(); +} diff --git a/src/plugins/cmakeprojectmanager/cmakeconfigurewidget.h b/src/plugins/cmakeprojectmanager/cmakeconfigurewidget.h new file mode 100644 index 00000000000..f44444537bf --- /dev/null +++ b/src/plugins/cmakeprojectmanager/cmakeconfigurewidget.h @@ -0,0 +1,48 @@ +#ifndef CMAKECONFIGUREWIDGET_H +#define CMAKECONFIGUREWIDGET_H + +#include "ui_cmakeconfigurewidget.h" +#include +#include + +namespace CMakeProjectManager { +namespace Internal { + +class CMakeManager; + +class CMakeConfigureWidget : public QWidget +{ + Q_OBJECT +public: + CMakeConfigureWidget(QWidget *parent, CMakeManager *manager, const QString &sourceDirectory); + Ui::CMakeConfigureWidget m_ui; + + QString buildDirectory(); + QStringList arguments(); + bool configureSucceded(); + +private slots: + void runCMake(); +private: + bool m_configureSucceded; + CMakeManager *m_cmakeManager; + QString m_sourceDirectory; +}; + +class CMakeConfigureDialog : public QDialog +{ +public: + CMakeConfigureDialog(QWidget *parent, CMakeManager *manager, const QString &sourceDirectory); + + QString buildDirectory(); + QStringList arguments(); + bool configureSucceded(); + +private: + CMakeConfigureWidget *m_cmakeConfigureWidget; +}; + +} +} + +#endif // CMAKECONFIGUREWIDGET_H diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.cpp b/src/plugins/cmakeprojectmanager/cmakeproject.cpp index effe432e36a..34bc8fa7908 100644 --- a/src/plugins/cmakeprojectmanager/cmakeproject.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeproject.cpp @@ -32,21 +32,24 @@ ***************************************************************************/ #include "cmakeproject.h" - +#include "ui_cmakeconfigurewidget.h" +#include "cmakeconfigurewidget.h" #include "cmakeprojectconstants.h" #include "cmakeprojectnodes.h" #include "cmakerunconfiguration.h" #include "cmakestep.h" #include "makestep.h" -#include #include +#include #include +#include #include #include #include #include +#include using namespace CMakeProjectManager; using namespace CMakeProjectManager::Internal; @@ -67,8 +70,6 @@ CMakeProject::CMakeProject(CMakeManager *manager, const QString &fileName) : m_manager(manager), m_fileName(fileName), m_rootNode(new CMakeProjectNode(m_fileName)) { m_file = new CMakeFile(this, fileName); - QDir dir = QFileInfo(m_fileName).absoluteDir(); - parseCMakeLists(dir); } CMakeProject::~CMakeProject() @@ -78,12 +79,12 @@ CMakeProject::~CMakeProject() // TODO also call this method if the CMakeLists.txt file changed, which is also called if the CMakeList.txt is updated // TODO make this function work even if it is reparsing -void CMakeProject::parseCMakeLists(const QDir &directory) +void CMakeProject::parseCMakeLists() { - createCbpFile(buildDirectory(QString())); - - QString cbpFile = findCbpFile(buildDirectory(QString())); + QString sourceDirectory = QFileInfo(m_fileName).absolutePath(); + m_manager->createXmlFile(cmakeStep()->userArguments(activeBuildConfiguration()), sourceDirectory, buildDirectory(activeBuildConfiguration())); + QString cbpFile = findCbpFile(buildDirectory(activeBuildConfiguration())); CMakeCbpParser cbpparser; qDebug()<<"Parsing file "< list) { @@ -300,8 +283,20 @@ void CMakeProject::restoreSettingsImpl(ProjectExplorer::PersistentSettingsReader { // TODO Project::restoreSettingsImpl(reader); - if (buildConfigurations().isEmpty()) { - // No build configuration, adding those + bool hasUserFile = !buildConfigurations().isEmpty(); + if (!hasUserFile) { + // Ask the user for where he wants to build it + // and the cmake command line + + // TODO check wheter there's already a CMakeCache.txt in the src directory, + // then we don't need to ask, we simply need to build in the src directory + + CMakeConfigureDialog ccd(Core::ICore::instance()->mainWindow(), m_manager, QFileInfo(m_fileName).absolutePath()); + ccd.exec(); + + qDebug()<<"ccd.buildDirectory()"<setBuildTarget("all", "all", true); + if (!ccd.buildDirectory().isEmpty()) + setValue("all", "buildDirectory", ccd.buildDirectory()); + cmakeStep->setUserArguments("all", ccd.arguments()); + } + parseCMakeLists(); // Gets the directory from the active buildconfiguration + + if (!hasUserFile) { // Create run configurations for m_targets qDebug()<<"Create run configurations of m_targets"; bool setActive = false; @@ -328,7 +330,6 @@ void CMakeProject::restoreSettingsImpl(ProjectExplorer::PersistentSettingsReader } } - // Restoring is fine } diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.h b/src/plugins/cmakeprojectmanager/cmakeproject.h index e07c4106d4b..5195cfb5735 100644 --- a/src/plugins/cmakeprojectmanager/cmakeproject.h +++ b/src/plugins/cmakeprojectmanager/cmakeproject.h @@ -105,11 +105,9 @@ public: CMakeStep *cmakeStep() const; QStringList targets() const; - private: - void parseCMakeLists(const QDir &directory); + void parseCMakeLists(); QString findCbpFile(const QDir &); - void createCbpFile(const QDir &); void buildTree(CMakeProjectNode *rootNode, QList list); ProjectExplorer::FolderNode *findOrCreateFolder(CMakeProjectNode *rootNode, QString directory); diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp index d8511011c36..6bed6c3aae8 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp @@ -36,11 +36,14 @@ #include "cmakeproject.h" #include "cmakeprojectconstants.h" +#include #include #include #include +#include +#include #include -#include +#include using namespace CMakeProjectManager::Internal; @@ -86,41 +89,131 @@ QString CMakeManager::mimeType() const return Constants::CMAKEMIMETYPE; } +QString CMakeManager::cmakeExecutable() const +{ + return m_settingsPage->cmakeExecutable(); +} + +// TODO need to refactor this out +// we probably want the process instead of this function +// cmakeproject then could even run the cmake process in the background, adding the files afterwards +// sounds like a plan +QString CMakeManager::createXmlFile(const QStringList &arguments, const QString &sourceDirectory, const QDir &buildDirectory) +{ + // We create a cbp file, only if we didn't find a cbp file in the base directory + // Yet that can still override cbp files in subdirectories + // And we are creating tons of files in the source directories + // All of that is not really nice. + // The mid term plan is to move away from the CodeBlocks Generator and use our own + // QtCreator generator, which actually can be very similar to the CodeBlock Generator + + + // TODO we need to pass on the same paremeters as the cmakestep + QString buildDirectoryPath = buildDirectory.absolutePath(); + qDebug()<<"Creating cbp file in"< &fi) +{ + m_mutex.lock(); + QString executable = m_executable; + m_mutex.unlock(); + QProcess cmake; + cmake.start(executable, QStringList()<<"--help"); + cmake.waitForFinished(); + QString response = cmake.readAll(); + QRegExp versionRegexp("^cmake version ([*\\d\\.]*)-(|patch (\\d*))(|\\r)\\n"); + versionRegexp.indexIn(response); + + m_mutex.lock(); + m_supportsQtCreator = response.contains("QtCreator"); + m_version = versionRegexp.cap(1); + if (!versionRegexp.capturedTexts().size()>3) + m_version += "." + versionRegexp.cap(3); + m_cacheUpToDate = true; + m_mutex.unlock(); + fi.reportFinished(); +} + +void CMakeRunner::setExecutable(const QString &executable) +{ + waitForUpToDate(); + m_mutex.lock(); + m_executable = executable; + m_cacheUpToDate = false; + m_mutex.unlock(); + m_future = QtConcurrent::run(&CMakeRunner::run, this); +} + +QString CMakeRunner::executable() const +{ + waitForUpToDate(); + m_mutex.lock(); + QString result = m_executable; + m_mutex.unlock(); + return result; +} + +QString CMakeRunner::version() const +{ + waitForUpToDate(); + m_mutex.lock(); + QString result = m_version; + m_mutex.unlock(); + return result; +} + +bool CMakeRunner::supportsQtCreator() const +{ + waitForUpToDate(); + m_mutex.lock(); + bool result = m_supportsQtCreator; + m_mutex.unlock(); + return result; +} + +void CMakeRunner::waitForUpToDate() const +{ + m_future.waitForFinished(); +} + ///// // CMakeSettingsPage //// + CMakeSettingsPage::CMakeSettingsPage() { Core::ICore *core = Core::ICore::instance(); QSettings * settings = core->settings(); settings->beginGroup("CMakeSettings"); - m_cmakeExecutable = settings->value("cmakeExecutable").toString(); + m_cmakeRunner.setExecutable(settings->value("cmakeExecutable").toString()); settings->endGroup(); - updateCachedInformation(); -} - -void CMakeSettingsPage::updateCachedInformation() const -{ - // We find out two things: - // Does this cmake version support a QtCreator generator - // and the version - QFileInfo fi(m_cmakeExecutable); - if (!fi.exists()) { - m_version.clear(); - m_supportsQtCreator = false; - } - QProcess cmake; - cmake.start(m_cmakeExecutable, QStringList()<<"--help"); - cmake.waitForFinished(); - QString response = cmake.readAll(); - QRegExp versionRegexp("^cmake version ([*\\d\\.]*)-(|patch (\\d*))(|\\r)\\n"); - versionRegexp.indexIn(response); - - m_supportsQtCreator = response.contains("QtCreator"); - m_version = versionRegexp.cap(1); - if (!versionRegexp.capturedTexts().size()>3) - m_version += "." + versionRegexp.cap(3); } QString CMakeSettingsPage::findCmakeExecutable() const @@ -160,14 +253,13 @@ void CMakeSettingsPage::saveSettings() const { QSettings *settings = Core::ICore::instance()->settings(); settings->beginGroup("CMakeSettings"); - settings->setValue("cmakeExecutable", m_cmakeExecutable); + settings->setValue("cmakeExecutable", m_cmakeRunner.executable()); settings->endGroup(); } void CMakeSettingsPage::apply() { - m_cmakeExecutable = m_pathchooser->path(); - updateCachedInformation(); + m_cmakeRunner.setExecutable(m_pathchooser->path()); saveSettings(); } @@ -178,14 +270,14 @@ void CMakeSettingsPage::finish() QString CMakeSettingsPage::cmakeExecutable() const { - if (m_cmakeExecutable.isEmpty()) { - m_cmakeExecutable = findCmakeExecutable(); - if (!m_cmakeExecutable.isEmpty()) { - updateCachedInformation(); + if (m_cmakeRunner.executable().isEmpty()) { + QString cmakeExecutable = findCmakeExecutable(); + if (!cmakeExecutable.isEmpty()) { + m_cmakeRunner.setExecutable(cmakeExecutable); saveSettings(); } } - return m_cmakeExecutable; + return m_cmakeRunner.executable(); } void CMakeSettingsPage::askUserForCMakeExecutable() diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.h b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.h index 49e6ac8846e..d8a61e6e802 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.h +++ b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.h @@ -37,11 +37,15 @@ #include #include #include +#include +#include +#include namespace CMakeProjectManager { namespace Internal { class CMakeSettingsPage; +class CMakeRunner; class CMakeManager : public ProjectExplorer::IProjectManager { @@ -52,16 +56,37 @@ public: virtual int projectContext() const; virtual int projectLanguage() const; - //virtual bool canOpenProject(const QString &fileName); virtual ProjectExplorer::Project *openProject(const QString &fileName); virtual QString mimeType() const; - //virtual QString fileFilter() const; + QString cmakeExecutable() const; + + QString createXmlFile(const QStringList &arguments, const QString &sourceDirectory, const QDir &buildDirectory); private: int m_projectContext; int m_projectLanguage; CMakeSettingsPage *m_settingsPage; }; +class CMakeRunner +{ +public: + CMakeRunner(); + void run(QFutureInterface &fi); + void setExecutable(const QString &executable); + QString executable() const; + QString version() const; + bool supportsQtCreator() const; + void waitForUpToDate() const; + +private: + QString m_executable; + QString m_version; + bool m_supportsQtCreator; + bool m_cacheUpToDate; + mutable QFuture m_future; + mutable QMutex m_mutex; +}; + class CMakeSettingsPage : public Core::IOptionsPage { Q_OBJECT @@ -82,9 +107,8 @@ private: void updateCachedInformation() const; void saveSettings() const; QString findCmakeExecutable() const; - mutable QString m_cmakeExecutable; - mutable QString m_version; - mutable bool m_supportsQtCreator; + + mutable CMakeRunner m_cmakeRunner; Core::Utils::PathChooser *m_pathchooser; }; diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.pro b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.pro index 74f69fea4ab..c6f238c822c 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.pro +++ b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.pro @@ -9,12 +9,15 @@ HEADERS = cmakeproject.h \ cmakeprojectnodes.h \ cmakestep.h \ makestep.h \ - cmakerunconfiguration.h + cmakerunconfiguration.h \ + cmakeconfigurewidget.h SOURCES = cmakeproject.cpp \ cmakeprojectplugin.cpp \ cmakeprojectmanager.cpp \ cmakeprojectnodes.cpp \ cmakestep.cpp \ makestep.cpp \ - cmakerunconfiguration.cpp + cmakerunconfiguration.cpp \ + cmakeconfigurewidget.cpp RESOURCES += cmakeproject.qrc +FORMS += cmakeconfigurewidget.ui diff --git a/src/plugins/cmakeprojectmanager/cmakestep.cpp b/src/plugins/cmakeprojectmanager/cmakestep.cpp index 9f114893fc4..3947f6c2792 100644 --- a/src/plugins/cmakeprojectmanager/cmakestep.cpp +++ b/src/plugins/cmakeprojectmanager/cmakestep.cpp @@ -36,6 +36,7 @@ #include "cmakeproject.h" #include "cmakeprojectconstants.h" +#include #include #include #include @@ -56,7 +57,10 @@ bool CMakeStep::init(const QString &buildConfiguration) { setEnabled(buildConfiguration, true); setWorkingDirectory(buildConfiguration, m_pro->buildDirectory(buildConfiguration)); - setCommand(buildConfiguration, "cmake"); // TODO give full path here? + + CMakeManager *cmakeProjectManager = static_cast(m_pro->projectManager()); + + setCommand(buildConfiguration, cmakeProjectManager->cmakeExecutable()); QString sourceDir = QFileInfo(m_pro->file()->fileName()).absolutePath(); setArguments(buildConfiguration, @@ -99,14 +103,14 @@ bool CMakeStep::immutable() const return true; } -QString CMakeStep::userArguments(const QString &buildConfiguration) const +QStringList CMakeStep::userArguments(const QString &buildConfiguration) const { - return ProjectExplorer::Environment::joinArgumentList(value(buildConfiguration, "userArguments").toStringList()); + return value(buildConfiguration, "userArguments").toStringList(); } -void CMakeStep::setUserArguments(const QString &buildConfiguration, const QString &arguments) +void CMakeStep::setUserArguments(const QString &buildConfiguration, const QStringList &arguments) { - setValue(buildConfiguration, "userArguments", ProjectExplorer::Environment::parseCombinedArgString(arguments)); + setValue(buildConfiguration, "userArguments", arguments); } // @@ -132,13 +136,13 @@ void CMakeBuildStepConfigWidget::init(const QString &buildConfiguration) { m_buildConfiguration = buildConfiguration; disconnect(m_arguments, SIGNAL(textChanged(QString)), this, SLOT(argumentsLineEditChanged())); - m_arguments->setText(m_cmakeStep->userArguments(buildConfiguration)); + m_arguments->setText(ProjectExplorer::Environment::joinArgumentList(m_cmakeStep->userArguments(buildConfiguration))); connect(m_arguments, SIGNAL(textChanged(QString)), this, SLOT(argumentsLineEditChanged())); } void CMakeBuildStepConfigWidget::argumentsLineEditChanged() { - m_cmakeStep->setUserArguments(m_buildConfiguration, m_arguments->text()); + m_cmakeStep->setUserArguments(m_buildConfiguration, ProjectExplorer::Environment::parseCombinedArgString(m_arguments->text())); } // diff --git a/src/plugins/cmakeprojectmanager/cmakestep.h b/src/plugins/cmakeprojectmanager/cmakestep.h index c5006a3eadc..861ccec51d5 100644 --- a/src/plugins/cmakeprojectmanager/cmakestep.h +++ b/src/plugins/cmakeprojectmanager/cmakestep.h @@ -63,8 +63,8 @@ public: virtual ProjectExplorer::BuildStepConfigWidget *createConfigWidget(); virtual bool immutable() const; - void setUserArguments(const QString &buildConfiguration, const QString &arguments); - QString userArguments(const QString &buildConfiguration) const; + void setUserArguments(const QString &buildConfiguration, const QStringList &arguments); + QStringList userArguments(const QString &buildConfiguration) const; private: CMakeProject *m_pro; }; From 8b3136f8b0a474e8253c90e84a54cb39dd0bfcbf Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 23 Jan 2009 17:02:22 +0100 Subject: [PATCH 12/42] Fixes: fakevim: work on writing --- src/plugins/fakevim/fakevimhandler.cpp | 42 ++++++++++++++------------ 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp index 7172e50f0ae..b8ae84ba4e6 100644 --- a/src/plugins/fakevim/fakevimhandler.cpp +++ b/src/plugins/fakevim/fakevimhandler.cpp @@ -1337,12 +1337,12 @@ int FakeVimHandler::Private::readLineCode(QString &cmd) void FakeVimHandler::Private::selectRange(int beginLine, int endLine) { - m_tc.setPosition(positionForLine(beginLine), MoveAnchor); + m_anchor = positionForLine(beginLine); if (endLine == linesInDocument()) { - m_tc.setPosition(positionForLine(endLine), KeepAnchor); - m_tc.movePosition(EndOfLine, KeepAnchor); + m_tc.setPosition(positionForLine(endLine), MoveAnchor); + m_tc.movePosition(EndOfLine, MoveAnchor); } else { - m_tc.setPosition(positionForLine(endLine + 1), KeepAnchor); + m_tc.setPosition(positionForLine(endLine + 1), MoveAnchor); } } @@ -1400,29 +1400,33 @@ void FakeVimHandler::Private::handleExCommand(const QString &cmd0) QString fileName = reWrite.cap(2); if (fileName.isEmpty()) fileName = m_currentFileName; - QFile file(fileName); - bool exists = file.exists(); + QFile file1(fileName); + bool exists = file1.exists(); if (exists && !forced && !noArgs) { showRedMessage(tr("File '%1' exists (add ! to override)").arg(fileName)); - } else if (file.open(QIODevice::ReadWrite)) { - file.close(); - QTextCursor tc = m_tc; + } else if (file1.open(QIODevice::ReadWrite)) { + file1.close(); selectRange(beginLine, endLine); QString contents = selectedText(); - m_tc = tc; + qDebug() << "LINES: " << beginLine << endLine; bool handled = false; emit q->writeFileRequested(&handled, fileName, contents); // nobody cared, so act ourselves if (!handled) { - //qDebug() << "HANDLING MANUAL SAVE"; - QFile file(fileName); - file.open(QIODevice::ReadWrite); - { QTextStream ts(&file); ts << contents; } - file.close(); + //qDebug() << "HANDLING MANUAL SAVE TO " << fileName; + QFile::remove(fileName); + QFile file2(fileName); + if (file2.open(QIODevice::ReadWrite)) { + QTextStream ts(&file2); + ts << contents; + } else { + showRedMessage(tr("Cannot open file '%1' for writing").arg(fileName)); + } } // check result by reading back - file.open(QIODevice::ReadOnly); - QByteArray ba = file.readAll(); + QFile file3(fileName); + file3.open(QIODevice::ReadOnly); + QByteArray ba = file3.readAll(); showBlackMessage(tr("\"%1\" %2 %3L, %4C written") .arg(fileName).arg(exists ? " " : " [New] ") .arg(ba.count('\n')).arg(ba.size())); @@ -1814,9 +1818,7 @@ QString FakeVimHandler::Private::selectedText() const { QTextCursor tc = m_tc; tc.setPosition(m_anchor, KeepAnchor); - QString text = tc.selection().toPlainText(); - tc.clearSelection(); - return text; + return tc.selection().toPlainText(); } int FakeVimHandler::Private::positionForLine(int line) const From 54f6f814c87ce135fdad4e311cd8c8fd9cba2e3f Mon Sep 17 00:00:00 2001 From: goro Date: Fri, 23 Jan 2009 17:12:47 +0100 Subject: [PATCH 13/42] Extend version bump script, bump docs to 0.9.2 --- doc/qtcreator.qdoc | 2 +- doc/qtcreator.qdocconf | 10 +++++----- replaceVersion.sh | 35 ++++++++++++++++++++++++++++++++--- 3 files changed, 38 insertions(+), 9 deletions(-) diff --git a/doc/qtcreator.qdoc b/doc/qtcreator.qdoc index 4f393ec9dc1..eb00ea835f7 100644 --- a/doc/qtcreator.qdoc +++ b/doc/qtcreator.qdoc @@ -11,7 +11,7 @@ Development Environment (IDE) to develop Qt projects. It is available for the Linux, Mac OS X and Windows platforms. - \note The current version of Qt Creator is 0.9.1 (Beta). It is + \note The current version of Qt Creator is 0.9.2 (Beta). It is possible to edit source code, compile, run and debug applications; other features are still under development. Please send bug reports and suggestions to qt-creator@trolltech.com. To subscribe, send a diff --git a/doc/qtcreator.qdocconf b/doc/qtcreator.qdocconf index b1a99f1319b..6daa5784d3d 100644 --- a/doc/qtcreator.qdocconf +++ b/doc/qtcreator.qdocconf @@ -17,15 +17,15 @@ sources.fileextensions = "qtcreator.qdoc" qhp.projects = QtCreator qhp.QtCreator.file = qtcreator.qhp -qhp.QtCreator.namespace = com.nokia.qtcreator.091 +qhp.QtCreator.namespace = com.nokia.qtcreator.092 qhp.QtCreator.virtualFolder = doc qhp.QtCreator.indexTitle = Qt Creator qhp.QtCreator.indexRoot = qhp.QtCreator.extraFiles = classic.css \ images/qt-logo.png -qhp.QtCreator.filterAttributes = qtcreator 0.9.1 -qhp.QtCreator.customFilters.QtCreator.name = Qt Creator 0.9.1 -qhp.QtCreator.customFilters.QtCreator.filterAttributes = qtcreator 0.9.1 +qhp.QtCreator.filterAttributes = qtcreator 0.9.2 +qhp.QtCreator.customFilters.QtCreator.name = Qt Creator 0.9.2 +qhp.QtCreator.customFilters.QtCreator.filterAttributes = qtcreator 0.9.2 # macros.qdocconf @@ -201,5 +201,5 @@ HTML.footer = "


\n" \ "\n" \ "\n" \ "\n" \ - "\n" \ + "\n" \ "
Copyright © 2008 Nokia 
Qt Creator 0.9.1
Qt Creator 0.9.2
" diff --git a/replaceVersion.sh b/replaceVersion.sh index 0bb38a68a94..3e1eff015bd 100755 --- a/replaceVersion.sh +++ b/replaceVersion.sh @@ -25,6 +25,12 @@ NEW_MINOR=`sed 's/^[0-9]\+\.\([0-9]\+\)\.[0-9]\+$/\1/' <<<"$2"` OLD_RELEASE=`sed 's/^[0-9]\+\.[0-9]\+\.\([0-9]\+\)$/\1/' <<<"$1"` NEW_RELEASE=`sed 's/^[0-9]\+\.[0-9]\+\.\([0-9]\+\)$/\1/' <<<"$2"` +OLD_THREE="${OLD_MAJOR}${OLD_MINOR}${OLD_RELEASE}" +NEW_THREE="${NEW_MAJOR}${NEW_MINOR}${NEW_RELEASE}" + +OLD_DOT_THREE="${OLD_MAJOR}\\.${OLD_MINOR}\\.${OLD_RELEASE}" +NEW_DOT_THREE="${NEW_MAJOR}\\.${NEW_MINOR}\\.${NEW_RELEASE}" + OLD_DOT_FOUR="${OLD_MAJOR}\\.${OLD_MINOR}\\.${OLD_RELEASE}\\.0" NEW_DOT_FOUR="${NEW_MAJOR}\\.${NEW_MINOR}\\.${NEW_RELEASE}\\.0" @@ -38,8 +44,10 @@ echo "# Major '${OLD_MAJOR}' -> '${NEW_MAJOR}'" echo "# Minor '${OLD_MINOR}' -> '${NEW_MINOR}'" echo "# Release '${OLD_RELEASE}' -> '${NEW_RELEASE}'" echo "#-----------------------------------------------" -echo "# Dots '${OLD_DOT_FOUR}' -> '${NEW_DOT_FOUR}'" -echo "# Comma '${OLD_COMMA_FOUR}' -> '${NEW_COMMA_FOUR}'" +echo "# 3 '${OLD_THREE}' -> '${NEW_THREE}'" +echo "# Dot 3 '${OLD_DOT_THREE}' -> '${NEW_DOT_THREE}'" +echo "# Dot 4 '${OLD_DOT_FOUR}' -> '${NEW_DOT_FOUR}'" +echo "# Comma 4 '${OLD_COMMA_FOUR}' -> '${NEW_COMMA_FOUR}'" echo "#===============================================" echo @@ -85,7 +93,7 @@ sed \ mv -f "${TMPFILE}" "${INSTALLER_RC}" -## Patch installer.rc +## Patch Info.plist TMPFILE=`mktemp` INFO_PLIST="${SCRIPT_DIR}/src/app/Info.plist" echo "Patching \`${INFO_PLIST}'" @@ -95,6 +103,27 @@ sed \ mv -f "${TMPFILE}" "${INFO_PLIST}" +## Patch qtcreator.qdocconf +TMPFILE=`mktemp` +QDOCCONF="${SCRIPT_DIR}/doc/qtcreator.qdocconf" +echo "Patching \`${QDOCCONF}'" +sed \ + -e "s/"${OLD_DOT_THREE}"/"${NEW_DOT_THREE}"/" \ + -e "s/"${OLD_THREE}"/"${NEW_THREE}"/" \ + "${QDOCCONF}" > "${TMPFILE}" +mv -f "${TMPFILE}" "${QDOCCONF}" + + +## Patch qtcreator.qdoc +TMPFILE=`mktemp` +QDOC="${SCRIPT_DIR}/doc/qtcreator.qdoc" +echo "Patching \`${QDOC}'" +sed \ + -e 's/\(The current version of Qt Creator is \)'${OLD_DOT_THREE}'/\1'${NEW_DOT_THREE}'/' \ + "${QDOC}" > "${TMPFILE}" +mv -f "${TMPFILE}" "${QDOC}" + + ## Go back to original $PWD echo "Leaving directory \`${SCRIPT_DIR}'" popd &>/dev/null || exit 1 From 94ae6add3e57aabfb60414eaa47a62ad693cd4e0 Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 23 Jan 2009 17:20:51 +0100 Subject: [PATCH 14/42] Fixes: debugger: remove misleading qt4macros path in preferences --- src/plugins/debugger/debuggerplugin.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 07904b8efa3..4f7e0b1a897 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -913,8 +913,9 @@ void DebuggerPlugin::readSettings() #if defined(Q_OS_WIN32) defaultCommand.append(".exe"); #endif - QString defaultScript = ICore::instance()->resourcePath() + - QLatin1String("/gdb/qt4macros"); + //QString defaultScript = ICore::instance()->resourcePath() + + // QLatin1String("/gdb/qt4macros"); + QString defaultScript; s->beginGroup(QLatin1String("DebugMode")); QByteArray ba = s->value("State", QByteArray()).toByteArray(); From 3967c9c9a17896d991b49bea76b7e4ef4072ff20 Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 23 Jan 2009 17:43:49 +0100 Subject: [PATCH 15/42] Fixes: add 'vim' option to editor options --- src/plugins/texteditor/generalsettingspage.ui | 40 +++++++++++++------ 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/src/plugins/texteditor/generalsettingspage.ui b/src/plugins/texteditor/generalsettingspage.ui index 140f94628d6..5f2be53a13f 100644 --- a/src/plugins/texteditor/generalsettingspage.ui +++ b/src/plugins/texteditor/generalsettingspage.ui @@ -7,15 +7,15 @@ 0 0 514 - 427 + 475
Form - - - + + + Tab/Indent Settings @@ -171,8 +171,8 @@ - - + + Storage Settings @@ -224,8 +224,8 @@
- - + + Display Settings @@ -289,15 +289,31 @@ - - + + + + Interaction Settings + + + + + + Use "vi" style editing + + + + + + + + Qt::Vertical - 351 - 0 + 20 + 8 From 4bca9d3d3485a8b41fd622b29c8f5306478da1b1 Mon Sep 17 00:00:00 2001 From: goro Date: Fri, 23 Jan 2009 18:12:27 +0100 Subject: [PATCH 16/42] Add "/qt" prefix to make stuff easier with Bitrock --- scripts/shipping/prepare-linux-qt-for-shipping.sh | 2 +- src/tools/qtlibspatcher/qtlibspatchermain.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/shipping/prepare-linux-qt-for-shipping.sh b/scripts/shipping/prepare-linux-qt-for-shipping.sh index 869f0e837f8..2f49413ebdd 100755 --- a/scripts/shipping/prepare-linux-qt-for-shipping.sh +++ b/scripts/shipping/prepare-linux-qt-for-shipping.sh @@ -2,7 +2,7 @@ version=4.4.3 workdir=/home/berlin/dev/qt-${version}-temp -destdir=/home/berlin/dev/qt-${version}-shipping +destdir=/home/berlin/dev/qt-${version}-shipping/qt # "/qt" suffix for Bitrock dir=qt-x11-opensource-src-${version} file_tar="${dir}.tar" file_tar_gz="${file_tar}.gz" diff --git a/src/tools/qtlibspatcher/qtlibspatchermain.cpp b/src/tools/qtlibspatcher/qtlibspatchermain.cpp index 975e58c971a..c3ff6a0387e 100644 --- a/src/tools/qtlibspatcher/qtlibspatchermain.cpp +++ b/src/tools/qtlibspatcher/qtlibspatchermain.cpp @@ -46,7 +46,7 @@ "Trolltech/Code_less_create_more/Troll/4.4.3"; #else const char * const oldSourceBase = "/home/berlin/dev/qt-4.4.3-temp/qt-x11-opensource-src-4.4.3"; - const char * const oldInstallBase = "/home/berlin/dev/qt-4.4.3-shipping"; + const char * const oldInstallBase = "/home/berlin/dev/qt-4.4.3-shipping/qt"; #endif From 15ac83eda44a0b089834f56d4d07ec5d5eb6b162 Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 23 Jan 2009 18:21:36 +0100 Subject: [PATCH 17/42] Fixes: fakevim: add flags to settings page --- src/plugins/fakevim/fakevimplugin.cpp | 10 ++- src/plugins/texteditor/basetexteditor.cpp | 4 + src/plugins/texteditor/basetexteditor.h | 18 +++-- src/plugins/texteditor/basetexteditor_p.h | 1 + .../texteditor/generalsettingspage.cpp | 29 +++++++- src/plugins/texteditor/generalsettingspage.h | 7 +- src/plugins/texteditor/generalsettingspage.ui | 2 +- .../texteditor/interactionsettings.cpp | 73 +++++++++++++++++++ src/plugins/texteditor/interactionsettings.h | 62 ++++++++++++++++ src/plugins/texteditor/tabsettings.cpp | 14 ++-- src/plugins/texteditor/texteditor.pro | 2 + src/plugins/texteditor/texteditorsettings.h | 3 + 12 files changed, 204 insertions(+), 21 deletions(-) create mode 100644 src/plugins/texteditor/interactionsettings.cpp create mode 100644 src/plugins/texteditor/interactionsettings.h diff --git a/src/plugins/fakevim/fakevimplugin.cpp b/src/plugins/fakevim/fakevimplugin.cpp index 0b35c4fb815..26a7d7fbbc0 100644 --- a/src/plugins/fakevim/fakevimplugin.cpp +++ b/src/plugins/fakevim/fakevimplugin.cpp @@ -53,6 +53,7 @@ #include #include #include +#include #include #include @@ -229,14 +230,12 @@ void FakeVimPluginPrivate::installHandler(Core::IEditor *editor) void FakeVimPluginPrivate::writeFile(bool *handled, const QString &fileName, const QString &contents) { - //qDebug() << "HANDLING WRITE FILE" << fileName << sender(); FakeVimHandler *handler = qobject_cast(sender()); if (!handler) return; Core::IEditor *editor = qobject_cast(handler->extraData()); if (editor && editor->file()->fileName() == fileName) { - //qDebug() << "HANDLING CORE SAVE"; // Handle that as a special case for nicer interaction with core Core::IFile *file = editor->file(); m_core->fileManager()->blockFileChange(file); @@ -261,6 +260,13 @@ void FakeVimPluginPrivate::editorOpened(Core::IEditor *editor) Q_UNUSED(editor); //qDebug() << "OPENING: " << editor << editor->widget(); //installHandler(editor); + QWidget *widget = editor->widget(); + if (BaseTextEditor *bt = qobject_cast(widget)) { + InteractionSettings settings = bt->interactionSettings(); + qDebug() << "USE VIM: " << settings.m_useVim; + if (settings.m_useVim) + installHandler(editor); + } } void FakeVimPluginPrivate::editorAboutToClose(Core::IEditor *editor) diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp index 0e058ff752e..718c1f736ab 100644 --- a/src/plugins/texteditor/basetexteditor.cpp +++ b/src/plugins/texteditor/basetexteditor.cpp @@ -2709,6 +2709,10 @@ const DisplaySettings &BaseTextEditor::displaySettings() const return d->m_displaySettings; } +const InteractionSettings &BaseTextEditor::interactionSettings() const +{ + return d->m_interactionSettings; +} void BaseTextEditor::indentOrUnindent(bool doIndent) diff --git a/src/plugins/texteditor/basetexteditor.h b/src/plugins/texteditor/basetexteditor.h index e5e79d4a4a2..7724f277356 100644 --- a/src/plugins/texteditor/basetexteditor.h +++ b/src/plugins/texteditor/basetexteditor.h @@ -37,6 +37,7 @@ #include "displaysettings.h" #include "tabsettings.h" +#include "interactionsettings.h" #include "itexteditable.h" #include @@ -88,7 +89,8 @@ struct TEXTEDITOR_EXPORT Parenthesis -class TEXTEDITOR_EXPORT TextBlockUserData : public QTextBlockUserData { +class TEXTEDITOR_EXPORT TextBlockUserData : public QTextBlockUserData +{ public: enum CollapseMode { NoCollapse , CollapseThis, CollapseAfter }; @@ -382,9 +384,9 @@ public: virtual void extraAreaMouseEvent(QMouseEvent *); virtual void extraAreaLeaveEvent(QEvent *); - const TabSettings &tabSettings() const; const DisplaySettings &displaySettings() const; + const InteractionSettings &interactionSettings() const; void markBlocksAsChanged(QList blockNumbers); @@ -402,9 +404,12 @@ public: void setExtraSelections(ExtraSelectionKind kind, const QList &selections); QList extraSelections(ExtraSelectionKind kind) const; - struct BlockRange { - BlockRange():first(0), last(-1){} - BlockRange(int first_position, int last_position):first(first_position), last(last_position){} + struct BlockRange + { + BlockRange() : first(0), last(-1) {} + BlockRange(int first_position, int last_position) + : first(first_position), last(last_position) + {} int first; int last; inline bool isNull() const { return last < first; } @@ -413,7 +418,6 @@ public: // the blocks list must be sorted void setIfdefedOutBlocks(const QList &blocks); - public slots: virtual void setTabSettings(const TextEditor::TabSettings &); virtual void setDisplaySettings(const TextEditor::DisplaySettings &); @@ -442,8 +446,6 @@ protected slots: virtual void slotCursorPositionChanged(); virtual void slotUpdateBlockNotify(const QTextBlock &); - - signals: void requestBlockUpdate(const QTextBlock &); void requestAutoCompletion(ITextEditable *editor, bool forced); diff --git a/src/plugins/texteditor/basetexteditor_p.h b/src/plugins/texteditor/basetexteditor_p.h index 3310b0665d2..270b7444f42 100644 --- a/src/plugins/texteditor/basetexteditor_p.h +++ b/src/plugins/texteditor/basetexteditor_p.h @@ -165,6 +165,7 @@ public: QWidget *m_extraArea; DisplaySettings m_displaySettings; + InteractionSettings m_interactionSettings; int extraAreaSelectionAnchorBlockNumber; int extraAreaToggleMarkBlockNumber; diff --git a/src/plugins/texteditor/generalsettingspage.cpp b/src/plugins/texteditor/generalsettingspage.cpp index 7be7bca1f4b..ec3c6178d16 100644 --- a/src/plugins/texteditor/generalsettingspage.cpp +++ b/src/plugins/texteditor/generalsettingspage.cpp @@ -33,6 +33,7 @@ #include "displaysettings.h" #include "generalsettingspage.h" +#include "interactionsettings.h" #include "storagesettings.h" #include "tabsettings.h" #include "ui_generalsettingspage.h" @@ -53,6 +54,7 @@ struct GeneralSettingsPage::GeneralSettingsPagePrivate TabSettings m_tabSettings; StorageSettings m_storageSettings; DisplaySettings m_displaySettings; + InteractionSettings m_interactionSettings; }; GeneralSettingsPage::GeneralSettingsPagePrivate::GeneralSettingsPagePrivate @@ -63,6 +65,7 @@ GeneralSettingsPage::GeneralSettingsPagePrivate::GeneralSettingsPagePrivate m_tabSettings.fromSettings(m_parameters.settingsPrefix, s); m_storageSettings.fromSettings(m_parameters.settingsPrefix, s); m_displaySettings.fromSettings(m_parameters.settingsPrefix, s); + m_interactionSettings.fromSettings(m_parameters.settingsPrefix, s); } } @@ -106,8 +109,11 @@ void GeneralSettingsPage::apply() TabSettings newTabSettings; StorageSettings newStorageSettings; DisplaySettings newDisplaySettings; + InteractionSettings newInteractionSettings; + + settingsFromUI(newTabSettings, newStorageSettings, newDisplaySettings, + newInteractionSettings); - settingsFromUI(newTabSettings, newStorageSettings, newDisplaySettings); Core::ICore *core = Core::ICore::instance(); if (newTabSettings != m_d->m_tabSettings) { @@ -133,11 +139,20 @@ void GeneralSettingsPage::apply() emit displaySettingsChanged(newDisplaySettings); } + + if (newInteractionSettings != m_d->m_interactionSettings) { + m_d->m_interactionSettings = newInteractionSettings; + if (QSettings *s = core->settings()) + m_d->m_interactionSettings.toSettings(m_d->m_parameters.settingsPrefix, s); + + emit interactionSettingsChanged(newInteractionSettings); + } } void GeneralSettingsPage::settingsFromUI(TabSettings &rc, StorageSettings &storageSettings, - DisplaySettings &displaySettings) const + DisplaySettings &displaySettings, + InteractionSettings &interactionSettings) const { rc.m_spacesForTabs = m_d->m_page.insertSpaces->isChecked(); rc.m_autoIndent = m_d->m_page.autoIndent->isChecked(); @@ -156,6 +171,8 @@ void GeneralSettingsPage::settingsFromUI(TabSettings &rc, displaySettings.m_visualizeWhitespace = m_d->m_page.visualizeWhitespace->isChecked(); displaySettings.m_displayFoldingMarkers = m_d->m_page.displayFoldingMarkers->isChecked(); displaySettings.m_highlightCurrentLine = m_d->m_page.highlightCurrentLine->isChecked(); + + interactionSettings.m_useVim = m_d->m_page.useVim->isChecked(); } void GeneralSettingsPage::settingsToUI() @@ -180,6 +197,9 @@ void GeneralSettingsPage::settingsToUI() m_d->m_page.visualizeWhitespace->setChecked(displaySettings.m_visualizeWhitespace); m_d->m_page.displayFoldingMarkers->setChecked(displaySettings.m_displayFoldingMarkers); m_d->m_page.highlightCurrentLine->setChecked(displaySettings.m_highlightCurrentLine); + + InteractionSettings interactionSettings = m_d->m_interactionSettings; + m_d->m_page.useVim->setChecked(interactionSettings.m_useVim); } TabSettings GeneralSettingsPage::tabSettings() const @@ -197,6 +217,11 @@ DisplaySettings GeneralSettingsPage::displaySettings() const return m_d->m_displaySettings; } +InteractionSettings GeneralSettingsPage::interactionSettings() const +{ + return m_d->m_interactionSettings; +} + void GeneralSettingsPage::setDisplaySettings(const DisplaySettings &newDisplaySettings) { if (newDisplaySettings != m_d->m_displaySettings) { diff --git a/src/plugins/texteditor/generalsettingspage.h b/src/plugins/texteditor/generalsettingspage.h index 5eb9c0811c2..7679d7b16db 100644 --- a/src/plugins/texteditor/generalsettingspage.h +++ b/src/plugins/texteditor/generalsettingspage.h @@ -45,6 +45,7 @@ namespace TextEditor { struct TabSettings; struct StorageSettings; struct DisplaySettings; +struct InteractionSettings; struct TEXTEDITOR_EXPORT GeneralSettingsPageParameters { @@ -74,6 +75,7 @@ public: TabSettings tabSettings() const; StorageSettings storageSettings() const; DisplaySettings displaySettings() const; + InteractionSettings interactionSettings() const; void setDisplaySettings(const DisplaySettings &); @@ -81,11 +83,14 @@ signals: void tabSettingsChanged(const TextEditor::TabSettings &); void storageSettingsChanged(const TextEditor::StorageSettings &); void displaySettingsChanged(const TextEditor::DisplaySettings &); + void interactionSettingsChanged(const TextEditor::InteractionSettings &); private: void settingsFromUI(TabSettings &rc, StorageSettings &storageSettings, - DisplaySettings &displaySettings) const; + DisplaySettings &displaySettings, + InteractionSettings &interactionSettings + ) const; void settingsToUI(); struct GeneralSettingsPagePrivate; GeneralSettingsPagePrivate *m_d; diff --git a/src/plugins/texteditor/generalsettingspage.ui b/src/plugins/texteditor/generalsettingspage.ui index 5f2be53a13f..58b6bdbc0aa 100644 --- a/src/plugins/texteditor/generalsettingspage.ui +++ b/src/plugins/texteditor/generalsettingspage.ui @@ -296,7 +296,7 @@ - + Use "vi" style editing diff --git a/src/plugins/texteditor/interactionsettings.cpp b/src/plugins/texteditor/interactionsettings.cpp new file mode 100644 index 00000000000..ae3be5203f6 --- /dev/null +++ b/src/plugins/texteditor/interactionsettings.cpp @@ -0,0 +1,73 @@ +/*************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Qt Software Information (qt-info@nokia.com) +** +** +** Non-Open Source Usage +** +** Licensees may use this file in accordance with the Qt Beta Version +** License Agreement, Agreement version 2.2 provided with the Software or, +** alternatively, in accordance with the terms contained in a written +** agreement between you and Nokia. +** +** GNU General Public License Usage +** +** Alternatively, this file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the packaging +** of this file. Please review the following information to ensure GNU +** General Public Licensing requirements will be met: +** +** http://www.fsf.org/licensing/licenses/info/GPLv2.html and +** http://www.gnu.org/copyleft/gpl.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt GPL Exception +** version 1.3, included in the file GPL_EXCEPTION.txt in this package. +** +***************************************************************************/ + +#include "interactionsettings.h" + +#include +#include + +namespace TextEditor { + +static const char *useVimKey = "useVim"; +static const char *groupPostfix = "InteractionSettings"; + +InteractionSettings::InteractionSettings() + : m_useVim(false) +{ +} + +void InteractionSettings::toSettings(const QString &category, QSettings *s) const +{ + QString group = QLatin1String(groupPostfix); + if (!category.isEmpty()) + group.insert(0, category); + s->beginGroup(group); + s->setValue(QLatin1String(useVimKey), m_useVim); + s->endGroup(); +} + +void InteractionSettings::fromSettings(const QString &category, const QSettings *s) +{ + QString group = QLatin1String(groupPostfix); + if (!category.isEmpty()) + group.insert(0, category); + group += QLatin1Char('/'); + m_useVim = s->value(group + QLatin1String(useVimKey), m_useVim).toBool(); +} + +bool InteractionSettings::equals(const InteractionSettings &ts) const +{ + return m_useVim == ts.m_useVim; +} + +} // namespace TextEditor diff --git a/src/plugins/texteditor/interactionsettings.h b/src/plugins/texteditor/interactionsettings.h new file mode 100644 index 00000000000..fc1ad0fe836 --- /dev/null +++ b/src/plugins/texteditor/interactionsettings.h @@ -0,0 +1,62 @@ +/*************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Qt Software Information (qt-info@nokia.com) +** +** +** Non-Open Source Usage +** +** Licensees may use this file in accordance with the Qt Beta Version +** License Agreement, Agreement version 2.2 provided with the Software or, +** alternatively, in accordance with the terms contained in a written +** agreement between you and Nokia. +** +** GNU General Public License Usage +** +** Alternatively, this file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the packaging +** of this file. Please review the following information to ensure GNU +** General Public Licensing requirements will be met: +** +** http://www.fsf.org/licensing/licenses/info/GPLv2.html and +** http://www.gnu.org/copyleft/gpl.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt GPL Exception +** version 1.3, included in the file GPL_EXCEPTION.txt in this package. +** +***************************************************************************/ + +#ifndef INTERACTIONSETTINGS_H +#define INTERACTIONSETTINGS_H + +#include "texteditor_global.h" + +QT_BEGIN_NAMESPACE +class QSettings; +QT_END_NAMESPACE + +namespace TextEditor { + +struct TEXTEDITOR_EXPORT InteractionSettings +{ + InteractionSettings(); + + void toSettings(const QString &category, QSettings *s) const; + void fromSettings(const QString &category, const QSettings *s); + + bool equals(const InteractionSettings &ts) const; + + bool m_useVim; +}; + +inline bool operator==(const InteractionSettings &t1, const InteractionSettings &t2) { return t1.equals(t2); } +inline bool operator!=(const InteractionSettings &t1, const InteractionSettings &t2) { return !t1.equals(t2); } + +} // namespace TextEditor + +#endif // INTERACTIONSETTINGS_H diff --git a/src/plugins/texteditor/tabsettings.cpp b/src/plugins/texteditor/tabsettings.cpp index 46d4100112f..5e61d0b4b8a 100644 --- a/src/plugins/texteditor/tabsettings.cpp +++ b/src/plugins/texteditor/tabsettings.cpp @@ -33,18 +33,18 @@ #include "tabsettings.h" +#include #include #include #include #include -#include -static const char* spacesForTabsKey = "SpacesForTabs"; -static const char* smartBackspaceKey = "SmartBackspace"; -static const char* autoIndentKey = "AutoIndent"; -static const char* tabSizeKey = "TabSize"; -static const char* indentSizeKey = "IndentSize"; -static const char* groupPostfix = "TabSettings"; +static const char *spacesForTabsKey = "SpacesForTabs"; +static const char *smartBackspaceKey = "SmartBackspace"; +static const char *autoIndentKey = "AutoIndent"; +static const char *tabSizeKey = "TabSize"; +static const char *indentSizeKey = "IndentSize"; +static const char *groupPostfix = "TabSettings"; namespace TextEditor { diff --git a/src/plugins/texteditor/texteditor.pro b/src/plugins/texteditor/texteditor.pro index 59c9cc4bb41..56c39604fb4 100644 --- a/src/plugins/texteditor/texteditor.pro +++ b/src/plugins/texteditor/texteditor.pro @@ -13,6 +13,7 @@ SOURCES += texteditorplugin.cpp \ completionsupport.cpp \ completionwidget.cpp \ fontsettingspage.cpp \ + interactionsettings.cpp \ tabsettings.cpp \ storagesettings.cpp \ displaysettings.cpp \ @@ -37,6 +38,7 @@ HEADERS += texteditorplugin.h \ texteditoractionhandler.h \ fontsettingspage.h \ icompletioncollector.h \ + interactionsettings.h \ texteditorconstants.h \ tabsettings.h \ storagesettings.h \ diff --git a/src/plugins/texteditor/texteditorsettings.h b/src/plugins/texteditor/texteditorsettings.h index fda32d20fae..032a8a139af 100644 --- a/src/plugins/texteditor/texteditorsettings.h +++ b/src/plugins/texteditor/texteditorsettings.h @@ -46,6 +46,7 @@ class FontSettings; struct TabSettings; struct StorageSettings; struct DisplaySettings; +struct InteractionSettings; namespace Internal { class TextEditorPlugin; @@ -70,12 +71,14 @@ public: TabSettings tabSettings() const; StorageSettings storageSettings() const; DisplaySettings displaySettings() const; + InteractionSettings interactionSettings() const; signals: void fontSettingsChanged(const TextEditor::FontSettings &); void tabSettingsChanged(const TextEditor::TabSettings &); void storageSettingsChanged(const TextEditor::StorageSettings &); void displaySettingsChanged(const TextEditor::DisplaySettings &); + void interactionSettingsChanged(const TextEditor::InteractionSettings &); private: TextEditor::FontSettingsPage *m_fontSettingsPage; From 7f614f1ae09fac60d8e537726ed07af29ea5a72f Mon Sep 17 00:00:00 2001 From: dt Date: Fri, 23 Jan 2009 18:30:21 +0100 Subject: [PATCH 18/42] Fixes: Add missing file. --- .../cmakeconfigurewidget.ui | 95 +++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 src/plugins/cmakeprojectmanager/cmakeconfigurewidget.ui diff --git a/src/plugins/cmakeprojectmanager/cmakeconfigurewidget.ui b/src/plugins/cmakeprojectmanager/cmakeconfigurewidget.ui new file mode 100644 index 00000000000..cdca9035e6f --- /dev/null +++ b/src/plugins/cmakeprojectmanager/cmakeconfigurewidget.ui @@ -0,0 +1,95 @@ + + + CMakeProjectManager::Internal::CMakeConfigureWidget + + + + 0 + 0 + 521 + 662 + + + + Form + + + + + + + + CMake Arguments: + + + + + + + + + + Builddirectory: + + + + + + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Run cmake + + + + + + + + + + + + + Core::Utils::PathChooser + QLineEdit +
utils/pathchooser.h
+
+
+ + +
From a087b138f5c8328b56e977a40e1a6ab106c772f8 Mon Sep 17 00:00:00 2001 From: dt Date: Fri, 23 Jan 2009 18:53:16 +0100 Subject: [PATCH 19/42] Fixes: Make searchInPath() more robust. Details: returns the argument if it is absolute and already exists. --- src/plugins/projectexplorer/environment.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/plugins/projectexplorer/environment.cpp b/src/plugins/projectexplorer/environment.cpp index 38f35af9727..cfc9c2213d2 100644 --- a/src/plugins/projectexplorer/environment.cpp +++ b/src/plugins/projectexplorer/environment.cpp @@ -188,6 +188,9 @@ QString Environment::searchInPath(QString executable) // qDebug()<<"looking for "< Date: Fri, 23 Jan 2009 18:54:46 +0100 Subject: [PATCH 20/42] Fixes: Add copyright header to cmakeconfigurationwidget.h and cpp --- .../cmakeconfigurewidget.cpp | 33 +++++++++++++++++++ .../cmakeconfigurewidget.h | 33 +++++++++++++++++++ 2 files changed, 66 insertions(+) diff --git a/src/plugins/cmakeprojectmanager/cmakeconfigurewidget.cpp b/src/plugins/cmakeprojectmanager/cmakeconfigurewidget.cpp index 41b6a7e0db5..c0065c4fc15 100644 --- a/src/plugins/cmakeprojectmanager/cmakeconfigurewidget.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeconfigurewidget.cpp @@ -1,3 +1,36 @@ +/*************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Qt Software Information (qt-info@nokia.com) +** +** +** Non-Open Source Usage +** +** Licensees may use this file in accordance with the Qt Beta Version +** License Agreement, Agreement version 2.2 provided with the Software or, +** alternatively, in accordance with the terms contained in a written +** agreement between you and Nokia. +** +** GNU General Public License Usage +** +** Alternatively, this file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the packaging +** of this file. Please review the following information to ensure GNU +** General Public Licensing requirements will be met: +** +** http://www.fsf.org/licensing/licenses/info/GPLv2.html and +** http://www.gnu.org/copyleft/gpl.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt GPL Exception +** version 1.3, included in the file GPL_EXCEPTION.txt in this package. +** +***************************************************************************/ + #include "cmakeconfigurewidget.h" #include "cmakeprojectmanager.h" #include diff --git a/src/plugins/cmakeprojectmanager/cmakeconfigurewidget.h b/src/plugins/cmakeprojectmanager/cmakeconfigurewidget.h index f44444537bf..5565f8f17bc 100644 --- a/src/plugins/cmakeprojectmanager/cmakeconfigurewidget.h +++ b/src/plugins/cmakeprojectmanager/cmakeconfigurewidget.h @@ -1,3 +1,36 @@ +/*************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Qt Software Information (qt-info@nokia.com) +** +** +** Non-Open Source Usage +** +** Licensees may use this file in accordance with the Qt Beta Version +** License Agreement, Agreement version 2.2 provided with the Software or, +** alternatively, in accordance with the terms contained in a written +** agreement between you and Nokia. +** +** GNU General Public License Usage +** +** Alternatively, this file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the packaging +** of this file. Please review the following information to ensure GNU +** General Public Licensing requirements will be met: +** +** http://www.fsf.org/licensing/licenses/info/GPLv2.html and +** http://www.gnu.org/copyleft/gpl.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt GPL Exception +** version 1.3, included in the file GPL_EXCEPTION.txt in this package. +** +***************************************************************************/ + #ifndef CMAKECONFIGUREWIDGET_H #define CMAKECONFIGUREWIDGET_H From 292d4bc3d52d567d16f662f950cc815976b059af Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 23 Jan 2009 19:13:00 +0100 Subject: [PATCH 21/42] Fixes: fakevim: provide an option in the text editor settings --- src/plugins/fakevim/fakevimhandler.cpp | 1 - src/plugins/fakevim/fakevimplugin.cpp | 19 +++++++++++++------ src/plugins/texteditor/basetexteditor.h | 2 +- .../texteditor/generalsettingspage.cpp | 10 +++++----- src/plugins/texteditor/generalsettingspage.h | 1 - .../texteditor/interactionsettings.cpp | 2 +- src/plugins/texteditor/linenumberfilter.cpp | 17 +++++++++-------- src/plugins/texteditor/linenumberfilter.h | 11 ++--------- src/plugins/texteditor/texteditorplugin.cpp | 5 +++-- src/plugins/texteditor/texteditorsettings.cpp | 3 +-- src/plugins/texteditor/texteditorsettings.h | 9 +-------- 11 files changed, 36 insertions(+), 44 deletions(-) diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp index b8ae84ba4e6..d2825c57959 100644 --- a/src/plugins/fakevim/fakevimhandler.cpp +++ b/src/plugins/fakevim/fakevimhandler.cpp @@ -2043,7 +2043,6 @@ FakeVimHandler::FakeVimHandler(QWidget *widget, QObject *parent) FakeVimHandler::~FakeVimHandler() { - qDebug() << "DELETING HANDLER" << this; delete d; } diff --git a/src/plugins/fakevim/fakevimplugin.cpp b/src/plugins/fakevim/fakevimplugin.cpp index 26a7d7fbbc0..5bf7c32675d 100644 --- a/src/plugins/fakevim/fakevimplugin.cpp +++ b/src/plugins/fakevim/fakevimplugin.cpp @@ -183,12 +183,6 @@ bool FakeVimPluginPrivate::initialize() return true; } -void FakeVimPluginPrivate::installHandler() -{ - if (Core::IEditor *editor = m_core->editorManager()->currentEditor()) - installHandler(editor); -} - void FakeVimPluginPrivate::installHandler(Core::IEditor *editor) { QWidget *widget = editor->widget(); @@ -230,6 +224,8 @@ void FakeVimPluginPrivate::installHandler(Core::IEditor *editor) void FakeVimPluginPrivate::writeFile(bool *handled, const QString &fileName, const QString &contents) { + Q_UNUSED(contents); + FakeVimHandler *handler = qobject_cast(sender()); if (!handler) return; @@ -260,6 +256,16 @@ void FakeVimPluginPrivate::editorOpened(Core::IEditor *editor) Q_UNUSED(editor); //qDebug() << "OPENING: " << editor << editor->widget(); //installHandler(editor); + +#if 1 + QSettings *s = ICore::instance()->settings(); + bool automatic = s->value("textInteractionSettings/UseVim").toBool(); + //qDebug() << "USE VIM: " << automatic; + if (automatic) + installHandler(editor); +#endif + +#if 0 QWidget *widget = editor->widget(); if (BaseTextEditor *bt = qobject_cast(widget)) { InteractionSettings settings = bt->interactionSettings(); @@ -267,6 +273,7 @@ void FakeVimPluginPrivate::editorOpened(Core::IEditor *editor) if (settings.m_useVim) installHandler(editor); } +#endif } void FakeVimPluginPrivate::editorAboutToClose(Core::IEditor *editor) diff --git a/src/plugins/texteditor/basetexteditor.h b/src/plugins/texteditor/basetexteditor.h index 7724f277356..83ce1538c7e 100644 --- a/src/plugins/texteditor/basetexteditor.h +++ b/src/plugins/texteditor/basetexteditor.h @@ -416,7 +416,7 @@ public: }; // the blocks list must be sorted - void setIfdefedOutBlocks(const QList &blocks); + void setIfdefedOutBlocks(const QList &blocks); public slots: virtual void setTabSettings(const TextEditor::TabSettings &); diff --git a/src/plugins/texteditor/generalsettingspage.cpp b/src/plugins/texteditor/generalsettingspage.cpp index ec3c6178d16..7482080ab95 100644 --- a/src/plugins/texteditor/generalsettingspage.cpp +++ b/src/plugins/texteditor/generalsettingspage.cpp @@ -115,10 +115,11 @@ void GeneralSettingsPage::apply() newInteractionSettings); Core::ICore *core = Core::ICore::instance(); + QSettings *s = core->settings(); if (newTabSettings != m_d->m_tabSettings) { m_d->m_tabSettings = newTabSettings; - if (QSettings *s = core->settings()) + if (s) m_d->m_tabSettings.toSettings(m_d->m_parameters.settingsPrefix, s); emit tabSettingsChanged(newTabSettings); @@ -126,7 +127,7 @@ void GeneralSettingsPage::apply() if (newStorageSettings != m_d->m_storageSettings) { m_d->m_storageSettings = newStorageSettings; - if (QSettings *s = core->settings()) + if (s) m_d->m_storageSettings.toSettings(m_d->m_parameters.settingsPrefix, s); emit storageSettingsChanged(newStorageSettings); @@ -134,7 +135,7 @@ void GeneralSettingsPage::apply() if (newDisplaySettings != m_d->m_displaySettings) { m_d->m_displaySettings = newDisplaySettings; - if (QSettings *s = core->settings()) + if (s) m_d->m_displaySettings.toSettings(m_d->m_parameters.settingsPrefix, s); emit displaySettingsChanged(newDisplaySettings); @@ -142,10 +143,9 @@ void GeneralSettingsPage::apply() if (newInteractionSettings != m_d->m_interactionSettings) { m_d->m_interactionSettings = newInteractionSettings; - if (QSettings *s = core->settings()) + if (s) m_d->m_interactionSettings.toSettings(m_d->m_parameters.settingsPrefix, s); - emit interactionSettingsChanged(newInteractionSettings); } } diff --git a/src/plugins/texteditor/generalsettingspage.h b/src/plugins/texteditor/generalsettingspage.h index 7679d7b16db..1f70fd6b0b0 100644 --- a/src/plugins/texteditor/generalsettingspage.h +++ b/src/plugins/texteditor/generalsettingspage.h @@ -83,7 +83,6 @@ signals: void tabSettingsChanged(const TextEditor::TabSettings &); void storageSettingsChanged(const TextEditor::StorageSettings &); void displaySettingsChanged(const TextEditor::DisplaySettings &); - void interactionSettingsChanged(const TextEditor::InteractionSettings &); private: void settingsFromUI(TabSettings &rc, diff --git a/src/plugins/texteditor/interactionsettings.cpp b/src/plugins/texteditor/interactionsettings.cpp index ae3be5203f6..368bc3ff615 100644 --- a/src/plugins/texteditor/interactionsettings.cpp +++ b/src/plugins/texteditor/interactionsettings.cpp @@ -38,7 +38,7 @@ namespace TextEditor { -static const char *useVimKey = "useVim"; +static const char *useVimKey = "UseVim"; static const char *groupPostfix = "InteractionSettings"; InteractionSettings::InteractionSettings() diff --git a/src/plugins/texteditor/linenumberfilter.cpp b/src/plugins/texteditor/linenumberfilter.cpp index cb02b0f8088..d8d2ea6cbda 100644 --- a/src/plugins/texteditor/linenumberfilter.cpp +++ b/src/plugins/texteditor/linenumberfilter.cpp @@ -43,10 +43,9 @@ using namespace QuickOpen; using namespace TextEditor; using namespace TextEditor::Internal; -LineNumberFilter::LineNumberFilter(EditorManager *editorManager, QObject *parent): - IQuickOpenFilter(parent) +LineNumberFilter::LineNumberFilter(QObject *parent) + : IQuickOpenFilter(parent) { - m_editorManager = editorManager; setShortcutString("l"); setIncludedByDefault(true); } @@ -65,17 +64,19 @@ void LineNumberFilter::accept(FilterEntry selection) const { ITextEditor *editor = currentTextEditor(); if (editor) { - m_editorManager->ensureEditorManagerVisible(); - m_editorManager->addCurrentPositionToNavigationHistory(true); + Core::EditorManager *editorManager = Core::EditorManager::instance(); + editorManager->ensureEditorManagerVisible(); + editorManager->addCurrentPositionToNavigationHistory(true); editor->gotoLine(selection.internalData.toInt()); - m_editorManager->addCurrentPositionToNavigationHistory(); + editorManager->addCurrentPositionToNavigationHistory(); editor->widget()->setFocus(); } } ITextEditor *LineNumberFilter::currentTextEditor() const { - if (!m_editorManager->currentEditor()) + Core::EditorManager *editorManager = Core::EditorManager::instance(); + if (!editorManager->currentEditor()) return 0; - return qobject_cast(m_editorManager->currentEditor()); + return qobject_cast(editorManager->currentEditor()); } diff --git a/src/plugins/texteditor/linenumberfilter.h b/src/plugins/texteditor/linenumberfilter.h index bc29b1db374..7ee8a6f6d5d 100644 --- a/src/plugins/texteditor/linenumberfilter.h +++ b/src/plugins/texteditor/linenumberfilter.h @@ -38,13 +38,7 @@ #include #include -#include #include -#include - -namespace Core { -class EditorManager; -} namespace TextEditor { @@ -57,7 +51,8 @@ class LineNumberFilter : public QuickOpen::IQuickOpenFilter Q_OBJECT public: - LineNumberFilter(Core::EditorManager *editorManager, QObject *parent = 0); + explicit LineNumberFilter(QObject *parent = 0); + QString trName() const { return tr("Line in current document"); } QString name() const { return "Line in current document"; } QuickOpen::IQuickOpenFilter::Priority priority() const { return QuickOpen::IQuickOpenFilter::High; } @@ -67,8 +62,6 @@ public: private: ITextEditor *currentTextEditor() const; - - Core::EditorManager *m_editorManager; }; } // namespace Internal diff --git a/src/plugins/texteditor/texteditorplugin.cpp b/src/plugins/texteditor/texteditorplugin.cpp index 1e6a47e47d4..765a4de2f11 100644 --- a/src/plugins/texteditor/texteditorplugin.cpp +++ b/src/plugins/texteditor/texteditorplugin.cpp @@ -42,6 +42,7 @@ #include "plaintexteditorfactory.h" #include "plaintexteditor.h" #include "storagesettings.h" +#include "interactionsettings.h" #include #include @@ -104,7 +105,7 @@ bool TextEditorPlugin::initialize(const QStringList &arguments, QString *errorMe addAutoReleasedObject(m_wizard); - m_settings = new TextEditorSettings(this, this); + m_settings = new TextEditorSettings(this); // Add plain text editor factory m_editorFactory = new PlainTextEditorFactory; @@ -112,7 +113,7 @@ bool TextEditorPlugin::initialize(const QStringList &arguments, QString *errorMe // Goto line functionality for quick open Core::ICore *core = Core::ICore::instance(); - m_lineNumberFilter = new LineNumberFilter(core->editorManager()); + m_lineNumberFilter = new LineNumberFilter; addAutoReleasedObject(m_lineNumberFilter); int contextId = core->uniqueIDManager()->uniqueIdentifier(TextEditor::Constants::C_TEXTEDITOR); diff --git a/src/plugins/texteditor/texteditorsettings.cpp b/src/plugins/texteditor/texteditorsettings.cpp index ea61d571725..999ad0d8ae7 100644 --- a/src/plugins/texteditor/texteditorsettings.cpp +++ b/src/plugins/texteditor/texteditorsettings.cpp @@ -51,8 +51,7 @@ using namespace TextEditor::Constants; TextEditorSettings *TextEditorSettings::m_instance = 0; -TextEditorSettings::TextEditorSettings(Internal::TextEditorPlugin *plugin, - QObject *parent) +TextEditorSettings::TextEditorSettings(QObject *parent) : QObject(parent) { QTC_ASSERT(!m_instance, return); diff --git a/src/plugins/texteditor/texteditorsettings.h b/src/plugins/texteditor/texteditorsettings.h index 032a8a139af..efaec3176b2 100644 --- a/src/plugins/texteditor/texteditorsettings.h +++ b/src/plugins/texteditor/texteditorsettings.h @@ -46,11 +46,6 @@ class FontSettings; struct TabSettings; struct StorageSettings; struct DisplaySettings; -struct InteractionSettings; - -namespace Internal { -class TextEditorPlugin; -} /** * This class provides a central place for basic text editor settings. These @@ -62,7 +57,7 @@ class TEXTEDITOR_EXPORT TextEditorSettings : public QObject Q_OBJECT public: - TextEditorSettings(Internal::TextEditorPlugin *plugin, QObject *parent); + explicit TextEditorSettings(QObject *parent); ~TextEditorSettings(); static TextEditorSettings *instance(); @@ -71,14 +66,12 @@ public: TabSettings tabSettings() const; StorageSettings storageSettings() const; DisplaySettings displaySettings() const; - InteractionSettings interactionSettings() const; signals: void fontSettingsChanged(const TextEditor::FontSettings &); void tabSettingsChanged(const TextEditor::TabSettings &); void storageSettingsChanged(const TextEditor::StorageSettings &); void displaySettingsChanged(const TextEditor::DisplaySettings &); - void interactionSettingsChanged(const TextEditor::InteractionSettings &); private: TextEditor::FontSettingsPage *m_fontSettingsPage; From a90545126fb63ed05fc559d50dbbb215dcd3f25e Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Sat, 24 Jan 2009 23:07:42 +0100 Subject: [PATCH 22/42] Fixes: Lookup of qualified name ids. --- src/libs/cplusplus/LookupContext.cpp | 41 ++++++++++++++-------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/src/libs/cplusplus/LookupContext.cpp b/src/libs/cplusplus/LookupContext.cpp index 2941489e01c..01d4e13b4eb 100644 --- a/src/libs/cplusplus/LookupContext.cpp +++ b/src/libs/cplusplus/LookupContext.cpp @@ -162,8 +162,26 @@ QList LookupContext::resolve(Name *name, const QList &visible if (QualifiedNameId *q = name->asQualifiedNameId()) { QList candidates; QList scopes = visibleScopes; - Identifier *id = identifier(name); + for (unsigned i = 0; i < q->nameCount(); ++i) { + Name *name = q->nameAt(i); + if (i + 1 == q->nameCount()) + candidates = resolve(name, scopes, mode); + else + candidates = resolveClassOrNamespace(name, scopes); + + if (candidates.isEmpty() || i + 1 == q->nameCount()) + break; + + scopes.clear(); + foreach (Symbol *candidate, candidates) { + if (ScopedSymbol *scoped = candidate->asScopedSymbol()) { + expand(scoped->members(), visibleScopes, &scopes); + } + } + } + + Identifier *id = identifier(name); foreach (Scope *scope, visibleScopes) { Symbol *symbol = scope->lookat(id); for (; symbol; symbol = symbol->next()) { @@ -189,26 +207,7 @@ QList LookupContext::resolve(Name *name, const QList &visible } } - for (unsigned i = 0; i < q->nameCount(); ++i) { - Name *name = q->nameAt(i); - - if (i + 1 == q->nameCount()) - candidates += resolve(name, scopes, mode); - else - candidates += resolveClassOrNamespace(name, scopes); - - if (candidates.isEmpty() || i + 1 == q->nameCount()) - return candidates; - - scopes.clear(); - foreach (Symbol *candidate, candidates) { - if (ScopedSymbol *scoped = candidate->asScopedSymbol()) { - expand(scoped->members(), visibleScopes, &scopes); - } - } - } - - return QList(); + return candidates; } QList candidates; From 24aef0aecce06631156ab87ad596eb2211a2e0d0 Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 26 Jan 2009 10:24:36 +0100 Subject: [PATCH 23/42] Fixes: fakevim: link fix Details: the installHandler() overload was missing an implementation --- src/plugins/fakevim/fakevimplugin.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/plugins/fakevim/fakevimplugin.cpp b/src/plugins/fakevim/fakevimplugin.cpp index 5bf7c32675d..d1ab5b40630 100644 --- a/src/plugins/fakevim/fakevimplugin.cpp +++ b/src/plugins/fakevim/fakevimplugin.cpp @@ -114,7 +114,7 @@ private slots: void editorOpened(Core::IEditor *); void editorAboutToClose(Core::IEditor *); - void installHandler(); + void installHandlerOnCurrentEditor(); void installHandler(Core::IEditor *editor); void removeHandler(); @@ -171,7 +171,7 @@ bool FakeVimPluginPrivate::initialize() advancedMenu->addAction(cmd, Core::Constants::G_EDIT_EDITOR); connect(m_installHandlerAction, SIGNAL(triggered()), - this, SLOT(installHandler())); + this, SLOT(installHandlerOnCurrentEditor())); // EditorManager QObject *editorManager = m_core->editorManager(); @@ -221,6 +221,11 @@ void FakeVimPluginPrivate::installHandler(Core::IEditor *editor) } } +void FakeVimPluginPrivate::installHandlerOnCurrentEditor() +{ + installHandler(EditorManager::instance()->currentEditor()); +} + void FakeVimPluginPrivate::writeFile(bool *handled, const QString &fileName, const QString &contents) { From c97dfb8b32f0135d814c867738f728992e0a00e2 Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 26 Jan 2009 10:31:49 +0100 Subject: [PATCH 24/42] Fixes: fakevim: suppress cursor when in ex mode --- src/plugins/fakevim/fakevimhandler.cpp | 26 +++++++++++--------------- tests/manual/fakevim/main.cpp | 12 ++++++++---- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp index d2825c57959..dbc6a2f26eb 100644 --- a/src/plugins/fakevim/fakevimhandler.cpp +++ b/src/plugins/fakevim/fakevimhandler.cpp @@ -201,7 +201,8 @@ private: int count() const { return mvCount() * opCount(); } int leftDist() const { return m_tc.position() - m_tc.block().position(); } int rightDist() const { return m_tc.block().length() - leftDist() - 1; } - bool atEndOfLine() const { return m_tc.atBlockEnd() && m_tc.block().length()>1; } + bool atEndOfLine() const + { return m_tc.atBlockEnd() && m_tc.block().length() > 1; } int lastPositionInDocument() const; int positionForLine(int line) const; // 1 based line, 0 based pos @@ -218,7 +219,7 @@ private: // helper functions for indenting bool isElectricCharacter(QChar c) const - { return (c == '{' || c == '}' || c == '#'); } + { return c == '{' || c == '}' || c == '#'; } int indentDist() const; void indentRegion(QTextBlock first, QTextBlock last, QChar typedChar=0); void indentCurrentLine(QChar typedChar); @@ -251,6 +252,7 @@ private: void enterInsertMode(); void enterCommandMode(); + void enterExMode(); void showRedMessage(const QString &msg); void showBlackMessage(const QString &msg); void notImplementedYet(); @@ -340,6 +342,7 @@ public: int m_desiredColumn; QPointer m_extraData; + int m_cursorWidth; }; FakeVimHandler::Private::Private(FakeVimHandler *parent, QWidget *widget) @@ -361,6 +364,7 @@ FakeVimHandler::Private::Private(FakeVimHandler *parent, QWidget *widget) m_moveType = MoveInclusive; m_anchor = 0; m_savedYankPosition = 0; + m_cursorWidth = EDITOR(cursorWidth()); m_config[ConfigStartOfLine] = ConfigOn; m_config[ConfigTabStop] = "8"; @@ -419,17 +423,14 @@ bool FakeVimHandler::Private::handleEvent(QKeyEvent *ev) void FakeVimHandler::Private::setupWidget() { enterCommandMode(); + EDITOR(installEventFilter(q)); + //EDITOR(setCursorWidth(QFontMetrics(ed->font()).width(QChar('x'))); if (m_textedit) { - m_textedit->installEventFilter(q); - //m_textedit->setCursorWidth(QFontMetrics(ed->font()).width(QChar('x'))); m_textedit->setLineWrapMode(QTextEdit::NoWrap); - m_wasReadOnly = m_textedit->isReadOnly(); } else if (m_plaintextedit) { - m_plaintextedit->installEventFilter(q); - //plaintextedit->setCursorWidth(QFontMetrics(ed->font()).width(QChar('x'))); m_plaintextedit->setLineWrapMode(QPlainTextEdit::NoWrap); - m_wasReadOnly = m_plaintextedit->isReadOnly(); } + m_wasReadOnly = EDITOR(isReadOnly()); showBlackMessage("vi emulation mode."); updateMiniBuffer(); } @@ -438,13 +439,8 @@ void FakeVimHandler::Private::restoreWidget() { //showBlackMessage(QString()); //updateMiniBuffer(); - if (m_textedit) { - m_textedit->removeEventFilter(q); - m_textedit->setReadOnly(m_wasReadOnly); - } else if (m_plaintextedit) { - m_plaintextedit->removeEventFilter(q); - m_plaintextedit->setReadOnly(m_wasReadOnly); - } + EDITOR(removeEventFilter(q)); + EDITOR(setReadOnly(m_wasReadOnly)); } bool FakeVimHandler::Private::handleKey(int key, int unmodified, const QString &text) diff --git a/tests/manual/fakevim/main.cpp b/tests/manual/fakevim/main.cpp index 9400fcf998f..2de37c10733 100644 --- a/tests/manual/fakevim/main.cpp +++ b/tests/manual/fakevim/main.cpp @@ -50,14 +50,18 @@ int main(int argc, char *argv[]) QString title; bool usePlainTextEdit = args.size() < 2; if (usePlainTextEdit) { - widget = new QPlainTextEdit; + QPlainTextEdit *w = new QPlainTextEdit; + w->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); title = "PlainTextEdit"; + widget = w; } else { - widget = new QTextEdit; + QTextEdit *w = new QTextEdit; + w->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); title = "TextEdit"; + widget = w; } widget->setObjectName("Editor"); - widget->resize(450, 350); + //widget->resize(450, 350); widget->setFocus(); Proxy proxy(widget); @@ -67,7 +71,7 @@ int main(int argc, char *argv[]) QMainWindow mw; mw.setWindowTitle("Fakevim (" + title + ")"); mw.setCentralWidget(widget); - mw.resize(500, 650); + mw.resize(600, 650); mw.move(0, 0); mw.show(); From fb1da77ef5492c4a8e06ceae529e3b2eeb58eb4a Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 26 Jan 2009 10:48:37 +0100 Subject: [PATCH 25/42] Fixes: fakevim: implement ';' Details: also provide an inactive implementaion for ',' --- src/plugins/fakevim/fakevimhandler.cpp | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp index dbc6a2f26eb..8e7dc5100e8 100644 --- a/src/plugins/fakevim/fakevimhandler.cpp +++ b/src/plugins/fakevim/fakevimhandler.cpp @@ -317,6 +317,11 @@ public: // extra data for '.' QString m_dotCommand; + // extra data for ';' + QString m_semicolonCount; + int m_semicolonType; // 'f', 'F', 't', 'T' + int m_semicolonKey; + // history for '/' QString lastSearchString() const; QStringList m_searchHistory; @@ -693,9 +698,11 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified, } m_submode = NoSubMode; } else if (m_subsubmode == FtSubSubMode) { + m_semicolonType = m_subsubdata; + m_semicolonKey = key; handleFfTt(key); m_subsubmode = NoSubSubMode; - finishMovement(QString(QChar(m_subsubdata)) + QChar(key)); + finishMovement(); } else if (m_submode == ReplaceSubMode) { if (count() < rightDist() && text.size() == 1 && (text.at(0).isPrint() || text.at(0).isSpace())) { @@ -733,6 +740,20 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified, } else { m_mvcount.append(QChar(key)); } + } else if (0 && key == ',') { + // FIXME: fakevim uses ',' by itself, so it is incompatible + m_subsubmode = FtSubSubMode; + // HACK: toggle 'f' <-> 'F', 't' <-> 'T' + m_subsubdata = m_semicolonType ^ 32; + handleFfTt(m_semicolonKey); + m_subsubmode = NoSubSubMode; + finishMovement(); + } else if (key == ';') { + m_subsubmode = FtSubSubMode; + m_subsubdata = m_semicolonType; + handleFfTt(m_semicolonKey); + m_subsubmode = NoSubSubMode; + finishMovement(); } else if (key == ':') { m_mode = ExMode; m_commandBuffer.clear(); @@ -1402,8 +1423,10 @@ void FakeVimHandler::Private::handleExCommand(const QString &cmd0) showRedMessage(tr("File '%1' exists (add ! to override)").arg(fileName)); } else if (file1.open(QIODevice::ReadWrite)) { file1.close(); + QTextCursor tc = m_tc; selectRange(beginLine, endLine); QString contents = selectedText(); + m_tc = tc; qDebug() << "LINES: " << beginLine << endLine; bool handled = false; emit q->writeFileRequested(&handled, fileName, contents); From 32b7951b18188d42eb23745315c2a1570b7e2659 Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 26 Jan 2009 10:52:48 +0100 Subject: [PATCH 26/42] Fixes: docs: remove spurious 'you' (spotted by Adrian) --- doc/qtcreator.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/qtcreator.qdoc b/doc/qtcreator.qdoc index eb00ea835f7..6713d82e6d8 100644 --- a/doc/qtcreator.qdoc +++ b/doc/qtcreator.qdoc @@ -1245,7 +1245,7 @@ \bold{Display Signals and Slots} If you have an instance of a class that is derived from QObject, and you - you would like to find all other objects connected to one of your object's + would like to find all other objects connected to one of your object's slots using Qt's signals and slots mechanism -- you can enable \gui{Use Custom Display for Qt Objects} feature under the \gui Debug menu. From 1e6a62942a4da22572a65cfbb8b560344801e6e8 Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 26 Jan 2009 12:08:39 +0100 Subject: [PATCH 27/42] Fixes: fakevim: fix 'y' in visual line mode; also try to hide cursor when in ex mode. --- src/plugins/fakevim/fakevimhandler.cpp | 30 ++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp index 8e7dc5100e8..3b981fa6a23 100644 --- a/src/plugins/fakevim/fakevimhandler.cpp +++ b/src/plugins/fakevim/fakevimhandler.cpp @@ -469,7 +469,7 @@ void FakeVimHandler::Private::finishMovement(const QString &dotCommand) int beginLine = lineForPosition(anchor()); int endLine = lineForPosition(position()); m_tc.setPosition(qMin(anchor(), position())); - m_mode = ExMode; + enterExMode(); m_commandBuffer = QString(".,+%1!").arg(qAbs(endLine - beginLine)); m_commandHistory.append(QString()); m_commandHistoryIndex = m_commandHistory.size() - 1; @@ -755,7 +755,7 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified, m_subsubmode = NoSubSubMode; finishMovement(); } else if (key == ':') { - m_mode = ExMode; + enterExMode(); m_commandBuffer.clear(); if (m_visualMode != NoVisualMode) m_commandBuffer = "'<,'>"; @@ -788,7 +788,7 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified, } else if (key == '!' && m_visualMode == NoVisualMode) { m_submode = FilterSubMode; } else if (key == '!' && m_visualMode == VisualLineMode) { - m_mode = ExMode; + enterExMode(); m_commandBuffer = "'<,'>!"; m_commandHistory.append(QString()); m_commandHistoryIndex = m_commandHistory.size() - 1; @@ -1078,13 +1078,22 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified, recordRemoveSelectedText(); } finishMovement(); - } else if (key == 'y') { + } else if (key == 'y' && m_visualMode == NoVisualMode) { m_savedYankPosition = m_tc.position(); if (atEndOfLine()) moveLeft(); recordBeginGroup(); setAnchor(); m_submode = YankSubMode; + } else if (key == 'y' && m_visualMode == VisualLineMode) { + int beginLine = lineForPosition(m_marks['<']); + int endLine = lineForPosition(m_marks['>']); + selectRange(beginLine, endLine); + m_registers[m_register] = selectedText(); + m_tc.setPosition(qMin(position(), anchor())); + moveToStartOfLine(); + leaveVisualMode(); + updateSelection(); } else if (key == 'Y') { moveToStartOfLine(); setAnchor(); @@ -2030,6 +2039,7 @@ void FakeVimHandler::Private::recordRemove(int position, const QString &data) void FakeVimHandler::Private::enterInsertMode() { + EDITOR(setCursorWidth(m_cursorWidth)); EDITOR(setOverwriteMode(false)); m_mode = InsertMode; m_lastInsertion.clear(); @@ -2038,13 +2048,21 @@ void FakeVimHandler::Private::enterInsertMode() void FakeVimHandler::Private::enterCommandMode() { - if (editor()) - EDITOR(setOverwriteMode(true)); + EDITOR(setCursorWidth(m_cursorWidth)); + EDITOR(setOverwriteMode(true)); m_mode = CommandMode; } +void FakeVimHandler::Private::enterExMode() +{ + EDITOR(setCursorWidth(0)); + EDITOR(setOverwriteMode(false)); + m_mode = ExMode; +} + void FakeVimHandler::Private::quit() { + EDITOR(setCursorWidth(m_cursorWidth)); EDITOR(setOverwriteMode(false)); q->quitRequested(); } From 5fc4fbb197f539c9904c0b3ba3fd7d382aeefa7d Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Mon, 26 Jan 2009 12:58:52 +0100 Subject: [PATCH 28/42] Fixes: Parsing of name ids. --- shared/cplusplus/Parser.cpp | 35 ++++++++++++++++++++--------------- shared/cplusplus/Parser.h | 1 + 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/shared/cplusplus/Parser.cpp b/shared/cplusplus/Parser.cpp index eefa3d5b9fe..f1b057d31ca 100644 --- a/shared/cplusplus/Parser.cpp +++ b/shared/cplusplus/Parser.cpp @@ -2556,24 +2556,12 @@ bool Parser::parsePrimaryExpression(ExpressionAST *&node) return parseQtMethod(node); default: { - unsigned startOfName = cursor(); NameAST *name = 0; - if (parseName(name)) { - if (LA() == T_IDENTIFIER || tok().isLiteral() || (tok().isOperator() && LA() != T_LPAREN && - LA() != T_LBRACKET)) { - rewind(startOfName); - parseName(name, false); - } - // literal - // identifier ? - // identifier - // identifier - // identifier rparen - // lparen type rparen identifier [[cast-expression]] - + if (parseNameId(name)) { node = name; return true; } + break; } // default } // switch @@ -2581,6 +2569,23 @@ bool Parser::parsePrimaryExpression(ExpressionAST *&node) return false; } +bool Parser::parseNameId(NameAST *&name) +{ + unsigned start = cursor(); + if (! parseName(name)) + return false; + + if (LA() == T_IDENTIFIER || + tok().isLiteral() || + (tok().isOperator() && LA() != T_LPAREN && LA() != T_LBRACKET)) + { + rewind(start); + return parseName(name, false); + } + + return false; +} + bool Parser::parseNestedExpression(ExpressionAST *&node) { if (LA() == T_LPAREN) { @@ -2763,7 +2768,7 @@ bool Parser::parsePostfixExpression(ExpressionAST *&node) ast->access_token = consumeToken(); if (LA() == T_TEMPLATE) ast->template_token = consumeToken(); - if (! parseName(ast->member_name)) + if (! parseNameId(ast->member_name)) _translationUnit->error(cursor(), "expected unqualified-id before token `%s'", tok().spell()); *postfix_ptr = ast; diff --git a/shared/cplusplus/Parser.h b/shared/cplusplus/Parser.h index 75fad457fad..d99d8d27fc0 100644 --- a/shared/cplusplus/Parser.h +++ b/shared/cplusplus/Parser.h @@ -141,6 +141,7 @@ public: bool parseMultiplicativeExpression(ExpressionAST *&node); bool parseTemplateId(NameAST *&node); bool parseClassOrNamespaceName(NameAST *&node); + bool parseNameId(NameAST *&node); bool parseName(NameAST *&node, bool acceptTemplateId = true); bool parseNestedNameSpecifier(NestedNameSpecifierAST *&node, bool acceptTemplateId); bool parseNestedNameSpecifierOpt(NestedNameSpecifierAST *&name, bool acceptTemplateId); From f31607b33d2e3c892c880c22d32c49fc04aa8719 Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 26 Jan 2009 13:03:38 +0100 Subject: [PATCH 29/42] Fixes: coreplugin: use UniqueIDManager more directly --- .../actionmanager/actionmanager.cpp | 31 ++++++++++--------- .../actionmanager/actionmanager_p.h | 2 +- src/plugins/coreplugin/mainwindow.cpp | 2 +- 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/src/plugins/coreplugin/actionmanager/actionmanager.cpp b/src/plugins/coreplugin/actionmanager/actionmanager.cpp index b5a1e5cc0c6..f3cf2f9c019 100644 --- a/src/plugins/coreplugin/actionmanager/actionmanager.cpp +++ b/src/plugins/coreplugin/actionmanager/actionmanager.cpp @@ -205,10 +205,11 @@ ActionManagerPrivate* ActionManagerPrivate::m_instance = 0; \internal */ -ActionManagerPrivate::ActionManagerPrivate(MainWindow *mainWnd, UniqueIDManager *uidmgr) : - ActionManager(mainWnd), +ActionManagerPrivate::ActionManagerPrivate(MainWindow *mainWnd) + : ActionManager(mainWnd), m_mainWnd(mainWnd) { + UniqueIDManager *uidmgr = UniqueIDManager::instance(); m_defaultGroups << uidmgr->uniqueIdentifier(Constants::G_DEFAULT_ONE); m_defaultGroups << uidmgr->uniqueIdentifier(Constants::G_DEFAULT_TWO); m_defaultGroups << uidmgr->uniqueIdentifier(Constants::G_DEFAULT_THREE); @@ -258,7 +259,7 @@ void ActionManagerPrivate::setContext(const QList &context) it.value()->setCurrentContext(m_context); const IdContainerMap::const_iterator acend = m_idContainerMap.constEnd(); - for ( IdContainerMap::const_iterator it = m_idContainerMap.constBegin(); it != acend; ++it) + for (IdContainerMap::const_iterator it = m_idContainerMap.constBegin(); it != acend; ++it) it.value()->update(); } @@ -273,7 +274,7 @@ bool ActionManagerPrivate::hasContext(QList context) const ActionContainer *ActionManagerPrivate::createMenu(const QString &id) { - const int uid = m_mainWnd->uniqueIDManager()->uniqueIdentifier(id); + const int uid = UniqueIDManager::instance()->uniqueIdentifier(id); const IdContainerMap::const_iterator it = m_idContainerMap.constFind(uid); if (it != m_idContainerMap.constEnd()) return it.value(); @@ -291,7 +292,7 @@ ActionContainer *ActionManagerPrivate::createMenu(const QString &id) ActionContainer *ActionManagerPrivate::createMenuBar(const QString &id) { - const int uid = m_mainWnd->uniqueIDManager()->uniqueIdentifier(id); + const int uid = UniqueIDManager::instance()->uniqueIdentifier(id); const IdContainerMap::const_iterator it = m_idContainerMap.constFind(uid); if (it != m_idContainerMap.constEnd()) return it.value(); @@ -320,7 +321,7 @@ Command *ActionManagerPrivate::registerAction(QAction *action, const QString &id Command *ActionManagerPrivate::registerOverridableAction(QAction *action, const QString &id, bool checkUnique) { OverrideableAction *a = 0; - const int uid = m_mainWnd->uniqueIDManager()->uniqueIdentifier(id); + const int uid = UniqueIDManager::instance()->uniqueIdentifier(id); if (CommandPrivate *c = m_idCmdMap.value(uid, 0)) { if (c->type() != Command::CT_OverridableAction) { qWarning() << "registerAction: id" << id << "is registered with a different command type."; @@ -366,7 +367,7 @@ Command *ActionManagerPrivate::registerOverridableAction(QAction *action, const Command *ActionManagerPrivate::registerShortcut(QShortcut *shortcut, const QString &id, const QList &context) { Shortcut *sc = 0; - int uid = m_mainWnd->uniqueIDManager()->uniqueIdentifier(id); + int uid = UniqueIDManager::instance()->uniqueIdentifier(id); if (CommandPrivate *c = m_idCmdMap.value(uid, 0)) { if (c->type() != Command::CT_Shortcut) { qWarning() << "registerShortcut: id" << id << "is registered with a different command type."; @@ -402,7 +403,7 @@ Command *ActionManagerPrivate::registerShortcut(QShortcut *shortcut, const QStri Command *ActionManagerPrivate::command(const QString &id) const { - const int uid = m_mainWnd->uniqueIDManager()->uniqueIdentifier(id); + const int uid = UniqueIDManager::instance()->uniqueIdentifier(id); const IdCmdMap::const_iterator it = m_idCmdMap.constFind(uid); if (it == m_idCmdMap.constEnd()) { if (warnAboutFindFailures) @@ -414,9 +415,9 @@ Command *ActionManagerPrivate::command(const QString &id) const ActionContainer *ActionManagerPrivate::actionContainer(const QString &id) const { - const int uid = m_mainWnd->uniqueIDManager()->uniqueIdentifier(id); - const IdContainerMap::const_iterator it = m_idContainerMap.constFind(uid); - if ( it == m_idContainerMap.constEnd()) { + const int uid = UniqueIDManager::instance()->uniqueIdentifier(id); + const IdContainerMap::const_iterator it = m_idContainerMap.constFind(uid); + if (it == m_idContainerMap.constEnd()) { if (warnAboutFindFailures) qWarning() << "ActionManagerPrivate::actionContainer(): failed to find :" << id << '/' << uid; return 0; @@ -429,7 +430,7 @@ Command *ActionManagerPrivate::command(int uid) const const IdCmdMap::const_iterator it = m_idCmdMap.constFind(uid); if (it == m_idCmdMap.constEnd()) { if (warnAboutFindFailures) - qWarning() << "ActionManagerPrivate::command(): failed to find :" << m_mainWnd->uniqueIDManager()->stringForUniqueIdentifier(uid) << '/' << uid; + qWarning() << "ActionManagerPrivate::command(): failed to find :" << UniqueIDManager::instance()->stringForUniqueIdentifier(uid) << '/' << uid; return 0; } return it.value(); @@ -440,7 +441,7 @@ ActionContainer *ActionManagerPrivate::actionContainer(int uid) const const IdContainerMap::const_iterator it = m_idContainerMap.constFind(uid); if (it == m_idContainerMap.constEnd()) { if (warnAboutFindFailures) - qWarning() << "ActionManagerPrivate::actionContainer(): failed to find :" << m_mainWnd->uniqueIDManager()->stringForUniqueIdentifier(uid) << uid; + qWarning() << "ActionManagerPrivate::actionContainer(): failed to find :" << UniqueIDManager::instance()->stringForUniqueIdentifier(uid) << uid; return 0; } return it.value(); @@ -458,7 +459,7 @@ void ActionManagerPrivate::initialize() settings->setArrayIndex(i); const QString sid = settings->value(QLatin1String(idKey)).toString(); const QKeySequence key(settings->value(QLatin1String(sequenceKey)).toString()); - const int id = m_mainWnd->uniqueIDManager()->uniqueIdentifier(sid); + const int id = UniqueIDManager::instance()->uniqueIdentifier(sid); Command *cmd = command(id); if (cmd) @@ -478,7 +479,7 @@ void ActionManagerPrivate::saveSettings(QSettings *settings) CommandPrivate *cmd = j.value(); QKeySequence key = cmd->keySequence(); if (key != cmd->defaultKeySequence()) { - const QString sid = m_mainWnd->uniqueIDManager()->stringForUniqueIdentifier(id); + const QString sid = UniqueIDManager::instance()->stringForUniqueIdentifier(id); settings->setArrayIndex(count); settings->setValue(QLatin1String(idKey), sid); settings->setValue(QLatin1String(sequenceKey), key.toString()); diff --git a/src/plugins/coreplugin/actionmanager/actionmanager_p.h b/src/plugins/coreplugin/actionmanager/actionmanager_p.h index f1e106c4bf7..658d3228cce 100644 --- a/src/plugins/coreplugin/actionmanager/actionmanager_p.h +++ b/src/plugins/coreplugin/actionmanager/actionmanager_p.h @@ -65,7 +65,7 @@ class ActionManagerPrivate : public Core::ActionManager Q_OBJECT public: - ActionManagerPrivate(MainWindow *mainWnd, UniqueIDManager *uidmgr); + explicit ActionManagerPrivate(MainWindow *mainWnd); ~ActionManagerPrivate(); void setContext(const QList &context); diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp index 68cea956947..800d5b4dfdc 100644 --- a/src/plugins/coreplugin/mainwindow.cpp +++ b/src/plugins/coreplugin/mainwindow.cpp @@ -116,7 +116,7 @@ MainWindow::MainWindow() : m_additionalContexts(m_globalContext), m_settings(new QSettings(QSettings::IniFormat, QSettings::UserScope, QLatin1String("Nokia"), QLatin1String("QtCreator"), this)), m_printer(0), - m_actionManager(new ActionManagerPrivate(this, m_uniqueIDManager)), + m_actionManager(new ActionManagerPrivate(this)), m_editorManager(0), m_fileManager(new FileManager(this)), m_progressManager(new ProgressManagerPrivate()), From f68d6cf0a041f266508b1e25894352bfe0dbdaf0 Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 26 Jan 2009 14:13:15 +0100 Subject: [PATCH 30/42] Fixes: rename OutputPane into OutputPaneManager RevBy: dt Details: also clean up the class interface a bit --- src/plugins/coreplugin/mainwindow.cpp | 20 +++--- src/plugins/coreplugin/mainwindow.h | 4 +- src/plugins/coreplugin/outputpane.cpp | 87 ++++++++++++++------------- src/plugins/coreplugin/outputpane.h | 33 +++++----- 4 files changed, 75 insertions(+), 69 deletions(-) diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp index 800d5b4dfdc..f83d63f7a1c 100644 --- a/src/plugins/coreplugin/mainwindow.cpp +++ b/src/plugins/coreplugin/mainwindow.cpp @@ -131,7 +131,6 @@ MainWindow::MainWindow() : m_versionDialog(0), m_activeContext(0), m_pluginManager(0), - m_outputPane(new OutputPane(m_globalContext)), m_outputMode(0), m_generalSettings(new GeneralSettings), m_shortcutSettings(new ShortcutSettings), @@ -150,6 +149,8 @@ MainWindow::MainWindow() : #endif m_toggleSideBarButton(new QToolButton) { + OutputPaneManager::create(); + setWindowTitle(tr("Qt Creator")); qApp->setWindowIcon(QIcon(":/core/images/qtcreator_logo_128.png")); setDockNestingEnabled(true); @@ -247,9 +248,9 @@ MainWindow::~MainWindow() //because they might trigger stuff that tries to access data from editorwindow, like removeContextWidget // All modes are now gone - delete OutputPane::instance(); + OutputPaneManager::destroy(); - // Now that the OutputPane is gone, is a good time to delete the view + // Now that the OutputPaneManager is gone, is a good time to delete the view m_pluginManager->removeObject(m_outputView); delete m_outputView; @@ -299,14 +300,15 @@ bool MainWindow::init(ExtensionSystem::PluginManager *pm, QString *) outputModeWidget->layout()->addWidget(new Core::FindToolBarPlaceHolder(m_outputMode)); outputModeWidget->setFocusProxy(oph); - m_outputMode->setContext(m_outputPane->context()); + m_outputMode->setContext(m_globalContext); m_pluginManager->addObject(m_outputMode); m_pluginManager->addObject(m_generalSettings); m_pluginManager->addObject(m_shortcutSettings); - // Add widget to the bottom, we create the view here instead of inside the OutputPane, since - // the ViewManager needs to be initilized before - m_outputView = new Core::BaseView("OutputWindow.Buttons", m_outputPane->buttonsWidget(), QList(), Core::IView::Second); + // Add widget to the bottom, we create the view here instead of inside the + // OutputPaneManager, since the ViewManager needs to be initilized before + m_outputView = new Core::BaseView("OutputWindow.Buttons", + OutputPaneManager::instance()->buttonsWidget(), QList(), Core::IView::Second); m_pluginManager->addObject(m_outputView); return true; } @@ -318,7 +320,7 @@ void MainWindow::extensionsInitialized() m_viewManager->extensionsInitalized(); m_messageManager->init(m_pluginManager); - m_outputPane->init(m_pluginManager); + OutputPaneManager::instance()->init(); m_actionManager->initialize(); readSettings(); @@ -756,7 +758,7 @@ void MainWindow::setFocusToEditor() if (focusWidget && focusWidget == qApp->focusWidget()) { if (FindToolBarPlaceHolder::getCurrent()) FindToolBarPlaceHolder::getCurrent()->hide(); - m_outputPane->slotHide(); + OutputPaneManager::instance()->slotHide(); RightPaneWidget::instance()->setShown(false); } } diff --git a/src/plugins/coreplugin/mainwindow.h b/src/plugins/coreplugin/mainwindow.h index 4fa8f7472c1..32513092dc5 100644 --- a/src/plugins/coreplugin/mainwindow.h +++ b/src/plugins/coreplugin/mainwindow.h @@ -80,13 +80,12 @@ class CoreImpl; class FancyTabWidget; class GeneralSettings; class NavigationWidget; -class OutputPane; class ProgressManagerPrivate; class ShortcutSettings; class ViewManager; class VersionDialog; -class CORE_EXPORT MainWindow : public QMainWindow +class CORE_EXPORT MainWindow : public QMainWindow { Q_OBJECT @@ -198,7 +197,6 @@ private: ExtensionSystem::PluginManager *m_pluginManager; - OutputPane *m_outputPane; BaseMode *m_outputMode; GeneralSettings *m_generalSettings; ShortcutSettings *m_shortcutSettings; diff --git a/src/plugins/coreplugin/outputpane.cpp b/src/plugins/coreplugin/outputpane.cpp index 52dec2a22ff..f983f5b15d9 100644 --- a/src/plugins/coreplugin/outputpane.cpp +++ b/src/plugins/coreplugin/outputpane.cpp @@ -81,7 +81,7 @@ private: OutputPanePlaceHolder *OutputPanePlaceHolder::m_current = 0; OutputPanePlaceHolder::OutputPanePlaceHolder(Core::IMode *mode, QWidget *parent) - :QWidget(parent), m_mode(mode), m_closeable(true) + : QWidget(parent), m_mode(mode), m_closeable(true) { setVisible(false); setLayout(new QVBoxLayout); @@ -98,8 +98,8 @@ OutputPanePlaceHolder::OutputPanePlaceHolder(Core::IMode *mode, QWidget *parent) OutputPanePlaceHolder::~OutputPanePlaceHolder() { if (m_current == this) { - OutputPane::instance()->setParent(0); - OutputPane::instance()->hide(); + OutputPaneManager::instance()->setParent(0); + OutputPaneManager::instance()->hide(); } } @@ -117,45 +117,54 @@ void OutputPanePlaceHolder::currentModeChanged(Core::IMode *mode) { if (m_current == this) { m_current = 0; - OutputPane::instance()->setParent(0); - OutputPane::instance()->hide(); - OutputPane::instance()->updateStatusButtons(false); + OutputPaneManager::instance()->setParent(0); + OutputPaneManager::instance()->hide(); + OutputPaneManager::instance()->updateStatusButtons(false); } if (m_mode == mode) { m_current = this; - layout()->addWidget(OutputPane::instance()); - OutputPane::instance()->show(); - OutputPane::instance()->updateStatusButtons(isVisible()); - OutputPane::instance()->setCloseable(m_closeable); + layout()->addWidget(OutputPaneManager::instance()); + OutputPaneManager::instance()->show(); + OutputPaneManager::instance()->updateStatusButtons(isVisible()); + OutputPaneManager::instance()->setCloseable(m_closeable); } } //// -// OutputPane +// OutputPaneManager //// -OutputPane *OutputPane::m_instance = 0; +static OutputPaneManager *m_instance = 0; -OutputPane *OutputPane::instance() +void OutputPaneManager::create() +{ + m_instance = new OutputPaneManager; +} + +void OutputPaneManager::destroy() +{ + delete m_instance; + m_instance = 0; +} + +OutputPaneManager *OutputPaneManager::instance() { return m_instance; } -void OutputPane::updateStatusButtons(bool visible) +void OutputPaneManager::updateStatusButtons(bool visible) { int idx = m_widgetComboBox->itemData(m_widgetComboBox->currentIndex()).toInt(); if (m_buttons.value(idx)) m_buttons.value(idx)->setChecked(visible); } -OutputPane::OutputPane(const QList &context, QWidget *parent) : +OutputPaneManager::OutputPaneManager(QWidget *parent) : QWidget(parent), - m_context(context), m_widgetComboBox(new QComboBox), m_clearButton(new QToolButton), m_closeButton(new QToolButton), m_closeAction(0), - m_pluginManager(0), m_lastIndex(-1), m_outputWidgetPane(new QStackedWidget), m_opToolBarWidgets(new QStackedWidget) @@ -191,24 +200,19 @@ OutputPane::OutputPane(const QList &context, QWidget *parent) : #else m_buttonsWidget->layout()->setSpacing(4); #endif - - m_instance = this; } -OutputPane::~OutputPane() +OutputPaneManager::~OutputPaneManager() { - m_instance = 0; } -QWidget *OutputPane::buttonsWidget() +QWidget *OutputPaneManager::buttonsWidget() { return m_buttonsWidget; } -void OutputPane::init(ExtensionSystem::PluginManager *pm) +void OutputPaneManager::init() { - m_pluginManager = pm; - ActionManager *am = Core::ICore::instance()->actionManager(); ActionContainer *mwindow = am->actionContainer(Constants::M_WINDOW); @@ -217,7 +221,8 @@ void OutputPane::init(ExtensionSystem::PluginManager *pm) mwindow->addMenu(mpanes, Constants::G_WINDOW_PANES); mpanes->menu()->setTitle(tr("Output &Panes")); - QList panes = m_pluginManager->getObjects(); + QList panes = ExtensionSystem::PluginManager::instance() + ->getObjects(); QMultiMap sorted; foreach (IOutputPane* outPane, panes) sorted.insertMulti(outPane->priorityInStatusBar(), outPane); @@ -251,7 +256,7 @@ void OutputPane::init(ExtensionSystem::PluginManager *pm) actionId.remove(QLatin1Char(' ')); QAction *action = new QAction(outPane->name(), this); - Command *cmd = am->registerAction(action, actionId, m_context); + Command *cmd = am->registerAction(action, actionId, QList() << Constants::C_GLOBAL_ID); if (outPane->priorityInStatusBar() != -1) { #ifdef Q_OS_MAC cmd->setDefaultKeySequence(QKeySequence("Ctrl+" + QString::number(shortcutNumber))); @@ -281,7 +286,7 @@ void OutputPane::init(ExtensionSystem::PluginManager *pm) changePage(); } -void OutputPane::shortcutTriggered() +void OutputPaneManager::shortcutTriggered() { QAction *action = qobject_cast(sender()); if (action && m_actions.contains(action)) { @@ -305,7 +310,7 @@ void OutputPane::shortcutTriggered() } } -void OutputPane::buttonTriggered() +void OutputPaneManager::buttonTriggered() { QPushButton *button = qobject_cast(sender()); QMap::const_iterator it, end; @@ -327,7 +332,7 @@ void OutputPane::buttonTriggered() } } -void OutputPane::updateToolTip() +void OutputPaneManager::updateToolTip() { QAction *action = qobject_cast(sender()); if (action) { @@ -337,7 +342,7 @@ void OutputPane::updateToolTip() } } -void OutputPane::slotHide() +void OutputPaneManager::slotHide() { if (OutputPanePlaceHolder::m_current) { OutputPanePlaceHolder::m_current->setVisible(false); @@ -350,7 +355,7 @@ void OutputPane::slotHide() } } -int OutputPane::findIndexForPage(IOutputPane *out) +int OutputPaneManager::findIndexForPage(IOutputPane *out) { if (!out) return -1; @@ -370,7 +375,7 @@ int OutputPane::findIndexForPage(IOutputPane *out) return -1; } -void OutputPane::ensurePageVisible(int idx) +void OutputPaneManager::ensurePageVisible(int idx) { if (m_widgetComboBox->itemData(m_widgetComboBox->currentIndex()).toInt() != idx) { m_widgetComboBox->setCurrentIndex(m_widgetComboBox->findData(idx)); @@ -380,13 +385,13 @@ void OutputPane::ensurePageVisible(int idx) } -void OutputPane::showPage(bool focus) +void OutputPaneManager::showPage(bool focus) { int idx = findIndexForPage(qobject_cast(sender())); showPage(idx, focus); } -void OutputPane::showPage(int idx, bool focus) +void OutputPaneManager::showPage(int idx, bool focus) { IOutputPane *out = m_pageMap.value(idx); if (idx > -1) { @@ -405,7 +410,7 @@ void OutputPane::showPage(int idx, bool focus) } } -void OutputPane::togglePage(bool focus) +void OutputPaneManager::togglePage(bool focus) { int idx = findIndexForPage(qobject_cast(sender())); if (OutputPanePlaceHolder::m_current @@ -417,23 +422,23 @@ void OutputPane::togglePage(bool focus) } } -void OutputPane::setCloseable(bool b) +void OutputPaneManager::setCloseable(bool b) { m_closeAction->setVisible(b); } -bool OutputPane::closeable() +bool OutputPaneManager::closeable() { return m_closeButton->isVisibleTo(m_closeButton->parentWidget()); } -void OutputPane::focusInEvent(QFocusEvent *e) +void OutputPaneManager::focusInEvent(QFocusEvent *e) { if (m_outputWidgetPane->currentWidget()) m_outputWidgetPane->currentWidget()->setFocus(e->reason()); } -void OutputPane::changePage() +void OutputPaneManager::changePage() { if (m_outputWidgetPane->count() <= 0) return; @@ -470,7 +475,7 @@ void OutputPane::changePage() m_lastIndex = idx; } -void OutputPane::clearPage() +void OutputPaneManager::clearPage() { if (m_pageMap.contains(m_outputWidgetPane->currentIndex())) m_pageMap.value(m_outputWidgetPane->currentIndex())->clearContents(); diff --git a/src/plugins/coreplugin/outputpane.h b/src/plugins/coreplugin/outputpane.h index 8505b34bfa8..3d105e377e3 100644 --- a/src/plugins/coreplugin/outputpane.h +++ b/src/plugins/coreplugin/outputpane.h @@ -47,21 +47,20 @@ class QStackedWidget; class QPushButton; QT_END_NAMESPACE -namespace ExtensionSystem { class PluginManager; } - namespace Core { class IMode; class IOutputPane; namespace Internal { -class OutputPane; +class OutputPaneManager; +class MainWindow; } class CORE_EXPORT OutputPanePlaceHolder : public QWidget { - friend class Core::Internal::OutputPane; // needs to set m_visible and thus access m_current + friend class Core::Internal::OutputPaneManager; // needs to set m_visible and thus access m_current Q_OBJECT public: OutputPanePlaceHolder(Core::IMode *mode, QWidget *parent = 0); @@ -80,17 +79,13 @@ private: namespace Internal { -class OutputPane - : public QWidget +class OutputPaneManager : public QWidget { Q_OBJECT public: - OutputPane(const QList &context, QWidget *parent = 0); - ~OutputPane(); - void init(ExtensionSystem::PluginManager *pm); - static OutputPane *instance(); - const QList &context() const { return m_context; } + void init(); + static OutputPaneManager *instance(); void setCloseable(bool b); bool closeable(); QWidget *buttonsWidget(); @@ -103,7 +98,7 @@ public slots: protected: void focusInEvent(QFocusEvent *e); -private slots:; +private slots: void changePage(); void showPage(bool focus); void togglePage(bool focus); @@ -112,17 +107,23 @@ private slots:; void buttonTriggered(); private: + // the only class that is allowed to create and destroy + friend class MainWindow; + + static void create(); + static void destroy(); + + OutputPaneManager(QWidget *parent = 0); + ~OutputPaneManager(); + void showPage(int idx, bool focus); void ensurePageVisible(int idx); int findIndexForPage(IOutputPane *out); - const QList m_context; QComboBox *m_widgetComboBox; QToolButton *m_clearButton; QToolButton *m_closeButton; QAction *m_closeAction; - ExtensionSystem::PluginManager *m_pluginManager; - QMap m_pageMap; int m_lastIndex; @@ -132,7 +133,7 @@ private: QMap m_buttons; QMap m_actions; - static OutputPane *m_instance; + static OutputPaneManager *m_instance; }; } // namespace Internal From f9679651e1b8862db38f3a474e58e602faa8cd4f Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 26 Jan 2009 14:25:03 +0100 Subject: [PATCH 31/42] Fixes: coreplugin: remove more PluginManager parameters Details: access PluginManager::instance() instead --- src/plugins/coreplugin/coreimpl.cpp | 5 --- src/plugins/coreplugin/coreimpl.h | 1 - src/plugins/coreplugin/coreplugin.cpp | 8 ++--- src/plugins/coreplugin/coreplugin.h | 4 +-- src/plugins/coreplugin/mainwindow.cpp | 37 +++++++++++------------ src/plugins/coreplugin/mainwindow.h | 10 +----- src/plugins/coreplugin/messagemanager.cpp | 12 ++++---- src/plugins/coreplugin/messagemanager.h | 5 +-- src/plugins/coreplugin/viewmanager.cpp | 3 +- 9 files changed, 32 insertions(+), 53 deletions(-) diff --git a/src/plugins/coreplugin/coreimpl.cpp b/src/plugins/coreplugin/coreimpl.cpp index e9a3799d628..626eca58775 100644 --- a/src/plugins/coreplugin/coreimpl.cpp +++ b/src/plugins/coreplugin/coreimpl.cpp @@ -93,11 +93,6 @@ MessageManager *CoreImpl::messageManager() const return m_mainwindow->messageManager(); } -ExtensionSystem::PluginManager *CoreImpl::pluginManager() const -{ - return m_mainwindow->pluginManager(); -} - EditorManager *CoreImpl::editorManager() const { return m_mainwindow->editorManager(); diff --git a/src/plugins/coreplugin/coreimpl.h b/src/plugins/coreplugin/coreimpl.h index a845a4b9905..25e8878d106 100644 --- a/src/plugins/coreplugin/coreimpl.h +++ b/src/plugins/coreplugin/coreimpl.h @@ -58,7 +58,6 @@ public: FileManager *fileManager() const ; UniqueIDManager *uniqueIDManager() const; MessageManager *messageManager() const; - ExtensionSystem::PluginManager *pluginManager() const; EditorManager *editorManager() const; ProgressManager *progressManager() const; ScriptManager *scriptManager() const; diff --git a/src/plugins/coreplugin/coreplugin.cpp b/src/plugins/coreplugin/coreplugin.cpp index c6bc596b282..db58f7d721c 100644 --- a/src/plugins/coreplugin/coreplugin.cpp +++ b/src/plugins/coreplugin/coreplugin.cpp @@ -50,7 +50,7 @@ using namespace Core::Internal; CorePlugin::CorePlugin() : - m_mainWindow(new MainWindow), m_welcomeMode(0), m_editMode(0), m_pm(0) + m_mainWindow(new MainWindow), m_welcomeMode(0), m_editMode(0) { } @@ -71,10 +71,10 @@ CorePlugin::~CorePlugin() delete m_mainWindow; } -bool CorePlugin::initialize(const QStringList & /*arguments*/, QString *error_message) +bool CorePlugin::initialize(const QStringList &arguments, QString *errorMessage) { - m_pm = ExtensionSystem::PluginManager::instance(); - const bool success = m_mainWindow->init(m_pm, error_message); + Q_UNUSED(arguments); + const bool success = m_mainWindow->init(errorMessage); if (success) { #if !defined(QT_NO_WEBKIT) QWebSettings *webSettings = QWebSettings::globalSettings(); diff --git a/src/plugins/coreplugin/coreplugin.h b/src/plugins/coreplugin/coreplugin.h index 020f407829a..b2aff60bca1 100644 --- a/src/plugins/coreplugin/coreplugin.h +++ b/src/plugins/coreplugin/coreplugin.h @@ -51,7 +51,7 @@ public: CorePlugin(); ~CorePlugin(); - bool initialize(const QStringList &arguments, QString *error_message = 0); + bool initialize(const QStringList &arguments, QString *errorMessage = 0); void extensionsInitialized(); public slots: @@ -61,8 +61,6 @@ private: MainWindow *m_mainWindow; WelcomeMode *m_welcomeMode; EditMode *m_editMode; - - ExtensionSystem::PluginManager *m_pm; }; } // namespace Internal diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp index f83d63f7a1c..fb5ac9c3ae7 100644 --- a/src/plugins/coreplugin/mainwindow.cpp +++ b/src/plugins/coreplugin/mainwindow.cpp @@ -130,7 +130,6 @@ MainWindow::MainWindow() : m_rightPaneWidget(0), m_versionDialog(0), m_activeContext(0), - m_pluginManager(0), m_outputMode(0), m_generalSettings(new GeneralSettings), m_shortcutSettings(new ShortcutSettings), @@ -225,8 +224,9 @@ void MainWindow::setSuppressNavigationWidget(bool suppress) MainWindow::~MainWindow() { hide(); - m_pluginManager->removeObject(m_shortcutSettings); - m_pluginManager->removeObject(m_generalSettings); + ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); + pm->removeObject(m_shortcutSettings); + pm->removeObject(m_generalSettings); delete m_messageManager; m_messageManager = 0; delete m_shortcutSettings; @@ -241,7 +241,7 @@ MainWindow::~MainWindow() m_uniqueIDManager = 0; delete m_vcsManager; m_vcsManager = 0; - m_pluginManager->removeObject(m_outputMode); + pm->removeObject(m_outputMode); delete m_outputMode; m_outputMode = 0; //we need to delete editormanager and viewmanager explicitly before the end of the destructor, @@ -251,7 +251,7 @@ MainWindow::~MainWindow() OutputPaneManager::destroy(); // Now that the OutputPaneManager is gone, is a good time to delete the view - m_pluginManager->removeObject(m_outputView); + pm->removeObject(m_outputView); delete m_outputView; delete m_editorManager; @@ -260,7 +260,7 @@ MainWindow::~MainWindow() m_viewManager = 0; delete m_progressManager; m_progressManager = 0; - m_pluginManager->removeObject(m_coreImpl); + pm->removeObject(m_coreImpl); delete m_coreImpl; m_coreImpl = 0; @@ -276,10 +276,12 @@ MainWindow::~MainWindow() m_mimeDatabase = 0; } -bool MainWindow::init(ExtensionSystem::PluginManager *pm, QString *) +bool MainWindow::init(QString *errorMessage) { - m_pluginManager = pm; - m_pluginManager->addObject(m_coreImpl); + Q_UNUSED(errorMessage); + + ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); + pm->addObject(m_coreImpl); m_viewManager->init(); m_modeManager->init(); m_progressManager->init(); @@ -301,15 +303,15 @@ bool MainWindow::init(ExtensionSystem::PluginManager *pm, QString *) outputModeWidget->setFocusProxy(oph); m_outputMode->setContext(m_globalContext); - m_pluginManager->addObject(m_outputMode); - m_pluginManager->addObject(m_generalSettings); - m_pluginManager->addObject(m_shortcutSettings); + pm->addObject(m_outputMode); + pm->addObject(m_generalSettings); + pm->addObject(m_shortcutSettings); // Add widget to the bottom, we create the view here instead of inside the // OutputPaneManager, since the ViewManager needs to be initilized before m_outputView = new Core::BaseView("OutputWindow.Buttons", OutputPaneManager::instance()->buttonsWidget(), QList(), Core::IView::Second); - m_pluginManager->addObject(m_outputView); + pm->addObject(m_outputView); return true; } @@ -319,7 +321,7 @@ void MainWindow::extensionsInitialized() m_viewManager->extensionsInitalized(); - m_messageManager->init(m_pluginManager); + m_messageManager->init(); OutputPaneManager::instance()->init(); m_actionManager->initialize(); @@ -343,7 +345,7 @@ void MainWindow::closeEvent(QCloseEvent *event) } const QList listeners = - pluginManager()->getObjects(); + ExtensionSystem::PluginManager::instance()->getObjects(); foreach (ICoreListener *listener, listeners) { if (!listener->coreAboutToClose()) { event->ignore(); @@ -885,11 +887,6 @@ MimeDatabase *MainWindow::mimeDatabase() const return m_mimeDatabase; } -ExtensionSystem::PluginManager *MainWindow::pluginManager() const -{ - return m_pluginManager; -} - IContext *MainWindow::contextObject(QWidget *widget) { return m_contextWidgets.value(widget); diff --git a/src/plugins/coreplugin/mainwindow.h b/src/plugins/coreplugin/mainwindow.h index 32513092dc5..c0203a2af37 100644 --- a/src/plugins/coreplugin/mainwindow.h +++ b/src/plugins/coreplugin/mainwindow.h @@ -49,10 +49,6 @@ class QSettings; class QShortcut; QT_END_NAMESPACE -namespace ExtensionSystem { -class PluginManager; -} - namespace Core { class ActionManager; @@ -93,7 +89,7 @@ public: MainWindow(); ~MainWindow(); - bool init(ExtensionSystem::PluginManager *pm, QString *error_message); + bool init(QString *errorMessage); void extensionsInitialized(); IContext *contextObject(QWidget *widget); @@ -103,12 +99,10 @@ public: void openFiles(const QStringList &fileNames); - inline ExtensionSystem::PluginManager *pluginManager() { return m_pluginManager; } Core::ActionManager *actionManager() const; Core::FileManager *fileManager() const; Core::UniqueIDManager *uniqueIDManager() const; Core::MessageManager *messageManager() const; - ExtensionSystem::PluginManager *pluginManager() const; Core::EditorManager *editorManager() const; Core::ProgressManager *progressManager() const; Core::ScriptManager *scriptManager() const; @@ -195,8 +189,6 @@ private: QMap m_contextWidgets; - ExtensionSystem::PluginManager *m_pluginManager; - BaseMode *m_outputMode; GeneralSettings *m_generalSettings; ShortcutSettings *m_shortcutSettings; diff --git a/src/plugins/coreplugin/messagemanager.cpp b/src/plugins/coreplugin/messagemanager.cpp index 1b74995ef4d..255a92de085 100644 --- a/src/plugins/coreplugin/messagemanager.cpp +++ b/src/plugins/coreplugin/messagemanager.cpp @@ -44,26 +44,26 @@ using namespace Core; MessageManager *MessageManager::m_instance = 0; MessageManager::MessageManager() - : m_pm(0), m_messageOutputWindow(0) + : m_messageOutputWindow(0) { m_instance = this; } MessageManager::~MessageManager() { - if (m_pm && m_messageOutputWindow) { - m_pm->removeObject(m_messageOutputWindow); + ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); + if (pm && m_messageOutputWindow) { + pm->removeObject(m_messageOutputWindow); delete m_messageOutputWindow; } m_instance = 0; } -void MessageManager::init(ExtensionSystem::PluginManager *pm) +void MessageManager::init() { - m_pm = pm; m_messageOutputWindow = new Internal::MessageOutputWindow; - pm->addObject(m_messageOutputWindow); + ExtensionSystem::PluginManager::instance()->addObject(m_messageOutputWindow); } void MessageManager::showOutputPane() diff --git a/src/plugins/coreplugin/messagemanager.h b/src/plugins/coreplugin/messagemanager.h index 12a1524cb47..7f9716b78e4 100644 --- a/src/plugins/coreplugin/messagemanager.h +++ b/src/plugins/coreplugin/messagemanager.h @@ -37,8 +37,6 @@ #include "core_global.h" #include -namespace ExtensionSystem { class PluginManager; } - namespace Core { namespace Internal { @@ -53,7 +51,7 @@ public: MessageManager(); ~MessageManager(); - void init(ExtensionSystem::PluginManager *pm); + void init(); static MessageManager *instance() { return m_instance; } @@ -64,7 +62,6 @@ public slots: void printToOutputPane(const QString &text, bool bringToForeground = true); private: - ExtensionSystem::PluginManager *m_pm; Internal::MessageOutputWindow *m_messageOutputWindow; static MessageManager *m_instance; diff --git a/src/plugins/coreplugin/viewmanager.cpp b/src/plugins/coreplugin/viewmanager.cpp index 052e2dee522..b0663d63f4e 100644 --- a/src/plugins/coreplugin/viewmanager.cpp +++ b/src/plugins/coreplugin/viewmanager.cpp @@ -115,7 +115,8 @@ void ViewManager::saveSettings(QSettings *settings) IView *ViewManager::view(const QString &id) { - QList list = m_mainWnd->pluginManager()->getObjects(); + QList list = + ExtensionSystem::PluginManager::instance()->getObjects(); foreach (IView *view, list) { if (view->uniqueViewName() == id) return view; From 191f182ec459e1c34f32ff6edb75a83d7e13cbff Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Mon, 26 Jan 2009 14:28:44 +0100 Subject: [PATCH 32/42] Fixed: Typo in parseNameId(). We need to return true on success :-) --- shared/cplusplus/Parser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared/cplusplus/Parser.cpp b/shared/cplusplus/Parser.cpp index f1b057d31ca..085c8cb54ef 100644 --- a/shared/cplusplus/Parser.cpp +++ b/shared/cplusplus/Parser.cpp @@ -2583,7 +2583,7 @@ bool Parser::parseNameId(NameAST *&name) return parseName(name, false); } - return false; + return true; } bool Parser::parseNestedExpression(ExpressionAST *&node) From 1a621a9c9e7507679d0d980583f60615c23b3b11 Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 26 Jan 2009 14:30:04 +0100 Subject: [PATCH 33/42] Fixes: coreplugin: remove a few more PluginManager* parameters --- src/plugins/coreplugin/mainwindow.cpp | 2 +- src/plugins/coreplugin/outputpane.h | 2 -- src/plugins/coreplugin/plugindialog.cpp | 4 ++-- src/plugins/coreplugin/plugindialog.h | 3 +-- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp index fb5ac9c3ae7..f5e131b98b1 100644 --- a/src/plugins/coreplugin/mainwindow.cpp +++ b/src/plugins/coreplugin/mainwindow.cpp @@ -1114,7 +1114,7 @@ void MainWindow::destroyVersionDialog() void MainWindow::aboutPlugins() { - PluginDialog dialog(ExtensionSystem::PluginManager::instance(), this); + PluginDialog dialog(this); dialog.exec(); } diff --git a/src/plugins/coreplugin/outputpane.h b/src/plugins/coreplugin/outputpane.h index 3d105e377e3..b947b12aef2 100644 --- a/src/plugins/coreplugin/outputpane.h +++ b/src/plugins/coreplugin/outputpane.h @@ -132,8 +132,6 @@ private: QWidget *m_buttonsWidget; QMap m_buttons; QMap m_actions; - - static OutputPaneManager *m_instance; }; } // namespace Internal diff --git a/src/plugins/coreplugin/plugindialog.cpp b/src/plugins/coreplugin/plugindialog.cpp index 29ea470411c..3bd7dc2a03a 100644 --- a/src/plugins/coreplugin/plugindialog.cpp +++ b/src/plugins/coreplugin/plugindialog.cpp @@ -48,9 +48,9 @@ using namespace Core::Internal; -PluginDialog::PluginDialog(ExtensionSystem::PluginManager *manager, QWidget *parent) +PluginDialog::PluginDialog(QWidget *parent) : QDialog(parent), - m_view(new ExtensionSystem::PluginView(manager, this)) + m_view(new ExtensionSystem::PluginView(ExtensionSystem::PluginManager::instance(), this)) { QVBoxLayout *vl = new QVBoxLayout(this); vl->addWidget(m_view); diff --git a/src/plugins/coreplugin/plugindialog.h b/src/plugins/coreplugin/plugindialog.h index ace03bb3c17..808490d94c1 100644 --- a/src/plugins/coreplugin/plugindialog.h +++ b/src/plugins/coreplugin/plugindialog.h @@ -41,7 +41,6 @@ class QPushButton; QT_END_NAMESPACE namespace ExtensionSystem { -class PluginManager; class PluginSpec; class PluginView; } @@ -54,7 +53,7 @@ class PluginDialog : public QDialog Q_OBJECT public: - PluginDialog(ExtensionSystem::PluginManager *manager, QWidget *parent); + explicit PluginDialog(QWidget *parent); private slots: void updateButtons(); From 18952c98b9436e49f849edfd2c4918c36165cc65 Mon Sep 17 00:00:00 2001 From: Adam Majer Date: Mon, 26 Jan 2009 13:14:28 +0100 Subject: [PATCH 34/42] Add explicit option to clean indentation It is desirable to have removal of trailing whitespace as a separate option to "tab cleanup". Clean Whitespace option without Clean Indentation option will now only remove trailing whitespace on file save and on Clean Whitespace requests. Clean Indentation option is set to true by default to maintain backward compatibility. Signed-off-by: Adam Majer --- src/plugins/texteditor/basetextdocument.cpp | 2 +- .../texteditor/generalsettingspage.cpp | 2 ++ src/plugins/texteditor/generalsettingspage.ui | 36 +++++++++++++++++++ src/plugins/texteditor/storagesettings.cpp | 9 +++-- src/plugins/texteditor/storagesettings.h | 1 + 5 files changed, 47 insertions(+), 3 deletions(-) diff --git a/src/plugins/texteditor/basetextdocument.cpp b/src/plugins/texteditor/basetextdocument.cpp index eb6069df6d9..d782ed5ace2 100644 --- a/src/plugins/texteditor/basetextdocument.cpp +++ b/src/plugins/texteditor/basetextdocument.cpp @@ -330,7 +330,7 @@ void BaseTextDocument::cleanWhitespace(QTextCursor& cursor, bool inEntireDocumen cursor.movePosition(QTextCursor::PreviousCharacter, QTextCursor::KeepAnchor, trailing); cursor.removeSelectedText(); } - if (!m_tabSettings.isIndentationClean(blockText)) { + if (m_storageSettings.m_cleanIndentation && !m_tabSettings.isIndentationClean(blockText)) { cursor.setPosition(block.position()); int firstNonSpace = m_tabSettings.firstNonSpace(blockText); if (firstNonSpace == blockText.length()) { diff --git a/src/plugins/texteditor/generalsettingspage.cpp b/src/plugins/texteditor/generalsettingspage.cpp index 7482080ab95..28400d10ebf 100644 --- a/src/plugins/texteditor/generalsettingspage.cpp +++ b/src/plugins/texteditor/generalsettingspage.cpp @@ -162,6 +162,7 @@ void GeneralSettingsPage::settingsFromUI(TabSettings &rc, storageSettings.m_cleanWhitespace = m_d->m_page.cleanWhitespace->isChecked(); storageSettings.m_inEntireDocument = m_d->m_page.inEntireDocument->isChecked(); + storageSettings.m_cleanIndentation = m_d->m_page.cleanIndentation->isChecked(); storageSettings.m_addFinalNewLine = m_d->m_page.addFinalNewLine->isChecked(); displaySettings.m_displayLineNumbers = m_d->m_page.displayLineNumbers->isChecked(); @@ -187,6 +188,7 @@ void GeneralSettingsPage::settingsToUI() StorageSettings storageSettings = m_d->m_storageSettings; m_d->m_page.cleanWhitespace->setChecked(storageSettings.m_cleanWhitespace); m_d->m_page.inEntireDocument->setChecked(storageSettings.m_inEntireDocument); + m_d->m_page.cleanIndentation->setChecked(storageSettings.m_cleanIndentation); m_d->m_page.addFinalNewLine->setChecked(storageSettings.m_addFinalNewLine); DisplaySettings displaySettings = m_d->m_displaySettings; diff --git a/src/plugins/texteditor/generalsettingspage.ui b/src/plugins/texteditor/generalsettingspage.ui index 58b6bdbc0aa..301ee8bdf55 100644 --- a/src/plugins/texteditor/generalsettingspage.ui +++ b/src/plugins/texteditor/generalsettingspage.ui @@ -214,6 +214,36 @@
+ + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 30 + 20 + + + + + + + + false + + + Clean indentation + + + + + @@ -338,6 +368,12 @@ + + cleanWhitespace + toggled(bool) + cleanIndentation + setEnabled(bool) + showWrapColumn toggled(bool) diff --git a/src/plugins/texteditor/storagesettings.cpp b/src/plugins/texteditor/storagesettings.cpp index b92b4973450..c14a28ae6a4 100644 --- a/src/plugins/texteditor/storagesettings.cpp +++ b/src/plugins/texteditor/storagesettings.cpp @@ -41,12 +41,14 @@ namespace TextEditor { static const char * const cleanWhitespaceKey = "cleanWhitespace"; static const char * const inEntireDocumentKey = "inEntireDocument"; static const char * const addFinalNewLineKey = "addFinalNewLine"; +static const char * const cleanIndentationKey = "cleanIndentation"; static const char * const groupPostfix = "StorageSettings"; StorageSettings::StorageSettings() : m_cleanWhitespace(true), m_inEntireDocument(false), - m_addFinalNewLine(true) + m_addFinalNewLine(true), + m_cleanIndentation(true) { } @@ -59,6 +61,7 @@ void StorageSettings::toSettings(const QString &category, QSettings *s) const s->setValue(QLatin1String(cleanWhitespaceKey), m_cleanWhitespace); s->setValue(QLatin1String(inEntireDocumentKey), m_inEntireDocument); s->setValue(QLatin1String(addFinalNewLineKey), m_addFinalNewLine); + s->setValue(QLatin1String(cleanIndentationKey), m_cleanIndentation); s->endGroup(); } @@ -71,13 +74,15 @@ void StorageSettings::fromSettings(const QString &category, const QSettings *s) m_cleanWhitespace = s->value(group + QLatin1String(cleanWhitespaceKey), m_cleanWhitespace).toBool(); m_inEntireDocument = s->value(group + QLatin1String(inEntireDocumentKey), m_inEntireDocument).toBool(); m_addFinalNewLine = s->value(group + QLatin1String(addFinalNewLineKey), m_addFinalNewLine).toBool(); + m_cleanIndentation = s->value(group + QLatin1String(cleanIndentationKey), m_cleanIndentation).toBool(); } bool StorageSettings::equals(const StorageSettings &ts) const { return m_addFinalNewLine == ts.m_addFinalNewLine && m_cleanWhitespace == ts.m_cleanWhitespace - && m_inEntireDocument == ts.m_inEntireDocument; + && m_inEntireDocument == ts.m_inEntireDocument + && m_cleanIndentation == ts.m_cleanIndentation; } } // namespace TextEditor diff --git a/src/plugins/texteditor/storagesettings.h b/src/plugins/texteditor/storagesettings.h index d90b462d321..4fca30b284d 100644 --- a/src/plugins/texteditor/storagesettings.h +++ b/src/plugins/texteditor/storagesettings.h @@ -54,6 +54,7 @@ struct TEXTEDITOR_EXPORT StorageSettings bool m_cleanWhitespace; bool m_inEntireDocument; bool m_addFinalNewLine; + bool m_cleanIndentation; }; inline bool operator==(const StorageSettings &t1, const StorageSettings &t2) { return t1.equals(t2); } From f37360d0fab1d908af99d0a300bde1cd9dfbfdaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= Date: Mon, 26 Jan 2009 13:39:24 +0100 Subject: [PATCH 35/42] Some feedback about 2-3 second delay before running qmake The GdbMacrosBuildStep is taking quite long and didn't tell the user what it was doing. This message helps a bit, but we should fix the delay. Reviewed-by: dt --- src/plugins/qt4projectmanager/gdbmacrosbuildstep.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/plugins/qt4projectmanager/gdbmacrosbuildstep.cpp b/src/plugins/qt4projectmanager/gdbmacrosbuildstep.cpp index ea622415a20..507c059239e 100644 --- a/src/plugins/qt4projectmanager/gdbmacrosbuildstep.cpp +++ b/src/plugins/qt4projectmanager/gdbmacrosbuildstep.cpp @@ -65,13 +65,13 @@ void GdbMacrosBuildStep::run(QFutureInterface & fi) { QVariant v = value("clean"); if (v.isNull() || v.toBool() == false) { + addToOutputWindow("Creating gdb macros library..."); // Normal run QString dumperPath = Core::ICore::instance()->resourcePath() + "/gdbmacros/"; QStringList files; files << "gdbmacros.cpp" << "gdbmacros.pro"; - QString destDir = m_buildDirectory + "/qtc-gdbmacros/"; QDir dir; dir.mkpath(destDir); @@ -124,7 +124,6 @@ void GdbMacrosBuildStep::run(QFutureInterface & fi) qmake.start(m_qmake, QStringList()<<"-spec"<qtVersion(m_buildConfiguration)->makeCommand(), makeArguments); qmake.waitForFinished(); From f4721eaae2a98d761c4dced68313caaa8fd1948b Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 26 Jan 2009 14:49:26 +0100 Subject: [PATCH 36/42] Fixes: coreplugin: remove 'fat' BaseView constructor Details: failed trial before the committee on un-qtish behaviour --- src/plugins/coreplugin/baseview.cpp | 23 ++--------------------- src/plugins/coreplugin/baseview.h | 4 +--- src/plugins/coreplugin/mainwindow.cpp | 6 ++++-- src/plugins/quickopen/quickopenplugin.cpp | 11 +++++++---- 4 files changed, 14 insertions(+), 30 deletions(-) diff --git a/src/plugins/coreplugin/baseview.cpp b/src/plugins/coreplugin/baseview.cpp index ae93c281fa5..8c04ee05aa7 100644 --- a/src/plugins/coreplugin/baseview.cpp +++ b/src/plugins/coreplugin/baseview.cpp @@ -82,29 +82,10 @@ BaseView::BaseView(QObject *parent) { } -/*! - \fn BaseView::BaseView(const char *name, QWidget *widget, const QList &context, Qt::DockWidgetArea position, QObject *parent) - - Creates a view with the given properties. - - \a name - \a widget - \a context - \a position - \a parent -*/ - -BaseView::BaseView(const char *name, QWidget *widget, const QList &context, IView::ViewPosition position, QObject *parent) - : IView(parent), - m_viewName(name), - m_widget(widget), - m_context(context), - m_defaultPosition(position) -{ -} - /*! \fn BaseView::~BaseView() + + Destructor also destroys the widget. */ BaseView::~BaseView() { diff --git a/src/plugins/coreplugin/baseview.h b/src/plugins/coreplugin/baseview.h index a39e4dc8ca2..6044ace493a 100644 --- a/src/plugins/coreplugin/baseview.h +++ b/src/plugins/coreplugin/baseview.h @@ -40,14 +40,12 @@ namespace Core { -class CORE_EXPORT BaseView - : public IView +class CORE_EXPORT BaseView : public IView { Q_OBJECT public: BaseView(QObject *parent = 0); - BaseView(const char *name, QWidget *widget, const QList &context, IView::ViewPosition position, QObject *parent = 0); ~BaseView(); QList context() const; diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp index f5e131b98b1..262b70b2145 100644 --- a/src/plugins/coreplugin/mainwindow.cpp +++ b/src/plugins/coreplugin/mainwindow.cpp @@ -309,8 +309,10 @@ bool MainWindow::init(QString *errorMessage) // Add widget to the bottom, we create the view here instead of inside the // OutputPaneManager, since the ViewManager needs to be initilized before - m_outputView = new Core::BaseView("OutputWindow.Buttons", - OutputPaneManager::instance()->buttonsWidget(), QList(), Core::IView::Second); + m_outputView = new Core::BaseView; + m_outputView->setUniqueViewName("OutputWindow.Buttons"); + m_outputView->setWidget(OutputPaneManager::instance()->buttonsWidget()); + m_outputView->setDefaultPosition(Core::IView::Second); pm->addObject(m_outputView); return true; } diff --git a/src/plugins/quickopen/quickopenplugin.cpp b/src/plugins/quickopen/quickopenplugin.cpp index aab8bf739be..a7b6de8fbab 100644 --- a/src/plugins/quickopen/quickopenplugin.cpp +++ b/src/plugins/quickopen/quickopenplugin.cpp @@ -57,6 +57,7 @@ using namespace QuickOpen; using namespace QuickOpen::Internal; + namespace { static bool filterLessThan(const IQuickOpenFilter *first, const IQuickOpenFilter *second) { @@ -89,10 +90,12 @@ bool QuickOpenPlugin::initialize(const QStringList &, QString *) m_quickOpenToolWindow = new QuickOpenToolWindow(this); m_quickOpenToolWindow->setEnabled(false); - Core::BaseView *view = new Core::BaseView("QuickOpen.ToolWindow", - m_quickOpenToolWindow, - QList() << core->uniqueIDManager()->uniqueIdentifier(QLatin1String("QuickOpenToolWindow")), - Core::IView::First); + Core::BaseView *view = new Core::BaseView; + view->setUniqueViewName("QuickOpen.ToolWindow"); + view->setWidget(m_quickOpenToolWindow); + view->setContext(QList() << core->uniqueIDManager() + ->uniqueIdentifier(QLatin1String("QuickOpenToolWindow"))); + view->setDefaultPosition(Core::IView::First); addAutoReleasedObject(view); const QString actionId = QLatin1String("QtCreator.View.QuickOpen.ToolWindow"); From 6f2da75dcba8f3c30c7552ecfa906ec6d76b6228 Mon Sep 17 00:00:00 2001 From: Daniel Molkentin Date: Mon, 26 Jan 2009 14:53:27 +0100 Subject: [PATCH 37/42] Fixes: RPATH for libs on Mac Task: Reported by Roberto RevBy: TrustMe Details: Plugins still don't load on Mac. --- src/qworkbenchlibrary.pri | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qworkbenchlibrary.pri b/src/qworkbenchlibrary.pri index 389d513eec9..a8af3d7edbd 100644 --- a/src/qworkbenchlibrary.pri +++ b/src/qworkbenchlibrary.pri @@ -7,7 +7,7 @@ win32 { DESTDIR = $$IDE_LIBRARY_PATH -include(../rpath.pri) +include(rpath.pri) TARGET = $$qtLibraryTarget($$TARGET) From 64f2d9f3d61dceaea47b7e9ddfd710b5aebb28f9 Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 26 Jan 2009 15:27:04 +0100 Subject: [PATCH 38/42] Fixes: coreplugin: small fixes Details: comments & codestyle --- src/plugins/coreplugin/icorelistener.h | 20 +++++---- .../coreplugin/inavigationwidgetfactory.cpp | 2 + .../coreplugin/inavigationwidgetfactory.h | 9 ++-- src/plugins/coreplugin/iview.h | 5 +-- src/plugins/coreplugin/mimedatabase.h | 3 +- src/plugins/coreplugin/rightpane.h | 24 ++++++++--- src/plugins/coreplugin/styleanimator.cpp | 41 ++++++++++--------- src/plugins/coreplugin/styleanimator.h | 38 ++++++++--------- src/plugins/coreplugin/stylehelper.h | 4 +- src/plugins/coreplugin/tabpositionindicator.h | 4 +- 10 files changed, 82 insertions(+), 68 deletions(-) diff --git a/src/plugins/coreplugin/icorelistener.h b/src/plugins/coreplugin/icorelistener.h index 25468fbfd1a..ba0482dfd69 100644 --- a/src/plugins/coreplugin/icorelistener.h +++ b/src/plugins/coreplugin/icorelistener.h @@ -42,23 +42,25 @@ namespace Core { /*! \class Core::ICoreListener - \brief Provides a hook for plugins to veto on certain events emitted from the core plugin. - You implement this interface if you want to prevent certain events from occurring, e.g. - if you want to prevent the closing of the whole application or to prevent the closing - of an editor window under certain conditions. + \brief Provides a hook for plugins to veto on certain events emitted from +the core plugin. + + You implement this interface if you want to prevent certain events from + occurring, e.g. if you want to prevent the closing of the whole application + or to prevent the closing of an editor window under certain conditions. If e.g. the application window requests a close, then first - ICoreListener::coreAboutToClose() is called (in arbitrary order) - on all registered objects implementing this interface. If one if these calls returns - false, the process is aborted and the event is ignored. - If all calls return true, the corresponding signal is emitted and the event is accepted/performed. + ICoreListener::coreAboutToClose() is called (in arbitrary order) on all + registered objects implementing this interface. If one if these calls returns + false, the process is aborted and the event is ignored. If all calls return + true, the corresponding signal is emitted and the event is accepted/performed. Guidelines for implementing: \list \o Return false from the implemented method if you want to prevent the event. \o You need to add your implementing object to the plugin managers objects: - ICore::pluginManager()->addObject(yourImplementingObject); + ExtensionSystem::PluginManager::instance()->addObject(yourImplementingObject); \o Don't forget to remove the object again at deconstruction (e.g. in the destructor of your plugin). */ diff --git a/src/plugins/coreplugin/inavigationwidgetfactory.cpp b/src/plugins/coreplugin/inavigationwidgetfactory.cpp index 4d64ad65876..e9b21971b1c 100644 --- a/src/plugins/coreplugin/inavigationwidgetfactory.cpp +++ b/src/plugins/coreplugin/inavigationwidgetfactory.cpp @@ -33,6 +33,8 @@ #include "inavigationwidgetfactory.h" +#include + using namespace Core; INavigationWidgetFactory::INavigationWidgetFactory() diff --git a/src/plugins/coreplugin/inavigationwidgetfactory.h b/src/plugins/coreplugin/inavigationwidgetfactory.h index e3bb73e7b30..78a8d059a8f 100644 --- a/src/plugins/coreplugin/inavigationwidgetfactory.h +++ b/src/plugins/coreplugin/inavigationwidgetfactory.h @@ -37,18 +37,19 @@ #include #include #include -#include QT_BEGIN_NAMESPACE class QToolButton; +class QKeySequence; class QWidget; QT_END_NAMESPACE namespace Core { -struct NavigationView { - QWidget *widget; - QList doockToolBarWidgets; +struct NavigationView +{ + QWidget *widget; + QList doockToolBarWidgets; }; class CORE_EXPORT INavigationWidgetFactory : public QObject diff --git a/src/plugins/coreplugin/iview.h b/src/plugins/coreplugin/iview.h index 0bce0f53544..8c419b5e8ff 100644 --- a/src/plugins/coreplugin/iview.h +++ b/src/plugins/coreplugin/iview.h @@ -36,14 +36,11 @@ #include "core_global.h" -#include - #include namespace Core { -class CORE_EXPORT IView - : public IContext +class CORE_EXPORT IView : public IContext { Q_OBJECT public: diff --git a/src/plugins/coreplugin/mimedatabase.h b/src/plugins/coreplugin/mimedatabase.h index d7d696bd723..f40cb45c306 100644 --- a/src/plugins/coreplugin/mimedatabase.h +++ b/src/plugins/coreplugin/mimedatabase.h @@ -120,7 +120,8 @@ private: * Extensions: * - List of suffixes and preferred suffix (derived from glob patterns). */ -class CORE_EXPORT MimeType { +class CORE_EXPORT MimeType +{ public: /* Return value of a glob match, which is higher than magic */ enum { GlobMatchPriority = 101 }; diff --git a/src/plugins/coreplugin/rightpane.h b/src/plugins/coreplugin/rightpane.h index 776b9fdb2bb..0eb0159be44 100644 --- a/src/plugins/coreplugin/rightpane.h +++ b/src/plugins/coreplugin/rightpane.h @@ -44,41 +44,51 @@ namespace Core { class IMode; class RightPaneWidget; -// TODO: The right pane works only for the help plugin atm. -// It can't cope with more than one plugin publishing objects they want in the right pane -// For that the API would need to be different. (Might be that instead of adding objects -// to the pool, there should be a method RightPaneWidget::setWidget(QWidget *w) -// Anyway if a second plugin wants to show something there, redesign this API +// TODO: The right pane works only for the help plugin atm. It can't cope +// with more than one plugin publishing objects they want in the right pane +// For that the API would need to be different. (Might be that instead of +// adding objects to the pool, there should be a method +// RightPaneWidget::setWidget(QWidget *w) Anyway if a second plugin wants to +// show something there, redesign this API + class CORE_EXPORT RightPanePlaceHolder : public QWidget { friend class Core::RightPaneWidget; Q_OBJECT + public: RightPanePlaceHolder(Core::IMode *mode, QWidget *parent = 0); ~RightPanePlaceHolder(); static RightPanePlaceHolder *current(); + private slots: void currentModeChanged(Core::IMode *); + private: void applyStoredSize(int width); Core::IMode *m_mode; static RightPanePlaceHolder* m_current; }; + class CORE_EXPORT BaseRightPaneWidget : public QObject { Q_OBJECT + public: BaseRightPaneWidget(QWidget *widget); ~BaseRightPaneWidget(); QWidget *widget() const; + private: QWidget *m_widget; }; + class CORE_EXPORT RightPaneWidget : public QWidget { Q_OBJECT + public: RightPaneWidget(); ~RightPaneWidget(); @@ -89,11 +99,13 @@ public: bool isShown(); void setShown(bool b); - static RightPaneWidget* instance(); + static RightPaneWidget *instance(); int storedWidth(); + protected: void resizeEvent(QResizeEvent *); + private slots: void objectAdded(QObject *obj); void aboutToRemoveObject(QObject *obj); diff --git a/src/plugins/coreplugin/styleanimator.cpp b/src/plugins/coreplugin/styleanimator.cpp index f0fda1f512c..2762cbcc383 100644 --- a/src/plugins/coreplugin/styleanimator.cpp +++ b/src/plugins/coreplugin/styleanimator.cpp @@ -54,25 +54,25 @@ void Animation::paint(QPainter *painter, const QStyleOption *option) void Animation::drawBlendedImage(QPainter *painter, QRect rect, float alpha) { - if (_secondaryImage.isNull() || _primaryImage.isNull()) + if (m_secondaryImage.isNull() || m_primaryImage.isNull()) return; - if (_tempImage.isNull()) - _tempImage = _secondaryImage; + if (m_tempImage.isNull()) + m_tempImage = m_secondaryImage; const int a = qRound(alpha*256); const int ia = 256 - a; - const int sw = _primaryImage.width(); - const int sh = _primaryImage.height(); - const int bpl = _primaryImage.bytesPerLine(); - switch (_primaryImage.depth()) { + const int sw = m_primaryImage.width(); + const int sh = m_primaryImage.height(); + const int bpl = m_primaryImage.bytesPerLine(); + switch (m_primaryImage.depth()) { case 32: { - uchar *mixed_data = _tempImage.bits(); - const uchar *back_data = _primaryImage.bits(); - const uchar *front_data = _secondaryImage.bits(); + uchar *mixed_data = m_tempImage.bits(); + const uchar *back_data = m_primaryImage.bits(); + const uchar *front_data = m_secondaryImage.bits(); for (int sy = 0; sy < sh; sy++) { - quint32* mixed = (quint32*)mixed_data; + quint32 *mixed = (quint32*)mixed_data; const quint32* back = (const quint32*)back_data; const quint32* front = (const quint32*)front_data; for (int sx = 0; sx < sw; sx++) { @@ -91,27 +91,28 @@ void Animation::drawBlendedImage(QPainter *painter, QRect rect, float alpha) default: break; } - painter->drawImage(rect, _tempImage); + painter->drawImage(rect, m_tempImage); } void Transition::paint(QPainter *painter, const QStyleOption *option) { float alpha = 1.0; - if (_duration > 0) { + if (m_duration > 0) { QTime current = QTime::currentTime(); - if (_startTime > current) - _startTime = current; + if (m_startTime > current) + m_startTime = current; - int timeDiff = _startTime.msecsTo(current); - alpha = timeDiff/(float)_duration; - if (timeDiff > _duration) { - _running = false; + int timeDiff = m_startTime.msecsTo(current); + alpha = timeDiff/(float)m_duration; + if (timeDiff > m_duration) { + m_running = false; alpha = 1.0; } } else { - _running = false; } + m_running = false; + } drawBlendedImage(painter, option->rect, alpha); } diff --git a/src/plugins/coreplugin/styleanimator.h b/src/plugins/coreplugin/styleanimator.h index 7a75056af5d..fb7248b4aa5 100644 --- a/src/plugins/coreplugin/styleanimator.h +++ b/src/plugins/coreplugin/styleanimator.h @@ -51,24 +51,24 @@ class Animation { public : - Animation() : _running(true) { } + Animation() : m_running(true) { } virtual ~Animation() { } - QWidget * widget() const { return _widget; } - bool running() const { return _running; } - const QTime &startTime() const { return _startTime; } - void setRunning(bool val) { _running = val; } - void setWidget(QWidget *widget) { _widget = widget; } - void setStartTime(const QTime &startTime) { _startTime = startTime; } + QWidget * widget() const { return m_widget; } + bool running() const { return m_running; } + const QTime &startTime() const { return m_startTime; } + void setRunning(bool val) { m_running = val; } + void setWidget(QWidget *widget) { m_widget = widget; } + void setStartTime(const QTime &startTime) { m_startTime = startTime; } virtual void paint(QPainter *painter, const QStyleOption *option); protected: void drawBlendedImage(QPainter *painter, QRect rect, float value); - QTime _startTime; - QPointer _widget; - QImage _primaryImage; - QImage _secondaryImage; - QImage _tempImage; - bool _running; + QTime m_startTime; + QPointer m_widget; + QImage m_primaryImage; + QImage m_secondaryImage; + QImage m_tempImage; + bool m_running; }; // Handles state transition animations @@ -76,13 +76,13 @@ class Transition : public Animation { public : Transition() : Animation() {} - virtual ~Transition() { } - void setDuration(int duration) { _duration = duration; } - void setStartImage(const QImage &image) { _primaryImage = image; } - void setEndImage(const QImage &image) { _secondaryImage = image; } + virtual ~Transition() {} + void setDuration(int duration) { m_duration = duration; } + void setStartImage(const QImage &image) { m_primaryImage = image; } + void setEndImage(const QImage &image) { m_secondaryImage = image; } virtual void paint(QPainter *painter, const QStyleOption *option); - int duration() const { return _duration; } - int _duration; //set time in ms to complete a state transition + int duration() const { return m_duration; } + int m_duration; //set time in ms to complete a state transition }; class StyleAnimator : public QObject diff --git a/src/plugins/coreplugin/stylehelper.h b/src/plugins/coreplugin/stylehelper.h index 3a1e8f5b4a2..15b5e6a73c5 100644 --- a/src/plugins/coreplugin/stylehelper.h +++ b/src/plugins/coreplugin/stylehelper.h @@ -69,9 +69,7 @@ public: static void menuGradient(QPainter *painter, const QRect &spanRect, const QRect &clipRect); // Pixmap cache should only be enabled for X11 due to slow gradients - static bool usePixmapCache() { - return true; - } + static bool usePixmapCache() { return true; } private: static QColor m_baseColor; diff --git a/src/plugins/coreplugin/tabpositionindicator.h b/src/plugins/coreplugin/tabpositionindicator.h index 55162cb838f..3dc9de1a028 100644 --- a/src/plugins/coreplugin/tabpositionindicator.h +++ b/src/plugins/coreplugin/tabpositionindicator.h @@ -36,8 +36,6 @@ #include -#define TABPOSITIONINDICATOR_WIDTH 2 - namespace Core { namespace Internal { @@ -46,6 +44,8 @@ class TabPositionIndicator : public QWidget Q_OBJECT public: + enum { TABPOSITIONINDICATOR_WIDTH = 2 }; + TabPositionIndicator(); int indicatorWidth() { return TABPOSITIONINDICATOR_WIDTH; } From c85ba53365d606192069a841ed806979f17d80bc Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 26 Jan 2009 15:33:24 +0100 Subject: [PATCH 39/42] Fixes: remove unneded declaration --- src/plugins/coreplugin/welcomemode.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/plugins/coreplugin/welcomemode.h b/src/plugins/coreplugin/welcomemode.h index bcd205072f8..56899a4463c 100644 --- a/src/plugins/coreplugin/welcomemode.h +++ b/src/plugins/coreplugin/welcomemode.h @@ -41,7 +41,6 @@ QT_BEGIN_NAMESPACE class QWidget; class QUrl; -class QLabel; QT_END_NAMESPACE namespace Core { @@ -77,8 +76,7 @@ public: const char* uniqueModeName() const; QList context() const; void activated(); - QString contextHelpId() const - { return QLatin1String("Qt Creator"); } + QString contextHelpId() const { return QLatin1String("Qt Creator"); } signals: void requestProject(const QString &project); From 9c897b4411477675447b109a41816e93bb8e196c Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Mon, 26 Jan 2009 15:46:11 +0100 Subject: [PATCH 40/42] Fixes: Polish toolbar buttons, fix invisible extension Details: I used vector graphics for icons, to give them a smoother appearance and added an improved extension button that is visible on a dark background. Down arrows are now painted with AA enabled. --- src/plugins/coreplugin/core.qrc | 1 + src/plugins/coreplugin/images/extension.png | Bin 0 -> 345 bytes src/plugins/coreplugin/images/linkicon.png | Bin 230 -> 592 bytes .../images/splitbutton_horizontal.png | Bin 147 -> 435 bytes src/plugins/coreplugin/mainwindow.cpp | 35 +++--- src/plugins/coreplugin/manhattanstyle.cpp | 102 ++++++++++++++++-- .../projectexplorer/images/filtericon.png | Bin 194 -> 494 bytes 7 files changed, 113 insertions(+), 25 deletions(-) create mode 100644 src/plugins/coreplugin/images/extension.png diff --git a/src/plugins/coreplugin/core.qrc b/src/plugins/coreplugin/core.qrc index c2a38452dcf..a7271ec6beb 100644 --- a/src/plugins/coreplugin/core.qrc +++ b/src/plugins/coreplugin/core.qrc @@ -67,5 +67,6 @@ images/undo.png images/unknownfile.png images/unlocked.png + images/extension.png diff --git a/src/plugins/coreplugin/images/extension.png b/src/plugins/coreplugin/images/extension.png new file mode 100644 index 0000000000000000000000000000000000000000..6bdfc07b83043b3443064d61e4dc74fe97ea8f95 GIT binary patch literal 345 zcmeAS@N?(olHy`uVBq!ia0y~yVBi2@4mJh`h9ms@x)~T4Sc;uILpV4%IBGajIv5xj zI14-?iy0W$-heQpT&aaA0|SF(iEBhjaDG}zd16s2LwR|*US?i)adKios$PCk`s{Z$ zQVa|X*F0SuLnNlw_A6!|4q#|`AIfryEpTCgm#`X}qFz9Btea%$WaHo5zZuv1b>4_c zFj%%MC^*o35tHIi#zyteIY*TB9^Un_+G$+QK7WU>%E$R?i}M-p^!=1O@P=Q&NoQ)1 zHA8-(jJ0c^&BQ+p8+JHtdu-9~wQ~Kw_x8;S6)RS~x+_tvw)4P_gMO1z?w7`1H94!r zb2#_*wpPPup%Yvpr%7Kg?Jtd$-*Qd-{`dXui5H??r!#C=I>o+n-hPG|DUoGUg63T^ snHwj6PWSXK>C?T>D_?7LEmLt6+P~Nzopr0JzkF=Kufz literal 0 HcmV?d00001 diff --git a/src/plugins/coreplugin/images/linkicon.png b/src/plugins/coreplugin/images/linkicon.png index 864f36f174708b92f2d7bcbb1ba459273510215d..4e4d4f7b7fbac77c23076501afd79910395a5fce 100644 GIT binary patch delta 567 zcmaFHc!6btNAX(xXQ4*Y= zR#Ki=l*&+EUaps!mtCBkSdglhUz9%kosAR&1LIjw7sn8b-nEnMGok`Tj_v=wXphGd zK`W7V1-^q5{BoylyU8Tv(Xm5R{rI&Y4n5Z7_Jo%~R`n$tWt~n=*~@!ULBoIYg@Ybi zT94vB__uz4v-Qrt=ZDL!LSA-9L~UT-_jJzhzZP?f^^}#)2wn1d_n)!A=j2)Dh#4nl zGW@vDV9wrrP?#ZlazguIM$buI4ELCK>~d335)jmydTMpn)?bQJy={zlHlKd~{k=xl zr$d|8Br8oiCa3g^wVvU@%d*{1-4<_5((ik+^7`xTO$Q&O?Z1Cs@FJVw$;k~<o|RX#wx(^4oRa!8Q$wWc`pXg~2Dv`#8J~aF+`gGpR^MOzZ(?zr zInQG477Y$Xu2rk%J^%c(*+)%SV()&z{^Roe?T07dKg=+P;Sa;LNhhD=?YiPih;S=-*1?cU7b$JmkWo;d6D+OXFkU7r b|Kgk(B5Qh;S>zQ10|SGntDnm{r-UW|y5a=g delta 202 zcmcb>@{DnUNGZx^prw85kJYlDyqr82*Fcg1yTpGcYi47I;J!Gca%qgD@k* ztT_@43=Hfgp1!W^H`t{4g*eSIc9XRuRu%Xq>xv zaM!V~hp&a0*zNmsVfKUxG7p&2_TLlNoj66dd&47HcIQRy3;8`GFKL<^OV7R5xYbYHL!w=C1lake!~celF{r5}E*E CaZYCd diff --git a/src/plugins/coreplugin/images/splitbutton_horizontal.png b/src/plugins/coreplugin/images/splitbutton_horizontal.png index 7b5f493758724b41d38d2288e0749b3bc841e1c2..a71fdfdb6244f23a5994f418cacfc39cede918b5 100644 GIT binary patch delta 409 zcmbQtxS4r^NAX(xXQ4*Y= zR#Ki=l*&+EUaps!mtCBkSdglhUz9%kosAR&1EYbbi(`mI@6yTkUPl}xj^01hmU>tr zx|4Gwzv7{Jhb~7%EIY${MEVV{%|WxwBWfHgb%Ip{MCt_v+isrxvoSK&*i+}u`kI>e z$A8~5I1<$z+&1qC+XLT>=L|Q_{8Mk}k93&#e0tafc zNh;>+D)+|4Pf4wO|NGw`&N;=qqt>R}-lngo;Cq=>v1P}v1ukp1s>lX(2Sc7HMB?YCu>I~tfSOm6sFm)|O2()ajwr*=f_ z_40bADM1N6o$FrDiz%0Ad#U(q!3jsrImK`FERq>?`dR~ZVy+!sr_KBkFZH!>b7O3VtQ&&YGO)d;mK4R1_lOGPZ!6K zid#v4{{OdUR&D5PbTatBwjn|Ac8~jBeM7c{(2mm&4ob4M97;6dxxn!F!g(JCMmC0b Yf4Mpt&qSPLU|?YIboFyt=akR{0ASuN2LJ#7 diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp index 262b70b2145..97648813d01 100644 --- a/src/plugins/coreplugin/mainwindow.cpp +++ b/src/plugins/coreplugin/mainwindow.cpp @@ -152,6 +152,24 @@ MainWindow::MainWindow() : setWindowTitle(tr("Qt Creator")); qApp->setWindowIcon(QIcon(":/core/images/qtcreator_logo_128.png")); + QCoreApplication::setApplicationName(QLatin1String("QtCreator")); + QCoreApplication::setApplicationVersion(QLatin1String(Core::Constants::IDE_VERSION_LONG)); + QCoreApplication::setOrganizationName(QLatin1String("Nokia")); + QSettings::setDefaultFormat(QSettings::IniFormat); + QString baseName = qApp->style()->objectName(); +#ifdef Q_WS_X11 + if (baseName == "windows") { + // Sometimes we get the standard windows 95 style as a fallback + // e.g. if we are running on a KDE4 desktop + QByteArray desktopEnvironment = qgetenv("DESKTOP_SESSION"); + if (desktopEnvironment == "kde") + baseName = "plastique"; + else + baseName = "cleanlooks"; + } +#endif + qApp->setStyle(new ManhattanStyle(baseName)); + setDockNestingEnabled(true); setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea); @@ -183,23 +201,6 @@ MainWindow::MainWindow() : //signal(SIGINT, handleSigInt); #endif - QCoreApplication::setApplicationName(QLatin1String("QtCreator")); - QCoreApplication::setApplicationVersion(QLatin1String(Core::Constants::IDE_VERSION_LONG)); - QCoreApplication::setOrganizationName(QLatin1String("Nokia")); - QSettings::setDefaultFormat(QSettings::IniFormat); - QString baseName = qApp->style()->objectName(); -#ifdef Q_WS_X11 - if (baseName == "windows") { - // Sometimes we get the standard windows 95 style as a fallback - // e.g. if we are running on a KDE4 desktop - QByteArray desktopEnvironment = qgetenv("DESKTOP_SESSION"); - if (desktopEnvironment == "kde") - baseName = "plastique"; - else - baseName = "cleanlooks"; - } -#endif - qApp->setStyle(new ManhattanStyle(baseName)); statusBar()->setProperty("p_styled", true); } diff --git a/src/plugins/coreplugin/manhattanstyle.cpp b/src/plugins/coreplugin/manhattanstyle.cpp index a38a6c9774b..ee3ca2f62d1 100644 --- a/src/plugins/coreplugin/manhattanstyle.cpp +++ b/src/plugins/coreplugin/manhattanstyle.cpp @@ -345,12 +345,11 @@ void ManhattanStyle::polish(QPalette &pal) QIcon ManhattanStyle::standardIconImplementation(StandardPixmap standardIcon, const QStyleOption *option, const QWidget *widget) const { - static const QIcon closeButton(":/core/images/closebutton.png"); QIcon icon; switch (standardIcon) { case QStyle::SP_TitleBarCloseButton: - icon = closeButton; - break; + case QStyle::SP_ToolBarHorizontalExtensionButton: + return QIcon(standardPixmap(standardIcon, option, widget)); default: icon = d->style->standardIcon(standardIcon, option, widget); } @@ -360,11 +359,20 @@ QIcon ManhattanStyle::standardIconImplementation(StandardPixmap standardIcon, co QPixmap ManhattanStyle::standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt, const QWidget *widget) const { - static const QPixmap closeButton(":/core/images/closebutton.png"); + if (widget && !panelWidget(widget)) + return d->style->standardPixmap(standardPixmap, opt, widget); + QPixmap pixmap; switch (standardPixmap) { - case QStyle::SP_TitleBarCloseButton: - pixmap = closeButton; + case QStyle::SP_ToolBarHorizontalExtensionButton: { + static const QPixmap extButton(":/core/images/extension.png"); + pixmap = extButton; + } + break; + case QStyle::SP_TitleBarCloseButton: { + static const QPixmap closeButton(":/core/images/closebutton.png"); + pixmap = closeButton; + } break; default: pixmap = d->style->standardPixmap(standardPixmap, opt, widget); @@ -593,6 +601,84 @@ void ManhattanStyle::drawPrimitive(PrimitiveElement element, const QStyleOption painter->restore(); } break; + case PE_IndicatorArrowUp: + case PE_IndicatorArrowDown: + case PE_IndicatorArrowRight: + case PE_IndicatorArrowLeft: + { + // From windowsstyle but modified to enable AA + if (option->rect.width() <= 1 || option->rect.height() <= 1) + break; + + QRect r = option->rect; + int size = qMin(r.height(), r.width()); + QPixmap pixmap; + QString pixmapName; + pixmapName.sprintf("%s-%s-%d-%d-%d-%lld", + "$qt_ia", metaObject()->className(), + uint(option->state), element, + size, option->palette.cacheKey()); + if (!QPixmapCache::find(pixmapName, pixmap)) { + int border = size/5; + int sqsize = 2*(size/2); + QImage image(sqsize, sqsize, QImage::Format_ARGB32); + image.fill(Qt::transparent); + QPainter imagePainter(&image); + imagePainter.setRenderHint(QPainter::Antialiasing, true); + imagePainter.translate(0.5, 0.5); + QPolygon a; + switch (element) { + case PE_IndicatorArrowUp: + a.setPoints(3, border, sqsize/2, sqsize/2, border, sqsize - border, sqsize/2); + break; + case PE_IndicatorArrowDown: + a.setPoints(3, border, sqsize/2, sqsize/2, sqsize - border, sqsize - border, sqsize/2); + break; + case PE_IndicatorArrowRight: + a.setPoints(3, sqsize - border, sqsize/2, sqsize/2, border, sqsize/2, sqsize - border); + break; + case PE_IndicatorArrowLeft: + a.setPoints(3, border, sqsize/2, sqsize/2, border, sqsize/2, sqsize - border); + break; + default: + break; + } + + int bsx = 0; + int bsy = 0; + + if (option->state & State_Sunken) { + bsx = pixelMetric(PM_ButtonShiftHorizontal); + bsy = pixelMetric(PM_ButtonShiftVertical); + } + + QRect bounds = a.boundingRect(); + int sx = sqsize / 2 - bounds.center().x() - 1; + int sy = sqsize / 2 - bounds.center().y() - 1; + imagePainter.translate(sx + bsx, sy + bsy); + imagePainter.setPen(option->palette.buttonText().color()); + imagePainter.setBrush(option->palette.buttonText()); + + if (!(option->state & State_Enabled)) { + imagePainter.translate(1, 1); + imagePainter.setBrush(option->palette.light().color()); + imagePainter.setPen(option->palette.light().color()); + imagePainter.drawPolygon(a); + imagePainter.translate(-1, -1); + imagePainter.setBrush(option->palette.mid().color()); + imagePainter.setPen(option->palette.mid().color()); + } + + imagePainter.drawPolygon(a); + imagePainter.end(); + pixmap = QPixmap::fromImage(image); + QPixmapCache::insert(pixmapName, pixmap); + } + int xOffset = r.x() + (r.width() - size)/2; + int yOffset = r.y() + (r.height() - size)/2; + painter->drawPixmap(xOffset, yOffset, pixmap); + } + break; default: d->style->drawPrimitive(element, option, painter, widget); @@ -902,7 +988,7 @@ void ManhattanStyle::drawComplexControl(ComplexControl control, const QStyleOpti newBtn.palette = panelPalette(option->palette); newBtn.rect = QRect(ir.right() - arrowSize - 1, ir.height() - arrowSize - 2, arrowSize, arrowSize); - QWindowsStyle::drawPrimitive(PE_IndicatorArrowDown, &newBtn, painter, widget); + drawPrimitive(PE_IndicatorArrowDown, &newBtn, painter, widget); } } break; @@ -929,7 +1015,7 @@ void ManhattanStyle::drawComplexControl(ComplexControl control, const QStyleOpti pal.setBrush(QPalette::All, QPalette::ButtonText, StyleHelper::panelTextColor()); arrowOpt.palette = pal; - QWindowsStyle::drawPrimitive(PE_IndicatorArrowDown, &arrowOpt, painter, widget); + drawPrimitive(PE_IndicatorArrowDown, &arrowOpt, painter, widget); painter->restore(); } diff --git a/src/plugins/projectexplorer/images/filtericon.png b/src/plugins/projectexplorer/images/filtericon.png index 0915b5e5f6167dfb71799f637ac2ba67f3be7deb..de7ee4b5f54f0db14e3137c0d9d97283f388a9f1 100644 GIT binary patch delta 468 zcmX@a_>OskNAX(xXQ4*Y= zR#Ki=l*&+EUaps!mtCBkSdglhUz9%kosAR&17o(Qi(`mI@6upH@52rvb=PGy4_drX z3G33h>ALbt*FP5P7njz`mSkPb^J}Vi($Z_~%kz_6Qm>GwG?lH>_4S2?Dgw83UQP)3 zyi>yGc7pET2M>O{+xvd+?{{*{4x1H>g3SaA>nHoDg=cNOb$1C%pvdnzpZ6Lzx-DLK zW82<D^_P*-!~{nsj~2H*M8u}70W-r4qcx`OzZ1G#3i z^Ib~B-kfo_nmg}&{nH}$yLsOWUnpE?6zM39j2|SD+n!hUbet%?yF$aaOHZ)2)%NX@ z`8%e0s7(9Em5{jkfW+;$C06E>R4V%(yQD_GJH2U-VebJe!J|x9*ctxbXS$s5Eb|W= YzlDO;trY_C3=9kmp00i_>zopr091t0VgLXD delta 166 zcmaFIe28&^NGZx^prw85kJYlDyqr82*Fcg1yTpGcYi47I;J!Gca%qgD@k* ztT_@43=Hfgp1!W^HyPP^6?o3>;GM$2z~JQR;uvCaIypgtwdcf~|Ns9#H!v`$co4Y1 zdE&%Et~lZU|NrlA6)9ZAb8z|0&a_76%~K~_)+{^tK;A5Y{mOsqw#qmL2BX~y!3TsY SS{WD^7(8A5T-G@yGywoZT08y# From 8c59160792cd9d1ef4a2273cd6058ad105b92ea5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= Date: Mon, 26 Jan 2009 15:51:14 +0100 Subject: [PATCH 41/42] Fix SIGNAL/SLOT completion with spaces after opening brace Spaces after the opening brace would cause SIGNAL/SLOT completion to be disabled along with function completion. Now function completion is checked at a later stage. --- src/plugins/cpptools/cppcodecompletion.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/plugins/cpptools/cppcodecompletion.cpp b/src/plugins/cpptools/cppcodecompletion.cpp index 573c9a25466..824b7b4b1cb 100644 --- a/src/plugins/cpptools/cppcodecompletion.cpp +++ b/src/plugins/cpptools/cppcodecompletion.cpp @@ -435,15 +435,15 @@ int CppCodeCompletion::startCompletion(TextEditor::ITextEditable *editor) m_startPosition = findStartOfName(editor); m_completionOperator = T_EOF_SYMBOL; - int endOfExpression = m_startPosition; + int endOfOperator = m_startPosition; // Skip whitespace preceding this position - while (editor->characterAt(endOfExpression - 1).isSpace()) - --endOfExpression; + while (editor->characterAt(endOfOperator - 1).isSpace()) + --endOfOperator; - endOfExpression = startOfOperator(editor, endOfExpression, - &m_completionOperator, - /*want function call =*/ editor->position() == endOfExpression); + int endOfExpression = startOfOperator(editor, endOfOperator, + &m_completionOperator, + /*want function call =*/ true); Core::IFile *file = editor->file(); QString fileName = file->fileName(); @@ -464,6 +464,11 @@ int CppCodeCompletion::startCompletion(TextEditor::ITextEditable *editor) m_completionOperator = T_SIGNAL; else if (expression.endsWith(QLatin1String("SLOT"))) m_completionOperator = T_SLOT; + else if (editor->position() != endOfOperator) { + // We don't want a function completion when the cursor isn't at the opening brace + expression.clear(); + m_completionOperator = T_EOF_SYMBOL; + } } } From fe0533de2a634ca377c2d8a0073e0eb2cbf89abf Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 26 Jan 2009 16:19:24 +0100 Subject: [PATCH 42/42] Fixes: move all files in shared/* to src/shared/* --- src/app/app.pro | 2 +- src/libs/cplusplus/cplusplus.pri | 2 +- src/libs/cplusplus/cplusplus.pro | 2 +- src/plugins/coreplugin/coreplugin.pro | 2 +- src/plugins/cpaster/cpaster.pro | 2 +- src/plugins/cppeditor/cppeditor.pro | 1 + src/plugins/designer/designer.pro | 2 +- src/plugins/fakevim/fakevim.pro | 2 +- src/plugins/help/help.pro | 2 +- src/plugins/projectexplorer/projectexplorer.pro | 2 +- src/plugins/qt4projectmanager/qt4projectmanager.pro | 2 +- src/plugins/qtscripteditor/qtscripteditor.pro | 6 +++--- src/plugins/resourceeditor/resourceeditor.pro | 2 +- src/rpath.pri | 2 -- {shared => src/shared}/cpaster/cgi.cpp | 0 {shared => src/shared}/cpaster/cgi.h | 0 {shared => src/shared}/cpaster/cpaster.pri | 0 {shared => src/shared}/cpaster/fetcher.cpp | 0 {shared => src/shared}/cpaster/fetcher.h | 0 {shared => src/shared}/cpaster/poster.cpp | 0 {shared => src/shared}/cpaster/poster.h | 0 {shared => src/shared}/cpaster/splitter.cpp | 0 {shared => src/shared}/cpaster/splitter.h | 0 {shared => src/shared}/cpaster/view.cpp | 0 {shared => src/shared}/cpaster/view.h | 0 {shared => src/shared}/cpaster/view.ui | 0 {shared => src/shared}/cplusplus/AST.cpp | 0 {shared => src/shared}/cplusplus/AST.h | 0 {shared => src/shared}/cplusplus/ASTVisitor.cpp | 0 {shared => src/shared}/cplusplus/ASTVisitor.h | 0 {shared => src/shared}/cplusplus/ASTfwd.h | 0 {shared => src/shared}/cplusplus/Array.cpp | 0 {shared => src/shared}/cplusplus/Array.h | 0 .../cplusplus/CPlusPlusForwardDeclarations.h | 0 .../shared}/cplusplus/CheckDeclaration.cpp | 0 {shared => src/shared}/cplusplus/CheckDeclaration.h | 0 .../shared}/cplusplus/CheckDeclarator.cpp | 0 {shared => src/shared}/cplusplus/CheckDeclarator.h | 0 .../shared}/cplusplus/CheckExpression.cpp | 0 {shared => src/shared}/cplusplus/CheckExpression.h | 0 {shared => src/shared}/cplusplus/CheckName.cpp | 0 {shared => src/shared}/cplusplus/CheckName.h | 0 {shared => src/shared}/cplusplus/CheckSpecifier.cpp | 0 {shared => src/shared}/cplusplus/CheckSpecifier.h | 0 {shared => src/shared}/cplusplus/CheckStatement.cpp | 0 {shared => src/shared}/cplusplus/CheckStatement.h | 0 {shared => src/shared}/cplusplus/Control.cpp | 0 {shared => src/shared}/cplusplus/Control.h | 0 {shared => src/shared}/cplusplus/CoreTypes.cpp | 0 {shared => src/shared}/cplusplus/CoreTypes.h | 0 .../shared}/cplusplus/DiagnosticClient.cpp | 0 {shared => src/shared}/cplusplus/DiagnosticClient.h | 0 .../shared}/cplusplus/FullySpecifiedType.cpp | 0 .../shared}/cplusplus/FullySpecifiedType.h | 0 {shared => src/shared}/cplusplus/Keywords.cpp | 0 {shared => src/shared}/cplusplus/Keywords.kwgen | 0 {shared => src/shared}/cplusplus/Lexer.cpp | 0 {shared => src/shared}/cplusplus/Lexer.h | 0 {shared => src/shared}/cplusplus/LiteralTable.cpp | 0 {shared => src/shared}/cplusplus/LiteralTable.h | 0 {shared => src/shared}/cplusplus/Literals.cpp | 0 {shared => src/shared}/cplusplus/Literals.h | 0 {shared => src/shared}/cplusplus/MemoryPool.cpp | 0 {shared => src/shared}/cplusplus/MemoryPool.h | 0 {shared => src/shared}/cplusplus/Name.cpp | 0 {shared => src/shared}/cplusplus/Name.h | 0 {shared => src/shared}/cplusplus/NameVisitor.cpp | 0 {shared => src/shared}/cplusplus/NameVisitor.h | 0 {shared => src/shared}/cplusplus/Names.cpp | 0 {shared => src/shared}/cplusplus/Names.h | 0 .../shared}/cplusplus/ObjectiveCAtKeywords.cpp | 0 {shared => src/shared}/cplusplus/Parser.cpp | 0 {shared => src/shared}/cplusplus/Parser.h | 0 {shared => src/shared}/cplusplus/PrettyPrinter.cpp | 0 {shared => src/shared}/cplusplus/PrettyPrinter.h | 0 {shared => src/shared}/cplusplus/Scope.cpp | 0 {shared => src/shared}/cplusplus/Scope.h | 0 {shared => src/shared}/cplusplus/Semantic.cpp | 0 {shared => src/shared}/cplusplus/Semantic.h | 0 {shared => src/shared}/cplusplus/SemanticCheck.cpp | 0 {shared => src/shared}/cplusplus/SemanticCheck.h | 0 {shared => src/shared}/cplusplus/Symbol.cpp | 0 {shared => src/shared}/cplusplus/Symbol.h | 0 {shared => src/shared}/cplusplus/SymbolVisitor.cpp | 0 {shared => src/shared}/cplusplus/SymbolVisitor.h | 0 {shared => src/shared}/cplusplus/Symbols.cpp | 0 {shared => src/shared}/cplusplus/Symbols.h | 0 {shared => src/shared}/cplusplus/Token.cpp | 0 {shared => src/shared}/cplusplus/Token.h | 0 .../shared}/cplusplus/TranslationUnit.cpp | 0 {shared => src/shared}/cplusplus/TranslationUnit.h | 0 {shared => src/shared}/cplusplus/Type.cpp | 0 {shared => src/shared}/cplusplus/Type.h | 0 {shared => src/shared}/cplusplus/TypeVisitor.cpp | 0 {shared => src/shared}/cplusplus/TypeVisitor.h | 0 {shared => src/shared}/cplusplus/cplusplus.pri | 0 .../shared}/designerintegrationv2/README.txt | 0 .../designerintegrationv2/designerintegration.pri | 0 .../shared}/designerintegrationv2/formresizer.cpp | 0 .../shared}/designerintegrationv2/formresizer.h | 0 .../designerintegrationv2/sizehandlerect.cpp | 0 .../shared}/designerintegrationv2/sizehandlerect.h | 0 .../shared}/designerintegrationv2/widgethost.cpp | 0 .../shared}/designerintegrationv2/widgethost.h | 0 .../designerintegrationv2/widgethostconstants.h | 0 {shared => src/shared}/help/bookmarkdialog.ui | 0 {shared => src/shared}/help/bookmarkmanager.cpp | 0 {shared => src/shared}/help/bookmarkmanager.h | 0 {shared => src/shared}/help/contentwindow.cpp | 0 {shared => src/shared}/help/contentwindow.h | 0 {shared => src/shared}/help/filternamedialog.cpp | 0 {shared => src/shared}/help/filternamedialog.h | 0 {shared => src/shared}/help/filternamedialog.ui | 0 {shared => src/shared}/help/help.pri | 0 {shared => src/shared}/help/helpviewer.cpp | 0 {shared => src/shared}/help/helpviewer.h | 0 {shared => src/shared}/help/indexwindow.cpp | 0 {shared => src/shared}/help/indexwindow.h | 0 {shared => src/shared}/help/topicchooser.cpp | 0 {shared => src/shared}/help/topicchooser.h | 0 {shared => src/shared}/help/topicchooser.ui | 0 {shared => src/shared}/indenter/README | 0 {shared => src/shared}/indenter/constants.cpp | 0 {shared => src/shared}/indenter/indenter.h | 0 {shared => src/shared}/indenter/indenter.pri | 0 {shared => src/shared}/indenter/indenter_impl.h | 0 {shared => src/shared}/indenter/test/main.cpp | 0 {shared => src/shared}/indenter/test/test.pro | 0 {shared => src/shared}/namespace_global.h | 0 .../shared}/proparser/abstractproitemvisitor.h | 0 {shared => src/shared}/proparser/images/append.png | Bin {shared => src/shared}/proparser/images/other.png | Bin {shared => src/shared}/proparser/images/profile.png | Bin {shared => src/shared}/proparser/images/remove.png | Bin {shared => src/shared}/proparser/images/scope.png | Bin {shared => src/shared}/proparser/images/set.png | Bin {shared => src/shared}/proparser/images/value.png | Bin .../shared}/proparser/procommandmanager.cpp | 0 .../shared}/proparser/procommandmanager.h | 0 {shared => src/shared}/proparser/proeditor.cpp | 0 {shared => src/shared}/proparser/proeditor.h | 0 {shared => src/shared}/proparser/proeditor.ui | 0 {shared => src/shared}/proparser/proeditormodel.cpp | 0 {shared => src/shared}/proparser/proeditormodel.h | 0 .../shared}/proparser/profileevaluator.cpp | 0 {shared => src/shared}/proparser/profileevaluator.h | 0 {shared => src/shared}/proparser/proiteminfo.cpp | 0 {shared => src/shared}/proparser/proiteminfo.h | 0 {shared => src/shared}/proparser/proiteminfo.xml | 0 {shared => src/shared}/proparser/proitems.cpp | 0 {shared => src/shared}/proparser/proitems.h | 0 {shared => src/shared}/proparser/proparser.pri | 0 {shared => src/shared}/proparser/proparser.qrc | 0 {shared => src/shared}/proparser/proparserutils.h | 0 {shared => src/shared}/proparser/prowriter.cpp | 0 {shared => src/shared}/proparser/prowriter.h | 0 {shared => src/shared}/proparser/proxml.cpp | 0 {shared => src/shared}/proparser/proxml.h | 0 {shared => src/shared}/proparser/valueeditor.cpp | 0 {shared => src/shared}/proparser/valueeditor.h | 0 {shared => src/shared}/proparser/valueeditor.ui | 0 {shared => src/shared}/qrceditor/qrceditor.cpp | 0 {shared => src/shared}/qrceditor/qrceditor.h | 0 {shared => src/shared}/qrceditor/qrceditor.pri | 0 {shared => src/shared}/qrceditor/qrceditor.ui | 0 {shared => src/shared}/qrceditor/resourcefile.cpp | 0 {shared => src/shared}/qrceditor/resourcefile_p.h | 0 {shared => src/shared}/qrceditor/resourceview.cpp | 0 {shared => src/shared}/qrceditor/resourceview.h | 0 {shared => src/shared}/qrceditor/test/main.cpp | 0 .../shared}/qrceditor/test/mainwindow.cpp | 0 {shared => src/shared}/qrceditor/test/mainwindow.h | 0 {shared => src/shared}/qrceditor/test/test.pro | 0 {shared => src/shared}/qrceditor/undocommands.cpp | 0 {shared => src/shared}/qrceditor/undocommands_p.h | 0 {shared => src/shared}/qscripthighlighter/README | 0 .../qscripthighlighter/qscripthighlighter.cpp | 0 .../shared}/qscripthighlighter/qscripthighlighter.h | 0 .../qscripthighlighter/qscripthighlighter.pri | 0 .../shared}/qscripthighlighter/test/main.cpp | 0 .../shared}/qscripthighlighter/test/test.pro | 0 {shared => src/shared}/qtextended_integration.h | 0 {shared => src/shared}/qtlockedfile/README.txt | 0 {shared => src/shared}/qtlockedfile/namespace.patch | 0 .../shared}/qtlockedfile/qtlockedfile.cpp | 0 {shared => src/shared}/qtlockedfile/qtlockedfile.h | 0 .../shared}/qtlockedfile/qtlockedfile.pri | 0 .../shared}/qtlockedfile/qtlockedfile_unix.cpp | 0 .../shared}/qtlockedfile/qtlockedfile_win.cpp | 0 .../shared}/qtsingleapplication/README.txt | 0 .../shared}/qtsingleapplication/namespace.patch | 0 .../shared}/qtsingleapplication/qtlocalpeer.cpp | 0 .../shared}/qtsingleapplication/qtlocalpeer.h | 0 .../qtsingleapplication/qtsingleapplication.cpp | 0 .../qtsingleapplication/qtsingleapplication.h | 0 .../qtsingleapplication/qtsingleapplication.pri | 0 .../qtsingleapplication/qtsinglecoreapplication.cpp | 0 .../qtsingleapplication/qtsinglecoreapplication.h | 0 .../qtsingleapplication/qtsinglecoreapplication.pri | 0 {shared => src/shared}/scriptwrapper/README | 0 .../shared}/scriptwrapper/interface_wrap_helpers.h | 0 .../shared}/scriptwrapper/scriptwrapper.pri | 0 {shared => src/shared}/scriptwrapper/wrap_helpers.h | 0 203 files changed, 15 insertions(+), 16 deletions(-) rename {shared => src/shared}/cpaster/cgi.cpp (100%) rename {shared => src/shared}/cpaster/cgi.h (100%) rename {shared => src/shared}/cpaster/cpaster.pri (100%) rename {shared => src/shared}/cpaster/fetcher.cpp (100%) rename {shared => src/shared}/cpaster/fetcher.h (100%) rename {shared => src/shared}/cpaster/poster.cpp (100%) rename {shared => src/shared}/cpaster/poster.h (100%) rename {shared => src/shared}/cpaster/splitter.cpp (100%) rename {shared => src/shared}/cpaster/splitter.h (100%) rename {shared => src/shared}/cpaster/view.cpp (100%) rename {shared => src/shared}/cpaster/view.h (100%) rename {shared => src/shared}/cpaster/view.ui (100%) rename {shared => src/shared}/cplusplus/AST.cpp (100%) rename {shared => src/shared}/cplusplus/AST.h (100%) rename {shared => src/shared}/cplusplus/ASTVisitor.cpp (100%) rename {shared => src/shared}/cplusplus/ASTVisitor.h (100%) rename {shared => src/shared}/cplusplus/ASTfwd.h (100%) rename {shared => src/shared}/cplusplus/Array.cpp (100%) rename {shared => src/shared}/cplusplus/Array.h (100%) rename {shared => src/shared}/cplusplus/CPlusPlusForwardDeclarations.h (100%) rename {shared => src/shared}/cplusplus/CheckDeclaration.cpp (100%) rename {shared => src/shared}/cplusplus/CheckDeclaration.h (100%) rename {shared => src/shared}/cplusplus/CheckDeclarator.cpp (100%) rename {shared => src/shared}/cplusplus/CheckDeclarator.h (100%) rename {shared => src/shared}/cplusplus/CheckExpression.cpp (100%) rename {shared => src/shared}/cplusplus/CheckExpression.h (100%) rename {shared => src/shared}/cplusplus/CheckName.cpp (100%) rename {shared => src/shared}/cplusplus/CheckName.h (100%) rename {shared => src/shared}/cplusplus/CheckSpecifier.cpp (100%) rename {shared => src/shared}/cplusplus/CheckSpecifier.h (100%) rename {shared => src/shared}/cplusplus/CheckStatement.cpp (100%) rename {shared => src/shared}/cplusplus/CheckStatement.h (100%) rename {shared => src/shared}/cplusplus/Control.cpp (100%) rename {shared => src/shared}/cplusplus/Control.h (100%) rename {shared => src/shared}/cplusplus/CoreTypes.cpp (100%) rename {shared => src/shared}/cplusplus/CoreTypes.h (100%) rename {shared => src/shared}/cplusplus/DiagnosticClient.cpp (100%) rename {shared => src/shared}/cplusplus/DiagnosticClient.h (100%) rename {shared => src/shared}/cplusplus/FullySpecifiedType.cpp (100%) rename {shared => src/shared}/cplusplus/FullySpecifiedType.h (100%) rename {shared => src/shared}/cplusplus/Keywords.cpp (100%) rename {shared => src/shared}/cplusplus/Keywords.kwgen (100%) rename {shared => src/shared}/cplusplus/Lexer.cpp (100%) rename {shared => src/shared}/cplusplus/Lexer.h (100%) rename {shared => src/shared}/cplusplus/LiteralTable.cpp (100%) rename {shared => src/shared}/cplusplus/LiteralTable.h (100%) rename {shared => src/shared}/cplusplus/Literals.cpp (100%) rename {shared => src/shared}/cplusplus/Literals.h (100%) rename {shared => src/shared}/cplusplus/MemoryPool.cpp (100%) rename {shared => src/shared}/cplusplus/MemoryPool.h (100%) rename {shared => src/shared}/cplusplus/Name.cpp (100%) rename {shared => src/shared}/cplusplus/Name.h (100%) rename {shared => src/shared}/cplusplus/NameVisitor.cpp (100%) rename {shared => src/shared}/cplusplus/NameVisitor.h (100%) rename {shared => src/shared}/cplusplus/Names.cpp (100%) rename {shared => src/shared}/cplusplus/Names.h (100%) rename {shared => src/shared}/cplusplus/ObjectiveCAtKeywords.cpp (100%) rename {shared => src/shared}/cplusplus/Parser.cpp (100%) rename {shared => src/shared}/cplusplus/Parser.h (100%) rename {shared => src/shared}/cplusplus/PrettyPrinter.cpp (100%) rename {shared => src/shared}/cplusplus/PrettyPrinter.h (100%) rename {shared => src/shared}/cplusplus/Scope.cpp (100%) rename {shared => src/shared}/cplusplus/Scope.h (100%) rename {shared => src/shared}/cplusplus/Semantic.cpp (100%) rename {shared => src/shared}/cplusplus/Semantic.h (100%) rename {shared => src/shared}/cplusplus/SemanticCheck.cpp (100%) rename {shared => src/shared}/cplusplus/SemanticCheck.h (100%) rename {shared => src/shared}/cplusplus/Symbol.cpp (100%) rename {shared => src/shared}/cplusplus/Symbol.h (100%) rename {shared => src/shared}/cplusplus/SymbolVisitor.cpp (100%) rename {shared => src/shared}/cplusplus/SymbolVisitor.h (100%) rename {shared => src/shared}/cplusplus/Symbols.cpp (100%) rename {shared => src/shared}/cplusplus/Symbols.h (100%) rename {shared => src/shared}/cplusplus/Token.cpp (100%) rename {shared => src/shared}/cplusplus/Token.h (100%) rename {shared => src/shared}/cplusplus/TranslationUnit.cpp (100%) rename {shared => src/shared}/cplusplus/TranslationUnit.h (100%) rename {shared => src/shared}/cplusplus/Type.cpp (100%) rename {shared => src/shared}/cplusplus/Type.h (100%) rename {shared => src/shared}/cplusplus/TypeVisitor.cpp (100%) rename {shared => src/shared}/cplusplus/TypeVisitor.h (100%) rename {shared => src/shared}/cplusplus/cplusplus.pri (100%) rename {shared => src/shared}/designerintegrationv2/README.txt (100%) rename {shared => src/shared}/designerintegrationv2/designerintegration.pri (100%) rename {shared => src/shared}/designerintegrationv2/formresizer.cpp (100%) rename {shared => src/shared}/designerintegrationv2/formresizer.h (100%) rename {shared => src/shared}/designerintegrationv2/sizehandlerect.cpp (100%) rename {shared => src/shared}/designerintegrationv2/sizehandlerect.h (100%) rename {shared => src/shared}/designerintegrationv2/widgethost.cpp (100%) rename {shared => src/shared}/designerintegrationv2/widgethost.h (100%) rename {shared => src/shared}/designerintegrationv2/widgethostconstants.h (100%) rename {shared => src/shared}/help/bookmarkdialog.ui (100%) rename {shared => src/shared}/help/bookmarkmanager.cpp (100%) rename {shared => src/shared}/help/bookmarkmanager.h (100%) rename {shared => src/shared}/help/contentwindow.cpp (100%) rename {shared => src/shared}/help/contentwindow.h (100%) rename {shared => src/shared}/help/filternamedialog.cpp (100%) rename {shared => src/shared}/help/filternamedialog.h (100%) rename {shared => src/shared}/help/filternamedialog.ui (100%) rename {shared => src/shared}/help/help.pri (100%) rename {shared => src/shared}/help/helpviewer.cpp (100%) rename {shared => src/shared}/help/helpviewer.h (100%) rename {shared => src/shared}/help/indexwindow.cpp (100%) rename {shared => src/shared}/help/indexwindow.h (100%) rename {shared => src/shared}/help/topicchooser.cpp (100%) rename {shared => src/shared}/help/topicchooser.h (100%) rename {shared => src/shared}/help/topicchooser.ui (100%) rename {shared => src/shared}/indenter/README (100%) rename {shared => src/shared}/indenter/constants.cpp (100%) rename {shared => src/shared}/indenter/indenter.h (100%) rename {shared => src/shared}/indenter/indenter.pri (100%) rename {shared => src/shared}/indenter/indenter_impl.h (100%) rename {shared => src/shared}/indenter/test/main.cpp (100%) rename {shared => src/shared}/indenter/test/test.pro (100%) rename {shared => src/shared}/namespace_global.h (100%) rename {shared => src/shared}/proparser/abstractproitemvisitor.h (100%) rename {shared => src/shared}/proparser/images/append.png (100%) rename {shared => src/shared}/proparser/images/other.png (100%) rename {shared => src/shared}/proparser/images/profile.png (100%) rename {shared => src/shared}/proparser/images/remove.png (100%) rename {shared => src/shared}/proparser/images/scope.png (100%) rename {shared => src/shared}/proparser/images/set.png (100%) rename {shared => src/shared}/proparser/images/value.png (100%) rename {shared => src/shared}/proparser/procommandmanager.cpp (100%) rename {shared => src/shared}/proparser/procommandmanager.h (100%) rename {shared => src/shared}/proparser/proeditor.cpp (100%) rename {shared => src/shared}/proparser/proeditor.h (100%) rename {shared => src/shared}/proparser/proeditor.ui (100%) rename {shared => src/shared}/proparser/proeditormodel.cpp (100%) rename {shared => src/shared}/proparser/proeditormodel.h (100%) rename {shared => src/shared}/proparser/profileevaluator.cpp (100%) rename {shared => src/shared}/proparser/profileevaluator.h (100%) rename {shared => src/shared}/proparser/proiteminfo.cpp (100%) rename {shared => src/shared}/proparser/proiteminfo.h (100%) rename {shared => src/shared}/proparser/proiteminfo.xml (100%) rename {shared => src/shared}/proparser/proitems.cpp (100%) rename {shared => src/shared}/proparser/proitems.h (100%) rename {shared => src/shared}/proparser/proparser.pri (100%) rename {shared => src/shared}/proparser/proparser.qrc (100%) rename {shared => src/shared}/proparser/proparserutils.h (100%) rename {shared => src/shared}/proparser/prowriter.cpp (100%) rename {shared => src/shared}/proparser/prowriter.h (100%) rename {shared => src/shared}/proparser/proxml.cpp (100%) rename {shared => src/shared}/proparser/proxml.h (100%) rename {shared => src/shared}/proparser/valueeditor.cpp (100%) rename {shared => src/shared}/proparser/valueeditor.h (100%) rename {shared => src/shared}/proparser/valueeditor.ui (100%) rename {shared => src/shared}/qrceditor/qrceditor.cpp (100%) rename {shared => src/shared}/qrceditor/qrceditor.h (100%) rename {shared => src/shared}/qrceditor/qrceditor.pri (100%) rename {shared => src/shared}/qrceditor/qrceditor.ui (100%) rename {shared => src/shared}/qrceditor/resourcefile.cpp (100%) rename {shared => src/shared}/qrceditor/resourcefile_p.h (100%) rename {shared => src/shared}/qrceditor/resourceview.cpp (100%) rename {shared => src/shared}/qrceditor/resourceview.h (100%) rename {shared => src/shared}/qrceditor/test/main.cpp (100%) rename {shared => src/shared}/qrceditor/test/mainwindow.cpp (100%) rename {shared => src/shared}/qrceditor/test/mainwindow.h (100%) rename {shared => src/shared}/qrceditor/test/test.pro (100%) rename {shared => src/shared}/qrceditor/undocommands.cpp (100%) rename {shared => src/shared}/qrceditor/undocommands_p.h (100%) rename {shared => src/shared}/qscripthighlighter/README (100%) rename {shared => src/shared}/qscripthighlighter/qscripthighlighter.cpp (100%) rename {shared => src/shared}/qscripthighlighter/qscripthighlighter.h (100%) rename {shared => src/shared}/qscripthighlighter/qscripthighlighter.pri (100%) rename {shared => src/shared}/qscripthighlighter/test/main.cpp (100%) rename {shared => src/shared}/qscripthighlighter/test/test.pro (100%) rename {shared => src/shared}/qtextended_integration.h (100%) rename {shared => src/shared}/qtlockedfile/README.txt (100%) rename {shared => src/shared}/qtlockedfile/namespace.patch (100%) rename {shared => src/shared}/qtlockedfile/qtlockedfile.cpp (100%) rename {shared => src/shared}/qtlockedfile/qtlockedfile.h (100%) rename {shared => src/shared}/qtlockedfile/qtlockedfile.pri (100%) rename {shared => src/shared}/qtlockedfile/qtlockedfile_unix.cpp (100%) rename {shared => src/shared}/qtlockedfile/qtlockedfile_win.cpp (100%) rename {shared => src/shared}/qtsingleapplication/README.txt (100%) rename {shared => src/shared}/qtsingleapplication/namespace.patch (100%) rename {shared => src/shared}/qtsingleapplication/qtlocalpeer.cpp (100%) rename {shared => src/shared}/qtsingleapplication/qtlocalpeer.h (100%) rename {shared => src/shared}/qtsingleapplication/qtsingleapplication.cpp (100%) rename {shared => src/shared}/qtsingleapplication/qtsingleapplication.h (100%) rename {shared => src/shared}/qtsingleapplication/qtsingleapplication.pri (100%) rename {shared => src/shared}/qtsingleapplication/qtsinglecoreapplication.cpp (100%) rename {shared => src/shared}/qtsingleapplication/qtsinglecoreapplication.h (100%) rename {shared => src/shared}/qtsingleapplication/qtsinglecoreapplication.pri (100%) rename {shared => src/shared}/scriptwrapper/README (100%) rename {shared => src/shared}/scriptwrapper/interface_wrap_helpers.h (100%) rename {shared => src/shared}/scriptwrapper/scriptwrapper.pri (100%) rename {shared => src/shared}/scriptwrapper/wrap_helpers.h (100%) diff --git a/src/app/app.pro b/src/app/app.pro index a8cb1a8e9dc..cc8ccbe1af1 100644 --- a/src/app/app.pro +++ b/src/app/app.pro @@ -1,7 +1,7 @@ IDE_BUILD_TREE = $$OUT_PWD/../../ include(../qworkbench.pri) -include(../../shared/qtsingleapplication/qtsingleapplication.pri) +include(../shared/qtsingleapplication/qtsingleapplication.pri) macx { CONFIG(debug, debug|release):LIBS *= -lExtensionSystem_debug -lAggregation_debug diff --git a/src/libs/cplusplus/cplusplus.pri b/src/libs/cplusplus/cplusplus.pri index e2d0f6f0339..e0cdf8900f0 100644 --- a/src/libs/cplusplus/cplusplus.pri +++ b/src/libs/cplusplus/cplusplus.pri @@ -1,3 +1,3 @@ -INCLUDEPATH += $$PWD/../../../shared/cplusplus +INCLUDEPATH += $$PWD/../../shared/cplusplus DEFINES += HAVE_QT CPLUSPLUS_WITH_NAMESPACE LIBS *= -l$$qtLibraryTarget(CPlusPlus) diff --git a/src/libs/cplusplus/cplusplus.pro b/src/libs/cplusplus/cplusplus.pro index f89d4d3f862..ccc38abb490 100644 --- a/src/libs/cplusplus/cplusplus.pro +++ b/src/libs/cplusplus/cplusplus.pro @@ -7,7 +7,7 @@ DEFINES += NDEBUG unix:QMAKE_CXXFLAGS_DEBUG += -O3 include(../../qworkbenchlibrary.pri) -include(../../../shared/cplusplus/cplusplus.pri) +include(../../shared/cplusplus/cplusplus.pri) HEADERS += \ SimpleLexer.h \ diff --git a/src/plugins/coreplugin/coreplugin.pro b/src/plugins/coreplugin/coreplugin.pro index 36f170fcf97..97b4180fe68 100644 --- a/src/plugins/coreplugin/coreplugin.pro +++ b/src/plugins/coreplugin/coreplugin.pro @@ -7,7 +7,7 @@ QT += xml \ include(../../qworkbenchplugin.pri) include(../../libs/utils/utils.pri) -include(../../../shared/scriptwrapper/scriptwrapper.pri) +include(../../shared/scriptwrapper/scriptwrapper.pri) include(coreplugin_dependencies.pri) INCLUDEPATH += dialogs \ actionmanager \ diff --git a/src/plugins/cpaster/cpaster.pro b/src/plugins/cpaster/cpaster.pro index 4ecdc545371..d75a91de5a1 100644 --- a/src/plugins/cpaster/cpaster.pro +++ b/src/plugins/cpaster/cpaster.pro @@ -12,4 +12,4 @@ SOURCES += cpasterplugin.cpp \ FORMS += settingspage.ui \ pasteselect.ui -include(../../../shared/cpaster/cpaster.pri) +include(../../shared/cpaster/cpaster.pri) diff --git a/src/plugins/cppeditor/cppeditor.pro b/src/plugins/cppeditor/cppeditor.pro index 3204ddf0943..2d28c6c8b86 100644 --- a/src/plugins/cppeditor/cppeditor.pro +++ b/src/plugins/cppeditor/cppeditor.pro @@ -3,6 +3,7 @@ TARGET = CppEditor DEFINES += CPPEDITOR_LIBRARY CONFIG += help include(../../libs/utils/utils.pri) +include(../../shared/indenter/indenter.pri) include(../../qworkbenchplugin.pri) include(cppeditor_dependencies.pri) HEADERS += cppplugin.h \ diff --git a/src/plugins/designer/designer.pro b/src/plugins/designer/designer.pro index 7006e656148..444eb2e7949 100644 --- a/src/plugins/designer/designer.pro +++ b/src/plugins/designer/designer.pro @@ -2,7 +2,7 @@ TEMPLATE = lib TARGET = Designer include(../../qworkbenchplugin.pri) -include(../../../shared/designerintegrationv2/designerintegration.pri) +include(../../shared/designerintegrationv2/designerintegration.pri) include(cpp/cpp.pri) include(designer_dependencies.pri) diff --git a/src/plugins/fakevim/fakevim.pro b/src/plugins/fakevim/fakevim.pro index 2c85f8c50b2..5c8ecd48429 100644 --- a/src/plugins/fakevim/fakevim.pro +++ b/src/plugins/fakevim/fakevim.pro @@ -8,7 +8,7 @@ include(../../plugins/projectexplorer/projectexplorer.pri) include(../../plugins/coreplugin/coreplugin.pri) include(../../plugins/texteditor/texteditor.pri) include(../../plugins/texteditor/cppeditor.pri) -include(../../../shared/indenter/indenter.pri) +include(../../shared/indenter/indenter.pri) # DEFINES += QT_NO_CAST_FROM_ASCII QT_NO_CAST_TO_ASCII QT += gui diff --git a/src/plugins/help/help.pro b/src/plugins/help/help.pro index b2e9a1dbd61..6fd810634b5 100644 --- a/src/plugins/help/help.pro +++ b/src/plugins/help/help.pro @@ -30,7 +30,7 @@ SOURCES += helpplugin.cpp \ FORMS += docsettingspage.ui \ filtersettingspage.ui RESOURCES += help.qrc -include(../../../shared/help/help.pri) +include(../../shared/help/help.pri) contains(QT_CONFIG, webkit) { QT += webkit diff --git a/src/plugins/projectexplorer/projectexplorer.pro b/src/plugins/projectexplorer/projectexplorer.pro index e345ff1c1ce..c62362c6ebe 100644 --- a/src/plugins/projectexplorer/projectexplorer.pro +++ b/src/plugins/projectexplorer/projectexplorer.pro @@ -4,7 +4,7 @@ QT += xml \ script include(../../qworkbenchplugin.pri) include(projectexplorer_dependencies.pri) -include(../../../shared/scriptwrapper/scriptwrapper.pri) +include(../../shared/scriptwrapper/scriptwrapper.pri) HEADERS += projectexplorer.h \ projectexplorer_export.h \ projectwindow.h \ diff --git a/src/plugins/qt4projectmanager/qt4projectmanager.pro b/src/plugins/qt4projectmanager/qt4projectmanager.pro index c7dc608437f..4cb8ff322b5 100644 --- a/src/plugins/qt4projectmanager/qt4projectmanager.pro +++ b/src/plugins/qt4projectmanager/qt4projectmanager.pro @@ -93,5 +93,5 @@ FORMS = qtversionmanager.ui \ qt4buildenvironmentwidget.ui RESOURCES = qt4projectmanager.qrc \ wizards/wizards.qrc -include(../../../shared/proparser/proparser.pri) +include(../../shared/proparser/proparser.pri) DEFINES += QT_NO_CAST_TO_ASCII diff --git a/src/plugins/qtscripteditor/qtscripteditor.pro b/src/plugins/qtscripteditor/qtscripteditor.pro index 1e93663ec4e..18fd16a0e40 100644 --- a/src/plugins/qtscripteditor/qtscripteditor.pro +++ b/src/plugins/qtscripteditor/qtscripteditor.pro @@ -3,10 +3,10 @@ TARGET = QtScriptEditor QT += script include(../../qworkbenchplugin.pri) -include(../../plugins/texteditor/texteditor.pri) -include(../../../shared/qscripthighlighter/qscripthighlighter.pri) -include(../../../shared/indenter/indenter.pri) include(../../plugins/coreplugin/coreplugin.pri) +include(../../plugins/texteditor/texteditor.pri) +include(../../shared/qscripthighlighter/qscripthighlighter.pri) +include(../../shared/indenter/indenter.pri) HEADERS += qtscripteditor.h \ qtscripteditorfactory.h \ diff --git a/src/plugins/resourceeditor/resourceeditor.pro b/src/plugins/resourceeditor/resourceeditor.pro index e91099d9630..5df0d635e57 100644 --- a/src/plugins/resourceeditor/resourceeditor.pro +++ b/src/plugins/resourceeditor/resourceeditor.pro @@ -6,7 +6,7 @@ qtAddLibrary(QtDesigner) include(../../qworkbenchplugin.pri) include(../../libs/utils/utils.pri) include(../../plugins/coreplugin/coreplugin.pri) -include(../../../shared/qrceditor/qrceditor.pri) +include(../../shared/qrceditor/qrceditor.pri) INCLUDEPATH += $$PWD/../../tools/utils diff --git a/src/rpath.pri b/src/rpath.pri index e6812dbc23a..8b026982c96 100644 --- a/src/rpath.pri +++ b/src/rpath.pri @@ -9,5 +9,3 @@ macx { QMAKE_LFLAGS += -Wl,-z,origin \'-Wl,-rpath,$${IDE_PLUGIN_RPATH}\' QMAKE_RPATHDIR = } - - diff --git a/shared/cpaster/cgi.cpp b/src/shared/cpaster/cgi.cpp similarity index 100% rename from shared/cpaster/cgi.cpp rename to src/shared/cpaster/cgi.cpp diff --git a/shared/cpaster/cgi.h b/src/shared/cpaster/cgi.h similarity index 100% rename from shared/cpaster/cgi.h rename to src/shared/cpaster/cgi.h diff --git a/shared/cpaster/cpaster.pri b/src/shared/cpaster/cpaster.pri similarity index 100% rename from shared/cpaster/cpaster.pri rename to src/shared/cpaster/cpaster.pri diff --git a/shared/cpaster/fetcher.cpp b/src/shared/cpaster/fetcher.cpp similarity index 100% rename from shared/cpaster/fetcher.cpp rename to src/shared/cpaster/fetcher.cpp diff --git a/shared/cpaster/fetcher.h b/src/shared/cpaster/fetcher.h similarity index 100% rename from shared/cpaster/fetcher.h rename to src/shared/cpaster/fetcher.h diff --git a/shared/cpaster/poster.cpp b/src/shared/cpaster/poster.cpp similarity index 100% rename from shared/cpaster/poster.cpp rename to src/shared/cpaster/poster.cpp diff --git a/shared/cpaster/poster.h b/src/shared/cpaster/poster.h similarity index 100% rename from shared/cpaster/poster.h rename to src/shared/cpaster/poster.h diff --git a/shared/cpaster/splitter.cpp b/src/shared/cpaster/splitter.cpp similarity index 100% rename from shared/cpaster/splitter.cpp rename to src/shared/cpaster/splitter.cpp diff --git a/shared/cpaster/splitter.h b/src/shared/cpaster/splitter.h similarity index 100% rename from shared/cpaster/splitter.h rename to src/shared/cpaster/splitter.h diff --git a/shared/cpaster/view.cpp b/src/shared/cpaster/view.cpp similarity index 100% rename from shared/cpaster/view.cpp rename to src/shared/cpaster/view.cpp diff --git a/shared/cpaster/view.h b/src/shared/cpaster/view.h similarity index 100% rename from shared/cpaster/view.h rename to src/shared/cpaster/view.h diff --git a/shared/cpaster/view.ui b/src/shared/cpaster/view.ui similarity index 100% rename from shared/cpaster/view.ui rename to src/shared/cpaster/view.ui diff --git a/shared/cplusplus/AST.cpp b/src/shared/cplusplus/AST.cpp similarity index 100% rename from shared/cplusplus/AST.cpp rename to src/shared/cplusplus/AST.cpp diff --git a/shared/cplusplus/AST.h b/src/shared/cplusplus/AST.h similarity index 100% rename from shared/cplusplus/AST.h rename to src/shared/cplusplus/AST.h diff --git a/shared/cplusplus/ASTVisitor.cpp b/src/shared/cplusplus/ASTVisitor.cpp similarity index 100% rename from shared/cplusplus/ASTVisitor.cpp rename to src/shared/cplusplus/ASTVisitor.cpp diff --git a/shared/cplusplus/ASTVisitor.h b/src/shared/cplusplus/ASTVisitor.h similarity index 100% rename from shared/cplusplus/ASTVisitor.h rename to src/shared/cplusplus/ASTVisitor.h diff --git a/shared/cplusplus/ASTfwd.h b/src/shared/cplusplus/ASTfwd.h similarity index 100% rename from shared/cplusplus/ASTfwd.h rename to src/shared/cplusplus/ASTfwd.h diff --git a/shared/cplusplus/Array.cpp b/src/shared/cplusplus/Array.cpp similarity index 100% rename from shared/cplusplus/Array.cpp rename to src/shared/cplusplus/Array.cpp diff --git a/shared/cplusplus/Array.h b/src/shared/cplusplus/Array.h similarity index 100% rename from shared/cplusplus/Array.h rename to src/shared/cplusplus/Array.h diff --git a/shared/cplusplus/CPlusPlusForwardDeclarations.h b/src/shared/cplusplus/CPlusPlusForwardDeclarations.h similarity index 100% rename from shared/cplusplus/CPlusPlusForwardDeclarations.h rename to src/shared/cplusplus/CPlusPlusForwardDeclarations.h diff --git a/shared/cplusplus/CheckDeclaration.cpp b/src/shared/cplusplus/CheckDeclaration.cpp similarity index 100% rename from shared/cplusplus/CheckDeclaration.cpp rename to src/shared/cplusplus/CheckDeclaration.cpp diff --git a/shared/cplusplus/CheckDeclaration.h b/src/shared/cplusplus/CheckDeclaration.h similarity index 100% rename from shared/cplusplus/CheckDeclaration.h rename to src/shared/cplusplus/CheckDeclaration.h diff --git a/shared/cplusplus/CheckDeclarator.cpp b/src/shared/cplusplus/CheckDeclarator.cpp similarity index 100% rename from shared/cplusplus/CheckDeclarator.cpp rename to src/shared/cplusplus/CheckDeclarator.cpp diff --git a/shared/cplusplus/CheckDeclarator.h b/src/shared/cplusplus/CheckDeclarator.h similarity index 100% rename from shared/cplusplus/CheckDeclarator.h rename to src/shared/cplusplus/CheckDeclarator.h diff --git a/shared/cplusplus/CheckExpression.cpp b/src/shared/cplusplus/CheckExpression.cpp similarity index 100% rename from shared/cplusplus/CheckExpression.cpp rename to src/shared/cplusplus/CheckExpression.cpp diff --git a/shared/cplusplus/CheckExpression.h b/src/shared/cplusplus/CheckExpression.h similarity index 100% rename from shared/cplusplus/CheckExpression.h rename to src/shared/cplusplus/CheckExpression.h diff --git a/shared/cplusplus/CheckName.cpp b/src/shared/cplusplus/CheckName.cpp similarity index 100% rename from shared/cplusplus/CheckName.cpp rename to src/shared/cplusplus/CheckName.cpp diff --git a/shared/cplusplus/CheckName.h b/src/shared/cplusplus/CheckName.h similarity index 100% rename from shared/cplusplus/CheckName.h rename to src/shared/cplusplus/CheckName.h diff --git a/shared/cplusplus/CheckSpecifier.cpp b/src/shared/cplusplus/CheckSpecifier.cpp similarity index 100% rename from shared/cplusplus/CheckSpecifier.cpp rename to src/shared/cplusplus/CheckSpecifier.cpp diff --git a/shared/cplusplus/CheckSpecifier.h b/src/shared/cplusplus/CheckSpecifier.h similarity index 100% rename from shared/cplusplus/CheckSpecifier.h rename to src/shared/cplusplus/CheckSpecifier.h diff --git a/shared/cplusplus/CheckStatement.cpp b/src/shared/cplusplus/CheckStatement.cpp similarity index 100% rename from shared/cplusplus/CheckStatement.cpp rename to src/shared/cplusplus/CheckStatement.cpp diff --git a/shared/cplusplus/CheckStatement.h b/src/shared/cplusplus/CheckStatement.h similarity index 100% rename from shared/cplusplus/CheckStatement.h rename to src/shared/cplusplus/CheckStatement.h diff --git a/shared/cplusplus/Control.cpp b/src/shared/cplusplus/Control.cpp similarity index 100% rename from shared/cplusplus/Control.cpp rename to src/shared/cplusplus/Control.cpp diff --git a/shared/cplusplus/Control.h b/src/shared/cplusplus/Control.h similarity index 100% rename from shared/cplusplus/Control.h rename to src/shared/cplusplus/Control.h diff --git a/shared/cplusplus/CoreTypes.cpp b/src/shared/cplusplus/CoreTypes.cpp similarity index 100% rename from shared/cplusplus/CoreTypes.cpp rename to src/shared/cplusplus/CoreTypes.cpp diff --git a/shared/cplusplus/CoreTypes.h b/src/shared/cplusplus/CoreTypes.h similarity index 100% rename from shared/cplusplus/CoreTypes.h rename to src/shared/cplusplus/CoreTypes.h diff --git a/shared/cplusplus/DiagnosticClient.cpp b/src/shared/cplusplus/DiagnosticClient.cpp similarity index 100% rename from shared/cplusplus/DiagnosticClient.cpp rename to src/shared/cplusplus/DiagnosticClient.cpp diff --git a/shared/cplusplus/DiagnosticClient.h b/src/shared/cplusplus/DiagnosticClient.h similarity index 100% rename from shared/cplusplus/DiagnosticClient.h rename to src/shared/cplusplus/DiagnosticClient.h diff --git a/shared/cplusplus/FullySpecifiedType.cpp b/src/shared/cplusplus/FullySpecifiedType.cpp similarity index 100% rename from shared/cplusplus/FullySpecifiedType.cpp rename to src/shared/cplusplus/FullySpecifiedType.cpp diff --git a/shared/cplusplus/FullySpecifiedType.h b/src/shared/cplusplus/FullySpecifiedType.h similarity index 100% rename from shared/cplusplus/FullySpecifiedType.h rename to src/shared/cplusplus/FullySpecifiedType.h diff --git a/shared/cplusplus/Keywords.cpp b/src/shared/cplusplus/Keywords.cpp similarity index 100% rename from shared/cplusplus/Keywords.cpp rename to src/shared/cplusplus/Keywords.cpp diff --git a/shared/cplusplus/Keywords.kwgen b/src/shared/cplusplus/Keywords.kwgen similarity index 100% rename from shared/cplusplus/Keywords.kwgen rename to src/shared/cplusplus/Keywords.kwgen diff --git a/shared/cplusplus/Lexer.cpp b/src/shared/cplusplus/Lexer.cpp similarity index 100% rename from shared/cplusplus/Lexer.cpp rename to src/shared/cplusplus/Lexer.cpp diff --git a/shared/cplusplus/Lexer.h b/src/shared/cplusplus/Lexer.h similarity index 100% rename from shared/cplusplus/Lexer.h rename to src/shared/cplusplus/Lexer.h diff --git a/shared/cplusplus/LiteralTable.cpp b/src/shared/cplusplus/LiteralTable.cpp similarity index 100% rename from shared/cplusplus/LiteralTable.cpp rename to src/shared/cplusplus/LiteralTable.cpp diff --git a/shared/cplusplus/LiteralTable.h b/src/shared/cplusplus/LiteralTable.h similarity index 100% rename from shared/cplusplus/LiteralTable.h rename to src/shared/cplusplus/LiteralTable.h diff --git a/shared/cplusplus/Literals.cpp b/src/shared/cplusplus/Literals.cpp similarity index 100% rename from shared/cplusplus/Literals.cpp rename to src/shared/cplusplus/Literals.cpp diff --git a/shared/cplusplus/Literals.h b/src/shared/cplusplus/Literals.h similarity index 100% rename from shared/cplusplus/Literals.h rename to src/shared/cplusplus/Literals.h diff --git a/shared/cplusplus/MemoryPool.cpp b/src/shared/cplusplus/MemoryPool.cpp similarity index 100% rename from shared/cplusplus/MemoryPool.cpp rename to src/shared/cplusplus/MemoryPool.cpp diff --git a/shared/cplusplus/MemoryPool.h b/src/shared/cplusplus/MemoryPool.h similarity index 100% rename from shared/cplusplus/MemoryPool.h rename to src/shared/cplusplus/MemoryPool.h diff --git a/shared/cplusplus/Name.cpp b/src/shared/cplusplus/Name.cpp similarity index 100% rename from shared/cplusplus/Name.cpp rename to src/shared/cplusplus/Name.cpp diff --git a/shared/cplusplus/Name.h b/src/shared/cplusplus/Name.h similarity index 100% rename from shared/cplusplus/Name.h rename to src/shared/cplusplus/Name.h diff --git a/shared/cplusplus/NameVisitor.cpp b/src/shared/cplusplus/NameVisitor.cpp similarity index 100% rename from shared/cplusplus/NameVisitor.cpp rename to src/shared/cplusplus/NameVisitor.cpp diff --git a/shared/cplusplus/NameVisitor.h b/src/shared/cplusplus/NameVisitor.h similarity index 100% rename from shared/cplusplus/NameVisitor.h rename to src/shared/cplusplus/NameVisitor.h diff --git a/shared/cplusplus/Names.cpp b/src/shared/cplusplus/Names.cpp similarity index 100% rename from shared/cplusplus/Names.cpp rename to src/shared/cplusplus/Names.cpp diff --git a/shared/cplusplus/Names.h b/src/shared/cplusplus/Names.h similarity index 100% rename from shared/cplusplus/Names.h rename to src/shared/cplusplus/Names.h diff --git a/shared/cplusplus/ObjectiveCAtKeywords.cpp b/src/shared/cplusplus/ObjectiveCAtKeywords.cpp similarity index 100% rename from shared/cplusplus/ObjectiveCAtKeywords.cpp rename to src/shared/cplusplus/ObjectiveCAtKeywords.cpp diff --git a/shared/cplusplus/Parser.cpp b/src/shared/cplusplus/Parser.cpp similarity index 100% rename from shared/cplusplus/Parser.cpp rename to src/shared/cplusplus/Parser.cpp diff --git a/shared/cplusplus/Parser.h b/src/shared/cplusplus/Parser.h similarity index 100% rename from shared/cplusplus/Parser.h rename to src/shared/cplusplus/Parser.h diff --git a/shared/cplusplus/PrettyPrinter.cpp b/src/shared/cplusplus/PrettyPrinter.cpp similarity index 100% rename from shared/cplusplus/PrettyPrinter.cpp rename to src/shared/cplusplus/PrettyPrinter.cpp diff --git a/shared/cplusplus/PrettyPrinter.h b/src/shared/cplusplus/PrettyPrinter.h similarity index 100% rename from shared/cplusplus/PrettyPrinter.h rename to src/shared/cplusplus/PrettyPrinter.h diff --git a/shared/cplusplus/Scope.cpp b/src/shared/cplusplus/Scope.cpp similarity index 100% rename from shared/cplusplus/Scope.cpp rename to src/shared/cplusplus/Scope.cpp diff --git a/shared/cplusplus/Scope.h b/src/shared/cplusplus/Scope.h similarity index 100% rename from shared/cplusplus/Scope.h rename to src/shared/cplusplus/Scope.h diff --git a/shared/cplusplus/Semantic.cpp b/src/shared/cplusplus/Semantic.cpp similarity index 100% rename from shared/cplusplus/Semantic.cpp rename to src/shared/cplusplus/Semantic.cpp diff --git a/shared/cplusplus/Semantic.h b/src/shared/cplusplus/Semantic.h similarity index 100% rename from shared/cplusplus/Semantic.h rename to src/shared/cplusplus/Semantic.h diff --git a/shared/cplusplus/SemanticCheck.cpp b/src/shared/cplusplus/SemanticCheck.cpp similarity index 100% rename from shared/cplusplus/SemanticCheck.cpp rename to src/shared/cplusplus/SemanticCheck.cpp diff --git a/shared/cplusplus/SemanticCheck.h b/src/shared/cplusplus/SemanticCheck.h similarity index 100% rename from shared/cplusplus/SemanticCheck.h rename to src/shared/cplusplus/SemanticCheck.h diff --git a/shared/cplusplus/Symbol.cpp b/src/shared/cplusplus/Symbol.cpp similarity index 100% rename from shared/cplusplus/Symbol.cpp rename to src/shared/cplusplus/Symbol.cpp diff --git a/shared/cplusplus/Symbol.h b/src/shared/cplusplus/Symbol.h similarity index 100% rename from shared/cplusplus/Symbol.h rename to src/shared/cplusplus/Symbol.h diff --git a/shared/cplusplus/SymbolVisitor.cpp b/src/shared/cplusplus/SymbolVisitor.cpp similarity index 100% rename from shared/cplusplus/SymbolVisitor.cpp rename to src/shared/cplusplus/SymbolVisitor.cpp diff --git a/shared/cplusplus/SymbolVisitor.h b/src/shared/cplusplus/SymbolVisitor.h similarity index 100% rename from shared/cplusplus/SymbolVisitor.h rename to src/shared/cplusplus/SymbolVisitor.h diff --git a/shared/cplusplus/Symbols.cpp b/src/shared/cplusplus/Symbols.cpp similarity index 100% rename from shared/cplusplus/Symbols.cpp rename to src/shared/cplusplus/Symbols.cpp diff --git a/shared/cplusplus/Symbols.h b/src/shared/cplusplus/Symbols.h similarity index 100% rename from shared/cplusplus/Symbols.h rename to src/shared/cplusplus/Symbols.h diff --git a/shared/cplusplus/Token.cpp b/src/shared/cplusplus/Token.cpp similarity index 100% rename from shared/cplusplus/Token.cpp rename to src/shared/cplusplus/Token.cpp diff --git a/shared/cplusplus/Token.h b/src/shared/cplusplus/Token.h similarity index 100% rename from shared/cplusplus/Token.h rename to src/shared/cplusplus/Token.h diff --git a/shared/cplusplus/TranslationUnit.cpp b/src/shared/cplusplus/TranslationUnit.cpp similarity index 100% rename from shared/cplusplus/TranslationUnit.cpp rename to src/shared/cplusplus/TranslationUnit.cpp diff --git a/shared/cplusplus/TranslationUnit.h b/src/shared/cplusplus/TranslationUnit.h similarity index 100% rename from shared/cplusplus/TranslationUnit.h rename to src/shared/cplusplus/TranslationUnit.h diff --git a/shared/cplusplus/Type.cpp b/src/shared/cplusplus/Type.cpp similarity index 100% rename from shared/cplusplus/Type.cpp rename to src/shared/cplusplus/Type.cpp diff --git a/shared/cplusplus/Type.h b/src/shared/cplusplus/Type.h similarity index 100% rename from shared/cplusplus/Type.h rename to src/shared/cplusplus/Type.h diff --git a/shared/cplusplus/TypeVisitor.cpp b/src/shared/cplusplus/TypeVisitor.cpp similarity index 100% rename from shared/cplusplus/TypeVisitor.cpp rename to src/shared/cplusplus/TypeVisitor.cpp diff --git a/shared/cplusplus/TypeVisitor.h b/src/shared/cplusplus/TypeVisitor.h similarity index 100% rename from shared/cplusplus/TypeVisitor.h rename to src/shared/cplusplus/TypeVisitor.h diff --git a/shared/cplusplus/cplusplus.pri b/src/shared/cplusplus/cplusplus.pri similarity index 100% rename from shared/cplusplus/cplusplus.pri rename to src/shared/cplusplus/cplusplus.pri diff --git a/shared/designerintegrationv2/README.txt b/src/shared/designerintegrationv2/README.txt similarity index 100% rename from shared/designerintegrationv2/README.txt rename to src/shared/designerintegrationv2/README.txt diff --git a/shared/designerintegrationv2/designerintegration.pri b/src/shared/designerintegrationv2/designerintegration.pri similarity index 100% rename from shared/designerintegrationv2/designerintegration.pri rename to src/shared/designerintegrationv2/designerintegration.pri diff --git a/shared/designerintegrationv2/formresizer.cpp b/src/shared/designerintegrationv2/formresizer.cpp similarity index 100% rename from shared/designerintegrationv2/formresizer.cpp rename to src/shared/designerintegrationv2/formresizer.cpp diff --git a/shared/designerintegrationv2/formresizer.h b/src/shared/designerintegrationv2/formresizer.h similarity index 100% rename from shared/designerintegrationv2/formresizer.h rename to src/shared/designerintegrationv2/formresizer.h diff --git a/shared/designerintegrationv2/sizehandlerect.cpp b/src/shared/designerintegrationv2/sizehandlerect.cpp similarity index 100% rename from shared/designerintegrationv2/sizehandlerect.cpp rename to src/shared/designerintegrationv2/sizehandlerect.cpp diff --git a/shared/designerintegrationv2/sizehandlerect.h b/src/shared/designerintegrationv2/sizehandlerect.h similarity index 100% rename from shared/designerintegrationv2/sizehandlerect.h rename to src/shared/designerintegrationv2/sizehandlerect.h diff --git a/shared/designerintegrationv2/widgethost.cpp b/src/shared/designerintegrationv2/widgethost.cpp similarity index 100% rename from shared/designerintegrationv2/widgethost.cpp rename to src/shared/designerintegrationv2/widgethost.cpp diff --git a/shared/designerintegrationv2/widgethost.h b/src/shared/designerintegrationv2/widgethost.h similarity index 100% rename from shared/designerintegrationv2/widgethost.h rename to src/shared/designerintegrationv2/widgethost.h diff --git a/shared/designerintegrationv2/widgethostconstants.h b/src/shared/designerintegrationv2/widgethostconstants.h similarity index 100% rename from shared/designerintegrationv2/widgethostconstants.h rename to src/shared/designerintegrationv2/widgethostconstants.h diff --git a/shared/help/bookmarkdialog.ui b/src/shared/help/bookmarkdialog.ui similarity index 100% rename from shared/help/bookmarkdialog.ui rename to src/shared/help/bookmarkdialog.ui diff --git a/shared/help/bookmarkmanager.cpp b/src/shared/help/bookmarkmanager.cpp similarity index 100% rename from shared/help/bookmarkmanager.cpp rename to src/shared/help/bookmarkmanager.cpp diff --git a/shared/help/bookmarkmanager.h b/src/shared/help/bookmarkmanager.h similarity index 100% rename from shared/help/bookmarkmanager.h rename to src/shared/help/bookmarkmanager.h diff --git a/shared/help/contentwindow.cpp b/src/shared/help/contentwindow.cpp similarity index 100% rename from shared/help/contentwindow.cpp rename to src/shared/help/contentwindow.cpp diff --git a/shared/help/contentwindow.h b/src/shared/help/contentwindow.h similarity index 100% rename from shared/help/contentwindow.h rename to src/shared/help/contentwindow.h diff --git a/shared/help/filternamedialog.cpp b/src/shared/help/filternamedialog.cpp similarity index 100% rename from shared/help/filternamedialog.cpp rename to src/shared/help/filternamedialog.cpp diff --git a/shared/help/filternamedialog.h b/src/shared/help/filternamedialog.h similarity index 100% rename from shared/help/filternamedialog.h rename to src/shared/help/filternamedialog.h diff --git a/shared/help/filternamedialog.ui b/src/shared/help/filternamedialog.ui similarity index 100% rename from shared/help/filternamedialog.ui rename to src/shared/help/filternamedialog.ui diff --git a/shared/help/help.pri b/src/shared/help/help.pri similarity index 100% rename from shared/help/help.pri rename to src/shared/help/help.pri diff --git a/shared/help/helpviewer.cpp b/src/shared/help/helpviewer.cpp similarity index 100% rename from shared/help/helpviewer.cpp rename to src/shared/help/helpviewer.cpp diff --git a/shared/help/helpviewer.h b/src/shared/help/helpviewer.h similarity index 100% rename from shared/help/helpviewer.h rename to src/shared/help/helpviewer.h diff --git a/shared/help/indexwindow.cpp b/src/shared/help/indexwindow.cpp similarity index 100% rename from shared/help/indexwindow.cpp rename to src/shared/help/indexwindow.cpp diff --git a/shared/help/indexwindow.h b/src/shared/help/indexwindow.h similarity index 100% rename from shared/help/indexwindow.h rename to src/shared/help/indexwindow.h diff --git a/shared/help/topicchooser.cpp b/src/shared/help/topicchooser.cpp similarity index 100% rename from shared/help/topicchooser.cpp rename to src/shared/help/topicchooser.cpp diff --git a/shared/help/topicchooser.h b/src/shared/help/topicchooser.h similarity index 100% rename from shared/help/topicchooser.h rename to src/shared/help/topicchooser.h diff --git a/shared/help/topicchooser.ui b/src/shared/help/topicchooser.ui similarity index 100% rename from shared/help/topicchooser.ui rename to src/shared/help/topicchooser.ui diff --git a/shared/indenter/README b/src/shared/indenter/README similarity index 100% rename from shared/indenter/README rename to src/shared/indenter/README diff --git a/shared/indenter/constants.cpp b/src/shared/indenter/constants.cpp similarity index 100% rename from shared/indenter/constants.cpp rename to src/shared/indenter/constants.cpp diff --git a/shared/indenter/indenter.h b/src/shared/indenter/indenter.h similarity index 100% rename from shared/indenter/indenter.h rename to src/shared/indenter/indenter.h diff --git a/shared/indenter/indenter.pri b/src/shared/indenter/indenter.pri similarity index 100% rename from shared/indenter/indenter.pri rename to src/shared/indenter/indenter.pri diff --git a/shared/indenter/indenter_impl.h b/src/shared/indenter/indenter_impl.h similarity index 100% rename from shared/indenter/indenter_impl.h rename to src/shared/indenter/indenter_impl.h diff --git a/shared/indenter/test/main.cpp b/src/shared/indenter/test/main.cpp similarity index 100% rename from shared/indenter/test/main.cpp rename to src/shared/indenter/test/main.cpp diff --git a/shared/indenter/test/test.pro b/src/shared/indenter/test/test.pro similarity index 100% rename from shared/indenter/test/test.pro rename to src/shared/indenter/test/test.pro diff --git a/shared/namespace_global.h b/src/shared/namespace_global.h similarity index 100% rename from shared/namespace_global.h rename to src/shared/namespace_global.h diff --git a/shared/proparser/abstractproitemvisitor.h b/src/shared/proparser/abstractproitemvisitor.h similarity index 100% rename from shared/proparser/abstractproitemvisitor.h rename to src/shared/proparser/abstractproitemvisitor.h diff --git a/shared/proparser/images/append.png b/src/shared/proparser/images/append.png similarity index 100% rename from shared/proparser/images/append.png rename to src/shared/proparser/images/append.png diff --git a/shared/proparser/images/other.png b/src/shared/proparser/images/other.png similarity index 100% rename from shared/proparser/images/other.png rename to src/shared/proparser/images/other.png diff --git a/shared/proparser/images/profile.png b/src/shared/proparser/images/profile.png similarity index 100% rename from shared/proparser/images/profile.png rename to src/shared/proparser/images/profile.png diff --git a/shared/proparser/images/remove.png b/src/shared/proparser/images/remove.png similarity index 100% rename from shared/proparser/images/remove.png rename to src/shared/proparser/images/remove.png diff --git a/shared/proparser/images/scope.png b/src/shared/proparser/images/scope.png similarity index 100% rename from shared/proparser/images/scope.png rename to src/shared/proparser/images/scope.png diff --git a/shared/proparser/images/set.png b/src/shared/proparser/images/set.png similarity index 100% rename from shared/proparser/images/set.png rename to src/shared/proparser/images/set.png diff --git a/shared/proparser/images/value.png b/src/shared/proparser/images/value.png similarity index 100% rename from shared/proparser/images/value.png rename to src/shared/proparser/images/value.png diff --git a/shared/proparser/procommandmanager.cpp b/src/shared/proparser/procommandmanager.cpp similarity index 100% rename from shared/proparser/procommandmanager.cpp rename to src/shared/proparser/procommandmanager.cpp diff --git a/shared/proparser/procommandmanager.h b/src/shared/proparser/procommandmanager.h similarity index 100% rename from shared/proparser/procommandmanager.h rename to src/shared/proparser/procommandmanager.h diff --git a/shared/proparser/proeditor.cpp b/src/shared/proparser/proeditor.cpp similarity index 100% rename from shared/proparser/proeditor.cpp rename to src/shared/proparser/proeditor.cpp diff --git a/shared/proparser/proeditor.h b/src/shared/proparser/proeditor.h similarity index 100% rename from shared/proparser/proeditor.h rename to src/shared/proparser/proeditor.h diff --git a/shared/proparser/proeditor.ui b/src/shared/proparser/proeditor.ui similarity index 100% rename from shared/proparser/proeditor.ui rename to src/shared/proparser/proeditor.ui diff --git a/shared/proparser/proeditormodel.cpp b/src/shared/proparser/proeditormodel.cpp similarity index 100% rename from shared/proparser/proeditormodel.cpp rename to src/shared/proparser/proeditormodel.cpp diff --git a/shared/proparser/proeditormodel.h b/src/shared/proparser/proeditormodel.h similarity index 100% rename from shared/proparser/proeditormodel.h rename to src/shared/proparser/proeditormodel.h diff --git a/shared/proparser/profileevaluator.cpp b/src/shared/proparser/profileevaluator.cpp similarity index 100% rename from shared/proparser/profileevaluator.cpp rename to src/shared/proparser/profileevaluator.cpp diff --git a/shared/proparser/profileevaluator.h b/src/shared/proparser/profileevaluator.h similarity index 100% rename from shared/proparser/profileevaluator.h rename to src/shared/proparser/profileevaluator.h diff --git a/shared/proparser/proiteminfo.cpp b/src/shared/proparser/proiteminfo.cpp similarity index 100% rename from shared/proparser/proiteminfo.cpp rename to src/shared/proparser/proiteminfo.cpp diff --git a/shared/proparser/proiteminfo.h b/src/shared/proparser/proiteminfo.h similarity index 100% rename from shared/proparser/proiteminfo.h rename to src/shared/proparser/proiteminfo.h diff --git a/shared/proparser/proiteminfo.xml b/src/shared/proparser/proiteminfo.xml similarity index 100% rename from shared/proparser/proiteminfo.xml rename to src/shared/proparser/proiteminfo.xml diff --git a/shared/proparser/proitems.cpp b/src/shared/proparser/proitems.cpp similarity index 100% rename from shared/proparser/proitems.cpp rename to src/shared/proparser/proitems.cpp diff --git a/shared/proparser/proitems.h b/src/shared/proparser/proitems.h similarity index 100% rename from shared/proparser/proitems.h rename to src/shared/proparser/proitems.h diff --git a/shared/proparser/proparser.pri b/src/shared/proparser/proparser.pri similarity index 100% rename from shared/proparser/proparser.pri rename to src/shared/proparser/proparser.pri diff --git a/shared/proparser/proparser.qrc b/src/shared/proparser/proparser.qrc similarity index 100% rename from shared/proparser/proparser.qrc rename to src/shared/proparser/proparser.qrc diff --git a/shared/proparser/proparserutils.h b/src/shared/proparser/proparserutils.h similarity index 100% rename from shared/proparser/proparserutils.h rename to src/shared/proparser/proparserutils.h diff --git a/shared/proparser/prowriter.cpp b/src/shared/proparser/prowriter.cpp similarity index 100% rename from shared/proparser/prowriter.cpp rename to src/shared/proparser/prowriter.cpp diff --git a/shared/proparser/prowriter.h b/src/shared/proparser/prowriter.h similarity index 100% rename from shared/proparser/prowriter.h rename to src/shared/proparser/prowriter.h diff --git a/shared/proparser/proxml.cpp b/src/shared/proparser/proxml.cpp similarity index 100% rename from shared/proparser/proxml.cpp rename to src/shared/proparser/proxml.cpp diff --git a/shared/proparser/proxml.h b/src/shared/proparser/proxml.h similarity index 100% rename from shared/proparser/proxml.h rename to src/shared/proparser/proxml.h diff --git a/shared/proparser/valueeditor.cpp b/src/shared/proparser/valueeditor.cpp similarity index 100% rename from shared/proparser/valueeditor.cpp rename to src/shared/proparser/valueeditor.cpp diff --git a/shared/proparser/valueeditor.h b/src/shared/proparser/valueeditor.h similarity index 100% rename from shared/proparser/valueeditor.h rename to src/shared/proparser/valueeditor.h diff --git a/shared/proparser/valueeditor.ui b/src/shared/proparser/valueeditor.ui similarity index 100% rename from shared/proparser/valueeditor.ui rename to src/shared/proparser/valueeditor.ui diff --git a/shared/qrceditor/qrceditor.cpp b/src/shared/qrceditor/qrceditor.cpp similarity index 100% rename from shared/qrceditor/qrceditor.cpp rename to src/shared/qrceditor/qrceditor.cpp diff --git a/shared/qrceditor/qrceditor.h b/src/shared/qrceditor/qrceditor.h similarity index 100% rename from shared/qrceditor/qrceditor.h rename to src/shared/qrceditor/qrceditor.h diff --git a/shared/qrceditor/qrceditor.pri b/src/shared/qrceditor/qrceditor.pri similarity index 100% rename from shared/qrceditor/qrceditor.pri rename to src/shared/qrceditor/qrceditor.pri diff --git a/shared/qrceditor/qrceditor.ui b/src/shared/qrceditor/qrceditor.ui similarity index 100% rename from shared/qrceditor/qrceditor.ui rename to src/shared/qrceditor/qrceditor.ui diff --git a/shared/qrceditor/resourcefile.cpp b/src/shared/qrceditor/resourcefile.cpp similarity index 100% rename from shared/qrceditor/resourcefile.cpp rename to src/shared/qrceditor/resourcefile.cpp diff --git a/shared/qrceditor/resourcefile_p.h b/src/shared/qrceditor/resourcefile_p.h similarity index 100% rename from shared/qrceditor/resourcefile_p.h rename to src/shared/qrceditor/resourcefile_p.h diff --git a/shared/qrceditor/resourceview.cpp b/src/shared/qrceditor/resourceview.cpp similarity index 100% rename from shared/qrceditor/resourceview.cpp rename to src/shared/qrceditor/resourceview.cpp diff --git a/shared/qrceditor/resourceview.h b/src/shared/qrceditor/resourceview.h similarity index 100% rename from shared/qrceditor/resourceview.h rename to src/shared/qrceditor/resourceview.h diff --git a/shared/qrceditor/test/main.cpp b/src/shared/qrceditor/test/main.cpp similarity index 100% rename from shared/qrceditor/test/main.cpp rename to src/shared/qrceditor/test/main.cpp diff --git a/shared/qrceditor/test/mainwindow.cpp b/src/shared/qrceditor/test/mainwindow.cpp similarity index 100% rename from shared/qrceditor/test/mainwindow.cpp rename to src/shared/qrceditor/test/mainwindow.cpp diff --git a/shared/qrceditor/test/mainwindow.h b/src/shared/qrceditor/test/mainwindow.h similarity index 100% rename from shared/qrceditor/test/mainwindow.h rename to src/shared/qrceditor/test/mainwindow.h diff --git a/shared/qrceditor/test/test.pro b/src/shared/qrceditor/test/test.pro similarity index 100% rename from shared/qrceditor/test/test.pro rename to src/shared/qrceditor/test/test.pro diff --git a/shared/qrceditor/undocommands.cpp b/src/shared/qrceditor/undocommands.cpp similarity index 100% rename from shared/qrceditor/undocommands.cpp rename to src/shared/qrceditor/undocommands.cpp diff --git a/shared/qrceditor/undocommands_p.h b/src/shared/qrceditor/undocommands_p.h similarity index 100% rename from shared/qrceditor/undocommands_p.h rename to src/shared/qrceditor/undocommands_p.h diff --git a/shared/qscripthighlighter/README b/src/shared/qscripthighlighter/README similarity index 100% rename from shared/qscripthighlighter/README rename to src/shared/qscripthighlighter/README diff --git a/shared/qscripthighlighter/qscripthighlighter.cpp b/src/shared/qscripthighlighter/qscripthighlighter.cpp similarity index 100% rename from shared/qscripthighlighter/qscripthighlighter.cpp rename to src/shared/qscripthighlighter/qscripthighlighter.cpp diff --git a/shared/qscripthighlighter/qscripthighlighter.h b/src/shared/qscripthighlighter/qscripthighlighter.h similarity index 100% rename from shared/qscripthighlighter/qscripthighlighter.h rename to src/shared/qscripthighlighter/qscripthighlighter.h diff --git a/shared/qscripthighlighter/qscripthighlighter.pri b/src/shared/qscripthighlighter/qscripthighlighter.pri similarity index 100% rename from shared/qscripthighlighter/qscripthighlighter.pri rename to src/shared/qscripthighlighter/qscripthighlighter.pri diff --git a/shared/qscripthighlighter/test/main.cpp b/src/shared/qscripthighlighter/test/main.cpp similarity index 100% rename from shared/qscripthighlighter/test/main.cpp rename to src/shared/qscripthighlighter/test/main.cpp diff --git a/shared/qscripthighlighter/test/test.pro b/src/shared/qscripthighlighter/test/test.pro similarity index 100% rename from shared/qscripthighlighter/test/test.pro rename to src/shared/qscripthighlighter/test/test.pro diff --git a/shared/qtextended_integration.h b/src/shared/qtextended_integration.h similarity index 100% rename from shared/qtextended_integration.h rename to src/shared/qtextended_integration.h diff --git a/shared/qtlockedfile/README.txt b/src/shared/qtlockedfile/README.txt similarity index 100% rename from shared/qtlockedfile/README.txt rename to src/shared/qtlockedfile/README.txt diff --git a/shared/qtlockedfile/namespace.patch b/src/shared/qtlockedfile/namespace.patch similarity index 100% rename from shared/qtlockedfile/namespace.patch rename to src/shared/qtlockedfile/namespace.patch diff --git a/shared/qtlockedfile/qtlockedfile.cpp b/src/shared/qtlockedfile/qtlockedfile.cpp similarity index 100% rename from shared/qtlockedfile/qtlockedfile.cpp rename to src/shared/qtlockedfile/qtlockedfile.cpp diff --git a/shared/qtlockedfile/qtlockedfile.h b/src/shared/qtlockedfile/qtlockedfile.h similarity index 100% rename from shared/qtlockedfile/qtlockedfile.h rename to src/shared/qtlockedfile/qtlockedfile.h diff --git a/shared/qtlockedfile/qtlockedfile.pri b/src/shared/qtlockedfile/qtlockedfile.pri similarity index 100% rename from shared/qtlockedfile/qtlockedfile.pri rename to src/shared/qtlockedfile/qtlockedfile.pri diff --git a/shared/qtlockedfile/qtlockedfile_unix.cpp b/src/shared/qtlockedfile/qtlockedfile_unix.cpp similarity index 100% rename from shared/qtlockedfile/qtlockedfile_unix.cpp rename to src/shared/qtlockedfile/qtlockedfile_unix.cpp diff --git a/shared/qtlockedfile/qtlockedfile_win.cpp b/src/shared/qtlockedfile/qtlockedfile_win.cpp similarity index 100% rename from shared/qtlockedfile/qtlockedfile_win.cpp rename to src/shared/qtlockedfile/qtlockedfile_win.cpp diff --git a/shared/qtsingleapplication/README.txt b/src/shared/qtsingleapplication/README.txt similarity index 100% rename from shared/qtsingleapplication/README.txt rename to src/shared/qtsingleapplication/README.txt diff --git a/shared/qtsingleapplication/namespace.patch b/src/shared/qtsingleapplication/namespace.patch similarity index 100% rename from shared/qtsingleapplication/namespace.patch rename to src/shared/qtsingleapplication/namespace.patch diff --git a/shared/qtsingleapplication/qtlocalpeer.cpp b/src/shared/qtsingleapplication/qtlocalpeer.cpp similarity index 100% rename from shared/qtsingleapplication/qtlocalpeer.cpp rename to src/shared/qtsingleapplication/qtlocalpeer.cpp diff --git a/shared/qtsingleapplication/qtlocalpeer.h b/src/shared/qtsingleapplication/qtlocalpeer.h similarity index 100% rename from shared/qtsingleapplication/qtlocalpeer.h rename to src/shared/qtsingleapplication/qtlocalpeer.h diff --git a/shared/qtsingleapplication/qtsingleapplication.cpp b/src/shared/qtsingleapplication/qtsingleapplication.cpp similarity index 100% rename from shared/qtsingleapplication/qtsingleapplication.cpp rename to src/shared/qtsingleapplication/qtsingleapplication.cpp diff --git a/shared/qtsingleapplication/qtsingleapplication.h b/src/shared/qtsingleapplication/qtsingleapplication.h similarity index 100% rename from shared/qtsingleapplication/qtsingleapplication.h rename to src/shared/qtsingleapplication/qtsingleapplication.h diff --git a/shared/qtsingleapplication/qtsingleapplication.pri b/src/shared/qtsingleapplication/qtsingleapplication.pri similarity index 100% rename from shared/qtsingleapplication/qtsingleapplication.pri rename to src/shared/qtsingleapplication/qtsingleapplication.pri diff --git a/shared/qtsingleapplication/qtsinglecoreapplication.cpp b/src/shared/qtsingleapplication/qtsinglecoreapplication.cpp similarity index 100% rename from shared/qtsingleapplication/qtsinglecoreapplication.cpp rename to src/shared/qtsingleapplication/qtsinglecoreapplication.cpp diff --git a/shared/qtsingleapplication/qtsinglecoreapplication.h b/src/shared/qtsingleapplication/qtsinglecoreapplication.h similarity index 100% rename from shared/qtsingleapplication/qtsinglecoreapplication.h rename to src/shared/qtsingleapplication/qtsinglecoreapplication.h diff --git a/shared/qtsingleapplication/qtsinglecoreapplication.pri b/src/shared/qtsingleapplication/qtsinglecoreapplication.pri similarity index 100% rename from shared/qtsingleapplication/qtsinglecoreapplication.pri rename to src/shared/qtsingleapplication/qtsinglecoreapplication.pri diff --git a/shared/scriptwrapper/README b/src/shared/scriptwrapper/README similarity index 100% rename from shared/scriptwrapper/README rename to src/shared/scriptwrapper/README diff --git a/shared/scriptwrapper/interface_wrap_helpers.h b/src/shared/scriptwrapper/interface_wrap_helpers.h similarity index 100% rename from shared/scriptwrapper/interface_wrap_helpers.h rename to src/shared/scriptwrapper/interface_wrap_helpers.h diff --git a/shared/scriptwrapper/scriptwrapper.pri b/src/shared/scriptwrapper/scriptwrapper.pri similarity index 100% rename from shared/scriptwrapper/scriptwrapper.pri rename to src/shared/scriptwrapper/scriptwrapper.pri diff --git a/shared/scriptwrapper/wrap_helpers.h b/src/shared/scriptwrapper/wrap_helpers.h similarity index 100% rename from shared/scriptwrapper/wrap_helpers.h rename to src/shared/scriptwrapper/wrap_helpers.h