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
46c09e77
Commit
46c09e77
authored
May 02, 2011
by
Oswald Buddenhagen
Browse files
change createEditor() error handling
take it out of the editor->open() error path. it's unrelated.
parent
40c6653f
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/coreplugin/editormanager/editormanager.cpp
View file @
46c09e77
...
@@ -1211,18 +1211,20 @@ IEditor *EditorManager::openEditor(Core::Internal::EditorView *view, const QStri
...
@@ -1211,18 +1211,20 @@ IEditor *EditorManager::openEditor(Core::Internal::EditorView *view, const QStri
return
activateEditor
(
view
,
editor
,
flags
);
return
activateEditor
(
view
,
editor
,
flags
);
}
}
QApplication
::
setOverrideCursor
(
QCursor
(
Qt
::
WaitCursor
));
IEditor
*
editor
=
createEditor
(
editorId
,
fn
);
IEditor
*
editor
=
createEditor
(
editorId
,
fn
);
// If we could not open the file in the requested editor, fall
// If we could not open the file in the requested editor, fall
// back to the default editor:
// back to the default editor:
if
(
!
editor
)
if
(
!
editor
)
editor
=
createEditor
(
QString
(),
fn
);
editor
=
createEditor
(
QString
(),
fn
);
if
(
!
editor
)
// Internal error
return
0
;
QApplication
::
setOverrideCursor
(
QCursor
(
Qt
::
WaitCursor
));
QString
errorString
;
QString
errorString
;
if
(
!
editor
||
!
editor
->
open
(
&
errorString
,
fn
))
{
if
(
!
editor
->
open
(
&
errorString
,
fn
))
{
QApplication
::
restoreOverrideCursor
();
QApplication
::
restoreOverrideCursor
();
QMessageBox
::
critical
(
m_d
->
m_core
->
mainWindow
(),
tr
(
"File Error"
),
errorString
);
QMessageBox
::
critical
(
m_d
->
m_core
->
mainWindow
(),
tr
(
"File Error"
),
errorString
);
delete
editor
;
delete
editor
;
editor
=
0
;
return
0
;
return
0
;
}
}
addEditor
(
editor
);
addEditor
(
editor
);
...
...
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