<?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>382239</bug_id>
          
          <creation_ts>2017-07-11 13:55:43 +0000</creation_ts>
          <short_desc>QUrl::path() returns invalid pathes on Windows</short_desc>
          <delta_ts>2018-03-26 09:09:03 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>umbrello</product>
          <component>general</component>
          <version>frameworks5</version>
          <rep_platform>Other</rep_platform>
          <op_sys>Microsoft Windows</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>
          
          <blocked>373932</blocked>
          <everconfirmed>0</everconfirmed>
          <reporter name="Ralf Habacker">ralf.habacker</reporter>
          <assigned_to name="Umbrello Development Group">umbrello-devel</assigned_to>
          <cc>simonandric5</cc>
          
          <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>1688142</commentid>
    <comment_count>0</comment_count>
    <who name="Ralf Habacker">ralf.habacker</who>
    <bug_when>2017-07-11 13:55:43 +0000</bug_when>
    <thetext>On porting KUrl::path() references directly to QUrl::path() the related locations returns invalid file pathes on Windows as shown with following examples:

    QUrl b = QUrl::fromLocalFile(&quot;/test/test.xyz&quot;);
    qDebug() &lt;&lt; b.path() &lt;&lt; b.toLocalFile();
    b = QUrl::fromLocalFile(&quot;c:/test/test.xyz&quot;);
    qDebug() &lt;&lt; b.path() &lt;&lt; b.toLocalFile();
    b = QUrl::fromLocalFile(&quot;c:\\test\\test.xyz&quot;);
    qDebug() &lt;&lt; b.path() &lt;&lt; b.toLocalFile();

Running this code on Windows returns 

&quot;/test/test.xyz&quot; &quot;/test/test.xyz&quot;
&quot;/c:/test/test.xyz&quot; &quot;c:/test/test.xyz&quot;
&quot;/c:/test/test.xyz&quot; &quot;c:/test/test.xyz&quot;

line 2 and 3  column 1 shows that QUrl::path() always prefixes the path with &apos;/&apos; which is incorrect.

KUrl from KDE4 does not have this problem because it covers the &quot;local file case&quot; (see https://github.com/KDE/kdelibs/blob/KDE/4.14/kdecore/io/kurl.cpp#L873 for details).

Instead QUrl::toLocalFile() should be used, which is also safe to use on non Windows OS.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1740680</commentid>
    <comment_count>1</comment_count>
    <who name="Ralf Habacker">ralf.habacker</who>
    <bug_when>2018-03-26 09:09:03 +0000</bug_when>
    <thetext>umbrello source code does not use QUrl::path() anymore.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>