~kubuntu-members/print-manager/4.11

« back to all changes in this revision

Viewing changes to libkcups/JobModel.cpp

  • Committer: Daniel Nicoletti
  • Date: 2013-10-22 18:32:48 UTC
  • Revision ID: git-v1:21e1129eeae8fc7f8af5189bf668792099bba790
Make sure we have a valid job item.
BUG: 326455

Show diffs side-by-side

added added

removed removed

Lines of Context:
541
541
KCupsRequest* JobModel::modifyJob(int row, JobAction action, const QString &newDestName, const QModelIndex &parent)
542
542
{
543
543
    Q_UNUSED(parent)
 
544
 
 
545
    if (row < 0 || row >= rowCount()) {
 
546
        kWarning() << "Row number is invalid:" << row;
 
547
        return 0;
 
548
    }
 
549
 
544
550
    QStandardItem *job = item(row, ColStatus);
545
551
    int jobId = job->data(RoleJobId).toInt();
546
552
    QString destName = job->data(RoleJobPrinter).toString();