From kde-devel Fri Apr 11 15:57:05 2014 From: "Kevin Krammer" Date: Fri, 11 Apr 2014 15:57:05 +0000 To: kde-devel Subject: Re: Review Request 117436: Doesn't assume that the users home directory is under /home Message-Id: <20140411155705.29770.90493 () probe ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-devel&m=139723186721054 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--===============3698461034692108591==" --===============3698461034692108591== Content-Type: multipart/alternative; boundary="===============5763475181705256064==" --===============5763475181705256064== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://git.reviewboard.kde.org/r/117436/#review55461 ----------------------------------------------------------- src/file/kcm/folderselectionwidget.cpp maybe QFileInfo(QDir::homePath()).absolutPath() src/file/kcm/folderselectionwidget.cpp p is a rather bad variable name :) the question is what does this check protect against? Might be easier to check if "url" is a prefix of QDir::homePath() if this protects against $HOME being excluded - Kevin Krammer On April 8, 2014, 1 p.m., Lindsay Mathieson wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://git.reviewboard.kde.org/r/117436/ > ----------------------------------------------------------- > > (Updated April 8, 2014, 1 p.m.) > > > Review request for Baloo. > > > Repository: baloo > > > Description > ------- > > Part of the KCM code assumes the users home dir is under "/home", which is not always the cause in linux - e.g OpenSUSE with AD Authentication uses a /home/DOMAIN hierarchy. Other systems use /opt. Not to mention windows etc. > > The code adds a function homeRoot() which returns the parent directory of the uses home directory. > > > Diffs > ----- > > src/file/kcm/folderselectionwidget.cpp bc87a33 > > Diff: https://git.reviewboard.kde.org/r/117436/diff/ > > > Testing > ------- > > Built, installed. Adding paths to the exclude lists still recognise the home root. > > > Thanks, > > Lindsay Mathieson > > --===============5763475181705256064== Content-Type: text/html; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit
This is an automatically generated e-mail. To reply, visit: https://git.reviewboard.kde.org/r/117436/

src/file/kcm/folderselectionwidget.cpp (Diff revision 1)
198
    return QDir::cleanPath(QDir::homePath() + "/..");
maybe QFileInfo(QDir::homePath()).absolutPath()

src/file/kcm/folderselectionwidget.cpp (Diff revision 1)
205
    if (url == QLatin1String("/home"))
210
    QString p = homeRoot();
p is a rather bad variable name :)
the question is what does this check protect against?
Might be easier to check if "url" is a prefix of QDir::homePath() if this protects against $HOME being excluded

- Kevin Krammer


On April 8th, 2014, 1 p.m. UTC, Lindsay Mathieson wrote:

Review request for Baloo.
By Lindsay Mathieson.

Updated April 8, 2014, 1 p.m.

Repository: baloo

Description

Part of the KCM code assumes the users home dir is under "/home", which is not always the cause in linux - e.g OpenSUSE with AD Authentication uses a /home/DOMAIN hierarchy. Other systems use /opt. Not to mention windows etc.

The code adds a function homeRoot() which returns the parent directory of the uses home directory.

Testing

Built, installed. Adding paths to the exclude lists still recognise the home root.

Diffs

  • src/file/kcm/folderselectionwidget.cpp (bc87a33)

View Diff

--===============5763475181705256064==-- --===============3698461034692108591== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe << --===============3698461034692108591==--