Am Mittwoch, den 10.03.2010, 20:06 +0100 schrieb manner.moe@gmx.de: > >Thanks for your patch. I took some time for another review. Do you want > >me to change the stuff or do you want to implement the changes yourself? > You can change the stuff if you want. I don´t have much experiences in > programming, so i can look at the changed code for better understanding how > the changes are working. OK, your patches will be merged quite soon now. > >I'm still unsure about this being the right model of > >OS-dependent/non-dependent split, but it seems to be a good start. It > >doesn't block your patch to go in. > i´m trying to implement a factory function (first time i´m doing this, i know > there´s much i have to learn). You are definitely on the right way of implementing a factory function. > >> - localmodel.setSorting(QDir::DirsFirst | QDir::Name); > >> + localmodel.setNameFilterDisables(false); > >> + localmodel.setReadOnly(false); > >> + localmodel.setRootPath("/home"); > >Are you *really* sure you need setRootPath()? This will break on Unix, > >and that's why we removed setRootPath from the old code. > Qt dokumentation says: "QFileSystemModel will not fetch any files or > directories until setRootPath is called. This will prevent any > unnecessary querying on the file system until that point such as > listing the drives on Windows." > On Windows all drives are listed if the specified root path is not available, > so it´s only necessary get QFileSystemModel working. Yeah, you are right. I should have checked the documentation. It also says that setRootPath is only about what directories get watched, not about what is displayed. > If there is no way to get it running on Unix, we have to write our own > function. I will just use localmodel.setRootPath("/") and test that on Windows. > >> diff --git a/qhimdtransfer/qhimdtransfer.pro > >> b/qhimdtransfer/qhimdtransfer.pro > >> index 1f0689d..1776b6b 100644 > >> --- a/qhimdtransfer/qhimdtransfer.pro > >> +++ b/qhimdtransfer/qhimdtransfer.pro > >Is reformatting this file needed? If yes, please make two seperate > >patches out of it by using git-commit after just reformatting. > No, it´s not needed. Windows version of QtCreator automatically reformats the > file (I´m actually using Qt SDK 2009.04). > I can change qhimdtransfer.pro outside QtCreator to prevent this If Qt Creator reformats the file, we should accept the reformatted file, to not have everyone to pay attention not to accidently reformat. > >> + case DBT_DEVICEREMOVECOMPLETE : > >> + { > >> + if(pHdr->dbch_devicetype == DBT_DEVTYP_VOLUME) > >> + { > >> + PDEV_BROADCAST_VOLUME pHdrv = (PDEV_BROADCAST_VOLUME)pHdr; > >> + path = FindPath(pHdrv->dbcv_unitmask); > >> + qDebug() << "Message:DBT_DEVICEREMOVECOMPLETE for drive " + path; > >> + remove_himddevice(path); > >> + } > >> + break; > >> + } > >Do we really need to handle DEVICEREMOVECOMPLETE? You already called > >remove_himddevice on DEVICEQUERYREMOVE if you consented. > > Yes i think we have to. If someone removes the device by just disconnecting > usb cable without using "safely remove hardware" windows function > DEVICEQUERYREMOVE message will not be sent. Good point. This block will stay in. Kind regards, Michael Karcher
Attachment:
signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil