From 5538db5198e6db421ed683cc1801b96d3968b87d Mon Sep 17 00:00:00 2001 From: chenpuhao Date: Mon, 26 Dec 2022 19:23:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=95=B4=E7=90=86=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E7=9A=84=E9=BB=98=E8=AE=A4=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README-en.md | 4 +-- README.md | 4 +-- data/MainUI/MainUI.data | 4 +-- data/collation/collation.data | 4 +-- data/collation/collationUI.data | 1 + src/main/java/cn/Function/Collation.java | 43 +++++++++++++++++++----- 6 files changed, 44 insertions(+), 16 deletions(-) diff --git a/README-en.md b/README-en.md index fc28be6..359cd5a 100644 --- a/README-en.md +++ b/README-en.md @@ -52,7 +52,7 @@ It helps you organize your desktop and find files, especially for school teacher The project is licensed under the GPL-3.0 license, see [LICENSE](LICENSE) ### Known issues **If you find a bug during use, please list it in the table below or send it to chenpuhao1229@163.com, thank you** -1. The default type is not available in the Organize desktop, use a custom type +1. ~~The default type is not available in the Organize desktop, use a custom type~~ ### note 1. If you can help me modify the code, please use IntelliJ IDEA, thanks! No IDEA?[Click me to download](https://www.jetbrains.com/zh-cn/idea/download/) 2. The Java development front-end will be abandoned, and C# ~~(as long as the author remembers)~~ will be used @@ -128,7 +128,7 @@ public class Find extends JDialog { ``` ### Future plans - [x] Completion of the third edition of the procedure (completion date: 2022/12/01) -- [ ] Fix default mode for grooming (completion date:) +- [x] Fix default mode for grooming (completion date: 2022/12/26) - [ ] Complete the new UI for the Organize Desktop feature (Completion date:) - [ ] ~~Development with C# (Completion date: )~~ diff --git a/README.md b/README.md index 9caf199..ccb888a 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ DeskAide是一款开源的基于Windows系统的桌面程序 该项目签署了GPL-3.0 授权许可,详情请参阅[LICENSE](LICENSE) ### 已知问题 **如果您在使用过程中发现了Bug,请在下表列出或者发送给chenpuhao1229@163.com,谢谢** -1. 整理桌面中默认类型不可用,请使用自定义类型 +1. ~~整理桌面中默认类型不可用,请使用自定义类型~~ ### 注意 1. 如果您可以帮助我修改代码,请使用IntelliJ IDEA,谢谢!没有IDEA?[点我去下载](https://www.jetbrains.com/zh-cn/idea/download/) 2. 后续将会放弃Java开发前端,将使用C#~~(只要作者想起来)~~ @@ -134,7 +134,7 @@ public class Find extends JDialog { ``` ### 未来计划 - [x] 完成第三版程序(完成日期:2022/12/01) -- [ ] 修复整理功能的默认模式(完成日期:) +- [x] 修复整理功能的默认模式(完成日期:2022/12/26) - [ ] 完成整理桌面功能新UI(完成日期:) - [ ] ~~使用C#进行开发(完成日期:)~~ diff --git a/data/MainUI/MainUI.data b/data/MainUI/MainUI.data index 9621535..a26b8b8 100644 --- a/data/MainUI/MainUI.data +++ b/data/MainUI/MainUI.data @@ -1,2 +1,2 @@ -781 -484 \ No newline at end of file +362 +433 \ No newline at end of file diff --git a/data/collation/collation.data b/data/collation/collation.data index 46864d0..6117fdb 100644 --- a/data/collation/collation.data +++ b/data/collation/collation.data @@ -1,3 +1,3 @@ C:\Users\高21级12班\OneDrive\Desktop -false -false \ No newline at end of file +true +true \ No newline at end of file diff --git a/data/collation/collationUI.data b/data/collation/collationUI.data index e69de29..5395bbc 100644 --- a/data/collation/collationUI.data +++ b/data/collation/collationUI.data @@ -0,0 +1 @@ +pdf pdf \ No newline at end of file diff --git a/src/main/java/cn/Function/Collation.java b/src/main/java/cn/Function/Collation.java index 530a2a8..1747d22 100644 --- a/src/main/java/cn/Function/Collation.java +++ b/src/main/java/cn/Function/Collation.java @@ -93,14 +93,22 @@ public void run() { String stxt = ".txt"; String spdf = ".pdf"; //调用查找XXX.后缀结尾的所有文件 - findEndsWith(file, sword); - findEndsWith(file, sppt); - findEndsWith(file, ssppt); - findEndsWith(file, sexcel); - findEndsWith(file, ssexcel); - findEndsWith(file, ssword); - findEndsWith(file, stxt); - findEndsWith(file, spdf); + name = "word"; + findEndsWith(file, sword); + name = "powerpoint"; + findEndsWith(file, sppt); + name = "powerpoint"; + findEndsWith(file, ssppt); + name = "excel"; + findEndsWith(file, sexcel); + name = "excel"; + findEndsWith(file, ssexcel); + name = "word"; + findEndsWith(file, ssword); + name = "txt"; + findEndsWith(file, stxt); + name = "pdf"; + findEndsWith(file, spdf); }else{ lineNumber = 1; try { @@ -159,9 +167,28 @@ public void findEndsWith(File file, String sword) { //是文件,判断是否是以.后缀名结尾 if(i.getPath().endsWith(sword)) { File doc; + int lineNumber = 3; + File sourceFile = new File("data/collation/collation.data"); + try { + readAppointedLineNumber(sourceFile, lineNumber); + } catch (IOException e) { + throw new RuntimeException(e); + } if (data.equals("false")) { + lineNumber = 1; + try { + readAppointedLineNumber(sourceFile, lineNumber); + } catch (IOException e) { + throw new RuntimeException(e); + } doc = new File(data + "\\" + name + "文件\\" + i.getName()); }else{ + lineNumber = 1; + try { + readAppointedLineNumber(sourceFile, lineNumber); + } catch (IOException e) { + throw new RuntimeException(e); + } doc = new File(data + "\\" + result + "\\" + i.getName()); } File docp = new File(i.getPath());