diff options
author | Saturneric <[email protected]> | 2021-12-02 21:35:16 +0000 |
---|---|---|
committer | Saturneric <[email protected]> | 2021-12-02 21:35:16 +0000 |
commit | 1e3f1d13a6fb1bfc8f24be83032df1e92350dbcc (patch) | |
tree | 58cabfa5c0065632b97823b6e6f068c04f1fa2e9 /src/ui | |
parent | Fix and Modified. (diff) | |
download | GpgFrontend-1e3f1d13a6fb1bfc8f24be83032df1e92350dbcc.tar.gz GpgFrontend-1e3f1d13a6fb1bfc8f24be83032df1e92350dbcc.zip |
Fixed.
1. Fixed known issue in File Operations.
Diffstat (limited to '')
-rw-r--r-- | src/ui/CMakeLists.txt | 1 | ||||
-rwxr-xr-x | src/ui/FileEncryptionDialog.cpp | 4 | ||||
-rw-r--r-- | src/ui/MainWindow.cpp | 5 | ||||
-rw-r--r-- | src/ui/function/FileReadThread.cpp | 63 | ||||
-rw-r--r-- | src/ui/function/FileReadThread.h | 52 | ||||
-rw-r--r-- | src/ui/function/VersionCheckThread.cpp (renamed from src/ui/help/VersionCheckThread.cpp) | 2 | ||||
-rw-r--r-- | src/ui/function/VersionCheckThread.h (renamed from src/ui/help/VersionCheckThread.h) | 0 | ||||
-rw-r--r-- | src/ui/main_window/MainWindowFileSlotFunction.cpp | 49 | ||||
-rw-r--r-- | src/ui/main_window/MainWindowSlotFunction.cpp | 22 | ||||
-rw-r--r-- | src/ui/widgets/EditorPage.cpp | 74 | ||||
-rw-r--r-- | src/ui/widgets/EditorPage.h | 10 | ||||
-rw-r--r-- | src/ui/widgets/FilePage.cpp | 10 | ||||
-rw-r--r-- | src/ui/widgets/SignersPicker.cpp | 7 | ||||
-rw-r--r-- | src/ui/widgets/TextEdit.cpp | 3 |
14 files changed, 202 insertions, 100 deletions
diff --git a/src/ui/CMakeLists.txt b/src/ui/CMakeLists.txt index 6e9ef497..acd0e42f 100644 --- a/src/ui/CMakeLists.txt +++ b/src/ui/CMakeLists.txt @@ -5,6 +5,7 @@ aux_source_directory(./keygen UI_SOURCE) aux_source_directory(./main_window UI_SOURCE) aux_source_directory(./help UI_SOURCE) aux_source_directory(./settings UI_SOURCE) +aux_source_directory(./function UI_SOURCE) if (SMTP_SUPPORT) message(STATUS "Build SMTP Support") diff --git a/src/ui/FileEncryptionDialog.cpp b/src/ui/FileEncryptionDialog.cpp index cad0dcb1..3e1e9b9a 100755 --- a/src/ui/FileEncryptionDialog.cpp +++ b/src/ui/FileEncryptionDialog.cpp @@ -208,9 +208,7 @@ void FileEncryptionDialog::slotExecuteAction() { auto out_data = std::make_unique<ByteArray>(); auto key_ids = mKeyList->getChecked(); - auto keys = std::vector<GpgKey>(); - for (const auto& key_id : *key_ids) - keys.push_back(GpgKeyGetter::GetInstance().GetKey(key_id)); + auto keys = GpgKeyGetter::GetInstance().GetKeys(key_ids); if (mAction == Encrypt) { qDebug() << "Action Encrypt"; diff --git a/src/ui/MainWindow.cpp b/src/ui/MainWindow.cpp index b9251243..31271ef1 100644 --- a/src/ui/MainWindow.cpp +++ b/src/ui/MainWindow.cpp @@ -65,10 +65,7 @@ void MainWindow::init() noexcept { KeyListColumn::Usage | KeyListColumn::Validity, this); mKeyList->setFilter([](const GpgKey& key) -> bool { - if (key.revoked() || key.disabled() || key.expired()) - return false; - else - return true; + return !(key.revoked() || key.disabled() || key.expired()); }); mKeyList->slotRefresh(); diff --git a/src/ui/function/FileReadThread.cpp b/src/ui/function/FileReadThread.cpp new file mode 100644 index 00000000..34ade8e2 --- /dev/null +++ b/src/ui/function/FileReadThread.cpp @@ -0,0 +1,63 @@ +/** + * This file is part of GpgFrontend. + * + * GpgFrontend is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Foobar is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <https://www.gnu.org/licenses/>. + * + * The initial version of the source code is inherited from gpg4usb-team. + * Their source code version also complies with GNU General Public License. + * + * The source code version of this software was modified and released + * by Saturneric<[email protected]><[email protected]> starting on May 12, 2021. + * + */ + +#include "FileReadThread.h" + +#include <boost/filesystem.hpp> +#include <utility> + +namespace GpgFrontend::UI { + +FileReadThread::FileReadThread(std::string path) : path(std::move(path)) {} + +void FileReadThread::run() { + LOG(INFO) << "read_thread Started"; + boost::filesystem::path read_file_path(this->path); + if (is_regular_file(read_file_path)) { + LOG(INFO) << "read_thread Read Open"; + + auto fp = fopen(read_file_path.c_str(), "r"); + size_t read_size; + LOG(INFO) << "Thread Start Reading"; + + char buffer[8192]; + while ((read_size = fread(buffer, sizeof(char), sizeof buffer, fp)) > 0) { + // Check isInterruptionRequested + if (QThread::currentThread()->isInterruptionRequested()) { + LOG(INFO) << "Read Thread isInterruptionRequested "; + fclose(fp); + return; + } + LOG(INFO) << "Read Thread Read block size " << read_size; + std::string buffer_str(buffer, read_size); + + emit sendReadBlock(QString::fromStdString(buffer_str)); + } + fclose(fp); + emit readDone(); + LOG(INFO) << "Thread End Reading"; + } +} + +} // namespace GpgFrontend::UI diff --git a/src/ui/function/FileReadThread.h b/src/ui/function/FileReadThread.h new file mode 100644 index 00000000..ebfcfb3c --- /dev/null +++ b/src/ui/function/FileReadThread.h @@ -0,0 +1,52 @@ +/** + * This file is part of GpgFrontend. + * + * GpgFrontend is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Foobar is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <https://www.gnu.org/licenses/>. + * + * The initial version of the source code is inherited from gpg4usb-team. + * Their source code version also complies with GNU General Public License. + * + * The source code version of this software was modified and released + * by Saturneric<[email protected]><[email protected]> starting on May 12, 2021. + * + */ + +#ifndef GPGFRONTEND_FILEREADTHREAD_H +#define GPGFRONTEND_FILEREADTHREAD_H + +#include "ui/GpgFrontendUI.h" +namespace GpgFrontend::UI { + +class FileReadThread : public QThread { + Q_OBJECT + + public: + explicit FileReadThread(std::string path); + + signals: + + void sendReadBlock(const QString& block); + + void readDone(); + + protected: + void run() override; + + private: + std::string path; +}; + +} // namespace GpgFrontend::UI + +#endif // GPGFRONTEND_FILEREADTHREAD_H diff --git a/src/ui/help/VersionCheckThread.cpp b/src/ui/function/VersionCheckThread.cpp index 44ef0bd1..50a4160e 100644 --- a/src/ui/help/VersionCheckThread.cpp +++ b/src/ui/function/VersionCheckThread.cpp @@ -22,7 +22,7 @@ * */ -#include "ui/help/VersionCheckThread.h" +#include "VersionCheckThread.h" #include "GpgFrontendBuildInfo.h" #include "rapidjson/document.h" diff --git a/src/ui/help/VersionCheckThread.h b/src/ui/function/VersionCheckThread.h index 181ee947..181ee947 100644 --- a/src/ui/help/VersionCheckThread.h +++ b/src/ui/function/VersionCheckThread.h diff --git a/src/ui/main_window/MainWindowFileSlotFunction.cpp b/src/ui/main_window/MainWindowFileSlotFunction.cpp index 32fae92e..b0f7c535 100644 --- a/src/ui/main_window/MainWindowFileSlotFunction.cpp +++ b/src/ui/main_window/MainWindowFileSlotFunction.cpp @@ -26,6 +26,7 @@ #include "gpg/function/GpgFileOpera.h" #include "gpg/function/GpgKeyGetter.h" #include "ui/UserInterfaceUtils.h" +#include "ui/widgets/SignersPicker.h" namespace GpgFrontend::UI { @@ -90,7 +91,7 @@ void MainWindow::slotFileEncrypt() { bool if_error = false; process_operation(this, _("Encrypting"), [&]() { try { - error = GpgFileOpera::EncryptFile(std::move(*keys), path.toStdString(), + error = GpgFileOpera::EncryptFile(std::move(keys), path.toStdString(), result); } catch (const std::runtime_error& e) { if_error = true; @@ -199,7 +200,7 @@ void MainWindow::slotFileSign() { process_operation(this, _("Signing"), [&]() { try { error = - GpgFileOpera::SignFile(std::move(*keys), path.toStdString(), result); + GpgFileOpera::SignFile(std::move(keys), path.toStdString(), result); } catch (const std::runtime_error& e) { if_error = true; } @@ -309,45 +310,40 @@ void MainWindow::slotFileEncryptSign() { } auto key_ids = mKeyList->getChecked(); - auto keys = GpgKeyGetter::GetInstance().GetKeys(key_ids); + auto p_keys = GpgKeyGetter::GetInstance().GetKeys(key_ids); - if (keys->empty()) { + if (p_keys->empty()) { QMessageBox::critical(this, _("No Key Selected"), _("No Key Selected")); return; } - bool can_sign = false, can_encr = false; - - for (const auto& key : *keys) { - bool key_can_sign = key.CanSignActual(); - bool key_can_encr = key.CanEncrActual(); + for (const auto& key : *p_keys) { + bool key_can_encrypt = key.CanEncrActual(); - if (!key_can_sign && !key_can_encr) { + if (!key_can_encrypt) { QMessageBox::critical( nullptr, _("Invalid KeyPair"), - QString(_( - "The selected keypair cannot be used for signing and encryption " - "at the same time.")) + + QString(_("The selected keypair cannot be used for encryption.")) + "<br/><br/>" + _("For example the Following Key:") + " <br/>" + QString::fromStdString(key.uids()->front().uid())); return; } - - if (key_can_sign) can_sign = true; - if (key_can_encr) can_encr = true; } - if (!can_encr) { - QMessageBox::critical(nullptr, _("Incomplete Operation"), - _("None of the selected key pairs can provide the " - "encryption function.")); - return; + auto signersPicker = new SignersPicker(this); + QEventLoop loop; + connect(signersPicker, SIGNAL(finished(int)), &loop, SLOT(quit())); + loop.exec(); + + auto signer_key_ids = signersPicker->getCheckedSigners(); + auto p_signer_keys = GpgKeyGetter::GetInstance().GetKeys(signer_key_ids); + + for (const auto& key : *p_keys) { + LOG(INFO) << "Keys " << key.email(); } - if (!can_sign) { - QMessageBox::warning(nullptr, _("Incomplete Operation"), - _("None of the selected key pairs can provide the " - "signature function.")); + for (const auto& signer : *p_signer_keys) { + LOG(INFO) << "Signers " << signer.email(); } GpgEncrResult encr_result = nullptr; @@ -359,7 +355,8 @@ void MainWindow::slotFileEncryptSign() { process_operation(this, _("Encrypting and Signing"), [&]() { try { error = GpgFileOpera::EncryptSignFile( - std::move(*keys), path.toStdString(), encr_result, sign_result); + std::move(p_keys), std::move(p_signer_keys), path.toStdString(), + encr_result, sign_result); } catch (const std::runtime_error& e) { if_error = true; } diff --git a/src/ui/main_window/MainWindowSlotFunction.cpp b/src/ui/main_window/MainWindowSlotFunction.cpp index edfa1388..205b9440 100644 --- a/src/ui/main_window/MainWindowSlotFunction.cpp +++ b/src/ui/main_window/MainWindowSlotFunction.cpp @@ -81,18 +81,19 @@ void MainWindow::slotEncrypt() { try { auto buffer = edit->curTextPage()->toPlainText().toUtf8().toStdString(); error = GpgFrontend::BasicOperator::GetInstance().Encrypt( - std::move(*keys), buffer, tmp, result); + std::move(keys), buffer, tmp, result); } catch (const std::runtime_error& e) { if_error = true; } }); if (!if_error) { - edit->slotFillTextEditWithText(QString::fromStdString(*tmp)); auto resultAnalyse = EncryptResultAnalyse(error, std::move(result)); resultAnalyse.analyse(); process_result_analyse(edit, infoBoard, resultAnalyse); - + + if (check_gpg_error_2_err_code(error) == GPG_ERR_NO_ERROR) + edit->slotFillTextEditWithText(QString::fromStdString(*tmp)); #ifdef SMTP_SUPPORT // set optional actions if (resultAnalyse.getStatus() >= 0) { @@ -155,7 +156,7 @@ void MainWindow::slotSign() { try { auto buffer = edit->curTextPage()->toPlainText().toUtf8().toStdString(); error = GpgFrontend::BasicOperator::GetInstance().Sign( - std::move(*keys), buffer, tmp, GPGME_SIG_MODE_CLEAR, result); + std::move(keys), buffer, tmp, GPGME_SIG_MODE_CLEAR, result); } catch (const std::runtime_error& e) { if_error = true; } @@ -165,7 +166,9 @@ void MainWindow::slotSign() { auto resultAnalyse = SignResultAnalyse(error, std::move(result)); resultAnalyse.analyse(); process_result_analyse(edit, infoBoard, resultAnalyse); - edit->slotFillTextEditWithText(QString::fromStdString(*tmp)); + + if (check_gpg_error_2_err_code(error) == GPG_ERR_NO_ERROR) + edit->slotFillTextEditWithText(QString::fromStdString(*tmp)); } else { QMessageBox::critical(this, _("Error"), _("An error occurred during operation.")); @@ -209,7 +212,7 @@ void MainWindow::slotDecrypt() { resultAnalyse.analyse(); process_result_analyse(edit, infoBoard, resultAnalyse); - if (gpgme_err_code(error) == GPG_ERR_NO_ERROR) + if (check_gpg_error_2_err_code(error) == GPG_ERR_NO_ERROR) edit->slotFillTextEditWithText(QString::fromStdString(*decrypted)); } else { QMessageBox::critical(this, _("Error"), @@ -312,7 +315,7 @@ void MainWindow::slotEncryptSign() { loop.exec(); auto signer_key_ids = signersPicker->getCheckedSigners(); - auto signer_keys = GpgKeyGetter::GetInstance().GetKeys(key_ids); + auto signer_keys = GpgKeyGetter::GetInstance().GetKeys(signer_key_ids); for (const auto& key : *keys) { LOG(INFO) << "Keys " << key.email(); @@ -332,7 +335,7 @@ void MainWindow::slotEncryptSign() { try { auto buffer = edit->curTextPage()->toPlainText().toUtf8().toStdString(); error = GpgFrontend::BasicOperator::GetInstance().EncryptSign( - std::move(*keys), std::move(*signer_keys), buffer, tmp, encr_result, + std::move(keys), std::move(signer_keys), buffer, tmp, encr_result, sign_result); } catch (const std::runtime_error& e) { if_error = true; @@ -360,7 +363,8 @@ void MainWindow::slotEncryptSign() { encrypt_res.analyse(); sign_res.analyse(); process_result_analyse(edit, infoBoard, encrypt_res, sign_res); - edit->slotFillTextEditWithText(QString::fromStdString(*tmp)); + if (check_gpg_error_2_err_code(error) == GPG_ERR_NO_ERROR) + edit->slotFillTextEditWithText(QString::fromStdString(*tmp)); #ifdef SMTP_SUPPORT infoBoard->resetOptionActionsMenu(); diff --git a/src/ui/widgets/EditorPage.cpp b/src/ui/widgets/EditorPage.cpp index 6fd72c20..eeedfaf5 100644 --- a/src/ui/widgets/EditorPage.cpp +++ b/src/ui/widgets/EditorPage.cpp @@ -27,6 +27,8 @@ #include <boost/filesystem.hpp> #include <utility> +#include "ui/function/FileReadThread.h" + namespace GpgFrontend::UI { EditorPage::EditorPage(QString filePath, QWidget* parent) @@ -106,51 +108,37 @@ void EditorPage::slotFormatGpgHeader() { } void EditorPage::readFile() { - if (this->readThread != nullptr) { - this->readThread->requestInterruption(); - this->readThread = nullptr; - } - LOG(INFO) << "EditorPage::readFile Started"; - this->readThread = QThread::create([&]() { - LOG(INFO) << "EditorPage::readFile read_thread Started"; - boost::filesystem::path read_file_path(this->fullFilePath.toStdString()); - if (is_regular_file(read_file_path)) { - LOG(INFO) << "EditorPage::readFile read_thread Read Open"; - - auto fp = fopen(read_file_path.c_str(), "r"); - size_t read_size; - qDebug() << "Thread Start Reading"; - // Event loop - this->getTextPage()->setReadOnly(true); - char buffer[8192]; - while ((read_size = fread(buffer, sizeof(char), sizeof buffer, fp)) > 0) { - // Check isInterruptionRequested - if (QThread::currentThread()->isInterruptionRequested()) { - LOG(INFO) - << "EditorPage::readFile ReadThread isInterruptionRequested "; - fclose(fp); - return; - } - - LOG(INFO) << "EditorPage::readFile read_thread Read block size" - << read_size; - this->getTextPage()->insertPlainText( - QString::fromLocal8Bit(buffer, read_size)); - - QThread::msleep(32); - } - fclose(fp); - this->getTextPage()->setReadOnly(false); - LOG(INFO) << "Thread End Reading"; - } + LOG(INFO) << "Called"; + + auto text_page = this->getTextPage(); + text_page->setReadOnly(true); + auto thread = new FileReadThread(this->fullFilePath.toStdString()); + + connect(thread, &FileReadThread::sendReadBlock, this, + &EditorPage::slotInsertText); + + connect(thread, &FileReadThread::readDone, this, [=]() { + LOG(INFO) << "Thread read done"; + text_page->document()->setModified(false); + text_page->setReadOnly(false); }); - connect(this->readThread, SIGNAL(finished()), this->readThread, - SLOT(deleteLater())); - connect(this, &QWidget::destroyed, [&]() { - LOG(INFO) << "QWidget::destroyed RequestInterruption for readThread"; - this->readThread->requestInterruption(); + + connect(thread, &FileReadThread::finished, this, [=]() { + LOG(INFO) << "Thread finished"; + thread->deleteLater(); + }); + + connect(this, &FileReadThread::destroyed, [=]() { + LOG(INFO) << "RequestInterruption for readThread"; + thread->requestInterruption(); + thread->deleteLater(); }); - this->readThread->start(); + + thread->start(); +} + +void EditorPage::slotInsertText(const QString& text) { + this->getTextPage()->insertPlainText(text); } } // namespace GpgFrontend::UI diff --git a/src/ui/widgets/EditorPage.h b/src/ui/widgets/EditorPage.h index 1e19a0de..1a19134c 100644 --- a/src/ui/widgets/EditorPage.h +++ b/src/ui/widgets/EditorPage.h @@ -30,11 +30,8 @@ QT_BEGIN_NAMESPACE class QVBoxLayout; - class QHBoxLayout; - class QString; - class QLabel; QT_END_NAMESPACE @@ -58,7 +55,7 @@ class EditorPage : public QWidget { /** * @details Get the filepath of the currently activated tab. */ - const QString& getFilePath() const; + [[nodiscard]] const QString& getFilePath() const; /** * @details Set filepath of currently activated tab. @@ -87,8 +84,6 @@ class EditorPage : public QWidget { */ void closeNoteByClass(const char* className); - const QString uuid = QUuid::createUuid().toString(); - void readFile(); private: @@ -96,7 +91,6 @@ class EditorPage : public QWidget { QVBoxLayout* mainLayout; /** The layout for the tab */ QString fullFilePath; /** The path to the file handled in the tab */ bool signMarked{}; /** true, if the signed header is marked, false if not */ - QThread* readThread = nullptr; private slots: @@ -104,6 +98,8 @@ class EditorPage : public QWidget { * @details Format the gpg header in another font-style */ void slotFormatGpgHeader(); + + void slotInsertText(const QString& text); }; } // namespace GpgFrontend::UI diff --git a/src/ui/widgets/FilePage.cpp b/src/ui/widgets/FilePage.cpp index 4b88092b..bb026804 100644 --- a/src/ui/widgets/FilePage.cpp +++ b/src/ui/widgets/FilePage.cpp @@ -53,7 +53,7 @@ FilePage::FilePage(QWidget* parent) : QWidget(parent) { connect(upLevelButton, SIGNAL(clicked(bool)), this, SLOT(slotUpLevel())); QString buttonStyle = - "QPushButton{border:none;background-color:rgba(255, 255, 255,100);}"; + "QPushButton{border:none;background-color:rgba(255, 255, 255, 0);}"; auto upPixmap = QPixmap(":up.png"); upPixmap = @@ -113,7 +113,7 @@ FilePage::FilePage(QWidget* parent) : QWidget(parent) { void FilePage::fileTreeViewItemClicked(const QModelIndex& index) { selectedPath = boost::filesystem::path( dirModel->fileInfo(index).absoluteFilePath().toStdString()); - LOG(INFO) << "FilePage::fileTreeViewItemClicked selectedPath" << selectedPath; + LOG(INFO) << "selected path" << selectedPath; } void FilePage::slotUpLevel() { @@ -129,7 +129,7 @@ void FilePage::slotUpLevel() { pathEdit->setText(mPath.c_str()); slotGoPath(); } - LOG(INFO) << "FilePage::slotUpLevel Current Root mPath" << mPath; + LOG(INFO) << "Current Root mPath" << mPath; emit pathChanged(mPath.c_str()); } } @@ -144,7 +144,7 @@ void FilePage::fileTreeViewItemDoubleClicked(const QModelIndex& index) { dirTreeView->setRootIndex(targetModelIndex); pathEdit->setText(mPath.c_str()); } - LOG(INFO) << "FilePage::fileTreeViewItemDoubleClicked Index mPath" << mPath; + LOG(INFO) << "Index mPath" << mPath; emit pathChanged(mPath.c_str()); } @@ -155,7 +155,7 @@ void FilePage::slotGoPath() { auto fileInfo = QFileInfo(pathEdit->text()); if (fileInfo.isDir() && fileInfo.isReadable() && fileInfo.isExecutable()) { mPath = boost::filesystem::path(fileInfo.filePath().toStdString()); - LOG(INFO) << "FilePage::slotGoPath Set Path" << mPath; + LOG(INFO) << "Set Path" << mPath; dirTreeView->setRootIndex(dirModel->index(fileInfo.filePath())); } else { QMessageBox::critical(this, "Error", diff --git a/src/ui/widgets/SignersPicker.cpp b/src/ui/widgets/SignersPicker.cpp index 3131989b..3e4b3bb5 100644 --- a/src/ui/widgets/SignersPicker.cpp +++ b/src/ui/widgets/SignersPicker.cpp @@ -45,12 +45,17 @@ SignersPicker::SignersPicker(QWidget* parent) : QDialog(parent) { mKeyList->slotRefresh(); auto* vbox2 = new QVBoxLayout(); - vbox2->addWidget(new QLabel("Select Signer(s): ")); + vbox2->addWidget(new QLabel(QString(_("Select Signer(s)")) + ": ")); vbox2->addWidget(mKeyList); + vbox2->addWidget(new QLabel( + _("Selecting Nothing will eventually use default key to sign."))); vbox2->addWidget(confirmButton); vbox2->addStretch(0); setLayout(vbox2); + this->setWindowFlags(Qt::Window | Qt::WindowTitleHint | + Qt::CustomizeWindowHint); + this->setModal(true); this->setWindowTitle("Signers Picker"); this->setMinimumWidth(480); diff --git a/src/ui/widgets/TextEdit.cpp b/src/ui/widgets/TextEdit.cpp index efc2abbf..528a4c88 100644 --- a/src/ui/widgets/TextEdit.cpp +++ b/src/ui/widgets/TextEdit.cpp @@ -74,7 +74,7 @@ void TextEdit::slotNewFileTab() const { void TextEdit::slotOpenFile(QString& path) { QFile file(path); - LOG(INFO) << "TextEdit::slotOpenFile path" << path.toStdString(); + LOG(INFO) << " path" << path.toStdString(); auto result = file.open(QIODevice::ReadOnly | QIODevice::Text); if (result) { auto* page = new EditorPage(path); @@ -93,6 +93,7 @@ void TextEdit::slotOpenFile(QString& path) { } file.close(); + LOG(INFO) << "done"; } void TextEdit::slotOpen() { |