@Override public void save() { if (ApplicationManagerEx.getApplicationEx().isDoNotSave()) { // no need to save return; } if (!mySavingInProgress.compareAndSet(false, true)) { return; } try { if (isToSaveProjectName()) { try { String basePath = getStateStore().getProjectBasePath(); File baseDir = basePath == null ? null : new File(basePath); if (baseDir != null && baseDir.exists()) { File ideaDir = new File(baseDir, DIRECTORY_STORE_FOLDER); if (ideaDir.exists() && ideaDir.isDirectory()) { FileUtil.writeToFile(new File(ideaDir, NAME_FILE), getName()); myOldName = null; RecentProjectsManager.getInstance().clearNameCache(); } } } catch (Throwable e) { LOG.error("Unable to store project name", e); } } StoreUtil.save(ServiceKt.getStateStore(this), this); } finally { mySavingInProgress.set(false); ApplicationManager.getApplication().getMessageBus().syncPublisher(ProjectSaved.TOPIC).saved(this); } }
@Override public void saveSettings() { if (myDoNotSave) return; if (mySaveSettingsIsInProgress.compareAndSet(false, true)) { try { StoreUtil.save(ServiceKt.getStateStore(this), null); } finally { mySaveSettingsIsInProgress.set(false); } } }
public void _saveSettings() { if (mySaveSettingsIsInProgress.compareAndSet(false, true)) { HeavyProcessLatch.INSTANCE.prioritizeUiActivity(); try { StoreUtil.save(getStateStore(), null); } finally { mySaveSettingsIsInProgress.set(false); } } }