D7930: Kdevelop CMake plugin : use canonical paths to build.dir

René J.V. Bertin noreply at phabricator.kde.org
Fri Sep 22 15:17:01 UTC 2017


rjvbb added a comment.


  Some tinkering with KDevelop::Path : forcing it to use canonical paths via
  
    diff --git a/kdevplatform/util/path.cpp b/kdevplatform/util/path.cpp
    index edcbfbe9adbcdb80b8b51759099aad0cc9e7deb1..33a5a1596eadec7e650555b1a948eb26ff17b685 100644
    --- a/kdevplatform/util/path.cpp
    +++ b/kdevplatform/util/path.cpp
    @@ -403,7 +404,9 @@ void Path::addPath(const QString& path)
             return;
         }
     
    -    const auto& newData = splitPath(path);
    +    // convert local paths to canonical if not adding it to an existing path
    +    bool convertToCanonical = m_data.isEmpty() && QUrl(path).isLocalFile();
    +    const auto& newData = splitPath(convertToCanonical ? QFileInfo(path).canonicalFilePath() : path);
         if (newData.isEmpty()) {
             if (m_data.size() == (isRemote() ? 1 : 0)) {
                 // this represents the root path, we just turned an invalid path into it
  
  doesn't seem to break anything (including the test_path unittest). To be exhaustive I'd need to figure out a clever & efficient way (that doesn't recurse out of bounds) to create canonical paths also when appending a segment to an already existing path.
  
  R.

REPOSITORY
  R32 KDevelop

REVISION DETAIL
  https://phabricator.kde.org/D7930

To: rjvbb, #kdevelop, apol
Cc: mwolff, apol, kdevelop-devel, geetamc, Pilzschaf, akshaydeo, surgenight, arrowdodger
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20170922/d7c013f7/attachment.html>


More information about the KDevelop-devel mailing list