addToFavourites: only save the minimum
This commit is contained in:
parent
7c2461626d
commit
2d79d74e06
@ -127,7 +127,7 @@ void Window::executeConfig(const EntryConfig &config)
|
|||||||
void Window::addToFavourites(const EntryConfig &config)
|
void Window::addToFavourites(const EntryConfig &config)
|
||||||
{
|
{
|
||||||
std::pair<int, int> cell = getNextFreeCell();
|
std::pair<int, int> cell = getNextFreeCell();
|
||||||
EntryConfig userConfig = config;
|
EntryConfig userConfig;
|
||||||
userConfig.userEntry = true;
|
userConfig.userEntry = true;
|
||||||
userConfig.row = cell.first;
|
userConfig.row = cell.first;
|
||||||
userConfig.col = cell.second;
|
userConfig.col = cell.second;
|
||||||
@ -144,6 +144,10 @@ void Window::addToFavourites(const EntryConfig &config)
|
|||||||
QMessageBox::critical(this, "Failed to save item to favourites", e.what());
|
QMessageBox::critical(this, "Failed to save item to favourites", e.what());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
/*we only want to save a minimal, inherited config. but it should be a "complete" button
|
||||||
|
when we add it to the favourites. the alternative would be to reload the whole config,
|
||||||
|
but that's probably overkill. */
|
||||||
|
userConfig.update(config);
|
||||||
userEntryButtons.append(createEntryButton(userConfig));
|
userEntryButtons.append(createEntryButton(userConfig));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user