[Uml-devel] branches/work/kinstance-redesign/kdesdk
Matthias Kretz
kretz at kde.org
Sun Jan 28 22:39:26 UTC 2007
SVN commit 628052 by mkretz:
port to KComponentData (not all is tested as it is not enabled for compilation)
M +2 -2 kapptemplate/kpartapp/app_part.cpp
M +1 -1 kapptemplate/kpartplugin/plugin_app.cpp
M +2 -2 kioslave/svn/svn.cpp
M +1 -1 kmtrace/demangle.cpp
M +2 -2 kmtrace/kmtrace.cpp
M +1 -1 kmtrace/match.cpp
M +5 -5 kompare/komparenavtreepart/komparenavtreepart.cpp
M +3 -3 kompare/komparenavtreepart/komparenavtreepart.h
M +3 -3 kompare/komparepart/kompare_part.cpp
M +2 -2 kompare/kompareurldialog.cpp
M +1 -0 kompare/libdialogpages/viewsettings.cpp
M +2 -2 kstartperf/kstartperf.cpp
M +2 -2 kuiviewer/kuiviewer_part.cpp
M +2 -2 kunittest/guimodrunner.cpp
M +1 -1 scripts/fixheaders
M +2 -2 umbrello/umbrello/plugin.h
M +12 -12 umbrello/umbrello/uml.cpp
M +3 -2 umbrello/umbrello/uml.h
--- branches/work/kinstance-redesign/kdesdk/kapptemplate/kpartapp/app_part.cpp #628051:628052
@@ -4,7 +4,7 @@
#include "${APP_NAME_LC}_part.moc"
-#include <kinstance.h>
+#include <kcomponentdata.h>
#include <kaction.h>
#include <kstandardaction.h>
#include <kfiledialog.h>
@@ -21,7 +21,7 @@
: KParts::ReadWritePart(parent)
{
// we need an instance
- setInstance( ${APP_NAME}PartFactory::instance() );
+ setComponentData( ${APP_NAME}PartFactory::componentData() );
// this should be your custom internal widget
m_widget = new Q3MultiLineEdit( parentWidget);
--- branches/work/kinstance-redesign/kdesdk/kapptemplate/kpartplugin/plugin_app.cpp #628051:628052
@@ -4,7 +4,7 @@
#include <khtml_part.h>
#include <kaction.h>
-#include <kinstance.h>
+#include <kcomponentdata.h>
#include <kmessagebox.h>
#include <klocale.h>
#include <kgenericfactory.h>
--- branches/work/kinstance-redesign/kdesdk/kioslave/svn/svn.cpp #628051:628052
@@ -31,7 +31,7 @@
#include <kapplication.h>
#include <kdebug.h>
#include <kmessagebox.h>
-#include <kinstance.h>
+#include <kcomponentdata.h>
#include <kglobal.h>
#include <kstandarddirs.h>
#include <klocale.h>
@@ -1566,7 +1566,7 @@
extern "C"
{
KDE_EXPORT int kdemain(int argc, char **argv) {
- KInstance instance( "kio_svn" );
+ KComponentData componentData( "kio_svn" );
kDebug(7128) << "*** Starting kio_svn " << endl;
--- branches/work/kinstance-redesign/kdesdk/kmtrace/demangle.cpp #628051:628052
@@ -10,7 +10,7 @@
#include <q3valuelist.h>
#include <stdlib.h>
#include <ktemporaryfile.h>
-#include <kinstance.h>
+#include <kcomponentdata.h>
#include <kstandarddirs.h>
#include <kcmdlineargs.h>
--- branches/work/kinstance-redesign/kdesdk/kmtrace/kmtrace.cpp #628051:628052
@@ -11,7 +11,7 @@
#include <Q3CString>
#include <stdlib.h>
#include <ktemporaryfile.h>
-#include <kinstance.h>
+#include <kcomponentdata.h>
#include <kstandarddirs.h>
#include <kcmdlineargs.h>
#include <kprocess.h>
@@ -582,7 +582,7 @@
int main(int argc, char *argv[])
{
- KInstance instance("kmtrace");
+ KComponentData componentData("kmtrace");
KCmdLineArgs::init(argc, argv, "kmtrace", "kmtrace", "KDE Memory leak tracer", "v1.0");
--- branches/work/kinstance-redesign/kdesdk/kmtrace/match.cpp #628051:628052
@@ -10,7 +10,7 @@
#include <q3valuelist.h>
#include <stdlib.h>
#include <ktemporaryfile.h>
-#include <kinstance.h>
+#include <kcomponentdata.h>
#include <kstandarddirs.h>
#include <kcmdlineargs.h>
--- branches/work/kinstance-redesign/kdesdk/kompare/komparenavtreepart/komparenavtreepart.cpp #628051:628052
@@ -23,7 +23,7 @@
#include <kmimetype.h>
#include <k3listview.h>
#include <kaboutdata.h>
-#include <kinstance.h>
+#include <kcomponentdata.h>
#include "difference.h"
#include "diffmodel.h"
@@ -661,7 +661,7 @@
}
// part stuff
-KInstance* KompareNavTreePartFactory::s_instance = 0L;
+KComponentData *KompareNavTreePartFactory::s_instance = 0L;
KAboutData* KompareNavTreePartFactory::s_about = 0L;
KompareNavTreePartFactory::KompareNavTreePartFactory()
@@ -689,16 +689,16 @@
return obj;
}
-KInstance* KompareNavTreePartFactory::instance()
+const KComponentData &KompareNavTreePartFactory::componentData()
{
if( !s_instance )
{
s_about = new KAboutData("komparenavtreepart", I18N_NOOP("KompareNavTreePart"), "1.1");
s_about->addAuthor("John Firebaugh", "Author", "jfirebaugh at kde.org");
s_about->addAuthor("Otto Bruggeman", "Author", "otto.bruggeman at home.nl" );
- s_instance = new KInstance(s_about);
+ s_instance = new KComponentData(s_about);
}
- return s_instance;
+ return *s_instance;
}
extern "C"
--- branches/work/kinstance-redesign/kdesdk/kompare/komparenavtreepart/komparenavtreepart.h #628051:628052
@@ -172,7 +172,7 @@
};
// part stuff
-class KInstance;
+class KComponentData;
class KAboutData;
class KompareNavTreePartFactory : public KParts::Factory
@@ -184,10 +184,10 @@
virtual KParts::Part* createPartObject( QWidget *parentWidget, const char *widgetName,
QObject *parent, const char *name,
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;
};
--- branches/work/kinstance-redesign/kdesdk/kompare/komparepart/kompare_part.cpp #628051:628052
@@ -32,7 +32,7 @@
#include <klocale.h>
#include <kmessagebox.h>
#include <kstandardaction.h>
-#include <kinstance.h>
+#include <kcomponentdata.h>
#include <ktempfile.h>
#include <kparts/genericfactory.h>
//#include <ktempdir.h>
@@ -64,7 +64,7 @@
m_info()
{
// we need an instance
- setInstance( KomparePartFactory::instance() );
+ setComponentData( KomparePartFactory::componentData() );
if( !m_viewSettings ) {
m_viewSettings = new ViewSettings( 0 );
@@ -434,7 +434,7 @@
if( dlg->exec() ) {
w->saveOptions();
- KConfig* config = instance()->config();
+ KSharedConfig::Ptr config = componentData().config();
saveProperties( config );
config->sync();
--- branches/work/kinstance-redesign/kdesdk/kompare/kompareurldialog.cpp #628051:628052
@@ -34,7 +34,7 @@
: KPageDialog( parent, flags )
{
setFaceType( List );
- KConfig* cfg = KGlobal::config();
+ KSharedConfig::Ptr cfg = KGlobal::config();
// QVBox* filesBox = addVBoxPage( i18n( "Files" ), i18n( "Here you can enter the files you want to compare." ) );
m_filesPage = new FilesPage( 0 );
@@ -76,7 +76,7 @@
{
m_filesPage->setURLsInComboBoxes();
- KConfig* cfg = KGlobal::config();
+ KSharedConfig::Ptr cfg = KGlobal::config();
m_filesPage->apply();
m_diffPage->apply();
--- branches/work/kinstance-redesign/kdesdk/kompare/libdialogpages/viewsettings.cpp #628051:628052
@@ -21,6 +21,7 @@
#include <kconfig.h>
#include <kglobalsettings.h>
+#include <kconfiggroup.h>
#include "viewsettings.h"
--- branches/work/kinstance-redesign/kdesdk/kstartperf/kstartperf.cpp #628051:628052
@@ -23,7 +23,7 @@
#include <kaboutdata.h>
#include <kcmdlineargs.h>
#include <klocale.h>
-#include <kinstance.h>
+#include <kcomponentdata.h>
#include <kstandarddirs.h>
@@ -83,7 +83,7 @@
KCmdLineArgs::addCmdLineOptions(options);
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
- KInstance instance( &aboutData );
+ KComponentData componentData( &aboutData );
QCoreApplication app( *KCmdLineArgs::qt_argc(), *KCmdLineArgs::qt_argv() );
// Check arguments
--- branches/work/kinstance-redesign/kdesdk/kuiviewer/kuiviewer_part.cpp #628051:628052
@@ -28,7 +28,7 @@
#include <kdebug.h>
#include <kdialog.h>
#include <kiconloader.h>
-#include <kinstance.h>
+#include <kcomponentdata.h>
#include <kio/netaccess.h>
#include <k3listview.h>
#include <kparts/genericfactory.h>
@@ -59,7 +59,7 @@
: KParts::ReadOnlyPart(parent)
{
// we need an instance
- setInstance( KUIViewerPartFactory::instance() );
+ setComponentData( KUIViewerPartFactory::componentData() );
KGlobal::locale()->insertCatalog("kuiviewer");
--- branches/work/kinstance-redesign/kdesdk/kunittest/guimodrunner.cpp #628051:628052
@@ -26,7 +26,7 @@
#include <kdebug.h>
#include <kapplication.h>
#include <kglobal.h>
-#include <kinstance.h>
+#include <kcomponentdata.h>
#include <kaboutdata.h>
#include <kcmdlineargs.h>
#include <klocale.h>
@@ -49,7 +49,7 @@
int main( int argc, char **argv )
{
- KInstance instance("modrunner");
+ KComponentData componentData("modrunner");
KAboutData about("KUnitTestModRunner", I18N_NOOP("KUnitTestModRunner"), version, description,
KAboutData::License_BSD, "(C) 2005 Jeroen Wijnhout", 0, 0,
--- branches/work/kinstance-redesign/kdesdk/scripts/fixheaders #628051:628052
@@ -74,7 +74,7 @@
'implicit declaration of function `int UserIcon\(...\)\'' => "kiconloader",
'`KIcon\' undeclared \(first use this function\)' => "kiconloader",
'invalid use of undefined type `class KIconLoader' => "kiconloader",
- 'invalid use of undefined type `class KInstance' => "kinstance",
+ 'invalid use of undefined type `class KComponentData' => "kcomponentdata",
'invalid use of undefined type `class KStatusBar\'' => "kstatusbar",
'invalid use of undefined type `class QLabel\'' => "qlabel",
'invalid use of undefined type `class QImage\'' => "qimage",
--- branches/work/kinstance-redesign/kdesdk/umbrello/umbrello/plugin.h #628051:628052
@@ -76,8 +76,8 @@
* must not load GUI plugins.
*
* In order to provide application-like functionality, this class offers
- * support for accessing the configuration records of the KInstance object
- * corresponding to the shared library. Because the KInstance object is
+ * support for accessing the configuration records of the KComponentData object
+ * corresponding to the shared library. Because the KComponentData object is
* only available within the scope of the shared library, the configuration
* records must be set in the constructor of the derived plugin class. However,
* because the construction name is passed to this constructor (as are the
--- branches/work/kinstance-redesign/kdesdk/umbrello/umbrello/uml.cpp #628051:628052
@@ -157,7 +157,7 @@
m_refactoringAssist = 0L;
- m_commoncodegenpolicy = new CodeGenerationPolicy(m_config);
+ m_commoncodegenpolicy = new CodeGenerationPolicy(m_config.data());
m_imageExporterAll = new UMLViewImageExporterAll();
}
@@ -588,10 +588,10 @@
void UMLApp::saveOptions() {
- toolBar("mainToolBar")->saveSettings(m_config, "toolbar");
- toolsbar->saveSettings(m_config, "workbar");
- m_alignToolBar->saveSettings(m_config, "aligntoolbar");
- fileOpenRecent->saveEntries(m_config,"Recent Files");
+ toolBar("mainToolBar")->saveSettings(m_config.data(), "toolbar");
+ toolsbar->saveSettings(m_config.data(), "workbar");
+ m_alignToolBar->saveSettings(m_config.data(), "aligntoolbar");
+ fileOpenRecent->saveEntries(m_config.data(),"Recent Files");
m_config->setGroup( "General Options" );
m_config->writeEntry( "Geometry", size() );
@@ -655,10 +655,10 @@
// write the config for a language-specific code gen policy
if (m_policyext)
- m_policyext->writeConfig(m_config);
+ m_policyext->writeConfig(m_config.data());
// now write the basic defaults to the m_config file
- m_commoncodegenpolicy->writeConfig(m_config);
+ m_commoncodegenpolicy->writeConfig(m_config.data());
// next, we record the activeLanguage in the Code Generation Group
if (m_codegen) {
@@ -669,11 +669,11 @@
void UMLApp::readOptions() {
// bar status settings
- toolBar("mainToolBar")->applySettings(m_config, "toolbar");
+ toolBar("mainToolBar")->applySettings(m_config.data(), "toolbar");
// do config for work toolbar
- toolsbar->applySettings(m_config, "workbar");
- m_alignToolBar->applySettings(m_config, "aligntoolbar");
- fileOpenRecent->loadEntries(m_config,"Recent Files");
+ toolsbar->applySettings(m_config.data(), "workbar");
+ m_alignToolBar->applySettings(m_config.data(), "aligntoolbar");
+ fileOpenRecent->loadEntries(m_config.data(),"Recent Files");
m_config->setGroup("General Options");
setImageMimeType(m_config->readEntry("imageMimeType","image/png"));
QSize tmpQSize(630,460);
@@ -1337,7 +1337,7 @@
updateLangSelectMenu(pl);
if (m_policyext)
- m_policyext->setDefaults(m_config, false); // picks up language specific stuff
+ m_policyext->setDefaults(m_config.data(), false); // picks up language specific stuff
return m_codegen;
}
--- branches/work/kinstance-redesign/kdesdk/umbrello/umbrello/uml.h #628051:628052
@@ -26,6 +26,7 @@
#include <kmainwindow.h>
#include <kdeversion.h>
#include <kurl.h>
+#include <kconfig.h>
// forward declaration of the UML classes
class AlignToolBar;
@@ -816,7 +817,7 @@
*/
void slotMoveTabRight();
- KConfig *getConfig() { return m_config; }
+ KConfig* getConfig() { return m_config.data(); }
/**
* This slot deletes the current XHTML documentation generator as soon as
@@ -881,7 +882,7 @@
/**
* The configuration object of the application.
*/
- KConfig* m_config;
+ KSharedConfigPtr m_config;
/**
* View is the main widget which represents your working area.
More information about the umbrello-devel
mailing list