2013/3/1 Иван Комиссаров <[email protected]>:
>
> 01.03.2013, в 13:54, André Somers <[email protected]> написал(а):
>
> Op 1-3-2013 10:22, Иван Комиссаров schreef:
>>> I don't think it's a good idea to try to fix QStorageInfo.
>>>
>>> The main argument is that QStorageInfo is a monitor+info provider, but
>>> monitor should depend on a DBus in Linux; however info provider doesn't
>>> require that. Also, monitor requires internal thread on Mac. My point is
>>> that in many cases, when you doesn't need monitor itself, it's too heavy to
>>> create such a huge object just to receive volume info.
>> I don't find that a convincing argument. The implementation could be such,
>> that the heavy machinery is only instantiated when somebody actually
>> connects to the monitoring signals. We have connectNotify and
>> disconnectNotify available for that in QObject.
>
> The argument is that you can't use QStorageInfo class from QtCore itself or
> an application that uses only QtCore. You're forced to use external
> dependencies right now, while QDriveInfo class is must-have class for IO
> operations (you can check if there's enough space on a hard drive before
> copying file to if). Linking to DBus for that... hm...
Not a best example, I can find some better ones ;)
The three ones I need most often:
1. if (QDriveInfo(from) == QDriveInfo(to)) QFile::move(from, to); else
QFile::copy(from, to);
handles the symlinks, mounpoints and junction points as well
2. if (QDriveInfo(path).capabilities() & ... )
-- one can check if the specified path belongs to a volume with
filesystem that supports case sensitive names, symlinks, or hardlinks,
w/o having to *guess*.
3. if (QDriveInfo(path).type() == QDriveInfo::RemoteDrive) /* VFS */;
else /* Local */;
>>> That's why i separated my solution into 2 different classes; so QtDriveInfo
>>> doesn't require external dependencies, like DBus.
>> I think I would prefer to have the controls and notification signals
>> directly on the QDriveInfo class itself. That seems to be more consistent
>> with the rest of the Qt API, where I can't think of other examples of a
>> separate controller class.
>
> What about QFile/QFileInfo separation?:)
>
>>>
>>> Next, QStorageInfo notification doesn't work for MingGW and Windows CE.
>>>
>>> Also QStorageInfo doesn't have internal caching.
>>>
>> I am not saying that I think your classes look bad in any way. In fact, I
>> think they look pretty neat!
>> I do have my doubts about the refresh() method. Isn't there any way to
>> automatically refresh without getting it too expensive?
>
> So far, i didn't find any solution for that...
>
>>
>> Thanks for your efforts so far!
>>
>> André
> _______________________________________________
> Development mailing list
> [email protected]
> http://lists.qt-project.org/mailman/listinfo/development
>
> _______________________________________________
> Development mailing list
> [email protected]
> http://lists.qt-project.org/mailman/listinfo/development
_______________________________________________
Development mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/development