Hi!

On Jun 19, 2009, at 5:41 PM, ext Frank Siegert wrote:

> Hi Eike,
>
> Eike Ziller, Friday 19 June 2009:
>> On Jun 19, 2009, at 1:47 PM, ext Frank Siegert wrote:
>>> Hi creators,
>>>
>>> Is there any way to access the file (name+path) which is currently
>>> active in the editor from the GenericMakeStep or GenericProject
>>> class?
>>
>> Core::EditorManager::instance()->currentEditor()
>> (->file()->fileName(), that includes the path)
>
> Thanks, that's exactly what I was looking for!
> The replacement is working fine now, at least in a hackish way,  
> which is
> good enough for my local working copy ;) (see below)
>
>>> So I thought implementing such a replacement in  
>>> GenericMakeStep::init
>>> would be the easiest and most local solution to the problem. But now
>>> I can't figure out how to access the currently active file from
>>> there.
>>
>> Ah, why "most local"?
>> /me already sees the emails that these variables should also be used
>> here-and-there.
>
> You might be right, but I am not familiar with qmake/cmake-based  
> projects,
> so I'm not sure whether this flexibility would be of any use to them?

I'm thinking of any kind of e.g. build or run configuration, command  
line arguments for starting a program, working directory settings,  
running external tools ... (a variable for the current editor might  
not be the most important one for these, but once the infrastructure  
is there, it could be used for a bunch of variables)

> Also, to implement this in a proper way, I'd have to make sure that I
> identify the file name components in a more platform-independent  
> way, i.e.
> not by looking for the last forward-slash.

QFileInfo(filePath).fileName()
that's what Qt is for ;-)

> Here I was hoping that the
> IFile object could take care of that abstraction, but it seems to  
> really
> only know about the full filename string?
>
>> BTW, you can find us on irc://irc.freenode.org/#qt-creator :)
>
> Thanks, I'll try that (again) when I'm not behind a restrictive  
> firewall
> :)


Hoping that I'm not too aggressive :),
Eike

-- 
Eike Ziller
Software Engineer
Nokia, Qt Software
Phone  +49 (0)30 6392 3255
Fax    +49 (0)30 6392 3256
E-mail eike.zil...@nokia.com




_______________________________________________
Qt-creator mailing list
Qt-creator@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-creator

Reply via email to