diff options
author | Simon Rettberg | 2020-03-09 16:24:04 +0100 |
---|---|---|
committer | Simon Rettberg | 2020-03-09 16:24:04 +0100 |
commit | 3d61c8adba6bab9f2d076a4338bf36c0407dbeb9 (patch) | |
tree | cfd8ba3f4e3327c02e392a4c5977d6524783f425 /src/xx.cpp | |
parent | Fix --mapping parsing (diff) | |
download | beamergui-3d61c8adba6bab9f2d076a4338bf36c0407dbeb9.tar.gz beamergui-3d61c8adba6bab9f2d076a4338bf36c0407dbeb9.tar.xz beamergui-3d61c8adba6bab9f2d076a4338bf36c0407dbeb9.zip |
Sort output list alphabetically when assigning resolutions
Diffstat (limited to 'src/xx.cpp')
-rw-r--r-- | src/xx.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -339,12 +339,18 @@ ConfigBackup ScreenSetup::setResolutionsFromString(const QString &resolutions, c } } auto outputListStr = mapping.split(QRegularExpression(QLatin1String("\\s+")), QString::SkipEmptyParts); + qDebug() << mapping << ">" << outputListStr; if (outputListStr.isEmpty()) { - int i = 0; + QList<QString> sorted; for (auto *o : a->_outputMap) { + sorted.append(o->outputName); + } + qSort(sorted); + int i = 0; + for (auto o : sorted) { int index = i % config.size(); auto x = config.at(index).second; - x.append(o->outputName); + x.append(o); config.replace(index, qMakePair(config.at(index).first, x)); qDebug() << "Resolution" << config.at(index).first << "is now" << config.at(index).second; ++i; |