Change Details
src/menu.cpp |
458 | 458 | #endif |
459 | 459 | } |
460 | 460 | |
461 | | void Menu::openPackage(std::string path) |
| 461 | void Menu::openPackage(std::string path, bool order) |
462 | 462 | { |
463 | 463 | /* First try to remove existing links of the same OPK |
464 | 464 | * (needed for instance when an OPK is modified) */ |
... | ... | |
516 | 516 | } |
517 | 517 | |
518 | 518 | opk_close(opk); |
519 | | orderLinks(); |
| 519 | |
| 520 | if (order) |
| 521 | orderLinks(); |
520 | 522 | } |
521 | 523 | |
522 | 524 | void Menu::readPackages(std::string parentDir) |
... | ... | |
548 | 550 | continue; |
549 | 551 | } |
550 | 552 | |
551 | | openPackage(parentDir + '/' + dptr->d_name); |
| 553 | openPackage(parentDir + '/' + dptr->d_name, false); |
552 | 554 | } |
553 | 555 | |
554 | 556 | closedir(dirp); |
| 557 | orderLinks(); |
555 | 558 | } |
556 | 559 | |
557 | 560 | #ifdef ENABLE_INOTIFY |
... | ... | |
608 | 611 | { |
609 | 612 | for (std::vector< std::vector<Link *> >::iterator section = links.begin(); |
610 | 613 | section < links.end(); section++) |
611 | | std::sort(section->begin(), section->end(), compare_links); |
| 614 | if (section->size() > 1) |
| 615 | std::sort(section->begin(), section->end(), compare_links); |
612 | 616 | } |
613 | 617 | |
614 | 618 | void Menu::readLinks() { |
src/menu.h |
67 | 67 | ~Menu(); |
68 | 68 | |
69 | 69 | #ifdef HAVE_LIBOPK |
70 | | void openPackage(std::string path); |
| 70 | void openPackage(std::string path, bool order = true); |
71 | 71 | void openPackagesFromDir(std::string path); |
72 | 72 | #ifdef ENABLE_INOTIFY |
73 | 73 | void removePackageLink(std::string path); |
Download the corresponding diff file