Date:2013-09-26 23:56:27 (6 months 24 days ago)
Author:Paul Cercueil
Commit:8452c037acc604668fad75a839d290dc4c26a9dd
Message:Remove calls to sync()

This is not a low-level tool to deal with the filesystem, using
sync() here is nonsense and just bogs down the system for nuts.
Files: src/gmenu2x.cpp (11 diffs)

Change Details

src/gmenu2x.cpp
424424            mb.setButton(InputManager::CANCEL, tr["No"]);
425425            if (mb.exec() == InputManager::ACCEPT) {
426426                unlink(logfile.c_str());
427                sync();
428427                menu->deleteSelectedLink();
429428            }
430429        }
...... 
503502            inf << curr->first << "=" << curr->second << endl;
504503
505504        inf.close();
506        sync();
507505    }
508506}
509507
...... 
540538        }
541539
542540        inf.close();
543        sync();
544541    }
545542}
546543
...... 
581578        if (!selectordir.empty())
582579            inf << "selectordir=" << selectordir << endl;
583580        inf.close();
584        sync();
585581    }
586582}
587583
...... 
865861
866862void GMenu2X::addLink() {
867863    FileDialog fd(this, ts, tr["Select an application"], "dge,sh,bin,py,elf,");
868    if (fd.exec()) {
864    if (fd.exec())
869865        menu->addLink(fd.getPath(), fd.getFile());
870        sync();
871    }
872866}
873867
874868void GMenu2X::editLink() {
...... 
958952            menu->linkChangeSection(menu->selLinkIndex(), menu->selSectionIndex(), newSectionIndex - menu->getSections().begin());
959953        }
960954        linkApp->save();
961        sync();
962955    }
963956}
964957
...... 
967960        MessageBox mb(this, tr.translate("Deleting $1",menu->selLink()->getTitle().c_str(),NULL)+"\n"+tr["Are you sure?"], menu->selLink()->getIconPath());
968961        mb.setButton(InputManager::ACCEPT, tr["Yes"]);
969962        mb.setButton(InputManager::CANCEL, tr["No"]);
970        if (mb.exec() == InputManager::ACCEPT) {
963        if (mb.exec() == InputManager::ACCEPT)
971964            menu->deleteSelectedLink();
972            sync();
973        }
974965    }
975966}
976967
...... 
981972        if (find(menu->getSections().begin(), menu->getSections().end(), id.getInput())
982973                == menu->getSections().end()) {
983974            //section directory doesn't exists
984            if (menu->addSection(id.getInput())) {
975            if (menu->addSection(id.getInput()))
985976                menu->setSectionIndex( menu->getSections().size()-1 ); //switch to the new section
986                sync();
987            }
988977        }
989978    }
990979}
...... 
10161005                    }
10171006                }
10181007                menu->renameSection(menu->selSectionIndex(), id.getInput());
1019                sync();
10201008            }
10211009        }
10221010    }
...... 
10281016    mb.setButton(InputManager::CANCEL, tr["No"]);
10291017    if (mb.exec() == InputManager::ACCEPT) {
10301018
1031        if (rmtree(getHome() + "/sections/" + menu->selSection())) {
1019        if (rmtree(getHome() + "/sections/" + menu->selSection()))
10321020            menu->deleteSelectedSection();
1033            sync();
1034        }
10351021    }
10361022}
10371023
...... 
10951081#ifdef ENABLE_CPUFREQ
10961082    setMenuClock();
10971083#endif
1098    sync();
10991084#endif
11001085
11011086    InputManager::Button button;

Archive Download the corresponding diff file



interactive