<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>118008</bug_id>
          
          <creation_ts>2005-12-09 14:44:14 +0000</creation_ts>
          <short_desc>using system:/media, folder icons cannot be customized</short_desc>
          <delta_ts>2006-09-23 19:08:04 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>10</classification_id>
          <classification>Unmaintained</classification>
          <product>kio</product>
          <component>kfile</component>
          <version>unspecified</version>
          <rep_platform>Slackware</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Esaltato">esaltato</reporter>
          <assigned_to name="Carsten Pfeiffer">pfeiffer</assigned_to>
          <cc>cyberquiet</cc>
    
    <cc>faure</cc>
    
    <cc>jens-bugs.kde.org</cc>
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>40</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>396988</commentid>
    <comment_count>0</comment_count>
    <who name="Esaltato">esaltato</who>
    <bug_when>2005-12-09 14:44:14 +0000</bug_when>
    <thetext>Version:            (using KDE KDE 3.5.0)
Installed from:    Slackware Packages
OS:                Linux

When browsing drives (any fs) using the new system:/media kio slave and choosing a new icon for the folder, changes are not applied. FS are read/write.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>405023</commentid>
    <comment_count>1</comment_count>
    <who name="Tommi Tervo">tommi.tervo</who>
    <bug_when>2006-01-10 16:13:58 +0000</bug_when>
    <thetext>*** Bug 119859 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>451505</commentid>
    <comment_count>2</comment_count>
    <who name="cyberquiet">cyberquiet</who>
    <bug_when>2006-07-04 12:19:32 +0000</bug_when>
    <thetext>I confirm this bug, whenever I open a media device in system:/media, icon size is reset to the default, which in my system consist of &quot;enormous icons&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>472178</commentid>
    <comment_count>3</comment_count>
    <who name="Stephan Kulow">coolo</who>
    <bug_when>2006-09-23 15:47:57 +0000</bug_when>
    <thetext>bug in the propertiesdialog (it tests for isLocalFile())</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>472241</commentid>
    <comment_count>4</comment_count>
    <who name="David Faure">faure</who>
    <bug_when>2006-09-23 19:07:59 +0000</bug_when>
    <thetext>SVN commit 587693 by dfaure:

More use of &quot;mostLocalURL&quot; to be able to edit icons and names with the properties dialog when using system:/ urls.
BUG: 118008, 95645


 M  +31 -27    kpropertiesdialog.cpp  


--- branches/KDE/3.5/kdelibs/kio/kfile/kpropertiesdialog.cpp #587692:587693
@@ -620,14 +620,16 @@
 bool KPropsDlgPlugin::isDesktopFile( KFileItem * _item )
 {
   // only local files
-  if ( !_item-&gt;isLocalFile() )
+  bool isLocal;
+  KURL url = _item-&gt;mostLocalURL( isLocal );
+  if ( !isLocal )
     return false;
 
   // only regular files
   if ( !S_ISREG( _item-&gt;mode() ) )
     return false;
 
-  QString t( _item-&gt;url().path() );
+  QString t( url.path() );
 
   // only if readable
   FILE *f = fopen( QFile::encodeName(t), &quot;r&quot; );
@@ -701,13 +703,16 @@
 
   // We set this data from the first item, and we&apos;ll
   // check that the other items match against it, resetting when not.
-  bool isLocal = properties-&gt;kurl().isLocalFile();
+  bool isLocal;
   KFileItem * item = properties-&gt;item();
+  KURL url = item-&gt;mostLocalURL( isLocal );
+  bool isReallyLocal = item-&gt;url().isLocalFile();
   bool bDesktopFile = isDesktopFile(item);
+  kdDebug() &lt;&lt; &quot;url=&quot; &lt;&lt; url &lt;&lt; &quot; bDesktopFile=&quot; &lt;&lt; bDesktopFile &lt;&lt; &quot; isLocal=&quot; &lt;&lt; isLocal &lt;&lt; &quot; isReallyLocal=&quot; &lt;&lt; isReallyLocal &lt;&lt; endl;
   mode_t mode = item-&gt;mode();
   bool hasDirs = item-&gt;isDir() &amp;&amp; !item-&gt;isLink();
-  bool hasRoot = properties-&gt;kurl().path() == QString::fromLatin1(&quot;/&quot;);
-  QString iconStr = KMimeType::iconForURL(properties-&gt;kurl(), mode);
+  bool hasRoot = url.path() == QString::fromLatin1(&quot;/&quot;);
+  QString iconStr = KMimeType::iconForURL(url, mode);
   QString directory = properties-&gt;kurl().directory();
   QString protocol = properties-&gt;kurl().protocol();
   QString mimeComment = item-&gt;mimeComment();
@@ -716,7 +721,7 @@
   KIO::filesize_t totalSize = item-&gt;size(hasTotalSize);
   QString magicMimeComment;
   if ( isLocal ) {
-      KMimeType::Ptr magicMimeType = KMimeType::findByFileContent( properties-&gt;kurl().path() );
+      KMimeType::Ptr magicMimeType = KMimeType::findByFileContent( url.path() );
       if ( magicMimeType-&gt;name() != KMimeType::defaultMimeType() )
           magicMimeComment = magicMimeType-&gt;comment();
   }
@@ -751,7 +756,7 @@
       if ( properties-&gt;kurl().protocol().find(&quot;device&quot;, 0, false)==0)
             isDevice = true;
       // Extract the full name, but without file: for local files
-      if ( isLocal )
+      if ( isReallyLocal )
         path = properties-&gt;kurl().path();
       else
         path = properties-&gt;kurl().prettyURL();
@@ -769,10 +774,7 @@
     // Extract the file name only
     filename = properties-&gt;defaultName();
     if ( filename.isEmpty() ) { // no template
-        if ( isTrash || isDevice || hasRoot ) // the cases where the filename won&apos;t be renameable
-            filename = item-&gt;name(); // this gives support for UDS_NAME, e.g. for kio_trash
-        else
-            filename = properties-&gt;kurl().fileName();
+      filename = item-&gt;name(); // this gives support for UDS_NAME, e.g. for kio_trash or kio_system
     } else {
       m_bFromTemplate = true;
       setDirty(); // to enforce that the copy happens
@@ -783,7 +785,7 @@
     filename = nameFromFileName( filename );
 
     if ( d-&gt;bKDesktopMode &amp;&amp; d-&gt;bDesktopFile ) {
-        KDesktopFile config( properties-&gt;kurl().path(), true /* readonly */ );
+        KDesktopFile config( url.path(), true /* readonly */ );
         if ( config.hasKey( &quot;Name&quot; ) ) {
             filename = config.readName();
         }
@@ -839,7 +841,7 @@
     }
   }
 
-  if (!isLocal &amp;&amp; !protocol.isEmpty())
+  if (!isReallyLocal &amp;&amp; !protocol.isEmpty())
   {
     directory += &apos; &apos;;
     directory += &apos;(&apos;;
@@ -856,12 +858,10 @@
     iconButton-&gt;setStrictIconSize(false);
     // This works for everything except Device icons on unmounted devices
     // So we have to really open .desktop files
-    QString iconStr = KMimeType::findByURL( properties-&gt;kurl(),
-                                            mode )-&gt;icon( properties-&gt;kurl(),
-                                                          isLocal );
+    QString iconStr = KMimeType::findByURL( url, mode )-&gt;icon( url, isLocal );
     if ( bDesktopFile &amp;&amp; isLocal )
     {
-      KDesktopFile config( properties-&gt;kurl().path(), true );
+      KDesktopFile config( url.path(), true );
       config.setDesktopGroup();
       iconStr = config.readEntry( &quot;Icon&quot; );
       if ( config.hasDeviceType() )
@@ -987,7 +987,7 @@
     if(hasTotalSize) {
       m_sizeLabel-&gt;setText(KIO::convertSizeWithBytes(totalSize));
     }
-    
+
     m_sizeDetermineButton = 0L;
     m_sizeStopButton = 0L;
   }
@@ -1067,7 +1067,7 @@
     grid-&gt;addMultiCellWidget(sep, curRow, curRow, 0, 2);
     ++curRow;
 
-    QString mountPoint = KIO::findPathMountPoint( properties-&gt;item()-&gt;url().path() );
+    QString mountPoint = KIO::findPathMountPoint( url.path() );
 
     if (mountPoint != &quot;/&quot;)
     {
@@ -1404,23 +1404,27 @@
 
 void KFilePropsPlugin::applyIconChanges()
 {
-  // handle icon changes - only local files for now
+  KIconButton *iconButton = ::qt_cast&lt;KIconButton *&gt;( iconArea );
+  if ( !iconButton )
+    return;
+  // handle icon changes - only local files (or pseudo-local) for now
   // TODO: Use KTempFile and KIO::file_copy with overwrite = true
-  if (iconArea-&gt;isA(&quot;KIconButton&quot;) &amp;&amp; properties-&gt;kurl().isLocalFile()) {
-    KIconButton *iconButton = (KIconButton *) iconArea;
+  KURL url = properties-&gt;kurl();
+  url = KIO::NetAccess::mostLocalURL( url, properties );
+  if (url.isLocalFile()) {
     QString path;
 
     if (S_ISDIR(properties-&gt;item()-&gt;mode()))
     {
-      path = properties-&gt;kurl().path(1) + QString::fromLatin1(&quot;.directory&quot;);
+      path = url.path(1) + QString::fromLatin1(&quot;.directory&quot;);
       // don&apos;t call updateUrl because the other tabs (i.e. permissions)
       // apply to the directory, not the .directory file.
     }
     else
-      path = properties-&gt;kurl().path();
+      path = url.path();
 
     // Get the default image
-    QString str = KMimeType::findByURL( properties-&gt;kurl(),
+    QString str = KMimeType::findByURL( url,
                                         properties-&gt;item()-&gt;mode(),
                                         true )-&gt;KServiceType::icon();
     // Is it another one than the default ?
@@ -2297,7 +2301,7 @@
     break;
   case PermissionsOnlyDirs:
     enableAccessControls(d-&gt;canChangePermissions &amp;&amp; !d-&gt;isIrregular &amp;&amp; !d-&gt;hasExtendedACL);
-    // if this is a dir, and we can change permissions, don&apos;t dis-allow 
+    // if this is a dir, and we can change permissions, don&apos;t dis-allow
     // recursive, we can do that for ACL setting.
     if ( d-&gt;cbRecursive )
        d-&gt;cbRecursive-&gt;setEnabled( d-&gt;canChangePermissions &amp;&amp; !d-&gt;isIrregular );
@@ -2468,7 +2472,7 @@
   const bool ACLChange = ( d-&gt;extendedACL !=  properties-&gt;item()-&gt;ACL() );
   const bool defaultACLChange = ( d-&gt;defaultACL != properties-&gt;item()-&gt;defaultACL() );
 
-  if ( owner.isEmpty() &amp;&amp; group.isEmpty() &amp;&amp; !recursive 
+  if ( owner.isEmpty() &amp;&amp; group.isEmpty() &amp;&amp; !recursive
       &amp;&amp; !permissionChange &amp;&amp; !ACLChange &amp;&amp; !defaultACLChange )
     return;
 
</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>