Review Request 119247: Fix the build of udsentry.cpp on Windows (msvc2013 32 bits)
Alexander Richardson
arichardson.kde at gmail.com
Mon Jul 14 20:56:52 UTC 2014
> On Juli 13, 2014, 1:17 nachm., Mark Gaiser wrote:
> > src/core/udsentry.cpp, line 72
> > <https://git.reviewboard.kde.org/r/119247/diff/2/?file=289937#file289937line72>
> >
> > I'm not sure if this is the correct approach either.
> >
> > When i'm looking at file.cpp (in kio/src/ioslaves/file/file.cpp) then this very same thing is done. So from a mac/linux perspective, this aproach is fine.
> >
> > However, we also have a specific windows implementation "file_win.cpp" which is in fact filling the username and group via a slightly different mechanism.
> >
> > On Linux/Mac: we use stat calls. Aka, we are completely in control.
> > On Windows we (why?) use QDirIterator. Each entry is then represented as a QFileInfo which in turn is being used to get the details from inclusing user/group.
> >
> > I can see a few approaches that could work:
> > 1. This version where windows is just out of luck.
> > 2. If windows is used, contruct a QFileInfo and get the user/group from there. Windows users will then have more stat calls in this function. Something we should try to prevent.
> > 3. This version and add a new constructor that takes a QFileInfo object - my preference.
> >
> > ... I think we need to wait for David' opinion on this. If David is OK with point 3 then i will create a patch + test and send a RR for it.
>
> Cristian Oneț wrote:
> Waiting for David's opinion about the best way to fix this.
>
> David Faure wrote:
> Mark: so this method is simply not used on Windows? Then I don't see the problem with this patch...
>
> Yes an overload with a QFileInfo would be ok too, but that's somewhat unrelated to this patch.
>
> Mark Gaiser wrote:
> In that case this patch is a Ship it.
> An overload for QFileInfo will come later this week on RR.
I guess on windows we should just use the native win32 api and not stat() since that is just a compatibility wrapper for UNIX programs (with some fields like st_uid and st_gid being always zero). Using the native API would also allow getting proper owner/group information there. My old Windows development machine no longer works, so I can't do it now. I can however try to implement this this once the new computer has arrived.
- Alexander
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/119247/#review62245
-----------------------------------------------------------
On Juli 14, 2014, 7:33 nachm., Cristian Oneț wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/119247/
> -----------------------------------------------------------
>
> (Updated Juli 14, 2014, 7:33 nachm.)
>
>
> Review request for KDE Frameworks and kdewin.
>
>
> Repository: kio
>
>
> Description
> -------
>
> The KUser(K_UID) constructor could not be mached since st_uid is a 'short' which can't be implicitly cast to a pointer type (K_UID is of type void * on Windows). The same applies to KUserGroup.
>
> Here is the compiler output:
>
> q:\kio\src\core\udsentry.cpp(72) : error C2440: '<function-style-cast>' : cannot convert from 'const short' to 'KUser'
> No constructor could take the source type, or constructor overload resolution was ambiguous
> q:\kio\src\core\udsentry.cpp(72) : error C2228: left of '.loginName' must have class/struct/union
> q:\kio\src\core\udsentry.cpp(72) : error C2661: 'KIO::UDSEntry::insert' : no overloaded function takes 1 arguments
> q:\kio\src\core\udsentry.cpp(73) : error C2440: '<function-style-cast>' : cannot convert from 'const short' to 'KUserGroup'
> No constructor could take the source type, or constructor overload resolution was ambiguous
> q:\kio\src\core\udsentry.cpp(73) : error C2228: left of '.name' must have class/struct/union
> q:\kio\src\core\udsentry.cpp(73) : error C2661: 'KIO::UDSEntry::insert' : no overloaded function takes 1 arguments
>
>
> Diffs
> -----
>
> src/core/udsentry.cpp c6ac21a1f7b45822bc3454409faf3dbdce7b2acc
>
> Diff: https://git.reviewboard.kde.org/r/119247/diff/
>
>
> Testing
> -------
>
> Build with msvc2013 on Windows and gcc-4.8.3 on Linux.
>
>
> Thanks,
>
> Cristian Oneț
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-windows/attachments/20140714/bbf059fe/attachment.html>
More information about the Kde-windows
mailing list