Am 03.04.2016 um 01:46 schrieb Alexandru Csete:
> On Thu, Mar 31, 2016 at 6:33 PM, wofritzyt <
wolfgan...@gmx.net> wrote:
>>
>> OK, here is my patch for review. The devices are only probed at program
>> startup. The device list is not updated if a device is connected after
>> program start. This has effect only for devices whch drivers really check
>> for the presence of the device, like SDRPlay. Later the cached device list
>> is used in the input configuration.
>>
>
> Hi Wolf,
>
> I'm quiet tired and may not properly undserstand what is going on, but
> would it be possible to move the code somewhere else than
> mainwindow.cpp? Mainwindow is already a huge file and we should avoid
> adding new code if we can - in particular if the code is not directly
> related to mainwindow functionality.
>
> Perhaps move into a separate header file, or have it as a static
> member of CIoConfig? THe data structure itself could still be a member
> of MainWindow, if required.
>
I'll look into this. There is another issue I found, the us of a
std::map for the device list orders the list alphabetically, which is
different from the original ordering.
> Some other comments:
>
>> + else if (this_dev.find("FUNcube Dongle V2.0") != string::npos)
>> + {
>> + devstr = "fcd,type=2,device='FUNcube Dongle V2.0'";
>> + devList.insert (std::pair<QString, QVariant>(QString("FUNcube Dongle V1.0"), QVariant(devstr)));
>
> Should be V2.0
>
Ups, don't now how this could happen, I just copied the code.
>
>> + while (it != dev.end())
>> + {
>> + std::cout << (*it).first << ":" << (*it).second << std::endl;
>> + ++it;
>> + }
>> + std::cout << "=========================================" << std::endl;
>
> Is this output necessary once the code is working? If yes, can we use
> qDebug()? Perhaps keep it in the CIoConfig constructor.
>
No, that code can be removed. I am using lots of debug code, it's more
or less for me to understand what's going on. I missed this one.
>> devList.insert (std::pair<QString, QVariant>(devlabel, devstr));
>
> As I said before, no spaces between function name and ().
>
I'll try my best...
BTW Alex, I really appreciate your responses, knowing your very limited
time. I contacted the driver developers but got no responses so far...
Wolf, DK7OB