aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2025-04-18 00:06:40 +0000
committersaturneric <[email protected]>2025-04-18 00:06:40 +0000
commit0261c780976d8ac650006916dcc2688582f4922e (patch)
tree6839e6738ec4c5d2447b3e60f7a974752050898e
parentfix: add missing libGLESv2.dll on windows platform (diff)
downloadGpgFrontend-0261c780976d8ac650006916dcc2688582f4922e.tar.gz
GpgFrontend-0261c780976d8ac650006916dcc2688582f4922e.zip
fix: issues found by testing
-rw-r--r--src/ui/GpgFrontendUIInit.cpp4
-rw-r--r--src/ui/widgets/TextEdit.cpp5
2 files changed, 5 insertions, 4 deletions
diff --git a/src/ui/GpgFrontendUIInit.cpp b/src/ui/GpgFrontendUIInit.cpp
index 1ee59d12..55d934bd 100644
--- a/src/ui/GpgFrontendUIInit.cpp
+++ b/src/ui/GpgFrontendUIInit.cpp
@@ -217,7 +217,8 @@ void WaitingAllInitializationFinished() {
auto RunGpgFrontendUI(QApplication* app) -> int {
// create main window and show it
- auto* main_window = new GpgFrontend::UI::MainWindow();
+ auto main_window = QSharedPointer<GpgFrontend::UI::MainWindow>::create();
+ main_window->setAttribute(Qt::WA_DeleteOnClose, false);
// pre-check, if application need to restart
if (CommonUtils::GetInstance()->IsApplicationNeedRestart()) {
@@ -233,7 +234,6 @@ auto RunGpgFrontendUI(QApplication* app) -> int {
// show main windows
main_window->show();
- // start the main event loop
return QApplication::exec();
}
diff --git a/src/ui/widgets/TextEdit.cpp b/src/ui/widgets/TextEdit.cpp
index 5cb5d269..4f0fdd6f 100644
--- a/src/ui/widgets/TextEdit.cpp
+++ b/src/ui/widgets/TextEdit.cpp
@@ -75,9 +75,10 @@ void TextEdit::SlotNewDefaultFileBrowserTab() {
void TextEdit::SlotNewFileBrowserTab() {
auto const target_path =
- QFileDialog::getOpenFileUrl(this, tr("Open File"), QDir::home().path());
+ QFileDialog::getOpenFileName(this, tr("Open File"), QDir::home().path());
+
if (target_path.isEmpty()) return;
- tab_widget_->SlotOpenPath(target_path.path());
+ tab_widget_->SlotOpenPath(target_path);
}
void TextEdit::SlotNewFileBrowserTabWithDirectory() {