Merge branch 'master' of git://scm.dev.nokia.troll.no/creator/mainline into make_install/master

This commit is contained in:
Daniel Molkentin
2009-01-22 10:28:15 +01:00
77 changed files with 513 additions and 589 deletions

View File

@@ -234,12 +234,11 @@ public:
BinEditorInterface(BinEditor *parent)
: Core::IEditor(parent)
{
Core::ICore *core = Core::ICore::instance();
Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance();
m_editor = parent;
m_file = new BinEditorFile(parent);
m_context << core->uniqueIDManager()->
uniqueIdentifier(Core::Constants::K_DEFAULT_BINARY_EDITOR);
m_context << core->uniqueIDManager()->uniqueIdentifier(Constants::C_BINEDITOR);
m_context << uidm->uniqueIdentifier(Core::Constants::K_DEFAULT_BINARY_EDITOR);
m_context << uidm->uniqueIdentifier(Constants::C_BINEDITOR);
m_cursorPositionLabel = new Core::Utils::LineColumnLabel;
QHBoxLayout *l = new QHBoxLayout;
@@ -276,10 +275,10 @@ public:
void setDisplayName(const QString &title) { m_displayName = title; emit changed(); }
bool duplicateSupported() const { return false; }
IEditor *duplicate(QWidget */*parent*/) { return 0; }
IEditor *duplicate(QWidget * /* parent */) { return 0; }
QByteArray saveState() const { return QByteArray();} // TODO
bool restoreState(const QByteArray &/*state*/) {return false;} // TODO
QByteArray saveState() const { return QByteArray(); } // TODO
bool restoreState(const QByteArray & /* state */) { return false; } // TODO
QToolBar *toolBar() { return m_toolBar; }
@@ -320,8 +319,8 @@ QString BinEditorFactory::kind() const
Core::IFile *BinEditorFactory::open(const QString &fileName)
{
Core::ICore *core = Core::ICore::instance();
Core::IEditor *iface = core->editorManager()->openEditor(fileName, kind());
Core::EditorManager *em = Core::EditorManager::instance();
Core::IEditor *iface = em->openEditor(fileName, kind());
return iface ? iface->file() : 0;
}
@@ -339,27 +338,17 @@ QStringList BinEditorFactory::mimeTypes() const
///////////////////////////////// BinEditorPlugin //////////////////////////////////
BinEditorPlugin *BinEditorPlugin::m_instance = 0;
BinEditorPlugin::BinEditorPlugin()
{
m_undoAction = m_redoAction = m_copyAction = m_selectAllAction = 0;
m_instance = this;
}
BinEditorPlugin::~BinEditorPlugin()
{
m_instance = 0;
}
BinEditorPlugin *BinEditorPlugin::instance()
{
return m_instance;
}
QAction *BinEditorPlugin::registerNewAction(const QString &id, const QString &title)
{
QAction *result = new QAction(title, this);
Core::ICore::instance()->actionManager()->registerAction(result, id, m_context);
return result;
@@ -384,8 +373,8 @@ void BinEditorPlugin::initializeEditor(BinEditor *editor)
QObject::connect(editor, SIGNAL(modificationChanged(bool)), editorInterface, SIGNAL(changed()));
editor->setEditorInterface(editorInterface);
Core::ICore *core = Core::ICore::instance();
m_context << core->uniqueIDManager()->uniqueIdentifier(Constants::C_BINEDITOR);
Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance();
m_context << uidm->uniqueIdentifier(Constants::C_BINEDITOR);
if (!m_undoAction) {
m_undoAction = registerNewAction(QLatin1String(Core::Constants::UNDO),
this, SLOT(undoAction()),

View File

@@ -43,7 +43,6 @@
#include <QtGui/QAction>
namespace Core {
class ICore;
class IWizard;
}
@@ -61,8 +60,6 @@ public:
BinEditorPlugin();
~BinEditorPlugin();
static BinEditorPlugin *instance();
bool initialize(const QStringList &arguments, QString *error_message = 0);
void extensionsInitialized();
@@ -77,6 +74,7 @@ private slots:
void updateActions();
void updateCurrentEditor(Core::IContext *object);
private:
QList<int> m_context;
QAction *registerNewAction(const QString &id, const QString &title = QString());
@@ -90,9 +88,6 @@ private:
friend class BinEditorFactory;
Core::IEditor *createEditor(QWidget *parent);
static BinEditorPlugin *m_instance;
Core::ICore *m_core;
typedef QList<Core::IWizard *> WizardList;
WizardList m_wizards;
BinEditorFactory *m_factory;

View File

@@ -293,8 +293,7 @@ void BookmarkView::gotoBookmark(const QModelIndex &index)
BookmarkContext::BookmarkContext(BookmarkView *widget)
: m_bookmarkView(widget)
{
Core::ICore *core = ICore::instance();
m_context << core->uniqueIDManager()->uniqueIdentifier(Constants::BOOKMARKS_CONTEXT);
m_context << UniqueIDManager::instance()->uniqueIdentifier(Constants::BOOKMARKS_CONTEXT);
}
QList<int> BookmarkContext::context() const
@@ -509,7 +508,7 @@ void BookmarkManager::documentPrevNext(bool next)
nextLine = markLine;
}
Core::EditorManager *em = Core::ICore::instance()->editorManager();
Core::EditorManager *em = Core::EditorManager::instance();
em->addCurrentPositionToNavigationHistory(true);
if (next) {
if (nextLine == -1)
@@ -554,7 +553,7 @@ void BookmarkManager::prev()
TextEditor::ITextEditor *BookmarkManager::currentTextEditor() const
{
Core::EditorManager *em = Core::ICore::instance()->editorManager();
Core::EditorManager *em = Core::EditorManager::instance();
Core::IEditor *currEditor = em->currentEditor();
if (!currEditor)
return 0;

View File

@@ -36,7 +36,6 @@
#include "cmakeproject.h"
#include "cmakeprojectconstants.h"
#include <coreplugin/icore.h>
#include <coreplugin/uniqueidmanager.h>
#include <projectexplorer/projectexplorerconstants.h>
@@ -44,9 +43,9 @@ using namespace CMakeProjectManager::Internal;
CMakeManager::CMakeManager()
{
Core::ICore *core = Core::ICore::instance();
m_projectContext = core->uniqueIDManager()->uniqueIdentifier(CMakeProjectManager::Constants::PROJECTCONTEXT);
m_projectLanguage = core->uniqueIDManager()->uniqueIdentifier(ProjectExplorer::Constants::LANG_CXX);
Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance();
m_projectContext = uidm->uniqueIdentifier(CMakeProjectManager::Constants::PROJECTCONTEXT);
m_projectLanguage = uidm->uniqueIdentifier(ProjectExplorer::Constants::LANG_CXX);
}
int CMakeManager::projectContext() const

View File

@@ -35,7 +35,6 @@
#include "actionmanager_p.h"
#include "command_p.h"
#include "coreimpl.h"
#include "coreconstants.h"
#include "uniqueidmanager.h"
@@ -150,15 +149,13 @@ bool ActionContainerPrivate::hasState(ContainerState state) const
void ActionContainerPrivate::appendGroup(const QString &group)
{
UniqueIDManager *idmanager = CoreImpl::instance()->uniqueIDManager();
int gid = idmanager->uniqueIdentifier(group);
int gid = UniqueIDManager::instance()->uniqueIdentifier(group);
m_groups << gid;
}
QAction *ActionContainerPrivate::insertLocation(const QString &group) const
{
UniqueIDManager *idmanager = CoreImpl::instance()->uniqueIDManager();
int grpid = idmanager->uniqueIdentifier(group);
int grpid = UniqueIDManager::instance()->uniqueIdentifier(group);
int prevKey = 0;
int pos = ((grpid << 16) | 0xFFFF);
return beforeAction(pos, &prevKey);
@@ -181,7 +178,7 @@ void ActionContainerPrivate::addAction(Command *action, const QString &group)
}
a->setStateFlags(a->stateFlags() | CommandPrivate::CS_Initialized);
} else {
UniqueIDManager *idmanager = CoreImpl::instance()->uniqueIDManager();
UniqueIDManager *idmanager = UniqueIDManager::instance();
int grpid = idmanager->uniqueIdentifier(Constants::G_DEFAULT_TWO);
if (!group.isEmpty())
grpid = idmanager->uniqueIdentifier(group);
@@ -208,7 +205,7 @@ void ActionContainerPrivate::addMenu(ActionContainer *menu, const QString &group
}
mc->setState(ActionContainerPrivate::CS_Initialized);
} else {
UniqueIDManager *idmanager = CoreImpl::instance()->uniqueIDManager();
UniqueIDManager *idmanager = UniqueIDManager::instance();
int grpid = idmanager->uniqueIdentifier(Constants::G_DEFAULT_TWO);
if (!group.isEmpty())
grpid = idmanager->uniqueIdentifier(group);

View File

@@ -222,7 +222,7 @@ ActionManagerPrivate::~ActionManagerPrivate()
qDeleteAll(m_idContainerMap.values());
}
ActionManagerPrivate* ActionManagerPrivate::instance()
ActionManagerPrivate *ActionManagerPrivate::instance()
{
return m_instance;
}

View File

@@ -69,7 +69,7 @@ public:
~ActionManagerPrivate();
void setContext(const QList<int> &context);
static ActionManagerPrivate* instance();
static ActionManagerPrivate *instance();
void saveSettings(QSettings *settings);
QList<int> defaultGroups() const;

View File

@@ -31,7 +31,6 @@
**
***************************************************************************/
#include "coreimpl.h"
#include "commandsfile.h"
#include "shortcutsettings.h"
#include "command_p.h"
@@ -100,7 +99,7 @@ QMap<QString, QKeySequence> CommandsFile::importCommands() const
*/
bool CommandsFile::exportCommands(const QList<ShortcutItem *> &items)
{
UniqueIDManager *idmanager = CoreImpl::instance()->uniqueIDManager();
UniqueIDManager *idmanager = UniqueIDManager::instance();
QFile file(m_filename);
if (!file.open(QIODevice::WriteOnly))
@@ -110,8 +109,7 @@ bool CommandsFile::exportCommands(const QList<ShortcutItem *> &items)
QDomElement root = doc.createElement("mapping");
doc.appendChild(root);
for (int i=0; i<items.count(); ++i) {
ShortcutItem *item = items.at(i);
foreach (const ShortcutItem *item, items) {
QDomElement ctag = doc.createElement("shortcut");
ctag.setAttribute(QLatin1String("id"), idmanager->stringForUniqueIdentifier(item->m_cmd->id()));
root.appendChild(ctag);

View File

@@ -509,7 +509,7 @@ bool BaseFileWizard::postGenerateFiles(const GeneratedFiles &l, QString *errorMe
{
// File mode: open the editors in file mode and ensure editor pane
const Core::GeneratedFiles::const_iterator cend = l.constEnd();
Core::EditorManager *em = Core::ICore::instance()->editorManager();
Core::EditorManager *em = Core::EditorManager::instance();
for (Core::GeneratedFiles::const_iterator it = l.constBegin(); it != cend; ++it) {
if (!em->openEditor(it->path(), it->editorKind())) {
*errorMessage = tr("Failed to open an editor for %1").arg(it->path());

View File

@@ -85,7 +85,7 @@ bool CorePlugin::initialize(const QStringList & /*arguments*/, QString *error_me
m_welcomeMode = new WelcomeMode;
addObject(m_welcomeMode);
EditorManager *editorManager = qobject_cast<EditorManager*>(m_mainWindow->editorManager());
EditorManager *editorManager = m_mainWindow->editorManager();
m_editMode = new EditMode(editorManager);
addObject(m_editMode);
}

View File

@@ -32,7 +32,6 @@
***************************************************************************/
#include "settingsdialog.h"
#include "coreimpl.h"
#include <extensionsystem/pluginmanager.h>

View File

@@ -34,14 +34,13 @@
#include "shortcutsettings.h"
#include "ui_shortcutsettings.h"
#include "actionmanager_p.h"
#include "actionmanager/command.h"
#include "command_p.h"
#include "coreconstants.h"
#include "coreimpl.h"
#include "commandsfile.h"
#include "coreconstants.h"
#include "filemanager.h"
#include <coreplugin/uniqueidmanager.h>
#include <coreplugin/actionmanager/command.h>
#include "icore.h"
#include "uniqueidmanager.h"
#include <QtGui/QKeyEvent>
#include <QtGui/QShortcut>
@@ -232,11 +231,10 @@ void ShortcutSettings::removeKeySequence()
void ShortcutSettings::importAction()
{
UniqueIDManager *uidm =
CoreImpl::instance()->uniqueIDManager();
UniqueIDManager *uidm = UniqueIDManager::instance();
QString fileName = QFileDialog::getOpenFileName(0, tr("Import Keyboard Mapping Scheme"),
CoreImpl::instance()->resourcePath() + "/schemes/",
ICore::instance()->resourcePath() + "/schemes/",
tr("Keyboard Mapping Scheme (*.kms)"));
if (!fileName.isEmpty()) {
CommandsFile cf(fileName);
@@ -266,9 +264,9 @@ void ShortcutSettings::defaultAction()
void ShortcutSettings::exportAction()
{
QString fileName = CoreImpl::instance()->fileManager()->getSaveFileNameWithExtension(
QString fileName = ICore::instance()->fileManager()->getSaveFileNameWithExtension(
tr("Export Keyboard Mapping Scheme"),
CoreImpl::instance()->resourcePath() + "/schemes/",
ICore::instance()->resourcePath() + "/schemes/",
tr("Keyboard Mapping Scheme (*.kms)"),
".kms");
if (!fileName.isEmpty()) {
@@ -279,16 +277,11 @@ void ShortcutSettings::exportAction()
void ShortcutSettings::initialize()
{
QMap<QString, QTreeWidgetItem *> categories;
m_am = ActionManagerPrivate::instance();
UniqueIDManager *uidm =
CoreImpl::instance()->uniqueIDManager();
UniqueIDManager *uidm = UniqueIDManager::instance();
QList<CommandPrivate *> cmds = m_am->commands();
for (int i = 0; i < cmds.size(); ++i) {
CommandPrivate *c = cmds.at(i);
if (c->hasAttribute(CommandPrivate::CA_NonConfigureable))
foreach (Command *c, m_am->commands()) {
if (c->hasAttribute(Command::CA_NonConfigureable))
continue;
if (c->action() && c->action()->isSeparator())
continue;
@@ -296,24 +289,15 @@ void ShortcutSettings::initialize()
QTreeWidgetItem *item = 0;
ShortcutItem *s = new ShortcutItem;
m_scitems << s;
if (c->category().isEmpty()) {
item = new QTreeWidgetItem(m_page->commandList);
} else {
if (!categories.contains(c->category())) {
QTreeWidgetItem *cat = new QTreeWidgetItem(m_page->commandList);
cat->setText(0, c->category());
categories.insert(c->category(), cat);
cat->setExpanded(true);
}
item = new QTreeWidgetItem(categories.value(c->category()));
}
item = new QTreeWidgetItem(m_page->commandList);
s->m_cmd = c;
s->m_item = item;
item->setText(0, uidm->stringForUniqueIdentifier(c->id()));
if (c->action()) {
QString text = c->hasAttribute(CommandPrivate::CA_UpdateText) && !c->defaultText().isNull() ? c->defaultText() : c->action()->text();
QString text = c->hasAttribute(Command::CA_UpdateText) && !c->defaultText().isNull() ? c->defaultText() : c->action()->text();
text.remove(QRegExp("&(?!&)"));
s->m_key = c->action()->shortcut();
item->setText(1, text);
} else {

View File

@@ -36,6 +36,9 @@
</item>
<item>
<widget class="QTreeWidget" name="commandList">
<property name="rootIsDecorated">
<bool>false</bool>
</property>
<property name="uniformRowHeights">
<bool>true</bool>
</property>

View File

@@ -34,7 +34,6 @@
#include "editmode.h"
#include "editormanager.h"
#include "coreconstants.h"
#include "coreimpl.h"
#include "modemanager.h"
#include "uniqueidmanager.h"
#include "minisplitter.h"
@@ -122,9 +121,9 @@ const char* EditMode::uniqueModeName() const
QList<int> EditMode::context() const
{
static QList<int> contexts = QList<int>() <<
CoreImpl::instance()->uniqueIDManager()->uniqueIdentifier(Constants::C_EDIT_MODE) <<
CoreImpl::instance()->uniqueIDManager()->uniqueIdentifier(Constants::C_EDITORMANAGER) <<
CoreImpl::instance()->uniqueIDManager()->uniqueIdentifier(Constants::C_NAVIGATION_PANE);
UniqueIDManager::instance()->uniqueIdentifier(Constants::C_EDIT_MODE) <<
UniqueIDManager::instance()->uniqueIdentifier(Constants::C_EDITORMANAGER) <<
UniqueIDManager::instance()->uniqueIdentifier(Constants::C_NAVIGATION_PANE);
return contexts;
}

View File

@@ -32,19 +32,19 @@
***************************************************************************/
#include "editormanager.h"
#include "editorgroup.h"
#include "editorsplitter.h"
#include "openeditorsview.h"
#include "openeditorswindow.h"
#include "openwithdialog.h"
#include "filemanager.h"
#include "tabpositionindicator.h"
#include "saveitemsdialog.h"
#include "vcsmanager.h"
#include "icore.h"
#include "iversioncontrol.h"
#include "openeditorsview.h"
#include "editorgroup.h"
#include "mimedatabase.h"
#include "saveitemsdialog.h"
#include "tabpositionindicator.h"
#include "vcsmanager.h"
#include <coreplugin/coreimpl.h>
#include <coreplugin/coreconstants.h>
#include <coreplugin/modemanager.h>
#include <coreplugin/uniqueidmanager.h>
@@ -68,6 +68,7 @@
#include <QtGui/QApplication>
#include <QtGui/QFileDialog>
#include <QtGui/QLayout>
#include <QtGui/QMainWindow>
#include <QtGui/QMenu>
#include <QtGui/QMessageBox>
#include <QtGui/QPushButton>
@@ -598,8 +599,7 @@ QList<IEditor*>
return found.toList();
}
QList<IFile *>
EditorManager::filesForEditors(QList<IEditor *> editors) const
QList<IFile *> EditorManager::filesForEditors(QList<IEditor *> editors) const
{
QSet<IEditor *> handledEditors;
QList<IFile *> files;
@@ -649,7 +649,7 @@ bool EditorManager::closeEditors(const QList<IEditor*> editorsToClose, bool askA
//ask whether to save modified files
if (askAboutModifiedEditors) {
bool cancelled = false;
QList<IFile*> list = CoreImpl::instance()->fileManager()->
QList<IFile*> list = ICore::instance()->fileManager()->
saveModifiedFiles(filesForEditors(acceptedEditors), &cancelled);
if (cancelled)
return false;
@@ -924,9 +924,8 @@ QStringList EditorManager::getOpenFileNames() const
void EditorManager::ensureEditorManagerVisible()
{
if (!isVisible()) {
if (!isVisible())
m_d->m_core->modeManager()->activateMode(Constants::MODE_EDIT);
}
}
IEditor *EditorManager::newFile(const QString &editorKind,
@@ -1549,7 +1548,7 @@ void EditorManager::openInExternalEditor()
return;
if (editor->file()->isModified()) {
bool cancelled = false;
QList<IFile*> list = CoreImpl::instance()->fileManager()->
QList<IFile*> list = ICore::instance()->fileManager()->
saveModifiedFiles(QList<IFile*>() << editor->file(), &cancelled);
if (cancelled)
return;

View File

@@ -34,7 +34,7 @@
#include "openeditorsview.h"
#include "editorgroup.h"
#include "editormanager.h"
#include "coreimpl.h"
#include "icore.h"
#include <coreplugin/coreconstants.h>
#include <coreplugin/filemanager.h>
@@ -218,13 +218,12 @@ void OpenEditorsWidget::closeEditors()
selectedEditors.append(item->data(0, Qt::UserRole).value<IEditor *>());
selectedFiles.append(item->data(0, Qt::UserRole).value<IEditor *>()->file());
}
ICore *core = CoreImpl::instance();
ICore *core = ICore::instance();
bool cancelled = false;
core->fileManager()->saveModifiedFiles(selectedFiles, &cancelled);
if (cancelled)
return;
core->editorManager()->
closeEditors(selectedEditors);
core->editorManager()->closeEditors(selectedEditors);
updateEditorList();
}

View File

@@ -33,7 +33,6 @@
#include "stackededitorgroup.h"
#include "editormanager.h"
#include "coreimpl.h"
#include <utils/qtcassert.h>
@@ -355,7 +354,7 @@ QList<IEditor *> StackedEditorGroup::editorsInNaturalOrder() const
void StackedEditorGroup::makeEditorWritable()
{
CoreImpl::instance()->editorManager()->makeEditorWritable(currentEditor());
EditorManager::instance()->makeEditorWritable(currentEditor());
}
void StackedEditorGroup::listSelectionChanged(int index)

View File

@@ -509,7 +509,7 @@ void FileManager::syncWithEditor(Core::IContext *context)
if (!context)
return;
Core::IEditor *editor = Core::ICore::instance()->editorManager()->currentEditor();
Core::IEditor *editor = Core::EditorManager::instance()->currentEditor();
if (editor && (editor->widget() == context->widget()))
setCurrentFile(editor->file()->fileName());
}

View File

@@ -94,7 +94,7 @@
extern "C" void handleSigInt(int sig)
{
Q_UNUSED(sig);
Core::Internal::CoreImpl::instance()->exit();
Core::ICore::instance()->exit();
qDebug() << "SIGINT caught. Shutting down.";
}
#endif

View File

@@ -42,7 +42,6 @@
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/actionmanager/command.h>
#include <coreplugin/coreconstants.h>
#include <coreplugin/coreimpl.h>
#include <coreplugin/imode.h>
#include <coreplugin/uniqueidmanager.h>

View File

@@ -33,10 +33,9 @@
#include "progressmanager_p.h"
#include "progressview.h"
#include "coreimpl.h"
#include "baseview.h"
#include "coreconstants.h"
#include "icore.h"
#include "uniqueidmanager.h"
#include <utils/qtcassert.h>
@@ -48,7 +47,7 @@ ProgressManagerPrivate::ProgressManagerPrivate(QObject *parent)
: ProgressManager(parent)
{
m_progressView = new ProgressView;
ICore *core = CoreImpl::instance();
ICore *core = ICore::instance();
connect(core, SIGNAL(coreAboutToClose()), this, SLOT(cancelAllRunningTasks()));
}

View File

@@ -47,7 +47,7 @@ public:
UniqueIDManager();
~UniqueIDManager();
static UniqueIDManager* instance() { return m_instance; }
static UniqueIDManager *instance() { return m_instance; }
bool hasUniqueIdentifier(const QString &id) const;
int uniqueIdentifier(const QString &id);

View File

@@ -34,7 +34,7 @@
#include "versiondialog.h"
#include "coreconstants.h"
#include "coreimpl.h"
#include "icore.h"
#include <utils/qtcassert.h>
@@ -121,7 +121,7 @@ void VersionDialog::popupLicense()
layout->addWidget(buttonBox);
// Read file into string
ICore * core = CoreImpl::instance();
ICore *core = ICore::instance();
QTC_ASSERT(core, return);
QString fileName = core->resourcePath() + "/license.txt";
QFile file(fileName);

View File

@@ -34,7 +34,6 @@
#include "welcomemode.h"
#include "coreconstants.h"
#include "uniqueidmanager.h"
#include "coreimpl.h"
#include "modemanager.h"
#if !defined(QT_NO_WEBKIT)
@@ -193,7 +192,7 @@ const char* WelcomeMode::uniqueModeName() const
QList<int> WelcomeMode::context() const
{
static QList<int> contexts = QList<int>()
<< CoreImpl::instance()->uniqueIDManager()->uniqueIdentifier(Constants::C_WELCOME_MODE);
<< UniqueIDManager::instance()->uniqueIdentifier(Constants::C_WELCOME_MODE);
return contexts;
}
@@ -250,7 +249,7 @@ void WelcomeMode::updateWelcomePage(const WelcomePageData &welcomePageData)
void WelcomeMode::linkClicked(const QUrl &url)
{
QString scheme = url.scheme();
Core::ModeManager *modeManager = CoreImpl::instance()->modeManager();
Core::ModeManager *modeManager = ModeManager::instance();
if (scheme.startsWith(QLatin1String("gh"))) {
QString s = url.toString(QUrl::RemoveScheme);
if (scheme == QLatin1String("gh")) {

View File

@@ -84,8 +84,7 @@ bool CodepasterPlugin::initialize(const QStringList &arguments, QString *error_m
// Create the globalcontext list to register actions accordingly
QList<int> globalcontext;
globalcontext << ICore::instance()->uniqueIDManager()->
uniqueIdentifier(Core::Constants::C_GLOBAL);
globalcontext << UniqueIDManager::instance()->uniqueIdentifier(Core::Constants::C_GLOBAL);
// Create the settings Page
m_settingsPage = new SettingsPage();
@@ -129,7 +128,7 @@ void CodepasterPlugin::post()
{
if (m_poster)
delete m_poster;
IEditor* editor = ICore::instance()->editorManager()->currentEditor();
IEditor* editor = EditorManager::instance()->currentEditor();
ITextEditor* textEditor = qobject_cast<ITextEditor*>(editor);
if (!textEditor)
return;
@@ -240,8 +239,7 @@ void CustomFetcher::customRequestFinished(int, bool error)
QByteArray data = body();
if (!m_listWidget) {
QString title = QString::fromLatin1("Code Paster: %1").arg(m_id);
ICore::instance()->editorManager()->newFile(Core::Constants::K_DEFAULT_TEXT_EDITOR
, &title, data);
EditorManager::instance()->newFile(Core::Constants::K_DEFAULT_TEXT_EDITOR, &title, data);
} else {
m_listWidget->clear();
QStringList lines = QString(data).split(QLatin1Char('\n'));

View File

@@ -139,10 +139,10 @@ QualifiedNameId *qualifiedNameIdForSymbol(Symbol *s, const LookupContext &contex
CPPEditorEditable::CPPEditorEditable(CPPEditor *editor)
: BaseTextEditorEditable(editor)
{
Core::ICore *core = Core::ICore::instance();
m_context << core->uniqueIDManager()->uniqueIdentifier(CppEditor::Constants::C_CPPEDITOR);
m_context << core->uniqueIDManager()->uniqueIdentifier(ProjectExplorer::Constants::LANG_CXX);
m_context << core->uniqueIDManager()->uniqueIdentifier(TextEditor::Constants::C_TEXTEDITOR);
Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance();
m_context << uidm->uniqueIdentifier(CppEditor::Constants::C_CPPEDITOR);
m_context << uidm->uniqueIdentifier(ProjectExplorer::Constants::LANG_CXX);
m_context << uidm->uniqueIdentifier(TextEditor::Constants::C_TEXTEDITOR);
}
CPPEditor::CPPEditor(QWidget *parent)
@@ -334,10 +334,10 @@ void CPPEditor::jumpToMethod(int)
if (! symbol)
return;
Core::ICore::instance()->editorManager()->addCurrentPositionToNavigationHistory(true);
Core::EditorManager::instance()->addCurrentPositionToNavigationHistory(true);
int line = symbol->line();
gotoLine(line);
Core::ICore::instance()->editorManager()->addCurrentPositionToNavigationHistory();
Core::EditorManager::instance()->addCurrentPositionToNavigationHistory();
setFocus();
}

View File

@@ -88,7 +88,7 @@ QString CppPluginEditorFactory::kind() const
Core::IFile *CppPluginEditorFactory::open(const QString &fileName)
{
Core::IEditor *iface = Core::ICore::instance()->editorManager()->openEditor(fileName, kind());
Core::IEditor *iface = Core::EditorManager::instance()->openEditor(fileName, kind());
return iface ? iface->file() : 0;
}
@@ -238,20 +238,18 @@ void CppPlugin::extensionsInitialized()
void CppPlugin::switchDeclarationDefinition()
{
Core::ICore *core = Core::ICore::instance();
CPPEditor *editor = qobject_cast<CPPEditor*>(core->editorManager()->currentEditor()->widget());
if (editor) {
Core::EditorManager *em = Core::EditorManager::instance();
CPPEditor *editor = qobject_cast<CPPEditor*>(em->currentEditor()->widget());
if (editor)
editor->switchDeclarationDefinition();
}
}
void CppPlugin::jumpToDefinition()
{
Core::ICore *core = Core::ICore::instance();
CPPEditor *editor = qobject_cast<CPPEditor*>(core->editorManager()->currentEditor()->widget());
if (editor) {
Core::EditorManager *em = Core::EditorManager::instance();
CPPEditor *editor = qobject_cast<CPPEditor*>(em->currentEditor()->widget());
if (editor)
editor->jumpToDefinition();
}
}
Q_EXPORT_PLUGIN(CppPlugin)

View File

@@ -147,7 +147,7 @@ void CppToolsPlugin::shutdown()
void CppToolsPlugin::switchHeaderSource()
{
Core::EditorManager *editorManager = Core::ICore::instance()->editorManager();
Core::EditorManager *editorManager = Core::EditorManager::instance();
Core::IEditor *editor = editorManager->currentEditor();
QString otherFile = correspondingHeaderOrSource(editor->file()->fileName());
if (!otherFile.isEmpty()) {

View File

@@ -723,18 +723,17 @@ void DebuggerPlugin::activatePreviousMode()
void DebuggerPlugin::activateDebugMode()
{
ICore *core = ICore::instance();
Core::ModeManager *modeManager = core->modeManager();
ModeManager *modeManager = ModeManager::instance();
m_previousMode = QLatin1String(modeManager->currentMode()->uniqueModeName());
modeManager->activateMode(QLatin1String(MODE_DEBUG));
}
void DebuggerPlugin::queryCurrentTextEditor(QString *fileName, int *lineNumber, QObject **object)
{
ICore *core = ICore::instance();
if (!core || !core->editorManager())
EditorManager *editorManager = EditorManager::instance();
if (!editorManager)
return;
Core::IEditor *editor = core->editorManager()->currentEditor();
Core::IEditor *editor = editorManager->currentEditor();
ITextEditor *textEditor = qobject_cast<ITextEditor*>(editor);
if (!textEditor)
return;
@@ -928,7 +927,7 @@ void DebuggerPlugin::readSettings()
m->m_skipKnownFrames = s->value("SkipKnownFrames", false).toBool();
m->m_debugDumpers = s->value("DebugDumpers", false).toBool();
m->m_useCustomDumpers = s->value("UseCustomDupers", false).toBool();
m->m_useCustomDumpers = s->value("UseCustomDumpers", true).toBool();
m->m_useFastStart = s->value("UseFastStart", false).toBool();
m->m_useToolTips = s->value("UseToolTips", false).toBool();
m->m_useTerminal = s->value("UseTerminal", false).toBool();

View File

@@ -467,20 +467,6 @@ void GdbEngine::handleResponse()
break;
}
case '#': {
//qDebug() << "CUSTOM OUTPUT, TOKEN" << token;
QString str;
for (; from != to && *from >= '0' && *from <= '9'; ++from)
str += QLatin1Char(*from);
++from; // skip the ' '
int len = str.toInt();
QByteArray ba(from, len);
from += len;
m_inbuffer = QByteArray(from, to - from);
m_customOutputForToken[token] += QString(ba);
break;
}
case '^': {
GdbResultRecord record;
@@ -1562,6 +1548,7 @@ bool GdbEngine::startDebugger()
//sendCommand("set confirm off");
//sendCommand("set pagination off");
sendCommand("set breakpoint pending on", BreakEnablePending);
sendCommand("set print elements 10000");
// one of the following is needed to prevent crashes in gdb on code like:
// template <class T> T foo() { return T(0); }
@@ -3078,14 +3065,11 @@ void GdbEngine::runCustomDumper(const WatchData & data0, bool dumpChildren)
q->showStatusMessage(
tr("Retrieving data for watch view (%1 requests pending)...")
.arg(m_pendingRequests + 1), 10000);
// create response slot for socket data
// retrieve response
QVariant var;
var.setValue(data);
sendSynchronizedCommand(QString(), WatchDumpCustomValue2, var);
// this increases the probability that gdb spits out output it
// has collected so far
//sendCommand("p qDumpInBuffer");
sendSynchronizedCommand("p (char*)qDumpOutBuffer", WatchDumpCustomValue2, var);
}
void GdbEngine::createGdbVariable(const WatchData &data)
@@ -3318,14 +3302,17 @@ void GdbEngine::handleQueryDataDumper1(const GdbResultRecord &record)
void GdbEngine::handleQueryDataDumper2(const GdbResultRecord &record)
{
// is this the official gdb response. However, it won't contain
// interesting data other than the information that 'real' data
// either already arrived or is still in the pipe. So we do
// _not_ register this result for counting purposes, this will
// be done by the 'real' result (with resultClass == GdbResultCustomDone)
//qDebug() << "DATA DUMPER TRIAL:" << record.toString();
GdbMi output = record.data.findChild("customvaluecontents");
GdbMi contents(output.data());
GdbMi output = record.data.findChild("consolestreamoutput");
QByteArray out = output.data();
out = out.mid(out.indexOf('"') + 2); // + 1 is success marker
out = out.left(out.lastIndexOf('"'));
out = out.replace('\'', '"');
out = "dummy={" + out + "}";
//qDebug() << "OUTPUT: " << out;
GdbMi contents;
contents.fromString(out);
GdbMi simple = contents.findChild("dumpers");
m_namespace = contents.findChild("namespace").data();
GdbMi qtversion = contents.findChild("qtversion");
@@ -3337,8 +3324,7 @@ void GdbEngine::handleQueryDataDumper2(const GdbResultRecord &record)
} else {
m_qtVersion = 0;
}
//qDebug() << "OUTPUT: " << output.toString();
//qDebug() << "CONTENTS: " << contents.toString();
//qDebug() << "SIMPLE DUMPERS: " << simple.toString();
m_availableSimpleDumpers.clear();
@@ -3479,7 +3465,7 @@ void GdbEngine::handleDumpCustomValue1(const GdbResultRecord &record,
QString msg = record.data.findChild("msg").data();
//qDebug() << "CUSTOM DUMPER ERROR MESSAGE: " << msg;
#ifdef QT_DEBUG
// Make debugging of dumers easier
// Make debugging of dumpers easier
if (q->settings()->m_debugDumpers
&& msg.startsWith("The program being debugged stopped while")
&& msg.contains("qDumpObjectData440")) {
@@ -3507,10 +3493,20 @@ void GdbEngine::handleDumpCustomValue2(const GdbResultRecord &record,
//qDebug() << "CUSTOM VALUE RESULT: " << record.toString();
//qDebug() << "FOR DATA: " << data.toString() << record.resultClass;
if (record.resultClass == GdbResultDone) {
GdbMi output = record.data.findChild("customvaluecontents");
//qDebug() << "HANDLE VALUE CONTENTS: " << output.toString(true);
if (!output.isValid()) {
//qDebug() << "INVALID";
GdbMi output = record.data.findChild("consolestreamoutput");
QByteArray out = output.data();
out = out.mid(out.indexOf('"') + 2); // + 1 is the 'success marker'
out = out.left(out.lastIndexOf('"'));
out = out.replace('\'', '"');
out = "dummy={" + out + "}";
//qDebug() << "OUTPUT: " << out;
GdbMi contents;
contents.fromString(out);
//qDebug() << "CONTENTS" << contents.toString(true);
if (!contents.isValid()) {
qDebug() << "INVALID";
// custom dumper produced no output
if (data.isValueNeeded())
data.setValue("<unknown>");
@@ -3523,10 +3519,6 @@ void GdbEngine::handleDumpCustomValue2(const GdbResultRecord &record,
data.setValueToolTip("<custom dumper produced no output>");
insertData(data);
} else {
GdbMi contents;
//qDebug() << "OUTPUT" << output.toString(true);
contents.fromString(output.data());
//qDebug() << "CONTENTS" << contents.toString(true);
setWatchDataType(data, contents.findChild("type"));
setWatchDataValue(data, contents.findChild("value"),
contents.findChild("valueencoded").data().toInt());
@@ -4020,8 +4012,7 @@ void GdbEngine::tryLoadCustomDumpers()
// retreive list of dumpable classes
sendCommand("call qDumpObjectData440(1,%1+1,0,0,0,0,0,0)",
GdbQueryDataDumper1);
// create response slot for socket data
sendCommand(QString(), GdbQueryDataDumper2);
sendCommand("p (char*)qDumpOutBuffer", GdbQueryDataDumper2);
}

View File

@@ -46,20 +46,20 @@ QTextStream & operator<<(QTextStream & os, const GdbMi & mi)
return os << mi.toString();
}
//static void skipSpaces(const GdbMi::Char *&from, const GdbMi::Char *to)
//static void skipSpaces(const char *&from, const char *to)
//{
// while (from != to && QChar(*from).isSpace())
// ++from;
//}
void GdbMi::parseResultOrValue(const Char *&from, const Char *to)
void GdbMi::parseResultOrValue(const char *&from, const char *to)
{
//skipSpaces(from, to);
while (from != to && QChar(*from).isSpace())
++from;
//qDebug() << "parseResultOrValue: " << QByteArray::fromLatin1(from, to - from);
//qDebug() << "parseResultOrValue: " << QByteArray(from, to - from);
parseValue(from, to);
if (isValid()) {
//qDebug() << "no valid result in " << QByteArray::fromLatin1(from, to - from);
@@ -67,7 +67,7 @@ void GdbMi::parseResultOrValue(const Char *&from, const Char *to)
}
if (from == to || *from == '(')
return;
const Char *ptr = from;
const char *ptr = from;
while (ptr < to && *ptr != '=') {
//qDebug() << "adding" << QChar(*ptr) << "to name";
++ptr;
@@ -80,7 +80,7 @@ void GdbMi::parseResultOrValue(const Char *&from, const Char *to)
}
}
QByteArray GdbMi::parseCString(const Char *&from, const Char *to)
QByteArray GdbMi::parseCString(const char *&from, const char *to)
{
QByteArray result;
//qDebug() << "parseCString: " << QByteArray::fromUtf16(from, to - from);
@@ -88,7 +88,7 @@ QByteArray GdbMi::parseCString(const Char *&from, const Char *to)
qDebug() << "MI Parse Error, double quote expected";
return QByteArray();
}
const Char *ptr = from;
const char *ptr = from;
++ptr;
while (ptr < to) {
if (*ptr == '"') {
@@ -115,7 +115,7 @@ QByteArray GdbMi::parseCString(const Char *&from, const Char *to)
return result;
}
void GdbMi::parseValue(const Char *&from, const Char *to)
void GdbMi::parseValue(const char *&from, const char *to)
{
//qDebug() << "parseValue: " << QByteArray::fromUtf16(from, to - from);
switch (*from) {
@@ -135,7 +135,7 @@ void GdbMi::parseValue(const Char *&from, const Char *to)
}
void GdbMi::parseTuple(const Char *&from, const Char *to)
void GdbMi::parseTuple(const char *&from, const char *to)
{
//qDebug() << "parseTuple: " << QByteArray::fromUtf16(from, to - from);
QTC_ASSERT(*from == '{', /**/);
@@ -143,7 +143,7 @@ void GdbMi::parseTuple(const Char *&from, const Char *to)
parseTuple_helper(from, to);
}
void GdbMi::parseTuple_helper(const Char *&from, const Char *to)
void GdbMi::parseTuple_helper(const char *&from, const char *to)
{
//qDebug() << "parseTuple_helper: " << QByteArray::fromUtf16(from, to - from);
m_type = Tuple;
@@ -163,7 +163,7 @@ void GdbMi::parseTuple_helper(const Char *&from, const Char *to)
}
}
void GdbMi::parseList(const Char *&from, const Char *to)
void GdbMi::parseList(const char *&from, const char *to)
{
//qDebug() << "parseList: " << QByteArray::fromUtf16(from, to - from);
QTC_ASSERT(*from == '[', /**/);
@@ -267,8 +267,8 @@ QByteArray GdbMi::toString(bool multiline, int indent) const
void GdbMi::fromString(const QByteArray &ba)
{
const Char *from = ba.constBegin();
const Char *to = ba.constEnd();
const char *from = ba.constBegin();
const char *to = ba.constEnd();
parseResultOrValue(from, to);
}
@@ -449,16 +449,16 @@ static struct Tester {
}
for (int i = from; i < to; ++i) {
if (str[i] == '{')
result += "{\n" + QByteArray(2*++indent + 1, QChar(' '));
result += "{\n" + QByteArray(2*++indent + 1, ' ');
else if (str[i] == '}') {
if (!result.isEmpty() && result[result.size() - 1] != '\n')
result += "\n";
result += QByteArray(2*--indent + 1, QChar(' ')) + "}\n";
result += QByteArray(2*--indent + 1, ' ') + "}\n";
}
else if (str[i] == ',') {
if (true || !result.isEmpty() && result[result.size() - 1] != '\n')
result += "\n";
result += QByteArray(2*indent, QChar(' '));
result += QByteArray(2*indent, ' ');
}
else
result += str[i];

View File

@@ -34,8 +34,6 @@
#ifndef DEBUGGER_GDBMI_H
#define DEBUGGER_GDBMI_H
#include <qglobal.h>
#include <QtCore/QByteArray>
#include <QtCore/QList>
@@ -125,8 +123,8 @@ public:
inline const QList<GdbMi> &children() const { return m_children; }
inline int childCount() const { return m_children.size(); }
const GdbMi & childAt(int index) const { return m_children[index]; }
GdbMi & childAt(int index) { return m_children[index]; }
const GdbMi &childAt(int index) const { return m_children[index]; }
GdbMi &childAt(int index) { return m_children[index]; }
GdbMi findChild(const QByteArray &name) const;
GdbMi findChild(const QByteArray &name, const QByteArray &defaultString) const;
@@ -138,14 +136,12 @@ private:
friend class GdbResultRecord;
friend class GdbEngine;
//typedef ushort Char;
typedef char Char;
static QByteArray parseCString(const Char *&from, const Char *to);
void parseResultOrValue(const Char *&from, const Char *to);
void parseValue(const Char *&from, const Char *to);
void parseTuple(const Char *&from, const Char *to);
void parseTuple_helper(const Char *&from, const Char *to);
void parseList(const Char *&from, const Char *to);
static QByteArray parseCString(const char *&from, const char *to);
void parseResultOrValue(const char *&from, const char *to);
void parseValue(const char *&from, const char *to);
void parseTuple(const char *&from, const char *to);
void parseTuple_helper(const char *&from, const char *to);
void parseList(const char *&from, const char *to);
void dumpChildren(QByteArray *str, bool multiline, int indent) const;
};
@@ -171,8 +167,6 @@ public:
int token;
GdbResultClass resultClass;
GdbMi data;
private:
friend class GdbMi;
};
} // namespace Internal

View File

@@ -43,8 +43,6 @@
#include <QtCore/QDir>
#include <QtCore/QDebug>
enum { debugFormClassWizard = 0 };
using namespace Designer;
using namespace Designer::Internal;
@@ -111,7 +109,7 @@ Core::GeneratedFiles FormClassWizard::generateFiles(const QWizard *w, QString *e
sourceFile.setContents(source);
headerFile.setContents(header);
if (debugFormClassWizard)
if (Designer::Constants::Internal::debug)
qDebug() << Q_FUNC_INFO << '\n' << header << '\n' << source;
return Core::GeneratedFiles() << headerFile << sourceFile << uiFile;

View File

@@ -67,6 +67,9 @@ enum EditModes
NumEditModes
};
namespace Internal {
enum { debug = 0 };
}
} // Constants
} // Designer

View File

@@ -63,7 +63,7 @@ QString FormEditorFactory::kind() const
Core::IFile *FormEditorFactory::open(const QString &fileName)
{
Core::IEditor *iface = Core::ICore::instance()->editorManager()->openEditor(fileName, kind());
Core::IEditor *iface = Core::EditorManager::instance()->openEditor(fileName, kind());
return iface ? iface->file() : 0;
}

View File

@@ -83,7 +83,6 @@
#include <QtCore/QDebug>
#include <QtCore/QSettings>
enum { debugFormEditor = 0 };
enum { wantCodeGenerationAction = 0 };
static const char *editorWidgetStateKeyC = "editorWidgetState";
@@ -169,7 +168,7 @@ FormEditorW::FormEditorW() :
m_actionPrint(0),
m_actionGenerateCode(0)
{
if (debugFormEditor)
if (Designer::Constants::Internal::debug)
qDebug() << Q_FUNC_INFO;
QTC_ASSERT(!m_self, return);
m_self = this;
@@ -220,7 +219,7 @@ void FormEditorW::fullInit()
{
QTC_ASSERT(m_initStage == RegisterPlugins, return);
QTime *initTime = 0;
if (debugFormEditor) {
if (Designer::Constants::Internal::debug) {
initTime = new QTime;
initTime->start();
}
@@ -244,7 +243,7 @@ void FormEditorW::fullInit()
}
}
if (debugFormEditor) {
if (Designer::Constants::Internal::debug) {
qDebug() << Q_FUNC_INFO << initTime->elapsed() << "ms";
delete initTime;
}
@@ -282,7 +281,7 @@ void FormEditorW::initDesignerSubWindows()
void FormEditorW::ensureInitStage(InitializationStage s)
{
if (debugFormEditor)
if (Designer::Constants::Internal::debug)
qDebug() << Q_FUNC_INFO << s;
if (!m_self)
m_self = new FormEditorW;
@@ -573,8 +572,8 @@ void FormEditorW::editorDestroyed()
{
QObject *source = sender();
if (debugFormEditor)
qDebug() << "FormEditorW::editorDestroyed()" << source;
if (Designer::Constants::Internal::debug)
qDebug() << Q_FUNC_INFO << source;
for (EditorList::iterator it = m_formWindows.begin(); it != m_formWindows.end(); ) {
if (*it == source) {
@@ -588,8 +587,8 @@ void FormEditorW::editorDestroyed()
void FormEditorW::currentEditorChanged(Core::IEditor *editor)
{
if (debugFormEditor)
qDebug() << "FormEditorW::currentEditorChanged" << editor << " of " << m_fwm->formWindowCount();
if (Designer::Constants::Internal::debug)
qDebug() << Q_FUNC_INFO << editor << " of " << m_fwm->formWindowCount();
// Deactivate Designer if a non-form is being edited
if (editor && !qstrcmp(editor->kind(), Constants::C_FORMWINDOW)) {
@@ -604,9 +603,8 @@ void FormEditorW::currentEditorChanged(Core::IEditor *editor)
void FormEditorW::activeFormWindowChanged(QDesignerFormWindowInterface *afw)
{
if (debugFormEditor)
qDebug() << "FormEditorW::activeFormWindowChanged" << afw
<< " of " << m_fwm->formWindowCount() << m_formWindows;
if (Designer::Constants::Internal::debug)
qDebug() << Q_FUNC_INFO << afw << " of " << m_fwm->formWindowCount() << m_formWindows;
m_fwm->closeAllPreviews();
@@ -718,7 +716,6 @@ void FormEditorW::print()
painter.drawPixmap(0, 0, pixmap);
m_core->mainWindow()->setCursor(oldCursor);
// m_core->statusBar()->showMessage(tr("Printed %1...").arg(QFileInfo(fw->fileName()).fileName()));
} while (false);
m_core->printer()->setFullPage(oldFullPage);
m_core->printer()->setOrientation(oldOrientation);

View File

@@ -64,8 +64,6 @@ using ProjectExplorer::ProjectNode;
using ProjectExplorer::FolderNode;
using ProjectExplorer::FileNode;
enum { debugFormWindowEditor = 0 };
class QrcFilesVisitor : public NodesVisitor
{
public:
@@ -109,8 +107,8 @@ FormWindowEditor::FormWindowEditor(const QList<int> &context,
m_sessionNode(0),
m_sessionWatcher(0)
{
if (debugFormWindowEditor)
qDebug() << "FormWindowEditor::FormWindowEditor" << form << parent;
if (Designer::Constants::Internal::debug)
qDebug() << Q_FUNC_INFO << form << parent;
connect(m_file, SIGNAL(reload(QString)), this, SLOT(slotOpen(QString)));
connect(m_file, SIGNAL(setDisplayName(QString)), this, SLOT(slotSetDisplayName(QString)));
@@ -130,8 +128,8 @@ FormWindowEditor::~FormWindowEditor()
delete m_toolBar;
delete m_host;
delete m_editorWidget;
if (debugFormWindowEditor)
qDebug() << "FormWindowEditor::~FormWindowEditor" << m_displayName;
if (Designer::Constants::Internal::debug)
qDebug() << Q_FUNC_INFO << m_displayName;
if (m_sessionNode && m_sessionWatcher) {
m_sessionNode->unregisterWatcher(m_sessionWatcher);
delete m_sessionWatcher;
@@ -140,8 +138,8 @@ FormWindowEditor::~FormWindowEditor()
bool FormWindowEditor::createNew(const QString &contents)
{
if (debugFormWindowEditor)
qDebug() << "FormWindowEditor::createNew()" << contents.size() << "chars";
if (Designer::Constants::Internal::debug)
qDebug() << Q_FUNC_INFO << contents.size() << "chars";
if (!m_formWindow)
return false;
@@ -157,8 +155,8 @@ bool FormWindowEditor::createNew(const QString &contents)
bool FormWindowEditor::open(const QString &fileName /*= QString()*/)
{
if (debugFormWindowEditor)
qDebug() << "FormWindowEditor::open" << fileName;
if (Designer::Constants::Internal::debug)
qDebug() << Q_FUNC_INFO << fileName;
if (fileName.isEmpty()) {
setDisplayName(tr("untitled"));
@@ -240,8 +238,8 @@ void FormWindowEditor::slotOpen(const QString &fileName)
void FormWindowEditor::slotSetDisplayName(const QString &title)
{
if (debugFormWindowEditor)
qDebug() << "FormWindowEditor::slotSetDisplayName" << title;
if (Designer::Constants::Internal::debug)
qDebug() << Q_FUNC_INFO << title;
setDisplayName(title);
}
@@ -304,8 +302,8 @@ QWidget *FormWindowEditor::widget()
bool FormWindowEditor::generateCode(QByteArray &header, QString &errorMessage) const
{
if (debugFormWindowEditor)
qDebug() << "FormWindowEditor::generateCode";
if (Designer::Constants::Internal::debug)
qDebug() << Q_FUNC_INFO;
QString tempPattern = QDir::tempPath();
if (!tempPattern.endsWith(QDir::separator())) // platform-dependant

View File

@@ -53,9 +53,6 @@ using namespace Designer::Internal;
using namespace Designer::Constants;
using namespace SharedTools;
enum { debugFormWindowFile = 0 };
FormWindowFile::FormWindowFile(QDesignerFormWindowInterface *form, QObject *parent)
: Core::IFile(parent),
m_mimeType(QLatin1String(FORM_MIMETYPE)),
@@ -67,8 +64,8 @@ bool FormWindowFile::save(const QString &name /*= QString()*/)
{
const QString actualName = name.isEmpty() ? fileName() : name;
if (debugFormWindowFile)
qDebug() << "FormWindowFile::save" << name << "->" << actualName;
if (Designer::Constants::Internal::debug)
qDebug() << Q_FUNC_INFO << name << "->" << actualName;
if (actualName.isEmpty())
return false;
@@ -118,8 +115,8 @@ bool FormWindowFile::isSaveAsAllowed() const
void FormWindowFile::modified(Core::IFile::ReloadBehavior *behavior)
{
if (debugFormWindowFile)
qDebug() << "FormWindowFile::modified" << m_fileName << *behavior;
if (Designer::Constants::Internal::debug)
qDebug() << Q_FUNC_INFO << m_fileName << *behavior;
switch (*behavior) {
case Core::IFile::ReloadNone:
@@ -157,8 +154,8 @@ QString FormWindowFile::defaultPath() const
void FormWindowFile::setSuggestedFileName(const QString &fileName)
{
if (debugFormWindowFile)
qDebug() << "FormWindowFile:setSuggestedFileName" << m_fileName << fileName;
if (Designer::Constants::Internal::debug)
qDebug() << Q_FUNC_INFO << m_fileName << fileName;
m_suggestedName = fileName;
}
@@ -175,8 +172,8 @@ QString FormWindowFile::mimeType() const
bool FormWindowFile::writeFile(const QString &fileName, QString &errorString) const
{
if (debugFormWindowFile)
qDebug() << "FormWindowFile::writeFile" << m_fileName << fileName;
if (Designer::Constants::Internal::debug)
qDebug() << Q_FUNC_INFO << m_fileName << fileName;
QFile file(fileName);
if (!file.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate)) {

View File

@@ -44,8 +44,6 @@
using namespace Designer::Internal;
using namespace SharedTools;
enum { debugFormWindowHost = 0 };
FormWindowHost::FormWindowHost(QDesignerFormWindowInterface *form,
QWidget *parent) :
WidgetHost(parent, form)
@@ -57,14 +55,14 @@ FormWindowHost::FormWindowHost(QDesignerFormWindowInterface *form,
FormWindowHost::~FormWindowHost()
{
if (debugFormWindowHost)
qDebug() << "FormWindowHost::~FormWindowHost";
if (Designer::Constants::Internal::debug)
qDebug() << Q_FUNC_INFO;
}
void FormWindowHost::formSizeChanged(int w, int h)
{
if (debugFormWindowHost)
qDebug() << "FormWindowHost::formSizeChanged" << w << h;
if (Designer::Constants::Internal::debug)
qDebug() << Q_FUNC_INFO << w << h;
formWindow()->setDirty(true);
static const QString geometry = QLatin1String("geometry");

View File

@@ -39,8 +39,6 @@
#include <QtCore/QFile>
#include <QtCore/QDebug>
enum { debugFormWizard = 0 };
using namespace Designer;
using namespace Designer::Internal;

View File

@@ -32,26 +32,23 @@
***************************************************************************/
#include "settingsmanager.h"
#include "designerconstants.h"
#include <QtCore/QDebug>
using namespace Designer::Internal;
namespace {
bool debug = false;
}
void SettingsManager::beginGroup(const QString &prefix)
{
if (debug)
qDebug() << "Designer - beginning group " << addPrefix(prefix);
if (Designer::Constants::Internal::debug)
qDebug() << Q_FUNC_INFO << addPrefix(prefix);
m_settings.beginGroup(addPrefix(prefix));
}
void SettingsManager::endGroup()
{
if (debug)
qDebug() << "Designer - end group";
if (Designer::Constants::Internal::debug)
qDebug() << Q_FUNC_INFO;
m_settings.endGroup();
}
@@ -62,16 +59,16 @@ bool SettingsManager::contains(const QString &key) const
void SettingsManager::setValue(const QString &key, const QVariant &value)
{
if (debug)
qDebug() << "Designer - storing " << addPrefix(key) << ": " << value;
if (Designer::Constants::Internal::debug)
qDebug() << Q_FUNC_INFO << addPrefix(key) << ": " << value;
m_settings.setValue(addPrefix(key), value);
}
QVariant SettingsManager::value(const QString &key, const QVariant &defaultValue) const
{
QVariant result = m_settings.value(addPrefix(key), defaultValue);
if (debug)
qDebug() << "Designer - retrieving " << addPrefix(key) << ": " << result;
if (Designer::Constants::Internal::debug)
qDebug() << Q_FUNC_INFO << addPrefix(key) << ": " << result;
return result;
}

View File

@@ -59,7 +59,6 @@
#include <QtCore/QFileInfo>
#include <QtCore/QDebug>
enum { debugSlotNavigation = 0 };
enum { indentation = 4 };
using namespace Designer::Internal;
@@ -149,7 +148,7 @@ static bool matchMemberClassName(const QString &needle, const QString &hayStack)
// Find class definition in namespace
static const Class *findClass(const Namespace *parentNameSpace, const QString &className, QString *namespaceName)
{
if (debugSlotNavigation)
if (Designer::Constants::Internal::debug)
qDebug() << Q_FUNC_INFO << className;
const Overview o;
@@ -487,7 +486,7 @@ static ClassDocumentPtrPair
const Document::Ptr &doc, const QString &className,
unsigned maxIncludeDepth, QString *namespaceName)
{
if (debugSlotNavigation)
if (Designer::Constants::Internal::debug)
qDebug() << Q_FUNC_INFO << doc->fileName() << maxIncludeDepth;
// Check document
if (const Class *cl = findClass(doc->globalNamespace(), className, namespaceName))
@@ -548,8 +547,8 @@ bool WorkbenchIntegration::navigateToSlot(const QString &objectName,
const CPlusPlus::Snapshot docTable = cppModelManagerInstance()->snapshot();
QList<Document::Ptr> docList = findDocumentsIncluding(docTable, uicedName, true); // change to false when we know the absolute path to generated ui_<>.h file
if (debugSlotNavigation)
qDebug() << objectName << signalSignature << "Looking for " << uicedName << " returned " << docList.size();
if (Designer::Constants::Internal::debug)
qDebug() << Q_FUNC_INFO << objectName << signalSignature << "Looking for " << uicedName << " returned " << docList.size();
if (docList.isEmpty()) {
*errorMessage = tr("No documents matching %1 could be found.").arg(uicedName);
return false;
@@ -559,7 +558,7 @@ bool WorkbenchIntegration::navigateToSlot(const QString &objectName,
const QString uiClass = uiClassName(fwi->mainContainer()->objectName());
if (debugSlotNavigation)
if (Designer::Constants::Internal::debug)
qDebug() << "Checking docs for " << uiClass;
// Find the class definition in the file itself or in the directly
@@ -587,8 +586,8 @@ bool WorkbenchIntegration::navigateToSlot(const QString &objectName,
const QString functionName = QLatin1String("on_") + objectName + QLatin1Char('_') + signalSignature;
const QString functionNameWithParameterNames = addParameterNames(functionName, parameterNames);
if (debugSlotNavigation)
qDebug() << "Found " << uiClass << doc->fileName() << " checking " << functionName << functionNameWithParameterNames;
if (Designer::Constants::Internal::debug)
qDebug() << Q_FUNC_INFO << "Found " << uiClass << doc->fileName() << " checking " << functionName << functionNameWithParameterNames;
int line = 0;
Document::Ptr sourceDoc;

View File

@@ -137,20 +137,20 @@ enum MoveType
struct EditOperation
{
EditOperation() : m_position(-1), m_itemCount(0) {}
int m_position;
int m_itemCount; // used to combine several operations
QString m_from;
QString m_to;
EditOperation() : position(-1), itemCount(0) {}
int position;
int itemCount; // used to combine several operations
QString from;
QString to;
};
QDebug &operator<<(QDebug &ts, const EditOperation &op)
{
if (op.m_itemCount > 0) {
ts << "\n EDIT BLOCK WITH " << op.m_itemCount << " ITEMS";
if (op.itemCount > 0) {
ts << "\n EDIT BLOCK WITH " << op.itemCount << " ITEMS";
} else {
ts << "\n EDIT AT " << op.m_position
<< "\n FROM " << op.m_from << "\n TO " << op.m_to;
ts << "\n EDIT AT " << op.position
<< "\n FROM " << op.from << "\n TO " << op.to;
}
return ts;
}
@@ -367,6 +367,7 @@ bool FakeVimHandler::Private::handleEvent(QKeyEvent *ev)
quit();
return true;
}
m_mode = CommandMode;
return false;
}
@@ -1356,9 +1357,9 @@ void FakeVimHandler::Private::handleExCommand(const QString &cmd0)
m_tc.setPosition(positionForLine(beginLine));
EditOperation op;
// FIXME: broken for "upward selection"
op.m_position = m_tc.position();
op.m_from = text;
op.m_to = result;
op.position = m_tc.position();
op.from = text;
op.to = result;
recordOperation(op);
enterCommandMode();
@@ -1748,60 +1749,52 @@ QWidget *FakeVimHandler::Private::editor() const
void FakeVimHandler::Private::undo()
{
#if 0
EDITOR(undo());
#else
if (m_undoStack.isEmpty()) {
showBlackMessage(tr("Already at oldest change"));
} else {
EditOperation op = m_undoStack.pop();
//qDebug() << "UNDO " << op;
if (op.m_itemCount > 0) {
for (int i = op.m_itemCount; --i >= 0; )
if (op.itemCount > 0) {
for (int i = op.itemCount; --i >= 0; )
undo();
} else {
m_tc.setPosition(op.m_position, MoveAnchor);
if (!op.m_to.isEmpty()) {
m_tc.setPosition(op.m_position + op.m_to.size(), KeepAnchor);
m_tc.deleteChar();
m_tc.setPosition(op.position, MoveAnchor);
if (!op.to.isEmpty()) {
m_tc.setPosition(op.position + op.to.size(), KeepAnchor);
m_tc.removeSelectedText();
}
if (!op.m_from.isEmpty())
m_tc.insertText(op.m_from);
m_tc.setPosition(op.m_position, MoveAnchor);
if (!op.from.isEmpty())
m_tc.insertText(op.from);
m_tc.setPosition(op.position, MoveAnchor);
}
m_redoStack.push(op);
showBlackMessage(QString());
}
#endif
}
void FakeVimHandler::Private::redo()
{
#if 0
EDITOR(redo());
#else
if (m_redoStack.isEmpty()) {
showBlackMessage(tr("Already at newest change"));
} else {
EditOperation op = m_redoStack.pop();
//qDebug() << "REDO " << op;
if (op.m_itemCount > 0) {
for (int i = op.m_itemCount; --i >= 0; )
if (op.itemCount > 0) {
for (int i = op.itemCount; --i >= 0; )
redo();
} else {
m_tc.setPosition(op.m_position, MoveAnchor);
if (!op.m_from.isEmpty()) {
m_tc.setPosition(op.m_position + op.m_from.size(), KeepAnchor);
m_tc.deleteChar();
m_tc.setPosition(op.position, MoveAnchor);
if (!op.from.isEmpty()) {
m_tc.setPosition(op.position + op.from.size(), KeepAnchor);
m_tc.removeSelectedText();
}
if (!op.m_to.isEmpty())
m_tc.insertText(op.m_to);
m_tc.setPosition(op.m_position, MoveAnchor);
if (!op.to.isEmpty())
m_tc.insertText(op.to);
m_tc.setPosition(op.position, MoveAnchor);
}
m_undoStack.push(op);
showBlackMessage(QString());
}
#endif
}
void FakeVimHandler::Private::recordBeginGroup()
@@ -1809,29 +1802,37 @@ void FakeVimHandler::Private::recordBeginGroup()
//qDebug() << "PUSH";
m_undoGroupStack.push(m_undoStack.size());
EditOperation op;
op.m_position = m_tc.position();
op.position = m_tc.position();
recordOperation(op);
}
void FakeVimHandler::Private::recordEndGroup()
{
if (m_undoGroupStack.isEmpty()) {
qWarning("fakevim: undo groups not balanced.\n");
return;
}
EditOperation op;
op.m_itemCount = m_undoStack.size() - m_undoGroupStack.pop();
//qDebug() << "POP " << op.m_itemCount;
op.itemCount = m_undoStack.size() - m_undoGroupStack.pop();
//qDebug() << "POP " << op.itemCount << m_undoStack;
recordOperation(op);
}
QString FakeVimHandler::Private::recordRemoveSelectedText()
{
EditOperation op;
//qDebug() << "1 POS: " << position() << " ANCHOR: " << anchor() << m_tc.anchor();
m_tc.setPosition(anchor(), KeepAnchor);
op.m_position = qMin(position(), anchor());
//qDebug() << "2 POS: " << position() << " ANCHOR: " << anchor() << m_tc.anchor();
op.m_from = m_tc.selection().toPlainText();
//qDebug() << "POS: " << position() << " ANCHOR: " << anchor() << m_tc.anchor();
int pos = m_tc.position();
if (pos == anchor())
return QString();
m_tc.setPosition(anchor(), MoveAnchor);
m_tc.setPosition(pos, KeepAnchor);
op.position = qMin(pos, anchor());
op.from = m_tc.selection().toPlainText();
//qDebug() << "OP: " << op;
recordOperation(op);
m_tc.deleteChar();
return op.m_from;
m_tc.removeSelectedText();
return op.from;
}
void FakeVimHandler::Private::recordRemoveNextChar()
@@ -1844,15 +1845,20 @@ void FakeVimHandler::Private::recordRemoveNextChar()
void FakeVimHandler::Private::recordInsertText(const QString &data)
{
EditOperation op;
op.m_position = m_tc.position();
op.m_to = data;
op.position = m_tc.position();
op.to = data;
recordOperation(op);
m_tc.insertText(data);
}
void FakeVimHandler::Private::recordOperation(const EditOperation &op)
{
//qDebug() << "OP: " << op;
// No need to record operations that actually do not change anything.
if (op.from.isEmpty() && op.to.isEmpty() && op.itemCount == 0)
return;
// No need to create groups with only one member.
if (op.itemCount == 1)
return;
m_undoStack.push(op);
m_redoStack.clear();
}
@@ -1860,16 +1866,16 @@ void FakeVimHandler::Private::recordOperation(const EditOperation &op)
void FakeVimHandler::Private::recordMove(int position, int nestedCount)
{
EditOperation op;
op.m_position = position;
op.m_itemCount = nestedCount;
op.position = position;
op.itemCount = nestedCount;
recordOperation(op);
}
void FakeVimHandler::Private::recordInsert(int position, const QString &data)
{
EditOperation op;
op.m_position = position;
op.m_to = data;
op.position = position;
op.to = data;
recordOperation(op);
}
@@ -1884,8 +1890,8 @@ void FakeVimHandler::Private::recordRemove(int position, int length)
void FakeVimHandler::Private::recordRemove(int position, const QString &data)
{
EditOperation op;
op.m_position = position;
op.m_from = data;
op.position = position;
op.from = data;
recordOperation(op);
}
@@ -1894,6 +1900,7 @@ void FakeVimHandler::Private::enterInsertMode()
EDITOR(setOverwriteMode(false));
m_mode = InsertMode;
m_lastInsertion.clear();
recordBeginGroup();
}
void FakeVimHandler::Private::enterCommandMode()

View File

@@ -45,8 +45,8 @@ using namespace Core;
using namespace Find;
using namespace Find::Internal;
CurrentDocumentFind::CurrentDocumentFind(ICore *core)
: m_core(core), m_currentFind(0)
CurrentDocumentFind::CurrentDocumentFind()
: m_currentFind(0)
{
connect(qApp, SIGNAL(focusChanged(QWidget*, QWidget*)),
this, SLOT(updateCurrentFindFilter(QWidget*,QWidget*)));

View File

@@ -36,8 +36,6 @@
#include "ifindfilter.h"
#include <coreplugin/icore.h>
#include <QtCore/QPointer>
#include <QtGui/QWidget>
@@ -49,7 +47,7 @@ class CurrentDocumentFind : public QObject
Q_OBJECT
public:
CurrentDocumentFind(Core::ICore *core);
CurrentDocumentFind();
void resetIncrementalSearch();
void clearResults();
@@ -83,7 +81,6 @@ private slots:
private:
void removeFindSupportConnections();
Core::ICore *m_core;
QPointer<IFindSupport> m_currentFind;
QPointer<QWidget> m_currentWidget;
};

View File

@@ -42,6 +42,7 @@
#include <coreplugin/actionmanager/actioncontainer.h>
#include <coreplugin/actionmanager/command.h>
#include <coreplugin/coreconstants.h>
#include <coreplugin/icore.h>
#include <extensionsystem/pluginmanager.h>
@@ -77,14 +78,13 @@ FindPlugin::~FindPlugin()
bool FindPlugin::initialize(const QStringList &, QString *)
{
Core::ICore *core = Core::ICore::instance();
setupMenu();
m_currentDocumentFind = new CurrentDocumentFind(core);
m_currentDocumentFind = new CurrentDocumentFind;
m_findToolBar = new FindToolBar(this, m_currentDocumentFind);
m_findDialog = new FindToolWindow(this);
SearchResultWindow *searchResultWindow = new SearchResultWindow(core);
SearchResultWindow *searchResultWindow = new SearchResultWindow;
addAutoReleasedObject(searchResultWindow);
return true;
}
@@ -126,8 +126,7 @@ void FindPlugin::openFindFilter()
void FindPlugin::setupMenu()
{
Core::ICore *core = Core::ICore::instance();
Core::ActionManager *am = core->actionManager();
Core::ActionManager *am = Core::ICore::instance()->actionManager();
Core::ActionContainer *medit = am->actionContainer(Core::Constants::M_EDIT);
Core::ActionContainer *mfind = am->createMenu(Constants::M_FIND);
medit->addMenu(mfind, Core::Constants::G_EDIT_FIND);
@@ -150,8 +149,7 @@ void FindPlugin::setupMenu()
void FindPlugin::setupFilterMenuItems()
{
Core::ICore *core = Core::ICore::instance();
Core::ActionManager *am = core->actionManager();
Core::ActionManager *am = Core::ICore::instance()->actionManager();
QList<IFindFilter*> findInterfaces =
ExtensionSystem::PluginManager::instance()->getObjects<IFindFilter>();
Core::Command *cmd;

View File

@@ -38,7 +38,6 @@
#include "ifindfilter.h"
#include "findtoolbar.h"
#include <coreplugin/icore.h>
#include <extensionsystem/iplugin.h>
#include <QtCore/QHash>

View File

@@ -37,6 +37,7 @@
#include <coreplugin/coreconstants.h>
#include <coreplugin/findplaceholder.h>
#include <coreplugin/icore.h>
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/actionmanager/actioncontainer.h>
#include <coreplugin/actionmanager/command.h>

View File

@@ -34,6 +34,8 @@
#include "searchresultwindow.h"
#include "searchresulttreemodel.h"
#include <coreplugin/icore.h>
#include <QtCore/QFile>
#include <QtCore/QTextStream>
#include <QtCore/QSettings>
@@ -46,10 +48,9 @@ using namespace Find::Internal;
static const QString SETTINGSKEYSECTIONNAME("SearchResults");
static const QString SETTINGSKEYEXPANDRESULTS("ExpandResults");
SearchResultWindow::SearchResultWindow(Core::ICore *core) :
m_core(core),
m_widget(new QStackedWidget())
SearchResultWindow::SearchResultWindow()
{
m_widget = new QStackedWidget;
m_widget->setWindowTitle(name());
m_searchResultTreeView = new SearchResultTreeView(m_widget);
@@ -173,8 +174,8 @@ void SearchResultWindow::handleExpandCollapseToolButton(bool checked)
void SearchResultWindow::readSettings(void)
{
if (m_core && m_core->settings()) {
QSettings *s = m_core->settings();
QSettings *s = Core::ICore::instance()->settings();
if (s) {
s->beginGroup(SETTINGSKEYSECTIONNAME);
m_expandCollapseToolButton->setChecked(s->value(SETTINGSKEYEXPANDRESULTS, m_initiallyExpand).toBool());
s->endGroup();
@@ -183,8 +184,8 @@ void SearchResultWindow::readSettings(void)
void SearchResultWindow::writeSettings(void)
{
if (m_core && m_core->settings()) {
QSettings *s = m_core->settings();
QSettings *s = Core::ICore::instance()->settings();
if (s) {
s->beginGroup(SETTINGSKEYSECTIONNAME);
s->setValue(SETTINGSKEYEXPANDRESULTS, m_expandCollapseToolButton->isChecked());
s->endGroup();

View File

@@ -38,7 +38,6 @@
#include "searchresulttreeview.h"
#include <coreplugin/ioutputpane.h>
#include <coreplugin/icore.h>
#include <QtCore/QThread>
#include <QtCore/QStringList>
@@ -65,7 +64,7 @@ class FIND_EXPORT SearchResultWindow : public Core::IOutputPane
Q_OBJECT
public:
SearchResultWindow(Core::ICore *core);
SearchResultWindow();
~SearchResultWindow();
QWidget *outputWidget(QWidget *);
@@ -97,7 +96,6 @@ private:
Internal::SearchResultTreeView *m_searchResultTreeView;
QListWidget *m_noMatchesFoundDisplay;
Core::ICore *m_core;
QToolButton *m_expandCollapseToolButton;
static const bool m_initiallyExpand = false;
QStackedWidget *m_widget;

View File

@@ -236,8 +236,7 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *error_message)
m_gitClient = new GitClient(this);
// Create the globalcontext list to register actions accordingly
QList<int> globalcontext;
globalcontext << m_core->uniqueIDManager()->
uniqueIdentifier(Core::Constants::C_GLOBAL);
globalcontext << m_core->uniqueIDManager()->uniqueIdentifier(Core::Constants::C_GLOBAL);
// Create the output Window
m_outputWindow = new GitOutputWindow();

View File

@@ -241,8 +241,8 @@ bool PerforcePlugin::initialize(const QStringList &arguments, QString *errorMess
globalcontext << Core::Constants::C_GLOBAL_ID;
QList<int> perforcesubmitcontext;
perforcesubmitcontext <<
Core::ICore::instance()->uniqueIDManager()->uniqueIdentifier(Constants::C_PERFORCESUBMITEDITOR);
perforcesubmitcontext << Core::UniqueIDManager::instance()->
uniqueIdentifier(Constants::C_PERFORCESUBMITEDITOR);
Core::Command *command;
QAction *tmpaction;
@@ -467,7 +467,7 @@ void PerforcePlugin::diffAllOpened()
void PerforcePlugin::printOpenedFileList()
{
Core::IEditor *e = Core::ICore::instance()->editorManager()->currentEditor();
Core::IEditor *e = Core::EditorManager::instance()->currentEditor();
if (e)
e->widget()->setFocus();
PerforceResponse result = runP4Cmd(QStringList() << QLatin1String("opened"), QStringList(), CommandToWindow|StdOutToWindow|StdErrToWindow|ErrorToWindow);
@@ -542,9 +542,9 @@ void PerforcePlugin::submit()
Core::IEditor *PerforcePlugin::openPerforceSubmitEditor(const QString &fileName, const QStringList &depotFileNames)
{
Core::IEditor *editor =
Core::ICore::instance()->editorManager()->openEditor(fileName, Constants::PERFORCESUBMITEDITOR_KIND);
Core::ICore::instance()->editorManager()->ensureEditorManagerVisible();
Core::EditorManager *editorManager = Core::EditorManager::instance();
Core::IEditor *editor = editorManager->openEditor(fileName, Constants::PERFORCESUBMITEDITOR_KIND);
editorManager->ensureEditorManagerVisible();
PerforceSubmitEditor *submitEditor = dynamic_cast<PerforceSubmitEditor*>(editor);
QTC_ASSERT(submitEditor, return 0);
submitEditor->restrictToProjectFiles(depotFileNames);
@@ -841,9 +841,9 @@ Core::IEditor * PerforcePlugin::showOutputInEditor(const QString& title, const Q
if (Perforce::Constants::debug)
qDebug() << "PerforcePlugin::showOutputInEditor" << title << kind << "Size= " << output.size() << " Type=" << editorType << debugCodec(codec);
QString s = title;
Core::IEditor *ediface = Core::ICore::instance()->editorManager()->
Core::IEditor *editor = Core::EditorManager::instance()->
newFile(kind, &s, output.toLocal8Bit());
PerforceEditor *e = qobject_cast<PerforceEditor*>(ediface->widget());
PerforceEditor *e = qobject_cast<PerforceEditor*>(editor->widget());
if (!e)
return 0;
s.replace(QLatin1Char(' '), QLatin1Char('_'));
@@ -857,7 +857,7 @@ QStringList PerforcePlugin::environment() const
{
QStringList newEnv = QProcess::systemEnvironment();
const QString name = "P4DIFF";
for (int i=0; i<newEnv.count(); ++i) {
for (int i = 0; i < newEnv.count(); ++i) {
if (newEnv.at(i).startsWith(name)) {
newEnv.removeAt(i);
return newEnv;
@@ -889,7 +889,7 @@ void PerforcePlugin::p4Diff(const QStringList &files, QString diffname)
diffname = fi.fileName();
}
foreach (Core::IEditor *ed, Core::ICore::instance()->editorManager()->openedEditors()) {
foreach (Core::IEditor *ed, Core::EditorManager::instance()->openedEditors()) {
if (ed->property("originalFileName").toString() == fileName) {
existingEditor = ed;
displayInEditor = false;
@@ -912,7 +912,7 @@ void PerforcePlugin::p4Diff(const QStringList &files, QString diffname)
} else if (!displayInEditor && existingEditor) {
if (existingEditor) {
existingEditor->createNew(result.stdOut);
Core::ICore::instance()->editorManager()->setCurrentEditor(existingEditor);
Core::EditorManager::instance()->setCurrentEditor(existingEditor);
}
}
}
@@ -930,7 +930,7 @@ void PerforcePlugin::describe(const QString & source, const QString &n)
void PerforcePlugin::submitCurrentLog()
{
Core::EditorManager *em = Core::ICore::instance()->editorManager();
Core::EditorManager *em = Core::EditorManager::instance();
em->closeEditors(QList<Core::IEditor*>() << em->currentEditor());
}
@@ -1004,8 +1004,8 @@ bool PerforcePlugin::editorAboutToClose(Core::IEditor *editor)
void PerforcePlugin::openFiles(const QStringList &files)
{
Core::EditorManager *em = Core::ICore::instance()->editorManager();
foreach (QString s, files)
Core::EditorManager *em = Core::EditorManager::instance();
foreach (const QString &s, files)
em->openEditor(clientFilePath(s));
em->ensureEditorManagerVisible();
}

View File

@@ -170,7 +170,7 @@ void FolderNavigationWidget::openItem(const QModelIndex &index)
setCurrentTitle(QDir(m_dirModel->filePath(srcIndex)));
} else {
const QString filePath = m_dirModel->filePath(srcIndex);
Core::EditorManager *editorManager = Core::ICore::instance()->editorManager();
Core::EditorManager *editorManager = Core::EditorManager::instance();
editorManager->openEditor(filePath);
editorManager->ensureEditorManagerVisible();
}

View File

@@ -870,7 +870,7 @@ bool ProjectExplorerPlugin::openProjects(const QStringList &fileNames)
updateActions();
Core::ICore::instance()->modeManager()->activateMode(Core::Constants::MODE_EDIT);
Core::ModeManager::instance()->activateMode(Core::Constants::MODE_EDIT);
QApplication::restoreOverrideCursor();
return true;
@@ -986,7 +986,7 @@ void ProjectExplorerPlugin::restoreSession()
}
// update welcome page
Core::ModeManager *modeManager = Core::ICore::instance()->modeManager();
Core::ModeManager *modeManager = Core::ModeManager::instance();
connect(modeManager, SIGNAL(currentModeChanged(Core::IMode*)), this, SLOT(currentModeChanged(Core::IMode*)));
if (Core::Internal::WelcomeMode *welcomeMode = qobject_cast<Core::Internal::WelcomeMode*>(modeManager->mode(Core::Constants::MODE_WELCOME))) {
updateWelcomePage(welcomeMode);
@@ -1618,9 +1618,9 @@ void ProjectExplorerPlugin::openFile()
{
if (m_currentNode)
return;
Core::ICore *core = Core::ICore::instance();
core->editorManager()->openEditor(m_currentNode->path());
core->editorManager()->ensureEditorManagerVisible();
Core::EditorManager *em = Core::EditorManager::instance();
em->openEditor(m_currentNode->path());
em->ensureEditorManagerVisible();
}
void ProjectExplorerPlugin::removeFile()
@@ -1802,7 +1802,7 @@ void ProjectExplorerPlugin::openWithMenuTriggered(QAction *action)
qWarning() << "Editor Factory not attached to action, can't happen"<<editorFactory;
return;
}
Core::EditorManager *em = Core::ICore::instance()->editorManager();
Core::EditorManager *em = Core::EditorManager::instance();
em->openEditor(currentNode()->path(), editorFactory->kind());
em->ensureEditorManagerVisible();
}

View File

@@ -291,7 +291,7 @@ void ProjectTreeWidget::openItem(const QModelIndex &mainIndex)
{
Node *node = m_model->nodeForIndex(mainIndex);
if (node->nodeType() == FileNodeType) {
Core::EditorManager *editorManager = Core::ICore::instance()->editorManager();
Core::EditorManager *editorManager = Core::EditorManager::instance();
editorManager->openEditor(node->path());
editorManager->ensureEditorManagerVisible();
}

View File

@@ -578,8 +578,8 @@ void TaskDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option,
TaskWindowContext::TaskWindowContext(QWidget *widget)
: m_taskList(widget)
{
Core::ICore *core = Core::ICore::instance();
m_context << core->uniqueIDManager()->uniqueIdentifier(Core::Constants::C_PROBLEM_PANE);
Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance();
m_context << uidm->uniqueIdentifier(Core::Constants::C_PROBLEM_PANE);
}
QList<int> TaskWindowContext::context() const

View File

@@ -40,7 +40,6 @@
#include "proeditormodel.h"
#include "procommandmanager.h"
#include <coreplugin/icore.h>
#include <coreplugin/uniqueidmanager.h>
#include <texteditor/fontsettings.h>
#include <texteditor/texteditoractionhandler.h>
@@ -62,13 +61,10 @@ using namespace ProjectExplorer;
ProFileEditorEditable::ProFileEditorEditable(ProFileEditor *editor)
: BaseTextEditorEditable(editor)
{
Core::ICore *core = Core::ICore::instance();
m_context << core->uniqueIDManager()->
uniqueIdentifier(Qt4ProjectManager::Constants::C_PROFILEEDITOR);
m_context << core->uniqueIDManager()->
uniqueIdentifier(TextEditor::Constants::C_TEXTEDITOR);
// m_contexts << core->uniqueIDManager()->
// uniqueIdentifier(Qt4ProjectManager::Constants::PROJECT_KIND);
Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance();
m_context << uidm->uniqueIdentifier(Qt4ProjectManager::Constants::C_PROFILEEDITOR);
m_context << uidm->uniqueIdentifier(TextEditor::Constants::C_TEXTEDITOR);
// m_contexts << uidm->uniqueIdentifier(Qt4ProjectManager::Constants::PROJECT_KIND);
}
TextEditor::BaseTextEditorEditable *ProFileEditor::createEditableInterface()

View File

@@ -37,7 +37,6 @@
#include "qt4projectmanagerconstants.h"
#include "profileeditor.h"
#include <coreplugin/icore.h>
#include <coreplugin/fileiconprovider.h>
#include <coreplugin/editormanager/editormanager.h>
#include <texteditor/texteditoractionhandler.h>
@@ -74,8 +73,7 @@ QString ProFileEditorFactory::kind() const
Core::IFile *ProFileEditorFactory::open(const QString &fileName)
{
Core::ICore *core = Core::ICore::instance();
Core::IEditor *iface = core->editorManager()->openEditor(fileName, kind());
Core::IEditor *iface = Core::EditorManager::instance()->openEditor(fileName, kind());
return iface ? iface->file() : 0;
}

View File

@@ -89,8 +89,8 @@ Qt4Manager::Qt4Manager(Qt4ProjectManagerPlugin *plugin)
m_contextProject(0),
m_languageID(0)
{
m_languageID = Core::ICore::instance()->uniqueIDManager()->
uniqueIdentifier(ProjectExplorer::Constants::LANG_CXX);
m_languageID = Core::UniqueIDManager::instance()->
uniqueIdentifier(ProjectExplorer::Constants::LANG_CXX);
}
Qt4Manager::~Qt4Manager()

View File

@@ -37,7 +37,6 @@
#include "qtscripteditorconstants.h"
#include "qtscripteditorplugin.h"
#include <coreplugin/icore.h>
#include <coreplugin/editormanager/editormanager.h>
#include <QtCore/QFileInfo>
@@ -67,7 +66,7 @@ QString QtScriptEditorFactory::kind() const
Core::IFile *QtScriptEditorFactory::open(const QString &fileName)
{
Core::IEditor *iface = Core::ICore::instance()->editorManager()->openEditor(fileName, kind());
Core::IEditor *iface = Core::EditorManager::instance()->openEditor(fileName, kind());
if (!iface) {
qWarning() << "QtScriptEditorFactory::open: openEditor failed for " << fileName;
return 0;

View File

@@ -33,7 +33,6 @@
#include "basefilefilter.h"
#include <coreplugin/icore.h>
#include <coreplugin/editormanager/editormanager.h>
#include <QtCore/QDir>
@@ -89,7 +88,7 @@ QList<FilterEntry> BaseFileFilter::matchesFor(const QString &origEntry)
void BaseFileFilter::accept(QuickOpen::FilterEntry selection) const
{
Core::EditorManager *em = Core::ICore::instance()->editorManager();
Core::EditorManager *em = Core::EditorManager::instance();
em->openEditor(selection.internalData.toString());
em->ensureEditorManagerVisible();
}

View File

@@ -36,7 +36,6 @@
#include "resourceeditorplugin.h"
#include "resourceeditorconstants.h"
#include <coreplugin/icore.h>
#include <coreplugin/uniqueidmanager.h>
#include <coreplugin/fileiconprovider.h>
#include <coreplugin/editormanager/editormanager.h>
@@ -53,7 +52,7 @@ ResourceEditorFactory::ResourceEditorFactory(ResourceEditorPlugin *plugin) :
m_kind(QLatin1String(C_RESOURCEEDITOR)),
m_plugin(plugin)
{
m_context += Core::ICore::instance()->uniqueIDManager()
m_context += Core::UniqueIDManager::instance()
->uniqueIdentifier(QLatin1String(ResourceEditor::Constants::C_RESOURCEEDITOR));
Core::FileIconProvider *iconProvider = Core::FileIconProvider::instance();
iconProvider->registerIconForSuffix(QIcon(":/resourceeditor/images/qt_qrc.png"),
@@ -67,7 +66,7 @@ QString ResourceEditorFactory::kind() const
Core::IFile *ResourceEditorFactory::open(const QString &fileName)
{
Core::IEditor *iface = Core::ICore::instance()->editorManager()->openEditor(fileName, kind());
Core::IEditor *iface = Core::EditorManager::instance()->openEditor(fileName, kind());
if (!iface) {
qWarning() << "ResourceEditorFactory::open: openEditor failed for " << fileName;
return 0;

View File

@@ -129,7 +129,7 @@ void ResourceEditorPlugin::onUndoStackChanged(ResourceEditorW const *editor,
ResourceEditorW * ResourceEditorPlugin::currentEditor() const
{
ResourceEditorW * const focusEditor = qobject_cast<ResourceEditorW *>(
Core::ICore::instance()->editorManager()->currentEditor());
Core::EditorManager::instance()->currentEditor());
QTC_ASSERT(focusEditor, return 0);
return focusEditor;
}

View File

@@ -134,7 +134,7 @@ static inline QString debugCodec(const QTextCodec *c)
Core::IEditor* locateEditor(const char *property, const QString &entry)
{
foreach (Core::IEditor *ed, Core::ICore::instance()->editorManager()->openedEditors())
foreach (Core::IEditor *ed, Core::EditorManager::instance()->openedEditors())
if (ed->property(property).toString() == entry)
return ed;
return 0;
@@ -407,7 +407,7 @@ bool SubversionPlugin::initialize(const QStringList &arguments, QString *errorMe
// Actions of the submit editor
QList<int> svncommitcontext;
svncommitcontext << Core::ICore::instance()->uniqueIDManager()->uniqueIdentifier(Constants::SUBVERSIONCOMMITEDITOR);
svncommitcontext << Core::UniqueIDManager::instance()->uniqueIdentifier(Constants::SUBVERSIONCOMMITEDITOR);
m_submitCurrentLogAction = new QAction(VCSBase::VCSBaseSubmitEditor::submitIcon(), tr("Commit"), this);
command = ami->registerAction(m_submitCurrentLogAction, Constants::SUBMIT_CURRENT, svncommitcontext);
@@ -513,7 +513,7 @@ void SubversionPlugin::svnDiff(const QStringList &files, QString diffname)
// Show in the same editor if diff has been executed before
if (Core::IEditor *editor = locateEditor("originalFileName", files.front())) {
editor->createNew(response.stdOut);
Core::ICore::instance()->editorManager()->setCurrentEditor(editor);
Core::EditorManager::instance()->setCurrentEditor(editor);
return;
}
}
@@ -525,7 +525,7 @@ void SubversionPlugin::svnDiff(const QStringList &files, QString diffname)
SubversionSubmitEditor *SubversionPlugin::openSubversionSubmitEditor(const QString &fileName)
{
Core::IEditor *editor = Core::ICore::instance()->editorManager()->openEditor(fileName, QLatin1String(Constants::SUBVERSIONCOMMITEDITOR_KIND));
Core::IEditor *editor = Core::EditorManager::instance()->openEditor(fileName, QLatin1String(Constants::SUBVERSIONCOMMITEDITOR_KIND));
SubversionSubmitEditor *submitEditor = qobject_cast<SubversionSubmitEditor*>(editor);
QTC_ASSERT(submitEditor, /**/);
submitEditor->registerActions(m_submitUndoAction, m_submitRedoAction, m_submitCurrentLogAction, m_submitDiffAction);
@@ -776,7 +776,7 @@ void SubversionPlugin::filelog(const QString &file)
if (Core::IEditor *editor = locateEditor("logFileName", file)) {
editor->createNew(response.stdOut);
Core::ICore::instance()->editorManager()->setCurrentEditor(editor);
Core::EditorManager::instance()->setCurrentEditor(editor);
} else {
const QString title = tr("svn log %1").arg(QFileInfo(file).fileName());
Core::IEditor *newEditor = showOutputInEditor(title, response.stdOut, VCSBase::LogOutput, file, codec);
@@ -819,7 +819,7 @@ void SubversionPlugin::annotate(const QString &file)
if (Core::IEditor *editor = locateEditor("annotateFileName", file)) {
editor->createNew(response.stdOut);
Core::ICore::instance()->editorManager()->setCurrentEditor(editor);
Core::EditorManager::instance()->setCurrentEditor(editor);
} else {
const QString title = tr("svn annotate %1").arg(QFileInfo(file).fileName());
Core::IEditor *newEditor = showOutputInEditor(title, response.stdOut, VCSBase::AnnotateOutput, file, codec);
@@ -873,7 +873,7 @@ void SubversionPlugin::describe(const QString &source, const QString &changeNr)
const QString id = diffArg + source;
if (Core::IEditor *editor = locateEditor("describeChange", id)) {
editor->createNew(response.stdOut);
Core::ICore::instance()->editorManager()->setCurrentEditor(editor);
Core::EditorManager::instance()->setCurrentEditor(editor);
} else {
const QString title = tr("svn describe %1#%2").arg(QFileInfo(source).fileName(), changeNr);
Core::IEditor *newEditor = showOutputInEditor(title, response.stdOut, VCSBase::DiffOutput, source, codec);
@@ -883,8 +883,8 @@ void SubversionPlugin::describe(const QString &source, const QString &changeNr)
void SubversionPlugin::submitCurrentLog()
{
Core::ICore::instance()->editorManager()->closeEditors(QList<Core::IEditor*>()
<< Core::ICore::instance()->editorManager()->currentEditor());
Core::EditorManager::instance()->closeEditors(QList<Core::IEditor*>()
<< Core::EditorManager::instance()->currentEditor());
}
QString SubversionPlugin::currentFileName() const
@@ -990,8 +990,8 @@ Core::IEditor * SubversionPlugin::showOutputInEditor(const QString& title, const
if (Subversion::Constants::debug)
qDebug() << "SubversionPlugin::showOutputInEditor" << title << kind << "Size= " << output.size() << " Type=" << editorType << debugCodec(codec);
QString s = title;
Core::IEditor *ediface = Core::ICore::instance()->editorManager()->newFile(kind, &s, output.toLocal8Bit());
SubversionEditor *e = qobject_cast<SubversionEditor*>(ediface->widget());
Core::IEditor *editor = Core::EditorManager::instance()->newFile(kind, &s, output.toLocal8Bit());
SubversionEditor *e = qobject_cast<SubversionEditor*>(editor->widget());
if (!e)
return 0;
s.replace(QLatin1Char(' '), QLatin1Char('_'));

View File

@@ -33,6 +33,7 @@
#include "basefilefind.h"
#include <coreplugin/icore.h>
#include <coreplugin/stylehelper.h>
#include <coreplugin/progressmanager/progressmanager.h>
#include <coreplugin/editormanager/editormanager.h>
@@ -40,7 +41,7 @@
#include <texteditor/itexteditor.h>
#include <texteditor/basetexteditor.h>
#include <QtDebug>
#include <QtCore/QDebug>
#include <QtCore/QDirIterator>
#include <QtGui/QPushButton>
#include <QtGui/QFileDialog>

View File

@@ -43,7 +43,6 @@
#include "codecselector.h"
#ifndef TEXTEDITOR_STANDALONE
#include <coreplugin/icore.h>
#include <coreplugin/manhattanstyle.h>
#include <coreplugin/coreconstants.h>
#include <coreplugin/editormanager/editormanager.h>
@@ -132,7 +131,7 @@ ITextEditor *BaseTextEditor::openEditorAt(const QString &fileName,
int column,
const QString &editorKind)
{
Core::EditorManager *editorManager = Core::ICore::instance()->editorManager();
Core::EditorManager *editorManager = Core::EditorManager::instance();
editorManager->addCurrentPositionToNavigationHistory(true);
Core::IEditor *editor = editorManager->openEditor(fileName, editorKind, true);
TextEditor::ITextEditor *texteditor = qobject_cast<TextEditor::ITextEditor *>(editor);

View File

@@ -35,7 +35,6 @@
#include <coreplugin/editormanager/editormanager.h>
#include <extensionsystem/pluginmanager.h>
#include <coreplugin/icore.h>
#include <QtCore/QTimer>
@@ -57,7 +56,7 @@ BaseTextMark::BaseTextMark(const QString &filename, int line)
void BaseTextMark::init()
{
m_init = true;
Core::EditorManager *em = Core::ICore::instance()->editorManager();
Core::EditorManager *em = Core::EditorManager::instance();
connect(em, SIGNAL(editorOpened(Core::IEditor *)), this, SLOT(editorOpened(Core::IEditor *)));
foreach (Core::IEditor *editor, em->openedEditors())
@@ -117,7 +116,7 @@ void BaseTextMark::updateMarker()
void BaseTextMark::moveMark(const QString & /* filename */, int /* line */)
{
Core::EditorManager *em = Core::ICore::instance()->editorManager();
Core::EditorManager *em = Core::EditorManager::instance();
if (!m_init) {
connect(em, SIGNAL(editorOpened(Core::IEditor *)), this, SLOT(editorOpened(Core::IEditor *)));
m_init = true;

View File

@@ -36,24 +36,21 @@
#include "texteditorplugin.h"
#include <coreplugin/coreconstants.h>
#include <coreplugin/icore.h>
#include <coreplugin/uniqueidmanager.h>
using namespace TextEditor;
using namespace TextEditor::Internal;
PlainTextEditorEditable::PlainTextEditorEditable(PlainTextEditor *editor)
:BaseTextEditorEditable(editor)
: BaseTextEditorEditable(editor)
{
Core::ICore *core = Core::ICore::instance();
m_context << core->uniqueIDManager()->
uniqueIdentifier(Core::Constants::K_DEFAULT_TEXT_EDITOR);
m_context << core->uniqueIDManager()->
uniqueIdentifier(TextEditor::Constants::C_TEXTEDITOR);
Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance();
m_context << uidm->uniqueIdentifier(Core::Constants::K_DEFAULT_TEXT_EDITOR);
m_context << uidm->uniqueIdentifier(TextEditor::Constants::C_TEXTEDITOR);
}
PlainTextEditor::PlainTextEditor(QWidget *parent) :
BaseTextEditor(parent)
PlainTextEditor::PlainTextEditor(QWidget *parent)
: BaseTextEditor(parent)
{
setRevisionsVisible(true);
setMarksVisible(true);

View File

@@ -37,7 +37,6 @@
#include "texteditorplugin.h"
#include "texteditoractionhandler.h"
#include <coreplugin/icore.h>
#include <coreplugin/coreconstants.h>
#include <coreplugin/editormanager/editormanager.h>
@@ -67,8 +66,7 @@ QString PlainTextEditorFactory::kind() const
Core::IFile *PlainTextEditorFactory::open(const QString &fileName)
{
Core::ICore *core = Core::ICore::instance();
Core::IEditor *iface = core->editorManager()->openEditor(fileName, kind());
Core::IEditor *iface = Core::EditorManager::instance()->openEditor(fileName, kind());
return iface ? iface->file() : 0;
}

View File

@@ -89,7 +89,7 @@ TextEditorActionHandler::TextEditorActionHandler(const QString &context,
m_moveLineUpAction = 0;
m_moveLineDownAction = 0;
m_contextId << Core::ICore::instance()->uniqueIDManager()->uniqueIdentifier(context);
m_contextId << Core::UniqueIDManager::instance()->uniqueIdentifier(context);
connect(Core::ICore::instance(), SIGNAL(contextAboutToChange(Core::IContext *)),
this, SLOT(updateCurrentEditor(Core::IContext *)));

View File

@@ -43,6 +43,7 @@
#include "plaintexteditor.h"
#include "storagesettings.h"
#include <coreplugin/icore.h>
#include <coreplugin/coreconstants.h>
#include <coreplugin/mimedatabase.h>
#include <coreplugin/uniqueidmanager.h>
@@ -166,7 +167,7 @@ void TextEditorPlugin::initializeEditor(TextEditor::PlainTextEditor *editor)
void TextEditorPlugin::invokeCompletion()
{
Core::IEditor *iface = Core::ICore::instance()->editorManager()->currentEditor();
Core::IEditor *iface = Core::EditorManager::instance()->currentEditor();
ITextEditor *editor = qobject_cast<ITextEditor *>(iface);
if (editor)
editor->triggerCompletions();

View File

@@ -35,7 +35,6 @@
#include "vcsbaseplugin.h"
#include "vcsbaseeditor.h"
#include <coreplugin/icore.h>
#include <coreplugin/editormanager/editormanager.h>
#include <texteditor/fontsettings.h>
#include <texteditor/texteditoractionhandler.h>
@@ -83,7 +82,7 @@ QString BaseVCSEditorFactory::kind() const
Core::IFile *BaseVCSEditorFactory::open(const QString &fileName)
{
Core::IEditor *iface = Core::ICore::instance()->editorManager()->openEditor(fileName, kind());
Core::IEditor *iface = Core::EditorManager::instance()->openEditor(fileName, kind());
return iface ? iface->file() : 0;
}

View File

@@ -34,7 +34,6 @@
#include "basevcssubmiteditorfactory.h"
#include "vcsbasesubmiteditor.h"
#include <coreplugin/icore.h>
#include <coreplugin/editormanager/editormanager.h>
namespace VCSBase {
@@ -82,8 +81,7 @@ QStringList BaseVCSSubmitEditorFactory::mimeTypes() const
Core::IFile *BaseVCSSubmitEditorFactory::open(const QString &fileName)
{
Core::ICore *core = Core::ICore::instance();
if (Core::IEditor *iface = core->editorManager()->openEditor(fileName, kind()))
if (Core::IEditor *iface = Core::EditorManager::instance()->openEditor(fileName, kind()))
return iface->file();
return 0;
}

View File

@@ -38,7 +38,6 @@
#include "vcsbaseconstants.h"
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/icore.h>
#include <coreplugin/uniqueidmanager.h>
#include <extensionsystem/pluginmanager.h>
#include <projectexplorer/editorconfiguration.h>
@@ -85,10 +84,9 @@ VCSBaseEditorEditable::VCSBaseEditorEditable(VCSBaseEditor *editor,
const VCSBaseEditorParameters *type)
: BaseTextEditorEditable(editor), m_kind(type->kind)
{
Core::ICore *core = Core::ICore::instance();
m_context << core->uniqueIDManager()->uniqueIdentifier(QLatin1String(type->context))
<< core->uniqueIDManager()->uniqueIdentifier(QLatin1String(TextEditor::Constants::C_TEXTEDITOR));
Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance();
m_context << uidm->uniqueIdentifier(QLatin1String(type->context))
<< uidm->uniqueIdentifier(QLatin1String(TextEditor::Constants::C_TEXTEDITOR));
}
QList<int> VCSBaseEditorEditable::context() const
@@ -363,7 +361,7 @@ void VCSBaseEditor::jumpToChangeFromDiff(QTextCursor cursor)
if (!exists)
return;
Core::EditorManager *em = Core::ICore::instance()->editorManager();
Core::EditorManager *em = Core::EditorManager::instance();
Core::IEditor *ed = em->openEditor(fileName);
em->ensureEditorManagerVisible();
if (TextEditor::ITextEditor *editor = qobject_cast<TextEditor::ITextEditor *>(ed))
@@ -409,8 +407,7 @@ static QTextCodec *findFileCodec(const QString &source)
{
typedef QList<Core::IEditor *> EditorList;
const EditorList editors =
Core::ICore::instance()->editorManager()->editorsForFileName(source);
const EditorList editors = Core::EditorManager::instance()->editorsForFileName(source);
if (!editors.empty()) {
const EditorList::const_iterator ecend = editors.constEnd();
for (EditorList::const_iterator it = editors.constBegin(); it != ecend; ++it)

View File

@@ -35,7 +35,6 @@
#include "submiteditorfile.h"
#include <coreplugin/ifile.h>
#include <coreplugin/icore.h>
#include <coreplugin/uniqueidmanager.h>
#include <coreplugin/actionmanager/actionmanager.h>
#include <extensionsystem/pluginmanager.h>
@@ -84,7 +83,7 @@ VCSBaseSubmitEditorPrivate::VCSBaseSubmitEditorPrivate(const VCSBaseSubmitEditor
m_parameters(parameters),
m_file(new VCSBase::Internal::SubmitEditorFile(QLatin1String(m_parameters->mimeType), q))
{
m_contexts << Core::ICore::instance()->uniqueIDManager()->uniqueIdentifier(m_parameters->context);
m_contexts << Core::UniqueIDManager::instance()->uniqueIdentifier(m_parameters->context);
}
VCSBaseSubmitEditor::VCSBaseSubmitEditor(const VCSBaseSubmitEditorParameters *parameters,