IDEA-CR-41226 IDEA-204001 don't update state on appClosing — projectClosed (fixed in this commit) and projectOpened (earlier commit) is more correct

This commit is contained in:
Vladimir Krivosheev
2018-12-12 20:40:07 +01:00
parent 598c7fe33c
commit 10ec8198a8
@@ -192,7 +192,7 @@ public class RecentProjectsManagerBase extends RecentProjectsManager implements
}
// it is not good to have timestamps in state data, anyway, now state saved not on "timer" (not more than once in 5 minutes),
// but if modification counter changed (that's why updateOpenProjectsTimestamps is not called in getModificationCounter as validateRecentProjects)
// but if modification counter changed
myState.updateOpenProjectsTimestamps(this);
return myState;
}
@@ -307,8 +307,10 @@ public class RecentProjectsManagerBase extends RecentProjectsManager implements
}
}
}
myState.validateRecentProjects(myModCounter);
}
// for simplicity, for now just increment and don't check is something really changed
myModCounter.incrementAndGet();
}
@@ -652,6 +654,7 @@ public class RecentProjectsManagerBase extends RecentProjectsManager implements
markPathRecent(path, openProject);
}
}
updateLastProjectPath();
updateUI();
}
}
@@ -757,7 +760,6 @@ public class RecentProjectsManagerBase extends RecentProjectsManager implements
@Override
public long getModificationCount() {
myState.validateRecentProjects(myModCounter);
return myModCounter.get();
}
@@ -778,20 +780,10 @@ public class RecentProjectsManagerBase extends RecentProjectsManager implements
doReopenLastProject();
}
@Override
public void projectFrameClosed() {
updateLastProjectPath();
}
@Override
public void projectOpenFailed() {
updateLastProjectPath();
}
@Override
public void appClosing() {
updateLastProjectPath();
}
}
private static class MyIcon extends Pair<Icon, Long> {