Date:2011-09-18 13:22:02 (12 years 6 months ago)
Author:Paul Cercueil
Commit:3995133fa5afa194220dd0be7d788e8c97bdbcee
Message:When deleting a link, check if the icon is used elsewhere before unloading it.

Files: src/menu.cpp (1 diff)

Change Details

src/menu.cpp
312312    return false;
313313}
314314
315void Menu::deleteSelectedLink() {
315void Menu::deleteSelectedLink()
316{
317    bool icon_used = false;
318    string iconpath = selLink()->getIconPath();
319
316320    INFO("Deleting link '%s'\n", selLink()->getTitle().c_str());
317321
318322    if (selLinkApp()!=NULL)
319323        unlink(selLinkApp()->getFile().c_str());
320    gmenu2x->sc.del(selLink()->getIconPath());
321324    sectionLinks()->erase( sectionLinks()->begin() + selLinkIndex() );
322325    setLinkIndex(selLinkIndex());
326
327    for (vector<linklist>::iterator section = links.begin();
328                !icon_used && section<links.end(); section++)
329        for (linklist::iterator link = section->begin();
330                    !icon_used && link<section->end(); link++)
331            icon_used = !iconpath.compare((*link)->getIconPath());
332
333    if (!icon_used)
334      gmenu2x->sc.del(iconpath);
323335}
324336
325337void Menu::deleteSelectedSection() {

Archive Download the corresponding diff file



interactive