Remove characters from UUID that aren't legal in URLs

This commit is contained in:
Albert Vaca 2018-08-01 11:10:14 +02:00
parent 316387ad00
commit 76ea0dd12d
3 changed files with 7 additions and 3 deletions

View file

@ -22,8 +22,10 @@
#define KDECONNECT_DBUSHELPER_H #define KDECONNECT_DBUSHELPER_H
#include <QString> #include <QString>
#include "kdeconnectcore_export.h"
namespace DbusHelper { namespace DbusHelper {
void filterNonExportableCharacters(QString& s); void KDECONNECTCORE_EXPORT filterNonExportableCharacters(QString& s);
} }
#endif #endif

View file

@ -15,6 +15,7 @@ set( kdeconnect_runcommand_config_SRCS runcommand_config.cpp )
add_library(kdeconnect_runcommand_config MODULE ${kdeconnect_runcommand_config_SRCS} ) add_library(kdeconnect_runcommand_config MODULE ${kdeconnect_runcommand_config_SRCS} )
target_link_libraries( kdeconnect_runcommand_config target_link_libraries( kdeconnect_runcommand_config
kdeconnectcore
kdeconnectpluginkcm kdeconnectpluginkcm
KF5::I18n KF5::I18n
KF5::CoreAddons KF5::CoreAddons

View file

@ -20,7 +20,6 @@
#include "runcommand_config.h" #include "runcommand_config.h"
#include <QStandardPaths>
#include <QTableView> #include <QTableView>
#include <QHBoxLayout> #include <QHBoxLayout>
#include <QHeaderView> #include <QHeaderView>
@ -32,9 +31,10 @@
#include <QJsonDocument> #include <QJsonDocument>
#include <KLocalizedString> #include <KLocalizedString>
#include <KPluginFactory> #include <KPluginFactory>
#include <core/dbushelper.h>
K_PLUGIN_FACTORY(ShareConfigFactory, registerPlugin<RunCommandConfig>();) K_PLUGIN_FACTORY(ShareConfigFactory, registerPlugin<RunCommandConfig>();)
@ -132,6 +132,7 @@ void RunCommandConfig::save()
if (key.isEmpty()) { if (key.isEmpty()) {
key = QUuid::createUuid().toString(); key = QUuid::createUuid().toString();
DbusHelper::filterNonExportableCharacters(key);
} }
QJsonObject entry; QJsonObject entry;
entry[QStringLiteral("name")] = name; entry[QStringLiteral("name")] = name;