Skip to content

Commit

Permalink
Remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
wonder-sk committed Sep 24, 2015
1 parent e5cca75 commit 7b48d95
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 60 deletions.
54 changes: 0 additions & 54 deletions src/app/qgsrulebasedlabelingwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ void QgsRuleBasedLabelingWidget::addRule()
int rows = mModel->rowCount();
mModel->insertRule( QModelIndex(), rows, newrule );
}
// TODO mModel->clearFeatureCounts();
}
else
{
Expand All @@ -114,7 +113,6 @@ void QgsRuleBasedLabelingWidget::editRule( const QModelIndex& index )
{
// model should know about the change and emit dataChanged signal for the view
mModel->updateRule( index.parent(), index.row() );
// TODO mModel->clearFeatureCounts();
}
}

Expand All @@ -130,7 +128,6 @@ void QgsRuleBasedLabelingWidget::removeRule()
}
// make sure that the selection is gone
viewRules->selectionModel()->clear();
// TODO mModel->clearFeatureCounts();
}

void QgsRuleBasedLabelingWidget::copy()
Expand Down Expand Up @@ -227,41 +224,6 @@ QVariant QgsRuleBasedLabelingModel::data( const QModelIndex& index, int role ) c
case 2: return rule->dependsOnScale() ? _formatScale( rule->scaleMaxDenom() ) : QVariant();
case 3: return rule->dependsOnScale() ? _formatScale( rule->scaleMinDenom() ) : QVariant();
case 4: return rule->settings() ? rule->settings()->fieldName : QVariant();
#if 0 // TODO: feature counts?
case 4:
if ( mFeatureCountMap.count( rule ) == 1 )
{
return QVariant( mFeatureCountMap[rule].count );
}
return QVariant();
case 5:
if ( mFeatureCountMap.count( rule ) == 1 )
{
if ( role == Qt::DisplayRole )
{
return QVariant( mFeatureCountMap[rule].duplicateCount );
}
else // tooltip - detailed info about duplicates
{
if ( mFeatureCountMap[rule].duplicateCount > 0 )
{
QString tip = "<p style='margin:0px;'><ul>";
Q_FOREACH ( QgsRuleBasedRendererV2::Rule* duplicateRule, mFeatureCountMap[rule].duplicateCountMap.keys() )
{
QString label = duplicateRule->label().replace( "&", "&amp;" ).replace( ">", "&gt;" ).replace( "<", "&lt;" );
tip += tr( "<li><nobr>%1 features also in rule %2</nobr></li>" ).arg( mFeatureCountMap[rule].duplicateCountMap[duplicateRule] ).arg( label );
}
tip += "</ul>";
return tip;
}
else
{
return 0;
}
}
}
return QVariant();
#endif
default: return QVariant();
}
}
Expand Down Expand Up @@ -313,18 +275,6 @@ QVariant QgsRuleBasedLabelingModel::headerData( int section, Qt::Orientation ori
QStringList lst; lst << tr( "Label" ) << tr( "Rule" ) << tr( "Min. scale" ) << tr( "Max. scale" ) << tr( "Text" ); // << tr( "Count" ) << tr( "Duplicate count" );
return lst[section];
}
else if ( orientation == Qt::Horizontal && role == Qt::ToolTipRole )
{
/* TODO
if ( section == 4 ) // Count
{
return tr( "Number of features in this rule." );
}
else if ( section == 5 ) // Duplicate count
{
return tr( "Number of features in this rule which are also present in other rule(s)." );
}*/
}

return QVariant();
}
Expand Down Expand Up @@ -530,8 +480,6 @@ bool QgsRuleBasedLabelingModel::removeRows( int row, int count, const QModelInde
if ( row < 0 || row >= parentRule->children().count() )
return false;

// TODO QgsDebugMsg( QString( "Called: row %1 count %2 parent ~~%3~~" ).arg( row ).arg( count ).arg( parentRule->dump() ) );

beginRemoveRows( parent, row, row + count - 1 );

for ( int i = 0; i < count; i++ )
Expand Down Expand Up @@ -562,8 +510,6 @@ void QgsRuleBasedLabelingModel::insertRule( const QModelIndex& parent, int befor
{
beginInsertRows( parent, before, before );

// TODO QgsDebugMsg( QString( "insert before %1 rule: %2" ).arg( before ).arg( newrule->dump() ) );

QgsRuleBasedLabeling::Rule* parentRule = ruleForIndex( parent );
parentRule->insertChild( before, newrule );

Expand Down
6 changes: 0 additions & 6 deletions src/app/qgsrulebasedlabelingwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,8 @@ class GUI_EXPORT QgsRuleBasedLabelingModel : public QAbstractItemModel
void willAddRules( const QModelIndex& parent, int count ); // call beginInsertRows
void finishedAddingRules(); // call endInsertRows

//! @note not available in python bindungs
// TODO
//void setFeatureCounts( QMap<QgsRuleBasedRendererV2::Rule*, QgsRuleBasedRendererV2Count> theCountMap );
//void clearFeatureCounts();

protected:
QgsRuleBasedLabeling::Rule* mRootRule;
// TODO QMap<QgsRuleBasedRendererV2::Rule*, QgsRuleBasedRendererV2Count> mFeatureCountMap;
};


Expand Down

0 comments on commit 7b48d95

Please sign in to comment.