исправление бага с неверным приоритетом открытия файлов проекта. v++
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"Workspace": "E:\\Tests",
|
"Workspace": "E:\\Tests",
|
||||||
"ProjectsSearchDirectory": "C:\\Users\\misha\\Documents\\visual_sapfor_2023\\Downloads\\JAC_1737641430\\JAC\\v1\\v1\\v1",
|
"ProjectsSearchDirectory": "E:\\BUG",
|
||||||
"VisualiserPath": "C:\\Users\\misha\\Downloads",
|
"VisualiserPath": "C:\\Users\\misha\\Downloads",
|
||||||
"Sapfor_FPath": "E:\\_sapfor_x64\\Components\\Sapfor_F",
|
"Sapfor_FPath": "E:\\_sapfor_x64\\Components\\Sapfor_F",
|
||||||
"Visualizer_2Path": "C:\\Users\\misha\\Documents",
|
"Visualizer_2Path": "C:\\Users\\misha\\Documents",
|
||||||
@@ -38,7 +38,7 @@
|
|||||||
"SmallScreen": false,
|
"SmallScreen": false,
|
||||||
"BugReportsAgeLimit": 1,
|
"BugReportsAgeLimit": 1,
|
||||||
"FastAccessPassesCount": 10,
|
"FastAccessPassesCount": 10,
|
||||||
"LastOpenedProjectsCount": 10,
|
"LastOpenedProjectsCount": 25,
|
||||||
"Mode": "Normal",
|
"Mode": "Normal",
|
||||||
"ComponentsServerPort": 7995,
|
"ComponentsServerPort": 7995,
|
||||||
"TestingServerPort": 7998,
|
"TestingServerPort": 7998,
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import Common.Passes.PassException;
|
|||||||
import Common.Utils.Index;
|
import Common.Utils.Index;
|
||||||
import Common.Utils.TextLog;
|
import Common.Utils.TextLog;
|
||||||
import Common.Utils.Utils_;
|
import Common.Utils.Utils_;
|
||||||
|
import Common.Utils.Vector_;
|
||||||
import Common.Visual.UI;
|
import Common.Visual.UI;
|
||||||
import _VisualDVM.Constants;
|
import _VisualDVM.Constants;
|
||||||
import _VisualDVM.Current;
|
import _VisualDVM.Current;
|
||||||
@@ -381,17 +382,32 @@ public class db_project_info extends DBObject {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
public DBProjectFile getLastOpenedFile() {
|
public DBProjectFile getLastOpenedFile() {
|
||||||
long max = 0;
|
Vector<DBProjectFile> sorted_= new Vector<>();
|
||||||
DBProjectFile res = null;
|
|
||||||
for (DBProjectFile f: db.files.Data.values()){
|
for (DBProjectFile f: db.files.Data.values()){
|
||||||
if (!f.state.equals(FileState.Excluded)) {
|
if (!f.state.equals(FileState.Excluded) && !f.fileType.equals(FileType.forbidden)) {
|
||||||
if (f.file.lastModified() > max) {
|
sorted_.add(f);
|
||||||
res = f;
|
|
||||||
max = f.file.lastModified();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
sorted_.sort(new Comparator<DBProjectFile>() {
|
||||||
|
@Override
|
||||||
|
public int compare(DBProjectFile o1, DBProjectFile o2) {
|
||||||
|
return Long.compare(o1.file.lastModified(), o2.file.lastModified());
|
||||||
}
|
}
|
||||||
return res;
|
}.reversed());
|
||||||
|
LinkedHashMap<FileType, DBProjectFile> matches = new LinkedHashMap<>();
|
||||||
|
DBProjectFile sorceFile= null;
|
||||||
|
DBProjectFile headerFile = null;
|
||||||
|
for (DBProjectFile f: sorted_){
|
||||||
|
if (!matches.containsKey(f.fileType)){
|
||||||
|
matches.put(f.fileType, f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Vector<FileType> priority = new Vector_<>(FileType.program, FileType.header, FileType.data, FileType.none);
|
||||||
|
for (FileType type: priority){
|
||||||
|
if (matches.containsKey(type))
|
||||||
|
return matches.get(type);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
public void CreateParserOptionsDirs() throws Exception {
|
public void CreateParserOptionsDirs() throws Exception {
|
||||||
Utils_.forceDeleteWithCheck(getOptionsDirectory());
|
Utils_.forceDeleteWithCheck(getOptionsDirectory());
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ public class Visualiser extends Component {
|
|||||||
//http://www.seostella.com/ru/article/2012/02/05/formatirovanie-daty-v-java.html
|
//http://www.seostella.com/ru/article/2012/02/05/formatirovanie-daty-v-java.html
|
||||||
@Override
|
@Override
|
||||||
public void GetVersionInfo() {
|
public void GetVersionInfo() {
|
||||||
version = 1138;
|
version = 1139;
|
||||||
String pattern = "MMM dd yyyy HH:mm:ss";
|
String pattern = "MMM dd yyyy HH:mm:ss";
|
||||||
DateFormat df = new SimpleDateFormat(pattern, Locale.ENGLISH);
|
DateFormat df = new SimpleDateFormat(pattern, Locale.ENGLISH);
|
||||||
date_text = df.format(getClassBuildTime());
|
date_text = df.format(getClassBuildTime());
|
||||||
|
|||||||
Reference in New Issue
Block a user