From 07bcf76bf4832700690ffa6b3ba9280bf8c97270 Mon Sep 17 00:00:00 2001 From: Markus Gans Date: Sun, 10 Jul 2016 00:23:39 +0200 Subject: [PATCH] Remove obsolete code from FDialog destructor --- ChangeLog | 3 +++ src/fapp.cpp | 7 ++++++- src/fdialog.cpp | 32 ++++++++------------------------ src/ffiledialog.cpp | 1 + 4 files changed, 18 insertions(+), 25 deletions(-) diff --git a/ChangeLog b/ChangeLog index 06a2e8bc..212512bb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2016-07-10 Markus Gans + * Remove obsolete code from FDialog destructor + 2016-07-08 Markus Gans * Better code readability: control structures (if/else, while, switch) are now separated by a blank line. diff --git a/src/fapp.cpp b/src/fapp.cpp index 2c5d4ef8..318e743a 100644 --- a/src/fapp.cpp +++ b/src/fapp.cpp @@ -1304,6 +1304,8 @@ int FApplication::processTimerEvent() //---------------------------------------------------------------------- void FApplication::processTerminalUpdate() { +#define MAX_SKIP 8 + if ( terminal_update_pending ) { if ( ! input_data_pending ) @@ -1312,7 +1314,7 @@ void FApplication::processTerminalUpdate() terminal_update_pending = false; skipped_terminal_update = 0; } - else if ( skipped_terminal_update > 8 ) + else if ( skipped_terminal_update > MAX_SKIP ) { force_terminal_update = true; updateTerminal(); @@ -1323,6 +1325,8 @@ void FApplication::processTerminalUpdate() else skipped_terminal_update++; } + +#undef MAX_SKIP } //---------------------------------------------------------------------- @@ -1343,6 +1347,7 @@ void FApplication::processCloseWidget() close_widget->clear(); } + updateTerminal(true); } diff --git a/src/fdialog.cpp b/src/fdialog.cpp index 64433619..67fe41fc 100644 --- a/src/fdialog.cpp +++ b/src/fdialog.cpp @@ -46,6 +46,8 @@ FDialog::~FDialog() // destructor { FApplication* fapp; + delete dialog_menu; + dgl_menuitem = 0; delete accelerator_list; accelerator_list = 0; activatePrevWindow(); @@ -56,28 +58,6 @@ FDialog::~FDialog() // destructor { const FRect& geometry = getGeometryGlobalShadow(); restoreVTerm (geometry); - getParentWidget()->redraw(); - } - - if ( window_list && ! window_list->empty() ) - { - widgetList::const_iterator iter, end; - iter = window_list->begin(); - end = window_list->end(); - - while ( iter != end ) - { - putArea ((*iter)->getGlobalPos(), (*iter)->getVWin()); - - if ( ! maximized && ((*iter)->getFlags() & fc::shadow) != 0 ) - static_cast(*iter)->drawDialogShadow(); - - ++iter; - } - - setFocusWidget(0); - updateTerminal(); - flush_out(); } if ( vwin != 0 ) @@ -777,10 +757,13 @@ void FDialog::onMouseDoubleClick (FMouseEvent* ev) { dialog_menu->unselectItem(); dialog_menu->hide(); + activateWindow(); + raiseWindow(); + getFocusWidget()->setFocus(); setClickedWidget(0); if ( isModal() ) - done(FDialog::Reject); + done (FDialog::Reject); else close(); } @@ -812,7 +795,8 @@ void FDialog::onWindowActive (FEvent*) //---------------------------------------------------------------------- void FDialog::onWindowInactive (FEvent*) { - FWindow::previous_widget = this; + if ( ! dialog_menu->isVisible() ) + FWindow::previous_widget = this; if ( isVisible() && isEnabled() ) drawTitleBar(); diff --git a/src/ffiledialog.cpp b/src/ffiledialog.cpp index 5a399dba..a8913609 100644 --- a/src/ffiledialog.cpp +++ b/src/ffiledialog.cpp @@ -526,6 +526,7 @@ void FFileDialog::onKeyPress (FKeyEvent* ev) return; int key = ev->key(); + switch ( key ) { case fc::Fkey_erase: