Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/owncloud/client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Müller <fmueller@owncloud.com>2022-05-19 19:10:23 +0300
committerHannah von Reth <vonreth@kde.org>2022-05-20 14:46:45 +0300
commit91f69458693220eeb2edd3ca6cfbbc53cc2d2b40 (patch)
treeb9416c7173f126edf64fbfe34f59d925b25629f8 /src/gui/libcloudproviders
parentfe7105baa296ec40e24e67cba9693e2e6cfdb27b (diff)
Fix object path passed to DBus by libcloudproviders
Diffstat (limited to 'src/gui/libcloudproviders')
-rw-r--r--src/gui/libcloudproviders/libcloudproviders.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/gui/libcloudproviders/libcloudproviders.cpp b/src/gui/libcloudproviders/libcloudproviders.cpp
index d9a2e46ce..af5ea016c 100644
--- a/src/gui/libcloudproviders/libcloudproviders.cpp
+++ b/src/gui/libcloudproviders/libcloudproviders.cpp
@@ -126,7 +126,15 @@ void LibCloudProvidersPrivate::exportFolder(Folder *folder)
g_error_free(error);
}
- auto exporter = cloud_providers_account_exporter_new(_exporter, folder->id().constData());
+ // DBus object paths must not contain characters other than [A-Z][a-z][0-9]_, see g_variant_is_object_path
+ const QByteArray dBusCompatibleFolderId = [folder]() {
+ // replace works inplace
+ auto rv = folder->id();
+ rv.replace("-", "");
+ return rv;
+ }();
+
+ auto exporter = cloud_providers_account_exporter_new(_exporter, dBusCompatibleFolderId.constData());
cloud_providers_account_exporter_set_path(exporter, folder->path().toUtf8().constData());
cloud_providers_account_exporter_set_icon(exporter, icon);
cloud_providers_account_exporter_set_status(exporter, CLOUD_PROVIDERS_ACCOUNT_STATUS_IDLE);