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
Tobias Hunger
qt-creator
Commits
ba4dd001
Commit
ba4dd001
authored
Mar 09, 2009
by
mae
Browse files
when closing a document, auto-load "restored" editors if required
parent
6b9444e1
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/plugins/coreplugin/editormanager/editormanager.cpp
View file @
ba4dd001
...
...
@@ -713,8 +713,13 @@ bool EditorManager::closeEditors(const QList<IEditor*> editorsToClose, bool askA
}
}
if
(
newCurrent
)
if
(
newCurrent
)
{
activateEditor
(
view
,
newCurrent
,
NoActivate
);
}
else
{
QModelIndex
idx
=
m_d
->
m_editorModel
->
firstRestoredEditor
();
if
(
idx
.
isValid
())
activateEditor
(
idx
,
view
);
}
}
...
...
src/plugins/coreplugin/editormanager/editorview.cpp
View file @
ba4dd001
...
...
@@ -116,6 +116,14 @@ void EditorModel::addRestoredEditor(const QString &fileName, const QString &disp
addEntry
(
entry
);
}
QModelIndex
EditorModel
::
firstRestoredEditor
()
const
{
for
(
int
i
=
0
;
i
<
m_editors
.
count
();
++
i
)
if
(
!
m_editors
.
at
(
i
).
editor
)
return
createIndex
(
i
,
0
);
return
QModelIndex
();
}
void
EditorModel
::
addEntry
(
const
Entry
&
entry
)
{
QString
fileName
=
entry
.
fileName
();
...
...
src/plugins/coreplugin/editormanager/editorview.h
View file @
ba4dd001
...
...
@@ -71,6 +71,7 @@ public:
void
addEditor
(
IEditor
*
editor
,
bool
isDuplicate
=
false
);
void
addRestoredEditor
(
const
QString
&
fileName
,
const
QString
&
displayName
,
const
QByteArray
&
kind
);
QModelIndex
firstRestoredEditor
()
const
;
struct
Entry
{
Entry
()
:
editor
(
0
){}
...
...
Write
Preview
Supports
Markdown
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