summaryrefslogtreecommitdiff
path: root/src/config/ConfigManager.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-07-30 22:54:29 +0200
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-07-30 22:54:29 +0200
commitd6a649c1b34d9972ce2ae3446bbfc0d520ffb843 (patch)
tree80ff0b4ecbd4e4b756de5f5cc2415e5d83598b24 /src/config/ConfigManager.cpp
parentf96b611651f5bbaf2b0401d44f4250f699b15be2 (diff)
added preferred to monitor cfg
Diffstat (limited to 'src/config/ConfigManager.cpp')
-rw-r--r--src/config/ConfigManager.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp
index 7fb2d267..88ed90e3 100644
--- a/src/config/ConfigManager.cpp
+++ b/src/config/ConfigManager.cpp
@@ -441,11 +441,15 @@ void CConfigManager::handleMonitor(const std::string& command, const std::string
return;
}
- newrule.resolution.x = stoi(curitem.substr(0, curitem.find_first_of('x')));
- newrule.resolution.y = stoi(curitem.substr(curitem.find_first_of('x') + 1, curitem.find_first_of('@')));
+ if (curitem.find("pref") == 0) {
+ newrule.resolution = Vector2D();
+ } else {
+ newrule.resolution.x = stoi(curitem.substr(0, curitem.find_first_of('x')));
+ newrule.resolution.y = stoi(curitem.substr(curitem.find_first_of('x') + 1, curitem.find_first_of('@')));
- if (curitem.contains("@"))
- newrule.refreshRate = stof(curitem.substr(curitem.find_first_of('@') + 1));
+ if (curitem.contains("@"))
+ newrule.refreshRate = stof(curitem.substr(curitem.find_first_of('@') + 1));
+ }
nextItem();