Skip to content
GitLab
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
6ffd2264
Commit
6ffd2264
authored
Jul 20, 2009
by
mae
Browse files
small code cleanup
parent
a81a90fc
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/plugins/coreplugin/editormanager/editormanager.cpp
View file @
6ffd2264
...
...
@@ -509,7 +509,7 @@ void EditorManager::setCurrentView(Core::Internal::SplitterOrView *view)
view
->
setFocus
();
}
Core
::
Internal
::
SplitterOrView
*
EditorManager
::
currentView
()
const
Core
::
Internal
::
SplitterOrView
*
EditorManager
::
current
SplitterOr
View
()
const
{
SplitterOrView
*
view
=
m_d
->
m_currentView
;
if
(
!
view
)
...
...
@@ -521,6 +521,13 @@ Core::Internal::SplitterOrView *EditorManager::currentView() const
return
view
;
}
Core
::
Internal
::
EditorView
*
EditorManager
::
currentEditorView
()
const
{
return
currentSplitterOrView
()
->
view
();
}
QList
<
IEditor
*>
EditorManager
::
editorsForFileName
(
const
QString
&
filename
)
const
{
QList
<
IEditor
*>
found
;
...
...
@@ -687,7 +694,7 @@ bool EditorManager::closeEditors(const QList<IEditor*> editorsToClose, bool askA
if
(
editorsToClose
.
isEmpty
())
return
true
;
SplitterOrView
*
currentSplitterOrView
=
currentView
();
SplitterOrView
*
currentSplitterOrView
=
this
->
current
SplitterOr
View
();
bool
closingFailed
=
false
;
QList
<
IEditor
*>
acceptedEditors
;
...
...
@@ -795,7 +802,7 @@ void EditorManager::closeDuplicate(Core::IEditor *editor)
if
(
original
==
editor
)
m_d
->
m_editorModel
->
makeOriginal
(
duplicates
.
first
());
SplitterOrView
*
currentSplitterOrView
=
currentView
();
SplitterOrView
*
currentSplitterOrView
=
this
->
current
SplitterOr
View
();
emit
editorAboutToClose
(
editor
);
...
...
@@ -883,7 +890,7 @@ Core::IEditor *EditorManager::activateEditor(Core::IEditor *editor, OpenEditorFl
Core
::
IEditor
*
EditorManager
::
activateEditor
(
Core
::
Internal
::
EditorView
*
view
,
Core
::
IEditor
*
editor
,
OpenEditorFlags
flags
)
{
if
(
!
view
)
view
=
currentView
()
->
view
();
view
=
current
SplitterOr
View
()
->
view
();
Q_ASSERT
(
view
);
...
...
@@ -1405,7 +1412,7 @@ void EditorManager::gotoNextDocHistory()
if
(
dialog
->
isVisible
())
{
dialog
->
selectNextEditor
();
}
else
{
EditorView
*
view
=
currentView
()
->
view
();
EditorView
*
view
=
current
SplitterOr
View
()
->
view
();
dialog
->
setEditors
(
m_d
->
m_view
,
view
,
m_d
->
m_editorModel
);
dialog
->
selectNextEditor
();
showWindowPopup
();
...
...
@@ -1418,7 +1425,7 @@ void EditorManager::gotoPreviousDocHistory()
if
(
dialog
->
isVisible
())
{
dialog
->
selectPreviousEditor
();
}
else
{
EditorView
*
view
=
currentView
()
->
view
();
EditorView
*
view
=
current
SplitterOr
View
()
->
view
();
dialog
->
setEditors
(
m_d
->
m_view
,
view
,
m_d
->
m_editorModel
);
dialog
->
selectPreviousEditor
();
showWindowPopup
();
...
...
@@ -1500,13 +1507,13 @@ OpenEditorsModel *EditorManager::openedEditorsModel() const
void
EditorManager
::
addCurrentPositionToNavigationHistory
(
IEditor
*
editor
,
const
QByteArray
&
saveState
)
{
currentView
()
->
view
()
->
addCurrentPositionToNavigationHistory
(
editor
,
saveState
);
current
SplitterOr
View
()
->
view
()
->
addCurrentPositionToNavigationHistory
(
editor
,
saveState
);
updateActions
();
}
void
EditorManager
::
goBackInNavigationHistory
()
{
currentView
()
->
view
()
->
goBackInNavigationHistory
();
current
SplitterOr
View
()
->
view
()
->
goBackInNavigationHistory
();
updateActions
();
ensureEditorManagerVisible
();
return
;
...
...
@@ -1514,7 +1521,7 @@ void EditorManager::goBackInNavigationHistory()
void
EditorManager
::
goForwardInNavigationHistory
()
{
currentView
()
->
view
()
->
goForwardInNavigationHistory
();
current
SplitterOr
View
()
->
view
()
->
goForwardInNavigationHistory
();
updateActions
();
ensureEditorManagerVisible
();
}
...
...
@@ -1609,7 +1616,7 @@ bool EditorManager::restoreState(const QByteArray &state)
ensureEditorManagerVisible
();
if
(
m_d
->
m_currentEditor
)
{
m_d
->
m_currentEditor
->
widget
()
->
setFocus
();
}
else
if
(
Core
::
Internal
::
SplitterOrView
*
view
=
currentView
())
{
}
else
if
(
Core
::
Internal
::
SplitterOrView
*
view
=
current
SplitterOr
View
())
{
if
(
IEditor
*
e
=
view
->
editor
())
e
->
widget
()
->
setFocus
();
else
if
(
view
->
view
())
...
...
@@ -1683,16 +1690,6 @@ void EditorManager::revertToSaved()
currEditor
->
file
()
->
modified
(
&
temp
);
}
Core
::
Internal
::
EditorView
*
EditorManager
::
currentEditorView
()
{
if
(
m_d
->
m_currentView
)
return
m_d
->
m_currentView
->
view
();
if
(
m_d
->
m_currentEditor
)
if
(
SplitterOrView
*
splitterOrView
=
m_d
->
m_splitter
->
findView
(
m_d
->
m_currentEditor
))
return
splitterOrView
->
view
();
return
m_d
->
m_view
;
}
void
EditorManager
::
showEditorInfoBar
(
const
QString
&
kind
,
const
QString
&
infoText
,
const
QString
&
buttonText
,
...
...
src/plugins/coreplugin/editormanager/editormanager.h
View file @
6ffd2264
...
...
@@ -244,13 +244,13 @@ private:
IEditor
*
openEditor
(
Core
::
Internal
::
EditorView
*
view
,
const
QString
&
fileName
,
const
QString
&
editorKind
=
QString
(),
OpenEditorFlags
flags
=
0
);
Core
::
Internal
::
SplitterOrView
*
currentView
()
const
;
Core
::
Internal
::
SplitterOrView
*
current
SplitterOr
View
()
const
;
void
closeEditor
(
Core
::
IEditor
*
editor
);
void
closeDuplicate
(
Core
::
IEditor
*
editor
);
void
closeView
(
Core
::
Internal
::
EditorView
*
view
);
void
emptyView
(
Core
::
Internal
::
EditorView
*
view
);
Core
::
Internal
::
EditorView
*
currentEditorView
();
Core
::
Internal
::
EditorView
*
currentEditorView
()
const
;
IEditor
*
pickUnusedEditor
()
const
;
...
...
src/plugins/coreplugin/editormanager/editorview.cpp
View file @
6ffd2264
...
...
@@ -648,7 +648,7 @@ void SplitterOrView::focusInEvent(QFocusEvent *)
void
SplitterOrView
::
paintEvent
(
QPaintEvent
*
)
{
if
(
CoreImpl
::
instance
()
->
editorManager
()
->
currentView
()
!=
this
)
if
(
CoreImpl
::
instance
()
->
editorManager
()
->
current
SplitterOr
View
()
!=
this
)
return
;
QPainter
painter
(
this
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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