Madhusudan C.S | 1 Feb 08:17 2009
Picon

https://bugs.kde.org/show_bug.cgi?id=178572

Hi all,
     I just took a look at the bugand started working on it. I just have came down to the core of the problem but I am stuck there. Here is the problem and I want some help from you guys to fix it. Kindly help me.

In kdeedu/step/step.worldmodel.cc, in the method QVariant WorldModel::data(const QModelIndex &index, int role) const which is an implementation of the QAbstractItemModel class's data() method, the index passed is valid, i.e isValid() returns true but the internalPointer() is null. I am just wondering if this possible at all. i.e how can index be valid when it points to no data. But some one on #kde-edu told its definitely possible, but I did not understand how.
This exactly is causing the bug reported in the above link. Can any one help me on how to go about to fix this bug?





--
Thanks and regards,
 Madhusudan.C.S

Blogs at: www.madhusudancs.info
Official Email ID: madhusudan <at> madhusudancs.info
_______________________________________________
kde-edu mailing list
kde-edu <at> mail.kde.org
https://mail.kde.org/mailman/listinfo/kde-edu
Vladimir Kuznetsov | 1 Feb 22:00 2009
Picon

https://bugs.kde.org/show_bug.cgi?id=178572

Hello Madhusudan !

Please forgive me for not replying for so long. I was very busy when I've got 
your mail, and then I've simply forget about it.

On Sunday 01 February 2009 10:09:00 you wrote:
> Hi Vladimir,
>          I had contacted you a month back or so and also had sent this same
> mail 2 weeks back. In reply to the first mail you had given some pointers
> regarding contribution to Step and you had given me a list of things I
> could do for Step. Unfortunately I could not do much because I had to give
> my end sem exams during this time. With last paper left for Monday, 19th
> Jan I thought its time to start working.
> I just took the bug
> https://bugs.kde.org/show_bug.cgi?id=178572
> and started working on it. I just have come down to the core of the problem
> but I am stuck there. Here is the problem and I want some help from you to
> fix it. Kindly help me.
>
> In kdeedu/step/step.worldmodel.cc, in the method QVariant
> WorldModel::data(const QModelIndex &index, int role) const which is an
> implementation of the QAbstractItemModel class's data() method, the index
> that is passed is valid, i.e isValid() returns true but the
> internalPointer() is null. I am just wondering if this possible at all. i.e
> how can index be valid when it points to no data. But some one on #kde-edu
> told its definitely possible, but I did not understand how.
Yes, this is definitely possible. isValid flag informs QT that the index is 
valid, but internalPointer is just a pointer to application-specific data which 
can be anything that application want to store into it. In case of Step that 
pointer is used to store a pointer to relevant StepCore::Object subclass and 
it should not be NULL, so we see a problem with it.

To check why it can be NULL, let's look at a point where the index is created. 
There are several functions in WorldModel which returns QModelIndex, but all 
of them uses WorldModel::solverIndex() function to obtain index for solver 
which in turn calls StepCore::World::solver() function which just returns 
_solver member of the World class.

Next we have to look at where that member (World::_solver) is initialized. 
There is World::setSolver function that sets it and it is called by 
WorldModel::swapSolver function which in turn is called by CommandSetSolver 
class which is created in WorldModel::newSolver function.

You could check using debugger whether WorldModel::newSolver receives a 
correct solver class name as an argument and whether the solver is created 
correctly. Then you could check whether it is correctly passed passed to 
swapSolver function.

But that is only my assumption which can be wrong (today I'm not at home and 
have no access to compiled Step). Please tell me about you results and ideas: 
I hope I'll reply faster this time :-)

> This exactly is causing the bug reported in the above link. Can you help me
> to go about fixing this bug? <madhusudan <at> madhusudancs.info>

--

-- 
      Best Regards,
        Vladimir
Tim Holy | 1 Feb 22:43 2009
Picon

: School-wide configuration: common solution?

Hello,

I'm one of the developers for TuxMath, one of the Tux4Kids suite of 
educational programs. Over the last year we've begun to think about some 
issues in making TuxMath more useful for schools. I've contacted you folks to 
see if you've faced/solved similar issues, or whether we might have some 
common interests that could involve shared development (say, for GSoC 2009).

Here's the background: TuxMath is an arcade game that helps kids practice math 
facts. Teachers are using it, and several have expressed interest in being 
able to configure, track, and otherwise administer classrooms of kids using the 
program. Here are some examples of some of the kinds of things we might want 
to support:
1. Managing "high scores" files by grade or classroom (we don't want 5th 
graders competing against 2nd graders)
2. Letting teachers set particular lesson files for kids to tackle that day
3. Letting teachers see how kids in their own classroom are doing on the 
lessons

Doing this in a sensible way requires a method for expressing relationships in 
a school, i.e., specifying the different grades, the different classrooms, and 
the kids within each classroom. I've set up an architecture for some of this 
within TuxMath, but having done that, I realize that no systems administrator 
will want to configure an entire school's worth of kids in 5 different ways for 
5 different open-source programs. So before I start thinking about building a 
GUI to administer this type of infrastructure in a more teacher-friendly way, 
it occurs me to approach other free software projects to see if there might be 
a common need for storing or managing information in a school- or classroom-
wide fashion.

The way I've set this up (for better or for worse) in TuxMath is to establish 
a directory hierarchy on the school server:
school/
   Kindergarten/
      Mrs. Smith/
         Kid A/
         Kid B/
         Kid C/
           ...
      Mr. Jones/
         Kid 1/
         Kid 2/
           ...
  1st grade/
       ...

Many schools seem to run without any individual student accounts (all students 
log in to a "Student" account without a password), so these directories serve 
as a mock home directory (no password) for the kids. In cases where the 
students do have real home directories, the lowest level could of course be 
symlinks (on Unix systems) to their real home directories. The advantage of 
this hierarchy is that it establishes a natural mechanism for expressing 
relationships among the different members of the school, and so programs can 
then find classroom-wide configurations, etc.

Clearly, there's no reason to have to set this kind of thing up many different 
times for many different programs (different programs can put their files in 
these directories), so I see a possible area of common interest.

Is this (or something better) of potential general interest to developers of 
other open-source educational software. Is there something out there already 
that does this in a general way?

If there is general interest in this, and it doesn't exist already, here are 
the components I envision:
1. A library (probably quite small) that helps individual games or other 
programs to access configuration settings, etc., from the school-wide 
configuration system.
2. A GUI administration program for assigning teachers and kids to classrooms, 
moving kids among classrooms, etc. Modeling on our current architecture, 
relationships are currently expressed as a directory hierarchy, so a lot of 
these administrative tasks simply involve setting up or moving directories; in 
other words, it's independent of the information that any particular program 
needs.

One constraint: at Tux4Kids we support Linux, Mac OSX, Windows, and BeOS, so 
everything would have to be designed to be portable.

If this is of potential interest, perhaps we could look into a project for 
GSoC (or just do it ourselves...).

Best wishes,
--Tim
Madhusudan C.S | 3 Feb 06:56 2009
Picon

https://bugs.kde.org/show_bug.cgi?id=178572

Hi Vladimir,
  I just went through the code as you suggested through gdb.

On Mon, Feb 2, 2009 at 2:30 AM, Vladimir Kuznetsov <ks.vladimir <at> gmail.com> wrote:

To check why it can be NULL, let's look at a point where the index is created.
There are several functions in WorldModel which returns QModelIndex, but all
of them uses WorldModel::solverIndex() function to obtain index for solver
which in turn calls StepCore::World::solver() function which just returns
_solver member of the World class.

Next we have to look at where that member (World::_solver) is initialized.
There is World::setSolver function that sets it and it is called by
WorldModel::swapSolver function which in turn is called by CommandSetSolver
class which is created in WorldModel::newSolver function. 

You could check using debugger whether WorldModel::newSolver receives a
correct solver class name as an argument and whether the solver is created
correctly. Then you could check whether it is correctly passed passed to
swapSolver function.

These are the results I got. For convenience I am pasting the
method here where the problem is occuring, please forgive :)

StepCore::Solver* WorldModel::swapSolver(StepCore::Solver* solver)
{
    bool selected = selectionModel()->isSelected(solverIndex());
    bool current = selectionModel()->currentIndex() == solverIndex();
    beginRemoveRows(QModelIndex(), 1, 1);
    StepCore::Solver* oldSolver = _world->removeSolver();
    endRemoveRows();
    beginInsertRows(QModelIndex(), 1, 1);
    _world->setSolver(solver);
    endInsertRows();
    if(selected) selectionModel()->select(solverIndex(), QItemSelectionModel::Select);
    if(current) selectionModel()->setCurrentIndex(solverIndex(), QItemSelectionModel::Current);
    emitChanged(true, true);
    return oldSolver;
}

Everything seems to be fine until first call goes to beginRemoveRows ()
and then to _world->removeSolver(), but the program crashes when
endRemoveRows() is called. Still not sure whats causing it. But I still did
not understand why a new object QModelIndex() was created and passed
to beginRemoveRows. Is that causing some kind of problem? The API
asks to pass the parent index but we pass a newly created index.
Is that all Ok?



--
Thanks and regards,
 Madhusudan.C.S

Blogs at: www.madhusudancs.info
Official Email ID: madhusudan <at> madhusudancs.info
_______________________________________________
kde-edu mailing list
kde-edu <at> mail.kde.org
https://mail.kde.org/mailman/listinfo/kde-edu
Burkhard Lück | 3 Feb 16:08 2009
Picon

[kde-edu]: bugs in kbruch messages

Hi,

translating kbruch I found some buggy messages in kbruch, which are very 
confusing for the intended audience.
These wrong messages are leftovers from the old kbruch from KDE 4.0.

Attached patch for trunk corrects them, please review/improve and commit.

--

-- 
Burkhard Lück
Attachment (kbruch.diff): text/x-diff, 2470 bytes
_______________________________________________
kde-edu mailing list
kde-edu <at> mail.kde.org
https://mail.kde.org/mailman/listinfo/kde-edu
Burkhard Lück | 3 Feb 16:41 2009
Picon

Re: : bugs in kbruch messages

Am Dienstag 03 Februar 2009 16:08:09 schrieb Burkhard Lück:
> Hi,
>
> translating kbruch I found some buggy messages in kbruch, which are very
> confusing for the intended audience.
> These wrong messages are leftovers from the old kbruch from KDE 4.0.
>
> Attached patch for trunk corrects them, please review/improve and commit.

Forget the first patch, there more wrong messages fix in this attachment.

I'll never understand that a lot of teams translated the wrong messages for 
4.1 and 4.2, but no one reported a bug.

--

-- 
Burkhard Lück
Attachment (kbruch.diff): text/x-diff, 6215 bytes
_______________________________________________
kde-edu mailing list
kde-edu <at> mail.kde.org
https://mail.kde.org/mailman/listinfo/kde-edu
Vladimir Kuznetsov | 3 Feb 16:55 2009
Picon

https://bugs.kde.org/show_bug.cgi?id=178572

Hello Madhusudan !

On Tuesday 03 February 2009 08:56:05 Madhusudan C.S wrote:
> Hi Vladimir,
>   I just went through the code as you suggested through gdb.
>
> On Mon, Feb 2, 2009 at 2:30 AM, Vladimir Kuznetsov 
<ks.vladimir <at> gmail.com>wrote:
> > To check why it can be NULL, let's look at a point where the index is
> > created.
> > There are several functions in WorldModel which returns QModelIndex, but
> > all
> > of them uses WorldModel::solverIndex() function to obtain index for
> > solver which in turn calls StepCore::World::solver() function which just
> > returns _solver member of the World class.
> >
> > Next we have to look at where that member (World::_solver) is
> > initialized. There is World::setSolver function that sets it and it is
> > called by WorldModel::swapSolver function which in turn is called by
> > CommandSetSolver class which is created in WorldModel::newSolver
> > function.
> >
> >
> > You could check using debugger whether WorldModel::newSolver receives a
> > correct solver class name as an argument and whether the solver is
> > created correctly. Then you could check whether it is correctly passed
> > passed to swapSolver function.
>
> These are the results I got. For convenience I am pasting the
> method here where the problem is occuring, please forgive :)
>
> StepCore::Solver* WorldModel::swapSolver(StepCore::Solver* solver)
> {
>     bool selected = selectionModel()->isSelected(solverIndex());
>     bool current = selectionModel()->currentIndex() == solverIndex();
>     beginRemoveRows(QModelIndex(), 1, 1);
>     StepCore::Solver* oldSolver = _world->removeSolver();
>     endRemoveRows();
>     beginInsertRows(QModelIndex(), 1, 1);
>     _world->setSolver(solver);
>     endInsertRows();
>     if(selected) selectionModel()->select(solverIndex(),
> QItemSelectionModel::Select);
>     if(current) selectionModel()->setCurrentIndex(solverIndex(),
> QItemSelectionModel::Current);
>     emitChanged(true, true);
>     return oldSolver;
> }
>
> Everything seems to be fine until first call goes to beginRemoveRows ()
> and then to _world->removeSolver(), but the program crashes when
> endRemoveRows() is called.
Hm, it seems that you are very close the the solution.

> Still not sure whats causing it. But I still did
> not understand why a new object QModelIndex() was created and passed
> to beginRemoveRows. Is that causing some kind of problem? The API
> asks to pass the parent index but we pass a newly created index.
> Is that all Ok?
This is OK, the QModelIndex is always a temporary object that just references 
actual data in the model (i.e. if two QModelIndex instances have the same row, 
column, parent and internalPointer then they are considered equal) so we can 
always create new QModelIndex with the same data instead of passing existing 
one. Here we use QModelIndex constructor that creates invalid index and 
passing it as a parent means that we want to remove top-level item.

But you say that the program crashed on endInsertRows() which causes Qt to 
reinspect our model by calling other methods of it. Crashing at this point 
could indicate some inconsistency in the model state and as it happens after 
removing the solver probably it has some connection to the solver. Indeed, 
take a look at WorldModel::rowCount function. It always returns the same 
number of top-level rows, moreover it asserts that the solver always exists !

Now we have two solution: either rewrite the model to allow removing the 
solver, or just avoid removing the solver. Indeed, the function removes it and 
immediately reinserts back which is just the same as simply changing it - we 
can keep the fact that it was removed in secret from Qt :-)

Why have I added that that beginRemoveRows/... calls ? I can't remember, 
probably that was just another stupid mistake that everyone sometimes makes :) 
Thanks a lot for finding it !

Do you have KDE svn account ? If not, just send me a patch and I'll commit it 
mentioning your name.

--

-- 
      Best Regards,
        Vladimir
Tiago Porangaba | 3 Feb 22:27 2009
Picon

Re: : kbruch doesn't show solution to some exercise

Hello Nadav!

Did you already create a entry on bugs.kde.org?

If not.. I will and as soon as possible try to correct this bug!

Cheers,
Tiago Porangaba



_______________________________________________
kde-edu mailing list
kde-edu <at> mail.kde.org
https://mail.kde.org/mailman/listinfo/kde-edu
Nadav Vinik | 3 Feb 22:37 2009
Picon

Re: [kde-edu]: kbruch doesn't show solution to some exercise

2009/2/3 Tiago Porangaba <tiagoporangaba <at> gmail.com>:
> Hello Nadav!
>
> Did you already create a entry on bugs.kde.org?

I open now: https://bugs.kde.org/show_bug.cgi?id=183063

bugs.kde.org wasn't available then

>
> If not.. I will and as soon as possible try to correct this bug!
>
> Cheers,
> Tiago Porangaba
>
> 2009/1/31 Nadav Vinik <nadavvin <at> gmail.com>
>>
>> http://img401.imageshack.us/my.php?image=kbruch2fd2.jpg
>> _______________________________________________
>> kde-edu mailing list
>> kde-edu <at> mail.kde.org
>> https://mail.kde.org/mailman/listinfo/kde-edu
>
>
>
> _______________________________________________
> kde-edu mailing list
> kde-edu <at> mail.kde.org
> https://mail.kde.org/mailman/listinfo/kde-edu
>
>

--

-- 
הבלוג שלי:
http://nadavvin.com
_______________________________________________
kde-edu mailing list
kde-edu <at> mail.kde.org
https://mail.kde.org/mailman/listinfo/kde-edu
mvillarino | 3 Feb 17:58 2009
Picon

: [PARLEY]

Good day,

Today I've been having a look at Parley, windows 4.2 version.

I think this app can be useful to create and edit terminologies on TBX
format (specification can be found on the internet). This is a file
format commonly used by translators, and is the format used by
lokalize for it's glossary.

By adding to Parley the functionality of importing this files and
saving/exporting to them, will make this application usefull for a new
range of users: l10n teams; the profit they will get is that of having
a tool to edit (and share through hot new stuff) this files and the
possibility of also use this tool to train new translators.

Thanks for your attention,

Marce Villarino

Gmane