~ubuntu-branches/ubuntu/maverick/kdeutils/maverick-proposed

« back to all changes in this revision

Viewing changes to okteta/kasten/controllers/view/structures/datatypes/datainformationwithchildren.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2010-07-09 04:21:43 UTC
  • mfrom: (1.2.47 upstream)
  • Revision ID: james.westby@ubuntu.com-20100709042143-g7b98oq44qrc35cf
Tags: 4:4.4.92-0ubuntu1
* New upstream release
  - Bump kde-sc-dev-latest to 4.4.92

Show diffs side-by-side

added added

removed removed

Lines of Context:
98
98
 
99
99
DataInformationWithChildren::~DataInformationWithChildren()
100
100
{
101
 
//    qDeleteAll(mChildren); // no need since this is set to their parent
 
101
    //    qDeleteAll(mChildren); // no need since this is set to their parent
102
102
}
103
103
 
104
104
DataInformationWithChildren::DataInformationWithChildren(QString& name, int index,
328
328
    DataInformation* convertedVal = conv.convert();
329
329
 
330
330
    if (!convertedVal)
 
331
    {
331
332
        ScriptUtils::object()->logScriptError("Parsing of children failed"
332
333
            " in setChildren(), please check script for errors");
 
334
        return;
 
335
    }
333
336
    //is valid now
 
337
    //childcount changed to 0
 
338
    emit childrenAboutToBeRemoved(this, 0, childCount() - 1);
334
339
    qDeleteAll(mChildren);
335
340
    mChildren.clear();
336
 
    for (int i = 0; i < convertedVal->childCount(); ++i)
337
 
    {
338
 
        DataInformation* child = convertedVal->childAt(i);
339
 
        appendChild(child);
340
 
    }
 
341
    emit childrenRemoved(this, 0, childCount() - 1);
341
342
    if (convertedVal->childCount() < 1)
342
343
        ScriptUtils::object()->logScriptError("Value from setChildren for " + name()
343
344
                + " has no children, please check script for errors");
344
 
    kDebug() << "setting children of " + name();
 
345
    else
 
346
    {
 
347
        emit childrenAboutToBeInserted(this, 0, convertedVal->childCount() - 1);
 
348
        for (int i = 0; i < convertedVal->childCount(); ++i)
 
349
        {
 
350
            DataInformation* child = convertedVal->childAt(i);
 
351
            appendChild(child);
 
352
        }
 
353
        emit childrenInserted(this, 0, convertedVal->childCount() - 1);
 
354
    }
 
355
    kDebug()
 
356
        << "setting children of " + name();
 
357
    delete convertedVal;
345
358
}
346
359