исправление бага с неверным приоритетом открытия файлов проекта. v++
This commit is contained in:
@@ -6,6 +6,7 @@ import Common.Passes.PassException;
|
||||
import Common.Utils.Index;
|
||||
import Common.Utils.TextLog;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Utils.Vector_;
|
||||
import Common.Visual.UI;
|
||||
import _VisualDVM.Constants;
|
||||
import _VisualDVM.Current;
|
||||
@@ -381,17 +382,32 @@ public class db_project_info extends DBObject {
|
||||
return null;
|
||||
}
|
||||
public DBProjectFile getLastOpenedFile() {
|
||||
long max = 0;
|
||||
DBProjectFile res = null;
|
||||
for (DBProjectFile f : db.files.Data.values()) {
|
||||
if (!f.state.equals(FileState.Excluded)) {
|
||||
if (f.file.lastModified() > max) {
|
||||
res = f;
|
||||
max = f.file.lastModified();
|
||||
}
|
||||
Vector<DBProjectFile> sorted_= new Vector<>();
|
||||
for (DBProjectFile f: db.files.Data.values()){
|
||||
if (!f.state.equals(FileState.Excluded) && !f.fileType.equals(FileType.forbidden)) {
|
||||
sorted_.add(f);
|
||||
}
|
||||
}
|
||||
return res;
|
||||
sorted_.sort(new Comparator<DBProjectFile>() {
|
||||
@Override
|
||||
public int compare(DBProjectFile o1, DBProjectFile o2) {
|
||||
return Long.compare(o1.file.lastModified(), o2.file.lastModified());
|
||||
}
|
||||
}.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 {
|
||||
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
|
||||
@Override
|
||||
public void GetVersionInfo() {
|
||||
version = 1138;
|
||||
version = 1139;
|
||||
String pattern = "MMM dd yyyy HH:mm:ss";
|
||||
DateFormat df = new SimpleDateFormat(pattern, Locale.ENGLISH);
|
||||
date_text = df.format(getClassBuildTime());
|
||||
|
||||
Reference in New Issue
Block a user