window: addToFavourites(): Save non-system entries in their originating path

这个提交包含在:
Albert S. 2020-10-04 19:46:35 +02:00
父节点 79d15fb628
当前提交 101885ffe4
共有 1 个文件被更改,包括 10 次插入1 次删除

查看文件

@ -134,7 +134,16 @@ void Window::addToFavourites(const EntryConfig &config)
userConfig.inherit = config.entryPath;
QFileInfo fi{config.entryPath};
QString entryName = fi.completeBaseName() + ".qsrun";
userConfig.entryPath = this->settingsProvider->userEntriesPaths()[0] + "/" + entryName;
QString entryPath;
if(config.type == EntryType::SYSTEM)
{
entryPath = this->settingsProvider->userEntriesPaths()[0] + "/" + entryName;
}
else
{
entryPath = fi.absoluteDir().absoluteFilePath(entryName);
}
userConfig.entryPath = entryPath;
try
{
entryProvider->saveUserEntry(userConfig);