diff --git a/src/apps/deskflow-gui/Hotkey.cpp b/src/apps/deskflow-gui/Hotkey.cpp index 86954a173..e0eca537e 100644 --- a/src/apps/deskflow-gui/Hotkey.cpp +++ b/src/apps/deskflow-gui/Hotkey.cpp @@ -69,8 +69,19 @@ bool Hotkey::operator==(const Hotkey &hk) const QTextStream &operator<<(QTextStream &outStream, const Hotkey &hotkey) { - for (int i = 0; i < hotkey.actions().size(); i++) - outStream << "\t" << hotkey.text() << " = " << hotkey.actions()[i] << Qt::endl; + // Don't write a config if there is no actions + if (hotkey.actions().size() == 0) + return outStream; + + outStream << "\t" << hotkey.text() << " = "; + for (int i = 0; i < hotkey.actions().size(); i++) { + outStream << hotkey.actions()[i]; + if (i != hotkey.actions().size() - 1) { + outStream << ", "; + } + } + + outStream << "\n"; return outStream; }