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

« back to all changes in this revision

Viewing changes to okteta/kasten/controllers/view/structures/structtreemodel.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:
159
159
        childItem = mTool->childAt(row);
160
160
    else
161
161
    {
 
162
        if (parent.column() != 0)
 
163
            return QModelIndex();
162
164
        DataInformation* parentItem =
163
165
                static_cast<DataInformation*> (parent.internalPointer());
164
166
        childItem = parentItem->childAt(row);
172
174
            //assume that all items with children can change their childCount
173
175
            if (!mItemsWithSignalConnected.contains(chldItm))
174
176
            {
175
 
//                kDebug()
176
 
//                    << "connecting '" << childItem->name()
177
 
//                            << "'s childCountChanged signal to model";
 
177
                //                kDebug()
 
178
                //                    << "connecting '" << childItem->name()
 
179
                //                            << "'s childCountChanged signal to model";
178
180
                //only connect once
179
 
                mItemsWithSignalConnected.append(chldItm);
 
181
                mItemsWithSignalConnected.insert(chldItm);
180
182
                connect(childItem, SIGNAL(destroyed(QObject*)),
181
183
                        SLOT(removeItemFromSignalsList(QObject*))); //remove after was deleted
182
184
 
232
234
{
233
235
    if (!parent.isValid())
234
236
        return mTool->childCount();
 
237
    if (parent.column() != 0)
 
238
        return 0;
235
239
    DataInformation* parentItem =
236
240
            static_cast<DataInformation*> (parent.internalPointer());
237
241
    if (!parentItem)
258
262
void StructTreeModel::removeItemFromSignalsList(QObject* obj)
259
263
{
260
264
    //obj has been deleted -> remove from list
261
 
    mItemsWithSignalConnected.removeAll(
 
265
    mItemsWithSignalConnected.remove(
262
266
            dynamic_cast<DataInformationWithChildren*> (obj));
263
267
}
264
268