Skip to content

Commit

Permalink
Merge pull request #50 from saturneric/develop-2.0.5
Browse files Browse the repository at this point in the history
v2.0.5.1
  • Loading branch information
saturneric committed Mar 19, 2022
2 parents d1e305c + 7b4369b commit 6b7cc11
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release-deb-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down
2 changes: 1 addition & 1 deletion src/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 ()
Expand Down
8 changes: 4 additions & 4 deletions src/core/function/ArchiveFileOperator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
13 changes: 13 additions & 0 deletions src/ui/mail/IMAPFolder.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,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
*
Expand Down
19 changes: 13 additions & 6 deletions src/ui/thread/FileReadThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -71,7 +78,7 @@ void FileReadThread::run() {
QThread::msleep(128);
#endif
}
file.close();
target_file.close();
emit SignalReadDone();
LOG(INFO) << "thread end reading";
}
Expand Down
2 changes: 1 addition & 1 deletion src/ui/widgets/FindWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());

Expand Down

0 comments on commit 6b7cc11

Please sign in to comment.