forked from qt-creator/qt-creator
ADS: Fix workspace dialog on removal
- Fix an issue where the list of workspaces is not correctly updated after removal of a workspace in the dialog - Fix initial sorting of the workspace model Change-Id: I0c16aabc1fdcc2690fcb83e40b0d5d16cb6c72ba Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
committed by
Henning Gründl
parent
5803448ea0
commit
e3e62d852f
@@ -774,15 +774,16 @@ namespace ADS
|
||||
if (!d->m_workspaces.contains(workspace))
|
||||
return false;
|
||||
|
||||
d->m_workspaces.removeOne(workspace);
|
||||
|
||||
emit workspacesRemoved();
|
||||
emit workspaceListChanged();
|
||||
|
||||
// Remove corresponding workspace file
|
||||
QFile fi(workspaceNameToFileName(workspace).toString());
|
||||
if (fi.exists())
|
||||
return fi.remove();
|
||||
if (fi.exists()) {
|
||||
if (fi.remove()) {
|
||||
d->m_workspaces.removeOne(workspace);
|
||||
emit workspacesRemoved();
|
||||
emit workspaceListChanged();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@@ -53,6 +53,7 @@ WorkspaceModel::WorkspaceModel(DockManager *manager, QObject *parent)
|
||||
, m_currentSortColumn(0)
|
||||
{
|
||||
m_sortedWorkspaces = m_manager->workspaces();
|
||||
sort(m_currentSortColumn, m_currentSortOrder);
|
||||
connect(m_manager, &DockManager::workspaceLoaded, this, &WorkspaceModel::resetWorkspaces);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user