Files
chatterino2/src/controllers/hotkeys/HotkeyHelpers.cpp
Mm2PL 703f3717e2 Add custom hotkeys. (#2340)
Co-authored-by: LosFarmosCTL <80157503+LosFarmosCTL@users.noreply.github.com>
Co-authored-by: Paweł <zneix@zneix.eu>
Co-authored-by: Felanbird <41973452+Felanbird@users.noreply.github.com>
Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
2021-11-21 17:46:21 +00:00

31 lines
686 B
C++

#include "controllers/hotkeys/HotkeyHelpers.hpp"
#include <QStringList>
namespace chatterino {
std::vector<QString> parseHotkeyArguments(QString argumentString)
{
std::vector<QString> arguments;
argumentString = argumentString.trimmed();
if (argumentString.isEmpty())
{
// argumentString is empty, early out to ensure we don't end up with a vector with one empty element
return arguments;
}
auto argList = argumentString.split("\n");
// convert the QStringList to our preferred std::vector
for (const auto &arg : argList)
{
arguments.push_back(arg.trimmed());
}
return arguments;
}
} // namespace chatterino