• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • KDevelop Platform Libraries
  • Sitemap
  • Contact Us
 

interfaces

iplugincontroller.cpp

00001 /* This file is part of the KDE project
00002 Copyright 2004 Alexander Dymo <adymo@kdevelop.org>
00003 Copyright     2006 Matt Rogers <mattr@kde.org
00004 Copyright 2007 Andreas Pakulat <apaku@gmx.de>
00005 
00006 Based on code from Kopete
00007 Copyright 2002-2003 Martijn Klingens <klingens@kde.org>
00008 
00009 This library is free software; you can redistribute it and/or
00010 modify it under the terms of the GNU Library General Public
00011 License as published by the Free Software Foundation; either
00012 version 2 of the License, or (at your option) any later version.
00013 
00014 This library is distributed in the hope that it will be useful,
00015 but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017 Library General Public License for more details.
00018 
00019 You should have received a copy of the GNU Library General Public License
00020 along with this library; see the file COPYING.LIB.  If not, write to
00021 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00022 Boston, MA 02110-1301, USA.
00023 */
00024 #include "iplugincontroller.h"
00025 
00026 #include <QtDesigner/QExtensionManager>
00027 
00028 #include <kservicetypetrader.h>
00029 #include "iplugin.h"
00030 
00031 namespace KDevelop
00032 {
00033 
00034 IPluginController::IPluginController( QObject* parent )
00035 : QObject( parent )
00036 {
00037 }
00038 
00039 
00040 IPluginController::~IPluginController()
00041 {
00042 }
00043 
00044 KPluginInfo::List IPluginController::query( const QString &serviceType,
00045         const QString &constraint )
00046 {
00047 
00048     KPluginInfo::List infoList;
00049     KService::List serviceList = KServiceTypeTrader::self() ->query( serviceType,
00050             QString( "%1 and [X-KDevelop-Version] == %2" ).arg( constraint ).arg( KDEVELOP_PLUGIN_VERSION ) );
00051 
00052     infoList = KPluginInfo::fromServices( serviceList );
00053     return infoList;
00054 }
00055 
00056 KPluginInfo::List IPluginController::queryPlugins( const QString &constraint )
00057 {
00058     return query( "KDevelop/Plugin", constraint );
00059 }
00060 
00061 QStringList IPluginController::argumentsFromService( const KService::Ptr &service )
00062 {
00063     QStringList args;
00064     if ( !service )
00065         // service is a reference to a pointer, so a check whether it is 0 is still required
00066         return args;
00067     QVariant prop = service->property( "X-KDevelop-Args" );
00068     if ( prop.isValid() )
00069         args = prop.toString().split( " " );
00070     return args;
00071 }
00072 
00073 void KDevelop::IPluginController::pluginUnloading(IPlugin * plugin)
00074 {
00075     emit pluginUnloaded(plugin);
00076 }
00077 
00078 }
00079 
00080 #include "iplugincontroller.moc"

interfaces

Skip menu "interfaces"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

KDevelop Platform Libraries

Skip menu "KDevelop Platform Libraries"
  • interfaces
  • language
  •   codegen
  •   duchain
  •   editor
  • outputview
  •     interfaces
  • project
  • shell
  • sublime
  • util
  • vcs
Generated for KDevelop Platform Libraries by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal