~smartboyhw/ubuntu/raring/calligra/2.6.0-0ubuntu1

« back to all changes in this revision

Viewing changes to libs/main/rdf/KoSopranoTableModel.cpp

  • Committer: Package Import Robot
  • Author(s): Philip Muškovac
  • Date: 2012-10-23 21:09:16 UTC
  • mfrom: (1.1.13)
  • Revision ID: package-import@ubuntu.com-20121023210916-m82w6zxnxhaxz7va
Tags: 1:2.5.90-0ubuntu1
* New upstream alpha release (LP: #1070436)
  - Add libkactivities-dev and libopenimageio-dev to build-depends
  - Add kubuntu_build_calligraactive.diff to build calligraactive by default
  - Add package for calligraauthor and move files that are shared between
    calligrawords and calligraauthor to calligrawords-common
* Document the patches
* Remove numbers from patches so they follow the same naming scheme as
  the rest of our patches.
* calligra-data breaks replaces krita-data (<< 1:2.5.3) (LP: #1071686)

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
    }
33
33
}
34
34
 
35
 
const Soprano::Model *KoSopranoTableModel::model() const
 
35
QSharedPointer<Soprano::Model> KoSopranoTableModel::model() const
36
36
{
37
37
    return m_rdf->model();
38
38
}
176
176
 */
177
177
bool KoSopranoTableModel::setDataUpdateTriple(const QModelIndex &index, Soprano::Statement &old, Soprano::Statement &n)
178
178
{
179
 
    const_cast<Soprano::Model*>(model())->addStatement(n);
180
 
    const_cast<Soprano::Model*>(model())->removeStatement(old);
 
179
    model()->addStatement(n);
 
180
    model()->removeStatement(old);
181
181
    m_statementIndex[ index.row()] = n;
182
182
    emit dataChanged(index, index);
183
183
    return true;
248
248
    int newRowNumber = rowCount();
249
249
    kDebug(30015) << "insert, newrow:" << newRowNumber << endl;
250
250
    beginInsertRows(parent, newRowNumber, newRowNumber);
251
 
    const_cast<Soprano::Model*>(model())->addStatement(st);
 
251
    model()->addStatement(st);
252
252
    m_statementIndex << st;
253
253
    endInsertRows();
254
254
    return newRowNumber;
280
280
        // is unique relative to the original.
281
281
        //
282
282
        Soprano::Node obj(QUrl(st.object().toString() + '-'
283
 
                               + const_cast<Soprano::Model*>(model())->createBlankNode().toString()));
 
283
                               + model()->createBlankNode().toString()));
284
284
        Soprano::Statement n(st.subject(), st.predicate(),
285
285
                             obj, st.context());
286
 
        const_cast<Soprano::Model*>(model())->addStatement(n);
 
286
        model()->addStatement(n);
287
287
        m_statementIndex << n;
288
288
        QModelIndex newIdx = index(currentNewRowNum, ColSubj);
289
289
        ret << newIdx;
316
316
        int firstRow =  r;
317
317
        int lastRow = r;
318
318
        beginRemoveRows(QModelIndex(), firstRow, lastRow);
319
 
        const_cast<Soprano::Model*>(model())->removeStatement(st);
 
319
        model()->removeStatement(st);
320
320
        // m_statementIndex[ r ] = Soprano::Statement();
321
321
        for (int i = r; i < m_statementIndex.size() - 1; ++i) {
322
322
            m_statementIndex[ i ] = m_statementIndex[ i + 1 ];