<?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>111760</bug_id>
          
          <creation_ts>2005-08-30 12:54:25 +0000</creation_ts>
          <short_desc>colon in filenames causes problems</short_desc>
          <delta_ts>2007-05-29 21:11:46 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>10</classification_id>
          <classification>Unmaintained</classification>
          <product>kuickshow</product>
          <component>general</component>
          <version>0.8.7</version>
          <rep_platform>unspecified</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="Walter Hofmann">kdebugs-050220211414-96ad</reporter>
          <assigned_to name="Carsten Pfeiffer">pfeiffer</assigned_to>
          
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>369765</commentid>
    <comment_count>0</comment_count>
    <who name="Walter Hofmann">kdebugs-050220211414-96ad</who>
    <bug_when>2005-08-30 12:54:26 +0000</bug_when>
    <thetext>Version:           0.8.7 (using KDE 3.4.1, Debian Package 4:3.4.1-1 (3.1))
Compiler:          gcc version 3.3.6 (Debian 1:3.3.6-5)
OS:                Linux (i686) release 2.6.13-rc6

I have a PNG-File created by tvtime which kuickshow cannot open from the command line:

wh@gimli:~$ kuickshow tvtime-output-12:46:40.png
kuickshow: ERROR: : couldn&apos;t create slave : Call of Input/Output-Module not possible.
klauncher meldet: Unknown protocol &quot;tvtime-output-12&quot;.
kuickshow:
IMLIB ERROR: Cannot load image: /tmp/kde-wh/kuickshowPqudRb.tmp
All fallbacks failed.
See /usr/share/doc/imlib2/README.fallback.
kuickshow: WARNING: ImlibWidget: can&apos;t load image /tmp/kde-wh/kuickshowPqudRb.tmp


Opening with the gui or with &quot;kuickshow ./tvtime-output-12:46:40.png&quot; works, though.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>386502</commentid>
    <comment_count>1</comment_count>
    <who name="Stuart Prescott">bugs.kde.org</who>
    <bug_when>2005-11-02 03:44:11 +0000</bug_when>
    <thetext>This is a general problem with the KDE File Save As dialogue too:

In kghostview, if I give a filename of smith2005:foo.pdf (i.e. a BibTeX publication key in standard format, which is a pretty common thing to do!) then kghostview complains:

kghostview: ERROR: : couldn&apos;t create slave : Unable to create io-slave:
klauncher said: Unknown protocol &apos;smith2005&apos;.

The workaround is to preface the filename with &quot;file:&quot; (i.e. type the filename file:smith2005:foo.pdf in the File Save As dialogue or use kuickshow file:tvtime-output-12:46:40.png)

Now... KDE&apos;s network transparency is great, but perhaps if the protocol doesn&apos;t exist then the user could be asked if it&apos;s supposed to be a local file? (Particuarly the File Save As which just silently fails unless you happen to have run it from a konsole to see the stderr!)

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>528755</commentid>
    <comment_count>2</comment_count>
    <who name="David Faure">faure</who>
    <bug_when>2007-05-29 21:09:23 +0000</bug_when>
    <thetext>SVN commit 669593 by dfaure:

Reworked KCmdLineArgs::makeURL to make &quot;kpdf a:b&quot; work when a:b is an existing file in the current directory
CCBUGS: 111760, 146105
Albert will backport to 3.x


 M  +14 -13    kernel/kcmdlineargs.cpp  
 M  +8 -0      tests/kcmdlineargstest.cpp  


--- trunk/KDE/kdelibs/kdecore/kernel/kcmdlineargs.cpp #669592:669593
@@ -1331,21 +1331,22 @@
 
 KUrl KCmdLineArgs::makeURL(const char *_urlArg)
 {
-   QString urlArg = QFile::decodeName(_urlArg);
-   if (!QDir::isRelativePath(urlArg))
-   {
-      KUrl result;
-      result.setPath(urlArg);
-      return result; // Absolute path.
-   }
+    const QString urlArg = QFile::decodeName(_urlArg);
+    QFileInfo fileInfo(urlArg);
+    if (!fileInfo.isRelative()) { // i.e. starts with &apos;/&apos;, on unix
+        KUrl result;
+        result.setPath(urlArg);
+        return result; // Absolute path.
+    }
 
-   if ( !KUrl::isRelativeUrl(urlArg) )
-     return KUrl(urlArg); // Argument is a URL
+    if ( KUrl::isRelativeUrl(urlArg) || fileInfo.exists() ) {
+        KUrl result;
+        result.setPath( cwd()+&apos;/&apos;+urlArg );
+        result.cleanPath();
+        return result;  // Relative path
+    }
 
-   KUrl result;
-   result.setPath( cwd()+&apos;/&apos;+urlArg );
-   result.cleanPath();
-   return result;  // Relative path
+    return KUrl(urlArg); // Argument is a URL
 }
 
 void
--- trunk/KDE/kdelibs/kdecore/tests/kcmdlineargstest.cpp #669592:669593
@@ -83,6 +83,14 @@
    kDebug() &lt;&lt; u &lt;&lt; endl;
    assert(u.url() == &quot;http://www.kde.org&quot;);
 
+   QFile file(&quot;a:b&quot;);
+   bool ok = file.open(QIODevice::WriteOnly);
+   assert(ok);
+   u = KCmdLineArgs::makeURL(&quot;a:b&quot;);
+   qDebug() &lt;&lt; u.path();
+   assert(u.isLocalFile());
+   assert(u.path().endsWith(&quot;a:b&quot;));
+
    args-&gt;clear(); // Free up memory.
 
 
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>528757</commentid>
    <comment_count>3</comment_count>
    <who name="Albert Astals Cid">aacid</who>
    <bug_when>2007-05-29 21:11:46 +0000</bug_when>
    <thetext>SVN commit 669594 by aacid:

backport SVN commit 669593 by dfaure:

Reworked KCmdLineArgs::makeURL to make &quot;kpdf a:b&quot; work when a:b is an existing file in the current directory

BUGS: 111760, 146105


 M  +10 -9     kcmdlineargs.cpp  


--- branches/KDE/3.5/kdelibs/kdecore/kcmdlineargs.cpp #669593:669594
@@ -1248,21 +1248,22 @@
 
 KURL KCmdLineArgs::makeURL(const char *_urlArg)
 {
-   QString urlArg = QFile::decodeName(_urlArg);
-   if (!QDir::isRelativePath(urlArg))
-   {
+   const QString urlArg = QFile::decodeName(_urlArg);
+   QFileInfo fileInfo(urlArg);
+   if (!fileInfo.isRelative()) { // i.e. starts with &apos;/&apos;, on unix
       KURL result;
       result.setPath(urlArg);
       return result; // Absolute path.
    }
 
-   if ( !KURL::isRelativeURL(urlArg) )
-     return KURL(urlArg); // Argument is a URL
+   if ( KURL::isRelativeURL(urlArg) || fileInfo.exists() ) {
+      KURL result;
+      result.setPath( cwd()+&apos;/&apos;+urlArg );
+      result.cleanPath();
+      return result;  // Relative path
+   }
 
-   KURL result;
-   result.setPath( cwd()+&quot;/&quot;+urlArg );
-   result.cleanPath();
-   return result;  // Relative path
+   return KURL(urlArg); // Argument is a URL
 }
 
 void
</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>