diff options
author | Saturneric <[email protected]> | 2022-05-07 17:01:29 +0000 |
---|---|---|
committer | Saturneric <[email protected]> | 2022-05-07 17:01:29 +0000 |
commit | f1a2ce4bcb7d46981d1fc471e517709f076d9365 (patch) | |
tree | e9d42769dccaf452ba14394e0e0fe574fcd086dd /src/ui/thread/SMTPConnectionTestThread.cpp | |
parent | fix: add openssl dependency for windows ci (diff) | |
download | GpgFrontend-f1a2ce4bcb7d46981d1fc471e517709f076d9365.tar.gz GpgFrontend-f1a2ce4bcb7d46981d1fc471e517709f076d9365.zip |
refactor: develop 2.0.6 start
1. delete smtp ability
2. change libs link type to dramatic
Diffstat (limited to '')
-rw-r--r-- | src/core/common/CoreCommonUtil.cpp (renamed from src/ui/thread/SMTPConnectionTestThread.cpp) | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/src/ui/thread/SMTPConnectionTestThread.cpp b/src/core/common/CoreCommonUtil.cpp index 95cc8f72..69d26f72 100644 --- a/src/ui/thread/SMTPConnectionTestThread.cpp +++ b/src/core/common/CoreCommonUtil.cpp @@ -24,25 +24,17 @@ * */ -#include "SMTPConnectionTestThread.h" -namespace GpgFrontend::UI { +#include "CoreCommonUtil.h" -void SMTPConnectionTestThread::run() { - SmtpClient smtp(host_.c_str(), port_, connection_type_); - if (identify_) { - smtp.setUser(username_.c_str()); - smtp.setPassword(password_.c_str()); - } - if (!smtp.connectToHost()) { - emit SignalSMTPConnectionTestResult("Fail to connect SMTP server"); - return; - } - if (!smtp.login()) { - emit SignalSMTPConnectionTestResult("Fail to login"); - return; +namespace GpgFrontend { + +std::unique_ptr<CoreCommonUtil> CoreCommonUtil::instance_ = nullptr; ///< + +CoreCommonUtil *CoreCommonUtil::GetInstance() { + LOG(INFO) << "called"; + if (instance_ == nullptr) { + instance_ = std::make_unique<CoreCommonUtil>(); } - smtp.quit(); - emit SignalSMTPConnectionTestResult("Succeed in testing connection"); + return instance_.get(); } - -} // namespace GpgFrontend::UI +} // namespace GpgFrontend |