aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/thread/SMTPConnectionTestThread.cpp
diff options
context:
space:
mode:
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