File tree 2 files changed +21
-2
lines changed
2 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -60,8 +60,11 @@ void QgsProcessingProvider::refreshAlgorithms()
60
60
{
61
61
qDeleteAll ( mAlgorithms );
62
62
mAlgorithms .clear ();
63
- loadAlgorithms ();
64
- emit algorithmsLoaded ();
63
+ if ( isActive () )
64
+ {
65
+ loadAlgorithms ();
66
+ emit algorithmsLoaded ();
67
+ }
65
68
}
66
69
67
70
QList<const QgsProcessingAlgorithm *> QgsProcessingProvider::algorithms () const
Original file line number Diff line number Diff line change @@ -323,6 +323,12 @@ class DummyProvider : public QgsProcessingProvider
323
323
return supportsNonFileOutputs;
324
324
}
325
325
326
+ bool isActive () const override
327
+ {
328
+ return active;
329
+ }
330
+
331
+ bool active = true ;
326
332
bool *unloaded = nullptr ;
327
333
bool supportsNonFileOutputs = false ;
328
334
@@ -1079,6 +1085,16 @@ void TestQgsProcessing::algorithm()
1079
1085
QCOMPARE ( providerRefreshed.count (), 2 + i );
1080
1086
}
1081
1087
1088
+ // inactive provider, should not load algorithms
1089
+ p->active = false ;
1090
+ p->refreshAlgorithms ();
1091
+ QCOMPARE ( providerRefreshed.count (), 3 );
1092
+ QVERIFY ( p->algorithms ().empty () );
1093
+ p->active = true ;
1094
+ p->refreshAlgorithms ();
1095
+ QCOMPARE ( providerRefreshed.count (), 4 );
1096
+ QVERIFY ( !p->algorithms ().empty () );
1097
+
1082
1098
QgsProcessingRegistry r;
1083
1099
r.addProvider ( p );
1084
1100
QCOMPARE ( r.algorithms ().size (), 2 );
You can’t perform that action at this time.
0 commit comments