mirror of
https://github.com/epasveer/seer.git
synced 2026-08-29 16:40:42 +08:00
EditorManager: Clear stack on statechanged signal
This commit is contained in:
@@ -430,13 +430,6 @@ const QString& SeerEditorManagerWidget::editorExternalEditorCommand () const {
|
||||
return _editorExternalEditorCommand;
|
||||
}
|
||||
|
||||
void SeerEditorManagerWidget::clearClosedFilesStack ()
|
||||
{
|
||||
while (!_stackClosedFiles.empty()) {
|
||||
_stackClosedFiles.pop();
|
||||
}
|
||||
}
|
||||
|
||||
void SeerEditorManagerWidget::handleText (const QString& text) {
|
||||
|
||||
// Update the current line.
|
||||
@@ -775,9 +768,11 @@ void SeerEditorManagerWidget::handleTabCloseRequested (int index) {
|
||||
|
||||
// Push to _stackClosedFiles before deleting
|
||||
QString fullname = tabWidget->tabToolTip(index).section(" : ", 1, 1);
|
||||
SeerEditorManagerEntries::iterator i = findEntry(fullname);
|
||||
SeerEditorWidgetSourceArea::SeerCurrentFile current = i->widget->sourceArea()->readCurrentPosition();
|
||||
_stackClosedFiles.push(current);
|
||||
if (fullname != "") { // Don't push place holder or Assembly tab
|
||||
SeerEditorManagerEntries::iterator i = findEntry(fullname);
|
||||
SeerEditorWidgetSourceArea::SeerCurrentFile current = i->widget->sourceArea()->readCurrentPosition();
|
||||
_stackClosedFiles.push(current);
|
||||
}
|
||||
|
||||
// Delete the tab.
|
||||
deleteEditorWidgetTab(index);
|
||||
@@ -1375,9 +1370,6 @@ void SeerEditorManagerWidget::handleSessionTerminated () {
|
||||
if (assemblyWidgetTab() != 0) {
|
||||
assemblyWidgetTab()->assemblyArea()->clearCurrentLines();
|
||||
}
|
||||
|
||||
// Clear stack of closed files.
|
||||
clearClosedFilesStack();
|
||||
}
|
||||
|
||||
// Handle opening recently closed file: When use Ctrl + Shift + T
|
||||
@@ -1447,3 +1439,11 @@ void SeerEditorManagerWidget::handleOpenRecentlyClosedFile() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Clear the stack of recently closed files whenever a new gdb session starts
|
||||
void SeerEditorManagerWidget::handleGdbStateChanged()
|
||||
{
|
||||
while (!_stackClosedFiles.empty()) {
|
||||
_stackClosedFiles.pop();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,7 +70,6 @@ class SeerEditorManagerWidget : public QWidget, protected Ui::SeerEditorManagerW
|
||||
int editorTabSize () const;
|
||||
void setEditorExternalEditorCommand (const QString& externalEditorCommand);
|
||||
const QString& editorExternalEditorCommand () const;
|
||||
void clearClosedFilesStack ();
|
||||
|
||||
public slots:
|
||||
void handleText (const QString& text);
|
||||
@@ -100,6 +99,7 @@ class SeerEditorManagerWidget : public QWidget, protected Ui::SeerEditorManagerW
|
||||
void handleAssemblyConfigChanged ();
|
||||
void handleSessionTerminated ();
|
||||
void handleOpenRecentlyClosedFile ();
|
||||
void handleGdbStateChanged ();
|
||||
|
||||
private slots:
|
||||
void handleFileOpenToolButtonClicked ();
|
||||
|
||||
@@ -441,6 +441,8 @@ SeerGdbWidget::SeerGdbWidget (QWidget* parent) : QWidget(parent) {
|
||||
QObject::connect(_gdbMonitor, &GdbMonitor::allTextOutput, _gdbOutputLog, &SeerGdbLogWidget::handleText);
|
||||
#endif
|
||||
|
||||
QObject::connect(this, &SeerGdbWidget::stateChanged, editorManagerWidget, &SeerEditorManagerWidget::handleGdbStateChanged);
|
||||
|
||||
// Restore window settings.
|
||||
readSettings();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user