EnrtyConfig: store iconPath, not QIcon. Keeps icon after rearranging entries

This commit is contained in:
2020-09-27 17:00:28 +02:00
förälder 9daaba2543
incheckning 7bae1183c6
5 ändrade filer med 32 tillägg och 15 borttagningar

Visa fil

@ -56,7 +56,7 @@ EntryConfig EntryProvider::readFromDesktopFile(const QString &path)
}
if(key == "icon")
{
result.icon = QIcon::fromTheme(args);
result.iconPath = args;
}
if(key == "exec")
{
@ -159,7 +159,7 @@ EntryConfig EntryProvider::readqsrunFile(const QString &path)
}
if(key == "icon")
{
result.icon = QIcon(splitted[1]);
result.iconPath = splitted[1];
}
if(key == "row")
{
@ -277,9 +277,9 @@ void EntryProvider::saveUserEntry(const EntryConfig &config)
{
outStream << "command" << " " << config.command << endl;
}
if(!config.icon.isNull())
if(!config.iconPath.isEmpty())
{
outStream << "icon" << " " << config.icon.name() << endl;
outStream << "icon" << " " << config.iconPath << endl;
}
outStream << "row" << " " << config.row << endl;
outStream << "col" << " " << config.col << endl;
@ -308,9 +308,9 @@ EntryConfig &EntryConfig::update(const EntryConfig &o)
assignIfDestDefault(this->arguments, o.arguments);
assignIfDestDefault(this->col, o.col);
assignIfDestDefault(this->command, o.command);
if(this->icon.isNull())
if(this->iconPath.isEmpty())
{
this->icon = o.icon;
this->iconPath = o.iconPath;
}
assignIfDestDefault(this->key, o.key);
assignIfDestDefault(this->name, o.name);