Author: sh-sh-sh Date: Mon Feb 4 13:33:36 2008 New Revision: 44121 URL: http://svn.opensuse.org/viewcvs/yast?rev=44121&view=rev Log: moved pkg plugin from YQUI to YQApp Removed: trunk/qt/src/YQUI_widgets.cc Modified: trunk/qt/src/CMakeLists.txt trunk/qt/src/YQApplication.cc trunk/qt/src/YQApplication.h trunk/qt/src/YQOptionalWidgetFactory.cc trunk/qt/src/YQUI.h trunk/qt/src/YQWidgetFactory.cc Modified: trunk/qt/src/CMakeLists.txt URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/CMakeLists.txt?rev=44121&r1=44120&r2=44121&view=diff ============================================================================== --- trunk/qt/src/CMakeLists.txt (original) +++ trunk/qt/src/CMakeLists.txt Mon Feb 4 13:33:36 2008 @@ -66,7 +66,6 @@ YQTree.cc YQUI_builtins.cc YQUI_core.cc - YQUI_widgets.cc YQUI_x11.cc YQWidgetCaption.cc YQWidgetFactory.cc Modified: trunk/qt/src/YQApplication.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/YQApplication.cc?rev=44121&r1=44120&r2=44121&view=diff ============================================================================== --- trunk/qt/src/YQApplication.cc (original) +++ trunk/qt/src/YQApplication.cc Mon Feb 4 13:33:36 2008 @@ -33,6 +33,7 @@ #include "YQi18n.h" #include "YQApplication.h" +#include "YQPackageSelectorPlugin.h" YQApplication::YQApplication() @@ -515,4 +516,24 @@ } +YQPackageSelectorPlugin * +YQApplication::packageSelectorPlugin() +{ + static YQPackageSelectorPlugin * plugin = 0; + + if ( ! plugin ) + { + plugin = new YQPackageSelectorPlugin(); + + // This is a deliberate memory leak: If an application requires a + // PackageSelector, it is a package selection application by + // definition. In this case, the qt_pkg plugin is intentionally kept + // open to avoid repeated start-up cost of the plugin and libzypp. + } + + return plugin; +} + + + #include "YQApplication.moc" Modified: trunk/qt/src/YQApplication.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/YQApplication.h?rev=44121&r1=44120&r2=44121&view=diff ============================================================================== --- trunk/qt/src/YQApplication.h (original) +++ trunk/qt/src/YQApplication.h Mon Feb 4 13:33:36 2008 @@ -27,6 +27,8 @@ #include "QY2Settings.h" #include "YApplication.h" +class YQPackageSelectorPlugin; + class YQApplication: public QObject, public YApplication { @@ -199,6 +201,12 @@ const QString & filter, const QString & headline ); + /** + * Return the package selector plugin singleton or creates it + * (including loading the plugin lib) if it does not exist yet. + **/ + static YQPackageSelectorPlugin * packageSelectorPlugin(); + protected: Modified: trunk/qt/src/YQOptionalWidgetFactory.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/YQOptionalWidgetFactory.cc?rev=44121&r1=44120&r2=44121&view=diff ============================================================================== --- trunk/qt/src/YQOptionalWidgetFactory.cc (original) +++ trunk/qt/src/YQOptionalWidgetFactory.cc Mon Feb 4 13:33:36 2008 @@ -17,7 +17,7 @@ /-*/ #include "YQOptionalWidgetFactory.h" -#include "YQUI.h" +#include "YQApplication.h" #include "YUIException.h" #include "YQPackageSelectorPlugin.h" #include "YQWizard.h" @@ -158,7 +158,7 @@ YQPatternSelector * YQOptionalWidgetFactory::createPatternSelector( YWidget * parent, long modeFlags ) { - YQPackageSelectorPlugin * plugin = YQUI::ui()->packageSelectorPlugin(); + YQPackageSelectorPlugin * plugin = YQApplication::packageSelectorPlugin(); if ( plugin ) return plugin->createPatternSelector( parent, modeFlags ); @@ -176,7 +176,7 @@ YQSimplePatchSelector * YQOptionalWidgetFactory::createSimplePatchSelector( YWidget * parent, long modeFlags ) { - YQPackageSelectorPlugin * plugin = YQUI::ui()->packageSelectorPlugin(); + YQPackageSelectorPlugin * plugin = YQApplication::packageSelectorPlugin(); if ( plugin ) return plugin->createSimplePatchSelector( parent, modeFlags ); Modified: trunk/qt/src/YQUI.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/YQUI.h?rev=44121&r1=44120&r2=44121&view=diff ============================================================================== --- trunk/qt/src/YQUI.h (original) +++ trunk/qt/src/YQUI.h Mon Feb 4 13:33:36 2008 @@ -39,7 +39,6 @@ class QY2Settings; class YEvent; class YQOptionalWidgetFactory; -class YQPackageSelectorPlugin; class YQWidgetFactory; class YQApplication; class YQUI_Ui; @@ -310,12 +309,6 @@ virtual float layoutUnits( YUIDimension dim, int device_units ); /** - * Returns the package selector plugin singleton of this UI or creates it - * (including loading the plugin lib) if it does not exist yet. - **/ - YQPackageSelectorPlugin * packageSelectorPlugin(); - - /** * Show hourglass cursor. * * Reimplemented from YUI. Modified: trunk/qt/src/YQWidgetFactory.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/YQWidgetFactory.cc?rev=44121&r1=44120&r2=44121&view=diff ============================================================================== --- trunk/qt/src/YQWidgetFactory.cc (original) +++ trunk/qt/src/YQWidgetFactory.cc Mon Feb 4 13:33:36 2008 @@ -21,7 +21,7 @@ #include "YUILog.h" #include "YQWidgetFactory.h" -#include "YQUI.h" +#include "YQApplication.h" #include "YUIException.h" #include "YQPackageSelectorPlugin.h" #include "YQMainWinDock.h" @@ -30,12 +30,14 @@ using std::string; + YQWidgetFactory::YQWidgetFactory() : YWidgetFactory() { // NOP } + YQWidgetFactory::~YQWidgetFactory() { // NOP @@ -292,7 +294,7 @@ YQPackageSelector * YQWidgetFactory::createPackageSelector( YWidget * parent, long modeFlags ) { - YQPackageSelectorPlugin * plugin = YQUI::ui()->packageSelectorPlugin(); + YQPackageSelectorPlugin * plugin = YQApplication::packageSelectorPlugin(); if ( plugin ) return plugin->createPackageSelector( parent, modeFlags ); -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org