> Comments welcome. I'm not at all sure about this.

I don't want to save the buffer in removeWorkArea(), because it's decided in 
GuiView::closeEvent that we don't do it, and then it seems strange that it is 
done anyway. Moreover, saving the buffer seems to be the responsibility of 
GuiView::closeEvent, we shouldn't mystify the logic.

By the way, this seems highly questionable:

(GuiWorkArea.cpp:TabWorkArea::showContextMenu)

popup.addAction(QIcon(getPixmap("images/", "hidetab", "png")),
        qt_("Hide tab"), this, SLOT(closeCurrentTab()));
popup.addAction(QIcon(getPixmap("images/", "closetab", "png")),
        qt_("Close tab"), this, SLOT(closeCurrentBuffer()));

The action "Hide tab" is connected to "Close Tab" and the action "Close Tab" is 
connected to "Close Buffer"...

I'd think that it would be clearer to rename closeCurrentTab() to 
hideCurrentTab(). Then we can check in hideCurrentTab() whether we should save 
the buffer or not and then we call removeWorkArea().


Last, I don't like the name "saveIfDirty". First, this function is only called 
for dirty buffers and the function doesn't even check wether the buffer is 
dirty. Second, the name suggests that we save the buffer, buf that's dependent 
on the user. I'd call it something like 
"SaveDirtyBufferIfUserWantsToSaveTheDirtyBuffer" (or something shorter).


>rh

Vincent

Reply via email to