Skip to content

Commit 58235a7

Browse files
committed
feat: 用户交互功能优化和修复;
1 parent 9e43d10 commit 58235a7

36 files changed

+2485
-2087
lines changed

3rdparty/QHexView/QHexEdit2/chunks.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ QByteArray Chunks::data(qint64 pos, qint64 maxSize) const {
6969
return {};
7070
}
7171

72+
auto oldPos = _ioDevice->pos(); // save the pos state
7273
while (maxSize > 0) {
7374
chunk.absPos = LLONG_MAX;
7475
bool chunksLoopOngoing = true;
@@ -116,6 +117,7 @@ QByteArray Chunks::data(qint64 pos, qint64 maxSize) const {
116117
pos += readBuffer.size();
117118
}
118119
}
120+
_ioDevice->seek(oldPos); // restore it
119121
return buffer;
120122
}
121123

@@ -290,6 +292,7 @@ qsizetype Chunks::getChunkIndex(qint64 absPos) const {
290292
}
291293

292294
if (foundIdx == -1) {
295+
auto oldPos = _ioDevice->pos();
293296
QMutexLocker locker(&_mutex);
294297
Chunk newChunk;
295298
qint64 readAbsPos = absPos - ioDelta;
@@ -299,6 +302,7 @@ qsizetype Chunks::getChunkIndex(qint64 absPos) const {
299302
newChunk.absPos = absPos - (readAbsPos - readPos);
300303
_chunks.insert(insertIdx, newChunk);
301304
foundIdx = insertIdx;
305+
_ioDevice->seek(oldPos);
302306
}
303307
return foundIdx;
304308
}

3rdparty/fmt

CMakeLists.txt

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,6 @@ if(WINGHEX_BUILD_TEST)
3636
add_subdirectory(test/TestStructGen)
3737
endif()
3838

39-
if(DEFINED CMAKE_CXX_BYTE_ORDER AND CMAKE_CXX_BYTE_ORDER)
40-
if(CMAKE_CXX_BYTE_ORDER STREQUAL "BIG_ENDIAN")
41-
add_definitions(-DWING_LITTLE_ENDIAN=0)
42-
elseif(CMAKE_CXX_BYTE_ORDER STREQUAL "LITTLE_ENDIAN")
43-
add_definitions(-DWING_LITTLE_ENDIAN=1)
44-
else()
45-
message(
46-
FATAL_ERROR
47-
"CMAKE_CXX_BYTE_ORDER defined but unknown value: ${CMAKE_CXX_BYTE_ORDER}"
48-
)
49-
endif()
50-
else()
51-
message(FATAL_ERROR "CMAKE_CXX_BYTE_ORDER not set or empty")
52-
endif()
53-
5439
if(WINGHEX_BUILD_TEST_PLUGIN)
5540
add_subdirectory(TestPlugin)
5641
add_subdirectory(TestHexExt)
@@ -250,6 +235,9 @@ set(DIALOG_SRC
250235
src/dialog/crashreport.ui
251236
src/dialog/showtextdialog.cpp
252237
src/dialog/showtextdialog.h
238+
src/dialog/mutisavedialog.h
239+
src/dialog/mutisavedialog.cpp
240+
src/dialog/mutisavedialog.ui
253241
src/dialog/definitiondownload.cpp
254242
src/dialog/definitiondownload.h)
255243

@@ -402,6 +390,9 @@ set(CLASS_SRC
402390
src/class/aswingcache.cpp
403391
src/class/lspeditorinterface.h
404392
src/class/lspeditorinterface.cpp
393+
src/class/editorinfo.h
394+
src/class/mutisavebuttondelegate.h
395+
src/class/mutisavebuttondelegate.cpp
405396
src/class/snippetprocessor.h
406397
src/class/snippetprocessor.cpp)
407398

ShareMemoryDrv/ShareMemoryDrv.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"Id" : "shmem",
3-
"SDK": 19,
3+
"SDK": 20,
44
"Version" : "0.0.1",
55
"Vendor" : "WingCloudStudio",
66
"Author" : "wingsummer",

TestHexExt/TestHexExt.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"Id": "TestHexExt",
3-
"SDK": 19,
3+
"SDK": 20,
44
"Version": "0.0.1",
55
"Vendor": "WingCloudStudio",
66
"Author": "wingsummer",

TestPlugin/TestPlugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"Id": "TestPlugin",
3-
"SDK": 19,
3+
"SDK": 20,
44
"Version": "0.0.1",
55
"Vendor": "WingCloudStudio",
66
"Dependencies": [

images/exit.png

3.6 KB
Loading

0 commit comments

Comments
 (0)