Commit 6dab5436 authored by Michael Reeves's avatar Michael Reeves

*port away from KComponentData

*update constructor for KPart plugin.
parent 7c07892d
......@@ -39,7 +39,6 @@
#include <QPrintDialog>
// include files for KDE
#include <kcomponentdata.h>
#include <kiconloader.h>
#include <kmessagebox.h>
#include <kfiledialog.h>
......@@ -50,7 +49,6 @@
#include <kstandardaction.h>
#include <kcmdlineargs.h>
//#include <kkeydialog.h>
#include <kglobal.h>
#include <ktoggleaction.h>
#include <ktoolbar.h>
#include <kiconloader.h>
......@@ -160,7 +158,7 @@ KDiff3App::KDiff3App(QWidget* pParent, const char* /*name*/, KDiff3Part* pKDiff3
// This is just a convenience variable to make code that accesses options more readable
m_pOptions = &m_pOptionDialog->m_options;
m_pOptionDialog->readOptions( isPart() ? m_pKDiff3Part->componentData()).config() : KGlobal::config() );
m_pOptionDialog->readOptions( KSharedConfig::openConfig() );
// Option handling: Only when pParent==0 (no parent)
KCmdLineArgs *args = isPart() ? 0 : KCmdLineArgs::parsedArgs();
......@@ -653,7 +651,7 @@ void KDiff3App::saveOptions( KSharedConfigPtr config )
bool KDiff3App::queryClose()
{
saveOptions( isPart() ? ((m_pKDiff3Part->componentData().config()) : KGlobal::config() );
saveOptions( KSharedConfig::openConfig() );
if(m_bOutputModified)
{
......
......@@ -19,9 +19,8 @@
#include "kdiff3_part.h"
#include <KAboutData>
//#include <KAboutData>
#include <K4AboutData>
#include <kcomponentdata.h>
#include <QAction>
#include <kstandardaction.h>
#include <kfiledialog.h>
......@@ -51,12 +50,12 @@ static KAboutData createAboutData()
K_PLUGIN_FACTORY( KDiff3PartFactory, registerPlugin<KDiff3Part>(); )
KDiff3Part::KDiff3Part( QWidget *parentWidget, const char *widgetName,
QObject *parent )
KDiff3Part::KDiff3Part( QWidget *parentWidget, QObject *parent, const QVariantList &args)
: KParts::ReadWritePart( parent )
{
// we need an instance
//setComponentData( KPluginFactory::componentData() );
const char *widgetName = args[0].toString().toUtf8().data();
// this should be your custom internal widget
m_widget = new KDiff3App( parentWidget, widgetName, this );
......@@ -84,7 +83,7 @@ KDiff3Part::KDiff3Part( QWidget *parentWidget, const char *widgetName,
KDiff3Part::~KDiff3Part()
{
if( m_widget != 0 && ! m_bIsShell ) {
m_widget->saveOptions( m_widget->isPart() ? KPluginFactory::componentData().config() : KGlobal::config() );
m_widget->saveOptions( KSharedConfig::openConfig() );
}
}
......
......@@ -41,8 +41,7 @@ public:
/**
* Default constructor
*/
KDiff3Part(QWidget *parentWidget, const char *widgetName,
QObject *parent );
KDiff3Part(QWidget *parentWidget, QObject *parent, const QVariantList &args );
/**
* Destructor
......
......@@ -149,7 +149,7 @@ void KDiff3Shell::optionsConfigureKeys()
void KDiff3Shell::optionsConfigureToolbars()
{
KConfigGroup mainWindowGroup( KGlobal::config(), "MainWindow" );
KConfigGroup mainWindowGroup( KSharedConfig::openConfig(), "MainWindow" );
saveMainWindowSettings( mainWindowGroup );
// use the standard toolbar editor
......@@ -160,7 +160,7 @@ void KDiff3Shell::optionsConfigureToolbars()
void KDiff3Shell::applyNewToolbarConfig()
{
KConfigGroup mainWindowGroup( KGlobal::config(), "MainWindow" );
KConfigGroup mainWindowGroup( KSharedConfig::openConfig(), "MainWindow" );
applyMainWindowSettings( mainWindowGroup );
}
......
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