Skip to content

Commit e3b6699

Browse files
authored
Merge pull request #46 from winseros/performance_fix
Increase the application performance when working with large files
2 parents 96c1587 + 89b0061 commit e3b6699

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+755
-620
lines changed

.github/workflows/artifcats.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ jobs:
4343
- name: Install Qt6
4444
uses: jurplel/install-qt-action@v3
4545
with:
46-
version: '6.5.2'
46+
version: '6.6.1'
4747
host: windows
4848
target: desktop
4949
arch: win64_msvc2019_64
5050
dir: ${{github.workspace}}
51-
tools: tools_openssl_x64
51+
tools: tools_opensslv3_x64
5252

5353
- name: Checkout
5454
uses: actions/checkout@v3

.github/workflows/tests.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- name: Install Qt6
3535
uses: jurplel/install-qt-action@v3
3636
with:
37-
version: '6.5.2'
37+
version: '6.6.1'
3838
host: windows
3939
target: desktop
4040
arch: win64_msvc2019_64

installer/PBOManager.wxs

+4-4
Original file line numberDiff line numberDiff line change
@@ -187,14 +187,14 @@
187187
Source="$(var.ArtifactsFolder)Qt6Network.dll" />
188188
</Component>
189189

190-
<Component Id="C_MainFiles__LibCrypto.dll" Guid="D20CBC68-368C-4B9C-A86B-0DC53656BAD4" Win64="yes">
190+
<Component Id="C_MainFiles__LibCrypto.dll" Guid="1B84214B-875F-4973-9F9F-C418483F7411" Win64="yes">
191191
<File Id="F_MainFiles__LibCrypto.dll" KeyPath="yes" Vital="yes"
192-
Source="$(var.ArtifactsFolder)libcrypto-1_1-x64.dll" />
192+
Source="$(var.ArtifactsFolder)libcrypto-3-x64.dll" />
193193
</Component>
194194

195-
<Component Id="C_MainFiles__LibSsl.dll" Guid="3F707811-31E4-4EAE-BB35-2F7013107C7C" Win64="yes">
195+
<Component Id="C_MainFiles__LibSsl.dll" Guid="EE38BD8E-35A9-4813-A157-519B1C5A25FA" Win64="yes">
196196
<File Id="F_MainFiles__LibSsl.dll" KeyPath="yes" Vital="yes"
197-
Source="$(var.ArtifactsFolder)libssl-1_1-x64.dll" />
197+
Source="$(var.ArtifactsFolder)libssl-3-x64.dll" />
198198
</Component>
199199
</DirectoryRef>
200200

pbom/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ install(FILES
6767
${QT_BINARIES_DIR}/plugins/tls/qschannelbackend${QT_BINARIES_SUFFIX}.dll
6868
DESTINATION ${CMAKE_INSTALL_BINDIR}/tls)
6969
install(FILES
70-
${QT_BINARIES_DIR}/../../Tools/OpenSSL/Win_x64/bin/libssl-1_1-x64.dll
71-
${QT_BINARIES_DIR}/../../Tools/OpenSSL/Win_x64/bin/libcrypto-1_1-x64.dll
70+
${QT_BINARIES_DIR}/../../Tools/OpenSSLv3/Win_x64/bin/libssl-3-x64.dll
71+
${QT_BINARIES_DIR}/../../Tools/OpenSSLv3/Win_x64/bin/libcrypto-3-x64.dll
7272
DESTINATION ${CMAKE_INSTALL_BINDIR})
7373

7474
add_executable(pbom_test ${PROJECT_SOURCES} ${PROJECT_SOURCES_UI} ${TEST_SOURCES} exception.cpp testmain.cpp)

pbom/domain/__test__/func_test.cpp

+17-61
Original file line numberDiff line numberDiff line change
@@ -4,76 +4,32 @@
44

55
namespace pboman3::domain::test {
66
TEST(FuncTest, CountFilesInTree_Counts_Files) {
7-
PboNode node("file.pbo", PboNodeType::Container, nullptr);
8-
node.createHierarchy(PboPath("f1/e1.txt"));
9-
node.createHierarchy(PboPath("f1/e2.txt"));
10-
node.createHierarchy(PboPath("f1/f2/e2.txt"));
11-
node.createHierarchy(PboPath("e2.txt"));
7+
const auto node = QSharedPointer<PboNode>::create("file.pbo", PboNodeType::Container, nullptr);
8+
node->createHierarchy(PboPath("f1/e1.txt"));
9+
node->createHierarchy(PboPath("f1/e2.txt"));
10+
node->createHierarchy(PboPath("f1/f2/e2.txt"));
11+
node->createHierarchy(PboPath("e2.txt"));
1212

1313
int count = 0;
14-
CountFilesInTree(node, count);
14+
CountFilesInTree(*node, count);
1515

1616
ASSERT_EQ(count, 4);
1717
}
1818

19-
TEST(FuncTest, FindDirectChild_Finds_Child_Case_Insensitively_Const) {
20-
PboNode node("file.pbo", PboNodeType::Container, nullptr);
21-
node.createHierarchy(PboPath("e1.txt"));
22-
node.createHierarchy(PboPath("e2.txt"));
23-
PboNode* e3 = node.createHierarchy(PboPath("e3.txt"));
24-
25-
const PboNode* found = FindDirectChild(const_cast<const PboNode*>(&node), "E3.TxT");
26-
27-
ASSERT_EQ(e3, found);
28-
}
29-
30-
TEST(FuncTest, FindDirectChild_Returns_Null_Const) {
31-
PboNode node("file.pbo", PboNodeType::Container, nullptr);
32-
node.createHierarchy(PboPath("e1.txt"));
33-
node.createHierarchy(PboPath("e2.txt"));
34-
node.createHierarchy(PboPath("e3.txt"));
35-
36-
const PboNode* found = FindDirectChild(const_cast<const PboNode*>(&node), "e4.txt");
37-
38-
ASSERT_EQ(found, nullptr);
39-
}
40-
41-
TEST(FuncTest, FindDirectChild_Finds_Child_Case_Insensitively_NonConst) {
42-
PboNode node("file.pbo", PboNodeType::Container, nullptr);
43-
node.createHierarchy(PboPath("e1.txt"));
44-
node.createHierarchy(PboPath("e2.txt"));
45-
PboNode* e3 = node.createHierarchy(PboPath("e3.txt"));
46-
47-
const PboNode* found = FindDirectChild(&node, "E3.TxT");
48-
49-
ASSERT_EQ(e3, found);
50-
}
51-
52-
TEST(FuncTest, FindDirectChild_Returns_Null_NonConst) {
53-
PboNode node("file.pbo", PboNodeType::Container, nullptr);
54-
node.createHierarchy(PboPath("e1.txt"));
55-
node.createHierarchy(PboPath("e2.txt"));
56-
node.createHierarchy(PboPath("e3.txt"));
57-
58-
const PboNode* found = FindDirectChild(&node, "e4.txt");
59-
60-
ASSERT_EQ(found, nullptr);
61-
}
62-
6319
TEST(FuncTest, IsPathConflict_Functional) {
64-
PboNode root("file-name", PboNodeType::Container, nullptr);
65-
ASSERT_EQ(root.depth(), 0);
20+
const auto root = QSharedPointer<PboNode>::create("file-name", PboNodeType::Container, nullptr);
21+
ASSERT_EQ(root->depth(), 0);
6622

67-
root.createHierarchy(PboPath("e1.txt"));
68-
root.createHierarchy(PboPath("f2/e2.txt"));
23+
root->createHierarchy(PboPath("e1.txt"));
24+
root->createHierarchy(PboPath("f2/e2.txt"));
6925

70-
ASSERT_TRUE(IsPathConflict(&root, PboPath("e1.txT")));
71-
ASSERT_TRUE(IsPathConflict(&root, PboPath("f2")));
72-
ASSERT_TRUE(IsPathConflict(&root, PboPath("F2/e2.Txt")));
73-
ASSERT_TRUE(IsPathConflict(&root, PboPath("f2/E2.txt/e4.txt")));
26+
ASSERT_TRUE(IsPathConflict(root.get(), PboPath("e1.txT")));
27+
ASSERT_TRUE(IsPathConflict(root.get(), PboPath("f2")));
28+
ASSERT_TRUE(IsPathConflict(root.get(), PboPath("F2/e2.Txt")));
29+
ASSERT_TRUE(IsPathConflict(root.get(), PboPath("f2/E2.txt/e4.txt")));
7430

75-
ASSERT_FALSE(IsPathConflict(&root, PboPath("e2.txt")));
76-
ASSERT_FALSE(IsPathConflict(&root, PboPath("f2/e3.txt")));
77-
ASSERT_FALSE(IsPathConflict(&root, PboPath("f3/e4.txt")));
31+
ASSERT_FALSE(IsPathConflict(root.get(), PboPath("e2.txt")));
32+
ASSERT_FALSE(IsPathConflict(root.get(), PboPath("f2/e3.txt")));
33+
ASSERT_FALSE(IsPathConflict(root.get(), PboPath("f3/e4.txt")));
7834
}
7935
}

0 commit comments

Comments
 (0)