Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
ebcb9dce
Commit
ebcb9dce
authored
Jan 26, 2009
by
mae
Browse files
separate EM::setCurrentEditor and EM::activateEditor
parent
1b345cfa
Changes
9
Hide whitespace changes
Inline
Side-by-side
src/plugins/coreplugin/editormanager/editormanager.cpp
View file @
ebcb9dce
...
...
@@ -687,7 +687,7 @@ bool EditorManager::closeEditors(const QList<IEditor*> editorsToClose, bool askA
}
if
(
currentEditorRemoved
)
{
if
(
m_d
->
m_editorHistory
.
count
()
>
0
)
{
setCurrent
Editor
(
m_d
->
m_editorHistory
.
first
(),
true
);
activate
Editor
(
m_d
->
m_editorHistory
.
first
(),
true
);
}
else
{
editorChanged
(
currentEditor
());
}
...
...
@@ -1223,7 +1223,7 @@ void EditorManager::updateActions()
QList
<
IEditor
*>
EditorManager
::
openedEditors
()
const
{
return
m_d
->
m_
view
->
editors
();
return
m_d
->
m_
editorModel
->
editors
();
}
Internal
::
EditorModel
*
EditorManager
::
openedEditorsModel
()
const
...
...
@@ -1611,7 +1611,7 @@ void EditorManager::unsplitAll()
{
m_d
->
m_splitter
->
unsplit
(
0
);
if
(
IEditor
*
e
=
m_d
->
m_splitter
->
editor
())
setCurrent
Editor
(
e
);
activate
Editor
(
e
);
}
void
EditorManager
::
gotoOtherWindow
()
...
...
src/plugins/coreplugin/editormanager/editormanager.h
View file @
ebcb9dce
...
...
@@ -116,7 +116,9 @@ public:
bool
hasEditor
(
const
QString
&
fileName
)
const
;
QList
<
IEditor
*>
editorsForFileName
(
const
QString
&
filename
)
const
;
private:
void
setCurrentEditor
(
IEditor
*
editor
,
bool
ignoreNavigationHistory
=
false
);
public:
IEditor
*
currentEditor
()
const
;
IEditor
*
activateEditor
(
IEditor
*
editor
,
bool
ignoreNavigationHistory
=
false
);
// EditorGroup *currentEditorGroup() const;
...
...
src/plugins/coreplugin/editormanager/openeditorswindow.cpp
View file @
ebcb9dce
...
...
@@ -235,7 +235,7 @@ void OpenEditorsWindow::selectEditor(QTreeWidgetItem *item)
IEditor
*
editor
=
0
;
if
(
item
)
editor
=
item
->
data
(
0
,
Qt
::
UserRole
).
value
<
IEditor
*>
();
EditorManager
::
instance
()
->
setCurrent
Editor
(
editor
);
EditorManager
::
instance
()
->
activate
Editor
(
editor
);
}
void
OpenEditorsWindow
::
editorClicked
(
QTreeWidgetItem
*
item
)
...
...
src/plugins/coreplugin/scriptmanager/qworkbench_wrapper.cpp
View file @
ebcb9dce
...
...
@@ -252,9 +252,9 @@ Core::IEditor *EditorManagerPrototype::currentEditor() const
return
callee
()
->
currentEditor
();
}
void
EditorManagerPrototype
::
setCurrent
Editor
(
Core
::
IEditor
*
editor
)
void
EditorManagerPrototype
::
activate
Editor
(
Core
::
IEditor
*
editor
)
{
callee
()
->
setCurrent
Editor
(
editor
);
callee
()
->
activate
Editor
(
editor
);
}
QList
<
Core
::
IEditor
*>
EditorManagerPrototype
::
openedEditors
()
const
...
...
@@ -267,11 +267,6 @@ QList<Core::IEditor*> EditorManagerPrototype::editorHistory() const
return
callee
()
->
editorHistory
();
}
//QList<Core::EditorGroup *> EditorManagerPrototype::editorGroups() const
//{
// return callee()->editorGroups();
//}
QList
<
Core
::
IEditor
*>
EditorManagerPrototype
::
editorsForFiles
(
QList
<
Core
::
IFile
*>
files
)
const
{
return
callee
()
->
editorsForFiles
(
files
);
...
...
@@ -376,70 +371,6 @@ QString EditorPrototype::toString() const
return
rc
;
}
// ----------- EditorGroupPrototype
EditorGroupPrototype
::
EditorGroupPrototype
(
QObject
*
parent
)
:
QObject
(
parent
)
{
}
int
EditorGroupPrototype
::
editorCount
()
const
{
return
callee
()
->
editorCount
();
}
Core
::
IEditor
*
EditorGroupPrototype
::
currentEditor
()
const
{
return
callee
()
->
currentEditor
();
}
void
EditorGroupPrototype
::
setCurrentEditor
(
Core
::
IEditor
*
editor
)
{
callee
()
->
setCurrentEditor
(
editor
);
}
QList
<
Core
::
IEditor
*>
EditorGroupPrototype
::
editors
()
const
{
return
callee
()
->
editors
();
}
void
EditorGroupPrototype
::
addEditor
(
Core
::
IEditor
*
editor
)
{
callee
()
->
addEditor
(
editor
);
}
void
EditorGroupPrototype
::
insertEditor
(
int
i
,
Core
::
IEditor
*
editor
)
{
callee
()
->
insertEditor
(
i
,
editor
);
}
void
EditorGroupPrototype
::
removeEditor
(
Core
::
IEditor
*
editor
)
{
callee
()
->
removeEditor
(
editor
);
}
void
EditorGroupPrototype
::
moveEditorsFromGroup
(
Core
::
EditorGroup
*
group
)
{
callee
()
->
moveEditorsFromGroup
(
group
);
}
void
EditorGroupPrototype
::
moveEditorFromGroup
(
Core
::
EditorGroup
*
group
,
Core
::
IEditor
*
editor
)
{
callee
()
->
moveEditorFromGroup
(
group
,
editor
);
}
QString
EditorGroupPrototype
::
toString
()
const
{
return
QLatin1String
(
"EditorGroup"
);
}
Core
::
EditorGroup
*
EditorGroupPrototype
::
callee
()
const
{
EditorGroup
*
rc
=
qscriptvalue_cast
<
EditorGroup
*>
(
thisObject
());
QTC_ASSERT
(
rc
,
return
0
);
return
rc
;
}
}
// namespace Internal
}
// namespace Core
src/plugins/coreplugin/scriptmanager/qworkbench_wrapper.h
View file @
ebcb9dce
...
...
@@ -167,20 +167,18 @@ private:
class
EditorManagerPrototype
:
public
QObject
,
public
QScriptable
{
Q_OBJECT
Q_PROPERTY
(
Core
::
IEditor
*
currentEditor
READ
currentEditor
WRITE
setCurrent
Editor
DESIGNABLE
false
SCRIPTABLE
true
STORED
false
)
Q_PROPERTY
(
Core
::
IEditor
*
currentEditor
READ
currentEditor
WRITE
activate
Editor
DESIGNABLE
false
SCRIPTABLE
true
STORED
false
)
Q_PROPERTY
(
QList
<
Core
::
IEditor
*>
openedEditors
READ
openedEditors
DESIGNABLE
false
SCRIPTABLE
true
STORED
false
)
Q_PROPERTY
(
QList
<
Core
::
IEditor
*>
editorHistory
READ
editorHistory
DESIGNABLE
false
SCRIPTABLE
true
STORED
false
)
// Q_PROPERTY(QList<Core::EditorGroup *> editorGroups READ editorGroups DESIGNABLE false SCRIPTABLE true STORED false)
public:
typedef
Core
::
EditorManager
EditorManager
;
EditorManagerPrototype
(
QObject
*
parent
=
0
);
Core
::
IEditor
*
currentEditor
()
const
;
void
setCurrent
Editor
(
Core
::
IEditor
*
editor
);
void
activate
Editor
(
Core
::
IEditor
*
editor
);
QList
<
Core
::
IEditor
*>
openedEditors
()
const
;
QList
<
Core
::
IEditor
*>
editorHistory
()
const
;
// QList<Core::EditorGroup *> editorGroups() const;
public
slots
:
QList
<
Core
::
IEditor
*>
editorsForFiles
(
QList
<
Core
::
IFile
*>
files
)
const
;
...
...
@@ -229,37 +227,6 @@ private:
Core
::
IEditor
*
callee
()
const
;
};
// Script prototype for the editor group interface with Script-managed life cycle.
class
EditorGroupPrototype
:
public
QObject
,
public
QScriptable
{
Q_OBJECT
Q_PROPERTY
(
int
editorCount
READ
editorCount
DESIGNABLE
false
SCRIPTABLE
true
STORED
false
)
Q_PROPERTY
(
Core
::
IEditor
*
currentEditor
READ
currentEditor
WRITE
setCurrentEditor
DESIGNABLE
false
SCRIPTABLE
true
STORED
false
)
Q_PROPERTY
(
QList
<
Core
::
IEditor
*>
editors
READ
editors
DESIGNABLE
false
SCRIPTABLE
true
STORED
false
)
public:
EditorGroupPrototype
(
QObject
*
parent
=
0
);
int
editorCount
()
const
;
Core
::
IEditor
*
currentEditor
()
const
;
void
setCurrentEditor
(
Core
::
IEditor
*
editor
);
QList
<
Core
::
IEditor
*>
editors
()
const
;
public
slots
:
void
addEditor
(
Core
::
IEditor
*
editor
);
void
insertEditor
(
int
i
,
Core
::
IEditor
*
editor
);
void
removeEditor
(
Core
::
IEditor
*
editor
);
void
moveEditorsFromGroup
(
Core
::
EditorGroup
*
group
);
void
moveEditorFromGroup
(
Core
::
EditorGroup
*
group
,
Core
::
IEditor
*
editor
);
QString
toString
()
const
;
private:
Core
::
EditorGroup
*
callee
()
const
;
};
}
// namespace Internal
}
// namespace Core
...
...
src/plugins/git/gitclient.cpp
View file @
ebcb9dce
...
...
@@ -169,7 +169,7 @@ VCSBase::VCSBaseEditor
outputEditor
->
createNew
(
m_msgWait
);
rc
=
VCSBase
::
VCSBaseEditor
::
getVcsBaseEditor
(
outputEditor
);
QTC_ASSERT
(
rc
,
return
0
);
m_core
->
editorManager
()
->
setCurrent
Editor
(
outputEditor
);
m_core
->
editorManager
()
->
activate
Editor
(
outputEditor
);
}
else
{
// Create new, set wait message, set up with source and codec
outputEditor
=
m_core
->
editorManager
()
->
newFile
(
kind
,
&
title
,
m_msgWait
);
...
...
src/plugins/perforce/perforceplugin.cpp
View file @
ebcb9dce
...
...
@@ -912,7 +912,7 @@ void PerforcePlugin::p4Diff(const QStringList &files, QString diffname)
}
else
if
(
!
displayInEditor
&&
existingEditor
)
{
if
(
existingEditor
)
{
existingEditor
->
createNew
(
result
.
stdOut
);
Core
::
EditorManager
::
instance
()
->
setCurrent
Editor
(
existingEditor
);
Core
::
EditorManager
::
instance
()
->
activate
Editor
(
existingEditor
);
}
}
}
...
...
src/plugins/quickopen/opendocumentsfilter.cpp
View file @
ebcb9dce
...
...
@@ -97,7 +97,7 @@ void OpenDocumentsFilter::accept(FilterEntry selection) const
{
IEditor
*
editor
=
selection
.
internalData
.
value
<
IEditor
*>
();
if
(
editor
)
{
m_editorManager
->
setCurrent
Editor
(
editor
);
m_editorManager
->
activate
Editor
(
editor
);
return
;
}
m_editorManager
->
openEditor
(
selection
.
internalData
.
toString
());
...
...
src/plugins/subversion/subversionplugin.cpp
View file @
ebcb9dce
...
...
@@ -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
::
EditorManager
::
instance
()
->
setCurrent
Editor
(
editor
);
Core
::
EditorManager
::
instance
()
->
activate
Editor
(
editor
);
return
;
}
}
...
...
@@ -776,7 +776,7 @@ void SubversionPlugin::filelog(const QString &file)
if
(
Core
::
IEditor
*
editor
=
locateEditor
(
"logFileName"
,
file
))
{
editor
->
createNew
(
response
.
stdOut
);
Core
::
EditorManager
::
instance
()
->
setCurrent
Editor
(
editor
);
Core
::
EditorManager
::
instance
()
->
activate
Editor
(
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
::
EditorManager
::
instance
()
->
setCurrent
Editor
(
editor
);
Core
::
EditorManager
::
instance
()
->
activate
Editor
(
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
::
EditorManager
::
instance
()
->
setCurrent
Editor
(
editor
);
Core
::
EditorManager
::
instance
()
->
activate
Editor
(
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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment