diff options
Diffstat (limited to 'lib/interfaces/kdevplugincontroller.cpp')
-rw-r--r-- | lib/interfaces/kdevplugincontroller.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/interfaces/kdevplugincontroller.cpp b/lib/interfaces/kdevplugincontroller.cpp index 1cc6caa3..2a1b0770 100644 --- a/lib/interfaces/kdevplugincontroller.cpp +++ b/lib/interfaces/kdevplugincontroller.cpp @@ -27,8 +27,17 @@ KDevPluginController::KDevPluginController() TDETrader::OfferList KDevPluginController::query(const TQString &serviceType, const TQString &constraint) { - return TDETrader::self()->query(serviceType, - TQString("%1 and [X-TDevelop-Version] == %2").arg(constraint).arg(TDEVELOP_PLUGIN_VERSION)); + TQString versionConstraint = + TQString::fromLatin1("[X-TDevelop-Version] == %1").arg(TDEVELOP_PLUGIN_VERSION); + + TQString newConstraint; + if (!constraint.isEmpty()) { + newConstraint = TQString("( %1 ) and %2").arg(constraint).arg(versionConstraint); + } else { + newConstraint = versionConstraint; + } + + return TDETrader::self()->query(serviceType, newConstraint); } TDETrader::OfferList KDevPluginController::queryPlugins(const TQString &constraint) |