[En-Nut-Discussion] qnutconf path mysteries

Thiago A. Corrêa thiago.correa at gmail.com
Sat Dec 12 03:53:39 CET 2009


Hi Harald,

On Tue, Dec 8, 2009 at 2:47 PM, Harald Kipp <harald.kipp at egnite.de> wrote:
> Thiago A. Corrêa wrote:
>> On Tue, Dec 8, 2009 at 9:52 AM, Harald Kipp <harald.kipp at egnite.de> wrote:
>>> start searching at the installation directory and stop searching as soon
>>> as they find
>>>
>>> C:\ethernut-4.9\crossworks\nut\...
>>>
>>> which is just a temporary directory containing a few patches, but no
>>> conf directory.
>>>
>>
>> It must contain an os/version.c in that path, as that's what it looks
>> for, like nutconf. We could simplify and look for conf/repository.nut
>> but then if you had a temporary directory containing that file, the
>> same thing would happen.
>
> Well, but your code tells a different story :-)
>
> if ( folder.contains( nutFolder ) )
> {
>  QDir nut( folder );
>  if ( nut.exists( filename ) )
>    return QDir::current().relativeFilePath( QDir( folder
> ).absoluteFilePath( filename ) );
>  else
>    return QString();
> }

I see, the else thing was a bad early bail-out from that function. I
removed it, and your test case now works for me.

> As soon as the path currently searched contains "/nut/", then
> findRelativePathDepthSearch will return, even if filename doesn't exist.
>

Yes, returns in an error though :)

>> Running from c:\Ethernut-x.y.z should work fine.
>
> Again your code tells a different story. :-)
>

Ah, I see... another bad attempt of optimizing the search hehe.
Removing the current.cdUp() from outside the while should fix it as well.

I will commit both changes now.
Kind Regards,
    Thiago A. Correa



More information about the En-Nut-Discussion mailing list