--- fpicker/source/unx/kde/kdefilepicker.cxx	2006-01-27 17:46:57.000000000 +0100
+++ fpicker/source/unx/kde/kdefilepicker.cxx	2006-01-27 19:29:05.000000000 +0100
@@ -76,6 +76,7 @@
 #define emit
 #endif
 
+#include <kdeversion.h>
 #include <kdiroperator.h>
 #include <kfiledialog.h>
 #include <kfilefiltercombo.h>
@@ -343,8 +344,13 @@ void FileDialog::customEvent( QCustomEve
                         setCanNotifySelection( true );
                         exec();
 
-                        qSelectedURL = addExtension( selectedURL().url() );
-                        QString qProtocol( selectedURL().protocol() );
+#if KDE_IS_VERSION(3,5,0)
+                        KURL qLocalSelectedURL = KIO::NetAccess::mostLocalURL( selectedURL(), this );
+#else
+                        KURL qLocalSelectedURL( selectedURL() );
+#endif
+                        qSelectedURL = addExtension( qLocalSelectedURL.url() );
+                        QString qProtocol( qLocalSelectedURL.protocol() );
 
                         if ( isSave() && result() == QDialog::Accepted )
                         {
@@ -632,6 +638,12 @@ bool FileDialog::isSupportedProtocol( co
 
 QString FileDialog::localCopy( const QString &rFileName ) const
 {
+#if KDE_IS_VERSION(3,5,0)
+    KURL qLocalURL = KIO::NetAccess::mostLocalURL( KURL( rFileName ), const_cast<FileDialog*>( this ) );
+    if ( qLocalURL.isLocalFile() )
+        return qLocalURL.url();
+#endif
+
     int nExtensionPos = rFileName.findRev( '/' );
     if ( nExtensionPos >= 0 )
         nExtensionPos = rFileName.find( '.', nExtensionPos );
