mirror of
https://github.com/Poikilos/b3view.git
synced 2023-10-03 07:58:48 -07:00
Fix duplicate menu items by respecting the addToEngine bool.
resolves #6
This commit is contained in:
parent
29f52a1ad1
commit
3e6f8324eb
@ -343,6 +343,7 @@ Engine::Engine()
|
||||
this->m_EnableTestAndExit = false;
|
||||
settings.set_int("max_recent", 10);
|
||||
std::string profile = std::getenv("HOME");
|
||||
// ^ changes to USERPROFILE below if blank
|
||||
std::string appdataParent;
|
||||
std::string appdatas;
|
||||
std::string myAppData;
|
||||
|
@ -35,6 +35,9 @@ const u32 UserInterface::UIC_FILE_RECENT_FIRST = UIE_RECENTMENU + 1;
|
||||
// PRIVATE
|
||||
void UserInterface::setupUserInterface()
|
||||
{
|
||||
this->recent_initialized = false;
|
||||
this->recentMenu = nullptr;
|
||||
|
||||
// Menu
|
||||
menu = m_Gui->addMenu();
|
||||
menu->addItem(L"File", UIE_FILEMENU, true, true);
|
||||
@ -893,7 +896,9 @@ void UserInterface::addRecentMenuItem(std::string path, bool addToEngine)
|
||||
}
|
||||
this->m_file_recent_last_idx = menu->getID();
|
||||
*/
|
||||
this->m_Engine->addRecent(path);
|
||||
if (addToEngine) {
|
||||
this->m_Engine->addRecent(path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user