703f3717e2
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>
31 lines
686 B
C++
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
|