Incoming shared files can now be placed in device-dependent dirs.
This commit is contained in:
parent
e2e3785206
commit
6549da84be
3 changed files with 15 additions and 6 deletions
|
@ -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();
|
||||
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>411</width>
|
||||
<height>165</height>
|
||||
<width>569</width>
|
||||
<height>140</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
|
@ -47,6 +47,13 @@
|
|||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>%1 in the path will be replaced with the specific device name.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue