Commit c77ec753 authored by Matthias Kretz's avatar Matthias Kretz
Browse files

merge the kinstance-redesign branch back to trunk.

svn path=/trunk/KDE/kdebase/khelpcenter/; revision=628276
parent 3ed7c299
......@@ -24,7 +24,7 @@
#include <QByteArray>
//Added by qt3to4:
#include <QTextStream>
#include <kinstance.h>
#include <kcomponentdata.h>
#include <kurl.h>
using namespace KIO;
......@@ -61,7 +61,7 @@ extern "C"
{
int KDE_EXPORT kdemain( int argc, char **argv ) {
KInstance instance("kio_about");
KComponentData componentData("kio_about");
if (argc != 4)
{
......
......@@ -24,7 +24,7 @@
#include <kdebug.h>
#include <kprocess.h>
#include <kstandarddirs.h>
#include <kinstance.h>
#include <kcomponentdata.h>
#include <klocale.h>
#include <kconfig.h>
......@@ -199,7 +199,7 @@ extern "C" { int KDE_EXPORT kdemain( int argc, char **argv ); }
int kdemain( int argc, char **argv )
{
KInstance instance( "kio_cgi" );
KComponentData componentData( "kio_cgi" );
kDebug(7124) << "kio_cgi starting " << getpid() << endl;
......
......@@ -19,7 +19,7 @@
#include <kconfig.h>
#include <klocale.h>
#include <kglobal.h>
#include <kinstance.h>
#include <kcomponentdata.h>
#include <kaboutdata.h>
#include <kfiledialog.h>
#include <khbox.h>
......@@ -39,7 +39,7 @@ typedef KGenericFactory<KCMCgi> KCMCgiFactory;
K_EXPORT_COMPONENT_FACTORY(cgi, KCMCgiFactory("kcmcgi"))
KCMCgi::KCMCgi(QWidget *parent, const QStringList &)
: KCModule(KCMCgiFactory::instance(), parent)
: KCModule(KCMCgiFactory::componentData(), parent)
{
setButtons(Default|Apply);
......
......@@ -25,7 +25,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <stdio.h>
#include <stdlib.h>
#include <kinstance.h>
#include <kcomponentdata.h>
#include <kdebug.h>
#include <kmimetype.h>
#include <kfilterbase.h>
......@@ -35,7 +35,7 @@ extern "C" { KDE_EXPORT int kdemain(int argc, char **argv); }
int kdemain( int argc, char ** argv)
{
KInstance instance( "kio_filter" );
KComponentData componentData( "kio_filter" );
kDebug(7110) << "Starting " << getpid() << endl;
......
......@@ -28,7 +28,7 @@
#include <QRegExp>
#include <kdebug.h>
#include <kinstance.h>
#include <kcomponentdata.h>
#include <kglobal.h>
#include <kstandarddirs.h>
#include <klocale.h>
......@@ -45,7 +45,7 @@ extern "C"
{
KDE_EXPORT int kdemain( int argc, char **argv )
{
KInstance instance( "kio_finger" );
KComponentData componentData( "kio_finger" );
//kDebug() << "*** Starting kio_finger " << getpid() << endl;
......
......@@ -62,7 +62,7 @@
#include <kdebug.h>
#include <kmessagebox.h>
#include <kinstance.h>
#include <kcomponentdata.h>
#include <kglobal.h>
#include <kstandarddirs.h>
#include <klocale.h>
......@@ -122,7 +122,7 @@ static void ripper(int)
int KDE_EXPORT kdemain( int argc, char **argv )
{
KLocale::setMainCatalog("kio_fish");
KInstance instance("fish");
KComponentData componentData("fish");
myDebug( << "*** Starting fish " << endl);
if (argc != 4) {
......
......@@ -43,7 +43,7 @@
#include "kio_floppy.h"
#include <kinstance.h>
#include <kcomponentdata.h>
#include <kdebug.h>
#include <kio/global.h>
#include <klocale.h>
......@@ -54,7 +54,7 @@ extern "C" { KDE_EXPORT int kdemain(int argc, char **argv); }
int kdemain( int argc, char **argv )
{
KInstance instance( "kio_floppy" );
KComponentData componentData( "kio_floppy" );
if (argc != 4)
{
......
......@@ -11,7 +11,7 @@
#include <kprocess.h>
#include <kstandarddirs.h>
#include <kiconloader.h>
#include <kinstance.h>
#include <kcomponentdata.h>
#include <klocale.h>
#include "info.h"
......@@ -24,7 +24,7 @@ InfoProtocol::InfoProtocol( const QByteArray &pool, const QByteArray &app )
, m_node( "" )
{
kDebug( 7108 ) << "InfoProtocol::InfoProtocol" << endl;
m_iconLoader = new KIconLoader(KGlobal::instance()->instanceName(), KGlobal::instance()->dirs());
m_iconLoader = new KIconLoader(KGlobal::mainComponent().componentName(), KGlobal::mainComponent().dirs());
m_perl = KGlobal::dirs()->findExe( "perl" );
m_infoScript = KStandardDirs::locate( "data", "kio_info/kde-info2html" );
m_infoConf = KStandardDirs::locate("data", "kio_info/kde-info2html.conf");
......@@ -240,7 +240,7 @@ extern "C" { int KDE_EXPORT kdemain( int argc, char **argv ); }
int kdemain( int argc, char **argv )
{
KInstance instance( "kio_info" );
KComponentData componentData( "kio_info" );
kDebug() << "kio_info starting " << getpid() << endl;
......
......@@ -74,8 +74,8 @@ private:
SearchProvider *m_provider;
};
FilterOptions::FilterOptions(KInstance *instance, QWidget *parent)
:KCModule(instance, parent)
FilterOptions::FilterOptions(const KComponentData &componentData, QWidget *parent)
:KCModule(componentData, parent)
{
QVBoxLayout *mainLayout = new QVBoxLayout( this );
mainLayout->setMargin( KDialog::marginHint() );
......@@ -208,7 +208,7 @@ void FilterOptions::save()
// kDebug () << "Engine: " << m_defaultEngineMap[engine] << endl;
int changedProviderCount = 0;
QString path = kapp->dirs()->saveLocation("services", "searchproviders/");
QString path = KGlobal::mainComponent().dirs()->saveLocation("services", "searchproviders/");
m_favoriteEngines.clear();
......@@ -276,7 +276,7 @@ void FilterOptions::save()
for (QStringList::ConstIterator it = m_deletedProviders.begin();
it != m_deletedProviders.end(); ++it)
{
QStringList matches = kapp->dirs()->findAllResources("services", "searchproviders/" + *it + ".desktop");
QStringList matches = KGlobal::mainComponent().dirs()->findAllResources("services", "searchproviders/" + *it + ".desktop");
// Shouldn't happen
if (!matches.count())
......
......@@ -44,7 +44,7 @@ class FilterOptions : public KCModule
Q_OBJECT
public:
FilterOptions(KInstance *instance, QWidget *parent = 0);
FilterOptions(const KComponentData &componentData, QWidget *parent = 0);
void load();
void save();
......
......@@ -23,7 +23,6 @@
#include <kdebug.h>
#include <klocale.h>
#include <kurl.h>
#include <kinstance.h>
#include <kglobal.h>
#include "ikwsopts.h"
......
......@@ -26,8 +26,6 @@
#include <kurifilter.h>
class KInstance;
class KAutoWebSearch : public KUriFilterPlugin
{
Q_OBJECT
......
......@@ -23,7 +23,7 @@
#include <kdebug.h>
#include <klocale.h>
#include <kinstance.h>
#include <kcomponentdata.h>
#include <kglobal.h>
#include "ikwsopts.h"
......@@ -82,7 +82,7 @@ bool KUriSearchFilter::filterUri( KUriFilterData &data ) const
KCModule *KUriSearchFilter::configModule(QWidget *parent, const char *) const
{
return new FilterOptions( KUriSearchFilterFactory::instance(), parent);
return new FilterOptions( KUriSearchFilterFactory::componentData(), parent);
}
QString KUriSearchFilter::configName() const
......
......@@ -26,8 +26,6 @@
#include <kurifilter.h>
class KInstance;
class KUriSearchFilter : public KUriFilterPlugin
{
Q_OBJECT
......
......@@ -27,7 +27,6 @@
#include <kurifilter.h>
#include <QRegExp>
class KInstance;
class KProcess;
/*
......
......@@ -28,8 +28,6 @@
//Added by qt3to4:
#include <QList>
class KInstance;
/**
* This is short URL filter class.
*
......
......@@ -9,7 +9,7 @@
#include <netinet/in.h>
#include <kdebug.h>
#include <kinstance.h>
#include <kcomponentdata.h>
#include <klocale.h>
#include <kldap/ldif.h>
......@@ -28,7 +28,7 @@ extern "C" { int KDE_EXPORT kdemain(int argc, char **argv); }
*/
int kdemain( int argc, char **argv )
{
KInstance instance( "kio_ldap" );
KComponentData componentData( "kio_ldap" );
kDebug(7125) << "Starting " << getpid() << endl;
......
......@@ -32,7 +32,7 @@
#include <QRegExp>
#include <kdebug.h>
#include <kinstance.h>
#include <kcomponentdata.h>
#include <kglobal.h>
#include <kstandarddirs.h>
#include <kprocess.h>
......@@ -688,7 +688,7 @@ extern "C"
int KDE_EXPORT kdemain( int argc, char **argv ) {
KInstance instance("kio_man");
KComponentData componentData("kio_man");
kDebug(7107) << "STARTING " << getpid() << endl;
......
......@@ -20,7 +20,7 @@
#include "kmanpart.h"
#include <QString>
#include <kinstance.h>
#include <kcomponentdata.h>
#include <kglobal.h>
#include <kdebug.h>
#include <klocale.h>
......@@ -36,7 +36,7 @@ extern "C"
}
}
KInstance* KManPartFactory::s_instance = 0L;
KComponentData *KManPartFactory::s_instance = 0L;
KAboutData* KManPartFactory::s_about = 0L;
KManPartFactory::KManPartFactory( QObject* parent )
......@@ -57,15 +57,15 @@ KParts::Part* KManPartFactory::createPartObject( QWidget * parentWidget, QObject
return part;
}
KInstance* KManPartFactory::instance()
const KComponentData &KManPartFactory::componentData()
{
if( !s_instance )
{
s_about = new KAboutData( "kmanpart",
I18N_NOOP( "KMan" ), KDE_VERSION_STRING );
s_instance = new KInstance( s_about );
s_instance = new KComponentData(s_about);
}
return s_instance;
return *s_instance;
}
......@@ -73,8 +73,7 @@ KManPart::KManPart( QWidget * parent )
: KHTMLPart( parent )
,m_job(0)
{
KInstance * instance = new KInstance( "kmanpart" );
setInstance( instance );
setComponentData(KComponentData("kmanpart"));
m_extension=new KParts::BrowserExtension(this);
}
......
......@@ -30,7 +30,7 @@
#include <kio/job.h>
#include <kio/jobclasses.h>
class KInstance;
class KComponentData;
class KAboutData;
/**
......@@ -48,10 +48,10 @@ class KManPartFactory: public KParts::Factory
QObject* parent, const char * classname,
const QStringList &args);
static KInstance * instance();
static const KComponentData &componentData();
private:
static KInstance * s_instance;
static KComponentData *s_instance;
static KAboutData * s_about;
};
......@@ -70,7 +70,6 @@ class KManPart : public KHTMLPart
void jobDone( KJob *);
protected:
virtual bool openFile();
KInstance *m_instance;
KParts::BrowserExtension * m_extension;
KIO::TransferJob *m_job;
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment