Thanks :-)<br><br><div class="gmail_quote">2010/11/16  <span dir="ltr"><<a href="mailto:pfee@talk21.com">pfee@talk21.com</a>></span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
<br>
Morten Volden wrote:<br>
<br>
> Hi All<br>
><br>
> A little while ago I asked on this list about the status of a Perforce<br>
> plug-in for Kdevelop4. Since no one replied I take it that development on<br>
> such a plug-in is not going on at the moment. So I started writing a<br>
> perforce plug-in.<br>
><br>
> My current status in short:<br>
> I have the plug-in loaded, and it will show in the context menu - So far<br>
> so good.<br>
><br>
> The plugin overrides pure virtual functions in ICentralizedVersionControl<br>
> and in IBasicVersionControl. E.g. for the edit function I do something<br>
> like this:<br>
><br>
> KDevelop::VcsJob* perforceplugin::edit(const KUrl& localLocation)<br>
> {<br>
>     QFileInfo fsObject(localLocation.toLocalFile());<br>
>     QString filename(fsObject.fileName());<br>
>     QDir path(fsObject.dir());<br>
><br>
>     DVcsJob* job = new DVcsJob(path, this, KDevelop::OutputJob::Verbose);<br>
>     if(job)<br>
>         kDebug() << "After Creating job, the path is " << path.path() <<<br>
> "and the filename is " << filename << "... And the jobs dir is: " <<<br>
> job->directory().path();<br>
>     *job << "p4" << "edit" << filename;<br>
>     return job;<br>
> }<br>
><br>
> When Trying to edit one of the files in my perforce testbed the kDebug<br>
> gives me the following output:<br>
><br>
> perforceplugin::edit: After Creating job, the path is<br>
> "/home/mvo/testbed/perforcetest" and the filename is  "main.cpp" ... And<br>
> the<br>
> jobs dir is:  "/home/mvo/testbed/perforcetest"<br>
><br>
> Which leads me to believe the DVcsJob I am creating has the correct CWD<br>
> (i.e. /home/mvo/testbed/perforcetest ). However, the command issued by the<br>
> job fails for reasons that escape me (as can be seen in the screenshot<br>
> below).<br>
><br>
> <a href="http://imagebin.ca/view/89faihm.html" target="_blank">http://imagebin.ca/view/89faihm.html</a><br>
><br>
> The perforce server and port are specified in the file p4config.txt (p4<br>
> will look for its settings in a file of that name).<br>
><br>
> If I issue the same command in a kdevelop konsole, it works (see konsole<br>
> window in screenshot below)<br>
><br>
> <a href="http://imagebin.ca/view/G4zUSuW.html" target="_blank">http://imagebin.ca/view/G4zUSuW.html</a><br>
><br>
> Can anyone shed some light on what the difference is between the command<br>
> in the DvcsJob and the command issued in the terminal?<br>
><br>
>  Thanks.<br>
><br>
> Morten<br>
<br>
Looks like the P4PORT is not set when the p4 command is invoked.<br>
<br>
Btw, the "p4 info" command is helpful when debugging as it doesn't depend on<br>
the rest of your client setup, just P4PORT.<br>
<br>
Also, rather than fragile environment variables, you can specify the p4 port<br>
as a command line argument.  That may be easier to pass through DVcsJob -<br>
especially if there's a bug in environment variable handling.<br>
<br>
e.g. p4 -p myserver:1666 info<br>
<br>
I see command line arguments and environment variables as cousins of<br>
function arguments and global variables.  Global variables aren't nice.<br>
<br>
... and good luck with the plugin, it'll be good to get Perforce support.<br>
<br>
Thanks,<br>
Paul<br>
<font color="#888888"><br>
<br>
<br>
<br>
<br>
<br>
--<br>
KDevelop-devel mailing list<br>
<a href="mailto:KDevelop-devel@kdevelop.org">KDevelop-devel@kdevelop.org</a><br>
<a href="https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel" target="_blank">https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel</a><br>
</font></blockquote></div><br><br clear="all"><br>-- <br>- When the split is pulled, mr. Grenade is no longer our friend<br>