Version: (using KDE 3.4.0 Level "a" , SUSE 9.2 UNSUPPORTED) Compiler: gcc version 3.3.4 (pre 3.3.5 20040809) OS: Linux (i686) release 2.6.8-24.11-default How to reproduce: - create a "network share" via remote:/ protocol. - Try to rename this via F2 or properties dialog. This does not work - plus, KDE tells me "Creating symlinks is not supported with protocol remote", which is a bit confusing. Please disable the properties dialog for network folders if those operations are not (yet) possible. Thank you! Jens
CVS commit by ervin: We now allow to rename a Network Folder. I simply forgot to do it earlier. :-) BUGS:100607 M +17 -0 kio_remote.cpp 1.8 M +1 -0 kio_remote.h 1.6 M +29 -0 remoteimpl.cpp 1.4 M +2 -0 remoteimpl.h 1.3 --- kdebase/kioslave/remote/kio_remote.cpp #1.7:1.8 @@ -193,3 +193,20 @@ void RemoteProtocol::get(const KURL &url } +void RemoteProtocol::rename(const KURL &src, const KURL &dest, + bool overwrite) +{ + if (src.protocol()!="remote" || dest.protocol()!="remote" + || m_impl.isWizardURL(src) || m_impl.isWizardURL(dest)) + { + error(KIO::ERR_UNSUPPORTED_ACTION, src.prettyURL()); + return; + } + if (m_impl.renameFolders(src.fileName(), dest.fileName(), overwrite)) + { + finished(); + return; + } + + error(KIO::ERR_CANNOT_RENAME, src.prettyURL()); +} --- kdebase/kioslave/remote/kio_remote.h #1.5:1.6 @@ -35,4 +35,5 @@ public: virtual void del(const KURL &url, bool isFile); virtual void get(const KURL &url); + virtual void rename(const KURL &src, const KURL &dest, bool overwrite); private: --- kdebase/kioslave/remote/remoteimpl.cpp #1.3:1.4 @@ -270,2 +270,31 @@ bool RemoteImpl::deleteNetworkFolder(con } +bool RemoteImpl::renameFolders(const QString &src, const QString &dest, + bool overwrite) const +{ + kdDebug() << "RemoteImpl::renameFolders: " + << src << ", " << dest << endl; + + QString directory; + if (findDirectory(src+".desktop", directory)) + { + if (!overwrite && QFile::exists(directory+dest+".desktop")) + { + return false; + } + + kdDebug() << "Renaming " << directory << src << ".desktop"<< endl; + QDir dir(directory); + bool res = dir.rename(src+".desktop", dest+".desktop"); + if (res) + { + KDesktopFile desktop(directory+dest+".desktop"); + desktop.writeEntry("Name", dest); + } + return res; + } + + return false; +} + + --- kdebase/kioslave/remote/remoteimpl.h #1.2:1.3 @@ -43,4 +43,6 @@ public: bool deleteNetworkFolder(const QString &filename) const; + bool renameFolders(const QString &src, const QString &dest, + bool overwrite) const; private:
Great (and fast)! Thank you! :-D
The rename functionality has been added with F2, but there is no rename option in the right-click menu, as reported here: https://launchpad.net/distros/ubuntu/+source/kubuntu-meta/+bug/35580