From kde-commits Sun Feb 15 20:05:03 2004 From: Dominique Devriese Date: Sun, 15 Feb 2004 20:05:03 +0000 To: kde-commits Subject: KDE_3_2_BRANCH: kdelibs/kdeprint Message-Id: <20040215200503.2FAC59672 () office ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=107687550901298 CVS commit by domi: This patch splits libkdeprint_management.la up into a library and a dlopen'able module. For various reasons it is not a good idea to have a library both linked to and dlopen'd. Ask away if you want details about this. As posted on kde-core-devel. A management/kdeprint_management_module.cpp 1.1.2.1 [LGPL] M +2 -2 kmmanager.cpp 1.38.2.1 M +1 -1 kxmlcommand.cpp 1.17.2.2 M +5 -0 management/Makefile.am 1.31.2.1 M +2 -11 management/kmmainview.cpp 1.68.2.1 M +2 -0 management/kmmainview.h 1.28.2.1 M +0 -13 management/kxmlcommandselector.cpp 1.15.2.1 --- kdelibs/kdeprint/kmmanager.cpp #1.38:1.38.2.1 @@ -482,5 +482,5 @@ QStringList KMManager::detectLocalPrinte int KMManager::addPrinterWizard(QWidget *parent) { - KLibrary *lib = KLibLoader::self()->library("libkdeprint_management"); + KLibrary *lib = KLibLoader::self()->library("libkdeprint_management_module"); if (!lib) setErrorMsg(i18n("Unable to load KDE print management library: %1").arg(KLibLoader::self()->lastErrorMessage())); @@ -498,5 +498,5 @@ int KMManager::addPrinterWizard(QWidget bool KMManager::invokeOptionsDialog(QWidget *parent) { - KLibrary *lib = KLibLoader::self()->library("libkdeprint_management"); + KLibrary *lib = KLibLoader::self()->library("libkdeprint_management_module"); if (!lib) setErrorMsg(i18n("Unable to load KDE print management library: %1").arg(KLibLoader::self()->lastErrorMessage())); --- kdelibs/kdeprint/kxmlcommand.cpp #1.17.2.1:1.17.2.2 @@ -654,5 +654,5 @@ QStringList KXmlCommandManager::commandL QString KXmlCommandManager::selectCommand(QWidget *parent) { - KLibrary *lib = KLibLoader::self()->library( "libkdeprint_management" ); + KLibrary *lib = KLibLoader::self()->library( "libkdeprint_management_module" ); if ( !lib ) { --- kdelibs/kdeprint/management/Makefile.am #1.31:1.31.2.1 @@ -4,4 +4,5 @@ lib_LTLIBRARIES = libkdeprint_management.la +kde_module_LTLIBRARIES = libkdeprint_management_module.la kdeinit_LTLIBRARIES = kaddprinterwizard.la bin_PROGRAMS = @@ -29,4 +30,8 @@ libkdeprint_management_la_METASOURCES = AUTO +libkdeprint_management_module_la_SOURCES = kdeprint_management_module.cpp +libkdeprint_management_module_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN) -no-undefined +libkdeprint_management_module_la_LIBADD = libkdeprint_management.la + kdeprint_HEADERS = kmmainview.h kmjobviewer.h kmprinterpage.h kiconselectaction.h kmtimer.h kdeprintdir = $(includedir)/kdeprint --- kdelibs/kdeprint/management/kmmainview.cpp #1.68:1.68.2.1 @@ -60,8 +60,6 @@ #define m_manager KMFactory::self()->manager() -extern "C" +int kdeprint_management_add_printer_wizard( QWidget* parent ) { - int add_printer_wizard(QWidget *parent) - { KMWizard dlg(parent); int flag(0); @@ -78,11 +76,4 @@ extern "C" } return flag; - } - - bool config_dialog(QWidget *parent) - { - KMConfigDialog dlg(parent); - return dlg.exec(); - } } @@ -562,5 +553,5 @@ void KMMainView::slotAdd() int result(0); - if ((result=add_printer_wizard(this)) == -1) + if ((result=kdeprint_management_add_printer_wizard(this)) == -1) showErrorMsg(i18n("Unable to create printer.")); --- kdelibs/kdeprint/management/kmmainview.h #1.28:1.28.2.1 @@ -127,3 +127,5 @@ private: }; +int kdeprint_management_add_printer_wizard( QWidget* parent ); + #endif --- kdelibs/kdeprint/management/kxmlcommandselector.cpp #1.15:1.15.2.1 @@ -41,17 +41,4 @@ #include -extern "C" -{ - QString select_command( QWidget* parent ) - { - KDialogBase dlg( parent, 0, true, i18n( "Select Command" ), KDialogBase::Ok|KDialogBase::Cancel ); - KXmlCommandSelector *xmlSel = new KXmlCommandSelector( false, &dlg, "CommandSelector", &dlg ); - dlg.setMainWidget( xmlSel ); - if ( dlg.exec() ) - return xmlSel->command(); - return QString::null; - } -} - KXmlCommandSelector::KXmlCommandSelector(bool canBeNull, QWidget *parent, const char *name, KDialogBase *dlg) : QWidget(parent, name)