Clean url's path before initializing KUrlNavigator

Review Request #128334 - Created July 1, 2016 and submitted

Information
Chinmoy Ranjan Pradhan
kio
master
Reviewers
dfaure

When KUrlNavigator is initialized with a path containing redundant ('/') say '/home/user///folder' then KUrlNavigator::updateButtons fails to create a button for "folder". This happes because of the following lines
const QString dirName = path.section(QLatin1Char('/'), idx, idx);
hasNext = isFirstButton || !dirName.isEmpty();
Here after creating button for "user" idx points to an empty field as a result an empty string is returned to dirName and hasNext evaluates to false. Due to this button for "folder" isn't created.

What i propose is to use QDir::cleanPath in KUrlNavigator::initialize to remove redundant "/" just like it is done in KUrlNavigator::setLocationUrl.

To test this i used the test provided for kurlnavigator in kio. I changed the source of kurlnavigatortes_gui.cpp and initialized kurlnavigator with the path ('/home/chinmoy///Desktop').

Files


Issues

  • 0
  • 4
  • 0
  • 4
Description From Last Updated
Chinmoy Ranjan Pradhan
Chinmoy Ranjan Pradhan
David Faure
Chinmoy Ranjan Pradhan
Chinmoy Ranjan Pradhan
David Faure
Chinmoy Ranjan Pradhan
Chinmoy Ranjan Pradhan
Chinmoy Ranjan Pradhan
David Faure
Chinmoy Ranjan Pradhan
David Faure
Chinmoy Ranjan Pradhan
Review request changed

Status: Closed (submitted)

Change Summary:

Submitted with commit 426d68119ecd0b11fb55dc7769ece302c6e30e10 by David Faure on behalf of Chinmoy Ranjan Pradhan to branch master.
Loading...