[Development] Differences: QDesktopServices vs QStandardPaths

David Faure faure at kde.org
Wed Jul 10 10:11:48 CEST 2013


Le mercredi 10 juillet 2013 09:41:59 Mark a écrit :
> On Tue, Jun 25, 2013 at 11:27 PM, Chris W
> 
> <chrisw.qtdevel at psychogeeks.com> wrote:
> > Hello,
> > 
> > Were the following differences between the paths returned by Qt 4.8
> > QDesktopServices and 5.1 QStandardPaths intentional or bug-worthy? (They
> > are annoying either way)

The removal of "data/" was intentional, because it prevented accessing other 
things under local/share. It was a hardcoded subdir that had no reason to be 
there (check local/share, the xdg standard is to put stuff directly in there, 
not in a data subdir).

However I didn't anticipate the migration problem, indeed.

At this point changing the behavior of QStandardPaths::DataLocation would 
surely create even more trouble, so instead I can offer a
 QStandardPaths::Qt4DataLocation which would have the "data", for easier 
migration from Qt4. How does this sound?

> > #if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
> > QStringList paths =
> > QStandardPaths::standardLocations(QStandardPaths::DataLocation);

writableLocation() is a more direct equivalent of 
QDesktopServices::storageLocation btw.

> > #else
> > QString paths =
> > QDesktopServices::storageLocation(QDesktopServices::DataLocation);

Mark wrote:
> Since you haven't received a single reply yet, adding David Faure (the
> author of this class) in the CC.

Yes, thanks. I get too much email to be able to monitor the development at qt 
list :(

> I recommend making a bug report: bugreports.qt-project.org

Yes.

-- 
David Faure, faure at kde.org, http://www.davidfaure.fr
Working on KDE, in particular KDE Frameworks 5




More information about the Development mailing list