IRC Log Viewer » #firebreath » 2012-01-10

IRC Nick Time (GMT-7) Message
shaheenbanu 00:01 Hello, One question related to events in firebreath
Like other events like onload, echo notify, is there any event to confirm? scenario : I have a block of code fstream fin; fin.open(xyz.txt ,ios::in); if (fin.fail()) { //File does not exist create new file and put String to file ofstream fout(path, ios::out); fout <<fileContents << endl; fout.close(); } else { fire_fired("File exist do you want to overwrite the conrtents of the file" , true ,1); //File e
Here in else block i want to put an confirmatiom from use like if "YES" overwrite the file contents if "NO" carry on with the existing file.
dupatam 03:01 I have some problem using FB in conjuction with IE, so the ActiveX. Everytime my plugin is being loaded into IE memory space, it throws exceptions in method:
FB::variant IDispatchAPI::GetProperty(const std::string& propertyName)
with propertyName = "pluginLoaded"
if (FAILED(hr)) { throw FB::script_error("Could not get property"); }
this line failes
Do anyone know whay can be wrong? The same plugin works fine with FF and Opera
Hi everyone
linearray 09:01 ohai
taxilian 09:01 g'morning
reichi 09:01 hmm it's 5:30pm here ;)
taxilian 09:01 =]
reichi 09:01 ok 5:40
taxilian: any clue/tip why the JSFakeArray doesn't work here?
in detail the [] operator refuses to work
taxilian 09:01 nope
refuses to work from where?
and what does that mean exactly?
reichi 09:01 javascript
taxilian 09:01 and what have you tried to troubleshoot it?
reichi 09:01 ok
let's start at the beginning ;)
i need this array-like thingy
with some special methods
and [index] working from javascript
taxilian 09:01 got that part
reichi 09:01 ok
so i started with the "more complex" way and tried to drive my class from JSFakeArray
but the [] operator didn't work from javascript
the browser is webkit based
qtwebkit to be more precise
(but it boils down to webkit)
taxilian 09:01 what have you tried to troubleshoot it? what OS?
reichi 09:01 linux (ubuntu)
well that's my problem
i don't know how i should troubleshoot that
the custom method is there
and works
console.log(broadcast.programmes.item(0));
console.log(broadcast.programmes[0]);
1. works
2. not
2. gives me undefined
taxilian 09:01 add some log messages or something to the GetProperty method on the fakearray, find out what is getting called
or if you know gdb well enough attach a debugger and set breakpoints
reichi 09:01 i suck on gdb :/
i now "bt full"
;)
know
taxilian 09:01 well currently you haven't been able to tell me enough for me to even hazard a guess
reichi 09:01 does FB have a global log method?
taxilian 09:01 so get digging =]
there is log4cplus, if you enable it
reichi 09:01 well
taxilian 09:01 there are docs on the wiki
reichi 09:01 my problem is I hardly knew where to start :/
I'll attach something to GetProperty
or log it...
taxilian 09:01 start there; see if it is getting called
reichi 09:01 gimme 2 minutes ;)
taxilian 09:01 what gets logged when you try the .programmes[0]?
what is the error message
reichi 09:01 i do get undefined
and not my jsapi-object
taxilian 09:01 but not an exception? good to know
reichi 09:01 exactly
hmm
my GetProperty(int index) doesn't seem to be called at all
taxilian 09:01 hmm. it's been awhile since I last used fakearray; it's not really the recommended way of doing things. try adding code to the string version of getproperty; I bet that's getting called
reichi 09:01 i assume so, too
i could try casting to int there
and do the int stuff if that works out
I assume
taxilian 09:01 right
reichi 09:01 would also catch some possible wrong made calls on javascript side
which is actually out of my control ;)
i'm starting to think i am doing something very wrong :/
man... i guess I'll hate the day I have to start getting this thing to cross-compile...
;)
hmm
01-10-12 17:11:16,035 [140201388541856] INFO FireBreath <> - /home/reichi/git/FireBreath/src/NpapiCore/NpapiPlugin.cpp:128 - virtual NPError FB::Npapi::NpapiPlugin::GetValue(NPPVariable, void*) - GetValue(NPPVpluginScriptableNPObject)
i guess that's somehow involved ;)
reichi 10:01 taxilian: correct guess
actually the GetProperty(const std::string &propertyName) is being called
taxilian 10:01 not surprised
reichi 10:01 well i am ;)
but hey
taxilian 10:01 hmm. that could probably be considered a framework bug
reichi 10:01 that's good
taxilian 10:01 it probably should detect that it's a numeric string and call the int version instead of the string version
either that or we should remove the int version
reichi 10:01 I agree on that
it's confusing that way
taxilian 10:01 the problem is that some browsers use the int version, others don't
reichi 10:01 well webkit doesn't seem to do so :)
taxilian 10:01 feel free to fix it and submit a patch ;-) otherwise, file a jira issue and I'll look at it at some point
yeah, webkit doesn't
reichi 10:01 hey
thx a lot :)
that was the last real issue
that remained unsolved :)
taxilian: I'm not sure if you would my code, I'm pretty new to c++ ;)
would like
taxilian 10:01 if you don't mind criticism and being told to change things I'll code review it until it is acceptible
reichi 10:01 I'm happy if people take the time to tell me how to do better :)
taxilian 10:01 well, you know, I've always been good at telling people what to do and where to go…. ;-)
reichi 10:01 :p
reichi 11:01 taxilian: HasProperty(int) and SetProperty(int) should be extended, too, i assume
taxilian 11:01 yeah
reichi 11:01 hmm
taxilian: NPObjectAPI, right?
taxilian 11:01 nope
reichi 11:01 or am i just heading the wrong direction? :/
taxilian 11:01 NPJavascriptObject
reichi 11:01 ahah
THAT explains a lot
taxilian 11:01 NPObjectAPI is for when you're calling into a page NPObject
reichi 11:01 i'm wondering why it doesn't work ;)
taxilian 11:01 =]
reichi 11:01 hmm
when looking at that code
i don't see GetProperty(int) coul ever be called
ah sorry
<-- blind
taxilian: and another question :/
how should i check if it is an int?
the ways i know are
using a stringstream and check if the conversion to int failed or not
or using boost::lexical_cast<int>(std::string) and surrounding it with try catch with will be rather slow
reichi 12:01 haha wonder what, it works now...
taxilian 12:01 ?
that's weird
reichi 12:01 what?
taxilian 12:01 oh, misunderstood
thought it started working without you changing anything
reichi 12:01 not at all ;)
it started working with me changing the RIGHT thing
taxilian 12:01 probably what I'd do is loop through the string and check for non-numeric characters; if it's longer than say 6 characters, don't bother
hmm… then again...
I dunno. tempted to just drop int property support
nobody is really using it, better would be I think to just make it always a string
reichi 12:01 and let the plugin override that
when required to do so
well
let me solve that within my plugin
should i open a bug in jira for you?
taxilian 12:01 yeah
do that
I'll look at it more later
reichi 12:01 so you remember you wanted to spend some time thinking about it? ;K9
goesmaster 22:01 is anyone there?
is anyone there?