mirror of
https://github.com/scorpion-26/gBar.git
synced 2024-11-22 03:02:49 +00:00
Move WorkspaceSymbol parsing to other map configs
This commit is contained in:
parent
df46c58244
commit
d811b14767
1 changed files with 16 additions and 17 deletions
|
@ -195,23 +195,6 @@ void Config::Load()
|
||||||
AddConfigVar("DateTimeLocale", config.dateTimeLocale, lineView, foundProperty);
|
AddConfigVar("DateTimeLocale", config.dateTimeLocale, lineView, foundProperty);
|
||||||
AddConfigVar("CheckPackagesCommand", config.checkPackagesCommand, lineView, foundProperty);
|
AddConfigVar("CheckPackagesCommand", config.checkPackagesCommand, lineView, foundProperty);
|
||||||
|
|
||||||
// Legacy syntax
|
|
||||||
for (int i = 1; i < 10; i++)
|
|
||||||
{
|
|
||||||
// Subtract 1 to index from 1 to 9 rather than 0 to 8
|
|
||||||
std::string symbol;
|
|
||||||
bool hasFoundProperty = foundProperty;
|
|
||||||
AddConfigVar("WorkspaceSymbol-" + std::to_string(i), symbol, lineView, foundProperty);
|
|
||||||
if (foundProperty && !hasFoundProperty)
|
|
||||||
{
|
|
||||||
config.workspaceSymbols[i] = symbol;
|
|
||||||
LOG("Warning: Legacy notation for WorkspaceSymbol used.");
|
|
||||||
LOG(" Please consider switching to \"WorkspaceSymbol: [number], [symbol]!\"");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Modern map syntax
|
|
||||||
AddConfigVar("WorkspaceSymbol", config.workspaceSymbols, lineView, foundProperty);
|
|
||||||
|
|
||||||
AddConfigVar("CenterTime", config.centerTime, lineView, foundProperty);
|
AddConfigVar("CenterTime", config.centerTime, lineView, foundProperty);
|
||||||
AddConfigVar("AudioInput", config.audioInput, lineView, foundProperty);
|
AddConfigVar("AudioInput", config.audioInput, lineView, foundProperty);
|
||||||
AddConfigVar("AudioRevealer", config.audioRevealer, lineView, foundProperty);
|
AddConfigVar("AudioRevealer", config.audioRevealer, lineView, foundProperty);
|
||||||
|
@ -239,6 +222,22 @@ void Config::Load()
|
||||||
|
|
||||||
AddConfigVar("SNIIconSize", config.sniIconSizes, lineView, foundProperty);
|
AddConfigVar("SNIIconSize", config.sniIconSizes, lineView, foundProperty);
|
||||||
AddConfigVar("SNIPaddingTop", config.sniPaddingTop, lineView, foundProperty);
|
AddConfigVar("SNIPaddingTop", config.sniPaddingTop, lineView, foundProperty);
|
||||||
|
// Modern map syntax
|
||||||
|
AddConfigVar("WorkspaceSymbol", config.workspaceSymbols, lineView, foundProperty);
|
||||||
|
// Legacy syntax
|
||||||
|
for (int i = 1; i < 10; i++)
|
||||||
|
{
|
||||||
|
// Subtract 1 to index from 1 to 9 rather than 0 to 8
|
||||||
|
std::string symbol;
|
||||||
|
bool hasFoundProperty = foundProperty;
|
||||||
|
AddConfigVar("WorkspaceSymbol-" + std::to_string(i), symbol, lineView, foundProperty);
|
||||||
|
if (foundProperty && !hasFoundProperty)
|
||||||
|
{
|
||||||
|
config.workspaceSymbols[i] = symbol;
|
||||||
|
LOG("Warning: Legacy notation for WorkspaceSymbol used.");
|
||||||
|
LOG(" Please consider switching to \"WorkspaceSymbol: [number], [symbol]!\"");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (foundProperty == false)
|
if (foundProperty == false)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue