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>
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user