Incoming shared files can now be placed in device-dependent dirs.

This commit is contained in:
Albert Vaca 2014-06-06 00:02:27 +02:00
parent e2e3785206
commit 6549da84be
3 changed files with 15 additions and 6 deletions

View file

@ -70,7 +70,7 @@ void ShareConfig::load()
void ShareConfig::save() 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(); KCModule::save();

View file

@ -9,8 +9,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>411</width> <width>569</width>
<height>165</height> <height>140</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -47,6 +47,13 @@
</item> </item>
</layout> </layout>
</item> </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> </layout>
</widget> </widget>
</item> </item>

View file

@ -52,11 +52,13 @@ KUrl SharePlugin::destinationDir() const
KUrl dir = config->group("receive").readEntry("path", KGlobalSettings::downloadPath()); KUrl dir = config->group("receive").readEntry("path", KGlobalSettings::downloadPath());
dir.adjustPath(KUrl::AddTrailingSlash); 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) bool SharePlugin::receivePackage(const NetworkPackage& np)