diff options
author | Saturn&Eric <[email protected]> | 2022-03-19 09:49:09 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2022-03-19 09:49:09 +0000 |
commit | 6b7cc11484ac705e1323169c44c08a935ba0ffe2 (patch) | |
tree | a4d29945fb91f72ba4cc06b55179c1ff3917a289 | |
parent | Merge pull request #49 from saturneric/develop-2.0.5 (diff) | |
parent | <fix>(ui): fix error in IMAPFolder (diff) | |
download | GpgFrontend-6b7cc11484ac705e1323169c44c08a935ba0ffe2.tar.gz GpgFrontend-6b7cc11484ac705e1323169c44c08a935ba0ffe2.zip |
Merge pull request #50 from saturneric/develop-2.0.5v2.0.5
v2.0.5.1
Diffstat (limited to '')
-rw-r--r-- | .github/workflows/release-deb-package.yml | 2 | ||||
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | src/core/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/core/function/ArchiveFileOperator.cpp | 8 | ||||
-rw-r--r-- | src/ui/mail/IMAPFolder.h | 13 | ||||
-rw-r--r-- | src/ui/thread/FileReadThread.cpp | 19 | ||||
-rw-r--r-- | src/ui/widgets/FindWidget.cpp | 2 |
7 files changed, 34 insertions, 14 deletions
diff --git a/.github/workflows/release-deb-package.yml b/.github/workflows/release-deb-package.yml index 02fb69bc..ea6869f6 100644 --- a/.github/workflows/release-deb-package.yml +++ b/.github/workflows/release-deb-package.yml @@ -46,7 +46,7 @@ jobs: - name: Build & Package GpgFrontend (Linux DEB Package) # Build your program with the given configuration run: | - cmake -B ${{github.workspace}}/build-deb-${{matrix.os}} -G Ninja -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DGENERATE_LINUX_INSTALL_SOFTWARE=ON -DCMAKE_INSTALL_PREFIX:PATH=${{github.workspace}} + cmake -B ${{github.workspace}}/build-deb-${{matrix.os}} -G Ninja -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DGPGFRONTEND_GENERATE_LINUX_INSTALL_SOFTWARE=ON -DCMAKE_INSTALL_PREFIX:PATH=${{github.workspace}} cmake --build ${{github.workspace}}/build-deb-${{matrix.os}} --config {{$env.BUILD_TYPE}} -- -v cd ${{github.workspace}}/build-deb-${{matrix.os}} ninja package @@ -163,7 +163,7 @@ Build the code and make the deb package. ```shell $ cd GpgFrontend $ mkdir build && cd build -$ cmake -G Ninja -DCMAKE_BUILD_TYPE="Release" -DGENERATE_LINUX_INSTALL_SOFTWARE=ON .. +$ cmake -G Ninja -DCMAKE_BUILD_TYPE="Release" -DGPGFRONTEND_GENERATE_LINUX_INSTALL_SOFTWARE=ON .. $ ninja $ ninja package ``` diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 66fe357c..7903ef80 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -62,7 +62,7 @@ endif () # link libarchive if (MINGW) find_library(LIBARCHIVE_LIB libarchive.a) - target_link_libraries(gpgfrontend_core ${LIBARCHIVE_LIB} expat lz4 zstd bcrypt lzma bz2 z) + target_link_libraries(gpgfrontend_core ${LIBARCHIVE_LIB} b2 expat lz4 zstd bcrypt lzma bz2 z) else () target_link_libraries(gpgfrontend_core archive_static) endif () diff --git a/src/core/function/ArchiveFileOperator.cpp b/src/core/function/ArchiveFileOperator.cpp index 1a1ffaec..17f29df1 100644 --- a/src/core/function/ArchiveFileOperator.cpp +++ b/src/core/function/ArchiveFileOperator.cpp @@ -231,11 +231,11 @@ void GpgFrontend::ArchiveFileOperator::ExtractArchive( LOG(ERROR) << "cannot read from stdin"; } #ifdef WINDOWS - if ((r = archive_read_open_filename_w(a, archive_path.wstring().c_str(), - 10240))) { + if (archive_read_open_filename_w(a, archive_path.wstring().c_str(), + 10240) != ARCHIVE_OK) { #else - if ((r = archive_read_open_filename(a, archive_path.u8string().c_str(), - 10240))) { + if (archive_read_open_filename(a, archive_path.u8string().c_str(), + 10240) != ARCHIVE_OK) { #endif LOG(ERROR) << "archive_read_open_filename() failed: " << archive_error_string(a); diff --git a/src/ui/mail/IMAPFolder.h b/src/ui/mail/IMAPFolder.h index 8d09eb94..7dc52438 100644 --- a/src/ui/mail/IMAPFolder.h +++ b/src/ui/mail/IMAPFolder.h @@ -49,6 +49,19 @@ class IMAPFolder { explicit IMAPFolder(std::shared_ptr<vmime::net::folder> folder); /** + * @brief Copy and construct the IMAPFolder object + */ + IMAPFolder(const IMAPFolder &) = default; + + /** + * @brief Copy the IMAPFolder object + * + * @return + */ + IMAPFolder &operator=(const IMAPFolder &) = default; + + + /** * @brief Set the Parent Folder object * * @param parent_node diff --git a/src/ui/thread/FileReadThread.cpp b/src/ui/thread/FileReadThread.cpp index 258b9405..83731c8a 100644 --- a/src/ui/thread/FileReadThread.cpp +++ b/src/ui/thread/FileReadThread.cpp @@ -47,18 +47,25 @@ void FileReadThread::run() { if (is_regular_file(read_file_path)) { LOG(INFO) << "read open" << read_file_path; - QFile file; - file.setFileName(QString::fromStdString(read_file_path.u8string())); - file.open(QIODevice::ReadOnly); + QFile target_file; + target_file.setFileName(QString::fromStdString(read_file_path.u8string())); + target_file.open(QIODevice::ReadOnly); QByteArray read_buffer; LOG(INFO) << "thread start reading"; const size_t buffer_size = 4096; - while ((read_buffer = file.read(buffer_size)).size() > 0) { + if(!(target_file.isOpen() && target_file.isReadable())) { + LOG(ERROR) << "file not open or not readable"; + if(target_file.isOpen()) + target_file.close(); + return; + } + + while (!target_file.atEnd() && (read_buffer = target_file.read(buffer_size)).size() > 0) { // Check isInterruptionRequested if (QThread::currentThread()->isInterruptionRequested()) { LOG(INFO) << "thread is interruption requested "; - file.close(); + target_file.close(); return; } LOG(INFO) << "block size " << read_buffer.size(); @@ -71,7 +78,7 @@ void FileReadThread::run() { QThread::msleep(128); #endif } - file.close(); + target_file.close(); emit SignalReadDone(); LOG(INFO) << "thread end reading"; } diff --git a/src/ui/widgets/FindWidget.cpp b/src/ui/widgets/FindWidget.cpp index 58ceda7c..defcf31c 100644 --- a/src/ui/widgets/FindWidget.cpp +++ b/src/ui/widgets/FindWidget.cpp @@ -59,7 +59,7 @@ FindWidget::FindWidget(QWidget* parent, PlainTextEditorPage* edit) } void FindWidget::set_background() { - auto cursor = m_text_page_->GetTextPage()->textCursor(); + // auto cursor = m_text_page_->GetTextPage()->textCursor(); // if match is found set background of QLineEdit to white, otherwise to red QPalette bgPalette(find_edit_->palette()); |