diff --git a/kded/plugins/share/share_config.cpp b/kded/plugins/share/share_config.cpp index 55d2f511f..d04bf0788 100644 --- a/kded/plugins/share/share_config.cpp +++ b/kded/plugins/share/share_config.cpp @@ -70,7 +70,7 @@ void ShareConfig::load() void ShareConfig::save() { - m_cfg->group("receive").writeEntry("path", m_ui->kurlrequester->url()); + m_cfg->group("receive").writeEntry("path", m_ui->kurlrequester->text()); KCModule::save(); diff --git a/kded/plugins/share/share_config.ui b/kded/plugins/share/share_config.ui index 5f355e44c..d6f618fb7 100644 --- a/kded/plugins/share/share_config.ui +++ b/kded/plugins/share/share_config.ui @@ -9,8 +9,8 @@ 0 0 - 411 - 165 + 569 + 140 @@ -47,6 +47,13 @@ + + + + %1 in the path will be replaced with the specific device name. + + + diff --git a/kded/plugins/share/shareplugin.cpp b/kded/plugins/share/shareplugin.cpp index 00ccac937..5520a39f0 100644 --- a/kded/plugins/share/shareplugin.cpp +++ b/kded/plugins/share/shareplugin.cpp @@ -52,11 +52,13 @@ KUrl SharePlugin::destinationDir() const KUrl dir = config->group("receive").readEntry("path", KGlobalSettings::downloadPath()); dir.adjustPath(KUrl::AddTrailingSlash); - QDir().mkpath(dir.toLocalFile()); + QString url = dir.toLocalFile(); + if (url.contains("%1")) url = url.arg(device()->name()); - kDebug(kdeconnect_kded()) << dir; + kDebug(kdeconnect_kded()) << url; + QDir().mkpath(url); - return dir; + return url; } bool SharePlugin::receivePackage(const NetworkPackage& np)