View Single Post
Old 02-15-2023, 06:07 PM   #8
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,809
Karma: 6000000
Join Date: Nov 2009
Device: many
It should not crash Sigil. Sigil's plugin runner should make sure that at least one file remains at all times. The plugin runner code explicitly is supposed to detect and prevent that.

I will look at it.

The pluginrunner process can fail but nothing the plugin does should cause Sigil itself to actually crash in an unrecoverable way.

Update: The PluginRunner has a bug:
Code:
    // don't allow changes to proceed if they will remove the very last xhtml/html file
    if (m_xhtml_net_change < 0) {
        QList<Resource *> htmlresources = m_book->GetFolderKeeper()->GetResourceListByType(Resource::HTMLResourceType);
        if (htmlresources.count() + m_xhtml_net_change < 0) {
            Utility::DisplayStdErrorDialog(tr("Error: Plugin Tried to Remove the Last XHTML file .. aborting changes"));
            ui.statusLbl->setText(tr("Status: No Changes Made"));
            m_result = "failed";
            return;
        }
    }
The test should have been:
Code:
if (htmlresources.count() + m_xhtml_net_change <= 0) {
I will fix this in Sigil master.

Last edited by KevinH; 02-15-2023 at 06:26 PM.
KevinH is offline   Reply With Quote