addToFavourites: catch exception when saving entry
This commit is contained in:
parent
47c0358a25
commit
84cf8837bd
10
window.cpp
10
window.cpp
@ -135,7 +135,15 @@ void Window::addToFavourites(const EntryPushButton &button)
|
|||||||
QFileInfo fi{button.getEntryConfig().entryPath};
|
QFileInfo fi{button.getEntryConfig().entryPath};
|
||||||
QString entryName = fi.completeBaseName() + ".qsrun";
|
QString entryName = fi.completeBaseName() + ".qsrun";
|
||||||
userConfig.entryPath = this->settingsProvider->userEntriesPaths()[0] + "/" + entryName;
|
userConfig.entryPath = this->settingsProvider->userEntriesPaths()[0] + "/" + entryName;
|
||||||
entryProvider->saveUserEntry(userConfig);
|
try
|
||||||
|
{
|
||||||
|
entryProvider->saveUserEntry(userConfig);
|
||||||
|
}
|
||||||
|
catch(std::exception &e)
|
||||||
|
{
|
||||||
|
QMessageBox::critical(this, "Failed to save item to favourites", e.what());
|
||||||
|
return;
|
||||||
|
}
|
||||||
userEntryButtons.append(createEntryButton(userConfig));
|
userEntryButtons.append(createEntryButton(userConfig));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user