Remove obsolete code from FDialog destructor

This commit is contained in:
Markus Gans 2016-07-10 00:23:39 +02:00
parent 9766ee4b6f
commit 07bcf76bf4
4 changed files with 18 additions and 25 deletions

View File

@ -1,3 +1,6 @@
2016-07-10 Markus Gans <guru.mail@muenster.de>
* Remove obsolete code from FDialog destructor
2016-07-08 Markus Gans <guru.mail@muenster.de> 2016-07-08 Markus Gans <guru.mail@muenster.de>
* Better code readability: control structures (if/else, while, switch) * Better code readability: control structures (if/else, while, switch)
are now separated by a blank line. are now separated by a blank line.

View File

@ -1304,6 +1304,8 @@ int FApplication::processTimerEvent()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FApplication::processTerminalUpdate() void FApplication::processTerminalUpdate()
{ {
#define MAX_SKIP 8
if ( terminal_update_pending ) if ( terminal_update_pending )
{ {
if ( ! input_data_pending ) if ( ! input_data_pending )
@ -1312,7 +1314,7 @@ void FApplication::processTerminalUpdate()
terminal_update_pending = false; terminal_update_pending = false;
skipped_terminal_update = 0; skipped_terminal_update = 0;
} }
else if ( skipped_terminal_update > 8 ) else if ( skipped_terminal_update > MAX_SKIP )
{ {
force_terminal_update = true; force_terminal_update = true;
updateTerminal(); updateTerminal();
@ -1323,6 +1325,8 @@ void FApplication::processTerminalUpdate()
else else
skipped_terminal_update++; skipped_terminal_update++;
} }
#undef MAX_SKIP
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -1343,6 +1347,7 @@ void FApplication::processCloseWidget()
close_widget->clear(); close_widget->clear();
} }
updateTerminal(true); updateTerminal(true);
} }

View File

@ -46,6 +46,8 @@ FDialog::~FDialog() // destructor
{ {
FApplication* fapp; FApplication* fapp;
delete dialog_menu;
dgl_menuitem = 0;
delete accelerator_list; delete accelerator_list;
accelerator_list = 0; accelerator_list = 0;
activatePrevWindow(); activatePrevWindow();
@ -56,28 +58,6 @@ FDialog::~FDialog() // destructor
{ {
const FRect& geometry = getGeometryGlobalShadow(); const FRect& geometry = getGeometryGlobalShadow();
restoreVTerm (geometry); 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<FDialog*>(*iter)->drawDialogShadow();
++iter;
}
setFocusWidget(0);
updateTerminal();
flush_out();
} }
if ( vwin != 0 ) if ( vwin != 0 )
@ -777,10 +757,13 @@ void FDialog::onMouseDoubleClick (FMouseEvent* ev)
{ {
dialog_menu->unselectItem(); dialog_menu->unselectItem();
dialog_menu->hide(); dialog_menu->hide();
activateWindow();
raiseWindow();
getFocusWidget()->setFocus();
setClickedWidget(0); setClickedWidget(0);
if ( isModal() ) if ( isModal() )
done(FDialog::Reject); done (FDialog::Reject);
else else
close(); close();
} }
@ -812,7 +795,8 @@ void FDialog::onWindowActive (FEvent*)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FDialog::onWindowInactive (FEvent*) void FDialog::onWindowInactive (FEvent*)
{ {
FWindow::previous_widget = this; if ( ! dialog_menu->isVisible() )
FWindow::previous_widget = this;
if ( isVisible() && isEnabled() ) if ( isVisible() && isEnabled() )
drawTitleBar(); drawTitleBar();

View File

@ -526,6 +526,7 @@ void FFileDialog::onKeyPress (FKeyEvent* ev)
return; return;
int key = ev->key(); int key = ev->key();
switch ( key ) switch ( key )
{ {
case fc::Fkey_erase: case fc::Fkey_erase: