[Kde-pim] fixing #42767 : attach directories to mail
Martin Bednár
serafean at gmail.com
Wed Aug 31 15:02:35 BST 2011
Le Wednesday 31 of August 2011 12:50:32 Kevin Krammer a écrit :
> On Wednesday, 2011-08-31, laurent Montel wrote:
> > Le Wednesday 31 August 2011 12:04:46 Martin Bednár a écrit :
> > > Posted on kde pastebin : http://pastebin.kde.org/116515/
> >
> > I think that:
> > - QFile file = QFile(info.path());
> > + QFile file(info.path());
> >
> > is better and will compile.
>
> Just as an explanation:
>
> QFile is a QObject subclass (indirect, there are some in between) and
> QObject's cannot be copied.
>
> QFile file = QFile(info.path());
Just a check to see if I understand this right :
QFile file allocates a new empty QFile, and QFile(info.path()); creates a
"temporary" initialized QFile that then gets copied into the allocated empty
QFile?
>
> would result in the invocation of the QFile copy constructor which is
> declared private to prevent the copying.
>
> Hence your error message:
> error: 'QFile::QFile(const QFile&)' is private
> error: within this context
>
> Laurent's modification passes the path argument directly to the QFile
> constructor of object "file".
Thanks a bunch!
The other error is gone too, apparently when using an enum, its name shouln't
be specified : QDir::Filter::Dirs is wrong and QDir::Dirs works.
/me feels silly
Thanks again,
Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20110831/221d50f6/attachment.sig>
-------------- next part --------------
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/
More information about the kde-pim
mailing list