Mailinglist Archive: yast-commit (2114 mails)

< Previous Next >
[yast-commit] r58729 - in /trunk/gtk: ChangeLog src/ygtkzyppview.cc src/yzyppwrapper.h
  • From: rpmcruz@xxxxxxxxxxxxxxxx
  • Date: Wed, 23 Sep 2009 22:21:04 -0000
  • Message-id: <E1MqaCu-000541-Mc@xxxxxxxxxxxxxxxx>
Author: rpmcruz
Date: Thu Sep 24 00:21:04 2009
New Revision: 58729

URL: http://svn.opensuse.org/viewcvs/yast?rev=58729&view=rev
Log:
* src/ygtkzyppview.cc: speed fix: don't load packages at
initialization for online_update.

Modified:
trunk/gtk/ChangeLog
trunk/gtk/src/ygtkzyppview.cc
trunk/gtk/src/yzyppwrapper.h

Modified: trunk/gtk/ChangeLog
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/gtk/ChangeLog?rev=58729&r1=58728&r2=58729&view=diff
==============================================================================
--- trunk/gtk/ChangeLog (original)
+++ trunk/gtk/ChangeLog Thu Sep 24 00:21:04 2009
@@ -1,5 +1,10 @@
2009-09-23 Ricardo Cruz <rpmcruz@xxxxxxxxxxxxxxxxxxx>

+ * src/ygtkzyppview.cc: speed fix: don't load packages at
+ initialization for online_update.
+
+2009-09-23 Ricardo Cruz <rpmcruz@xxxxxxxxxxxxxxxxxxx>
+
* src/YGDumbTab.cc: changed calling order of parent
class to reflect yast2-qt (to prevent any bug).


Modified: trunk/gtk/src/ygtkzyppview.cc
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/ygtkzyppview.cc?rev=58729&r1=58728&r2=58729&view=diff
==============================================================================
--- trunk/gtk/src/ygtkzyppview.cc (original)
+++ trunk/gtk/src/ygtkzyppview.cc Thu Sep 24 00:21:04 2009
@@ -1247,10 +1247,11 @@
struct Versions : public Ypp::PkgList::Listener {
GtkWidget *m_box, *m_versions_box, *m_button, *m_undo_button;
Ypp::PkgList m_packages; // we keep a copy to test against
modified...
+ bool m_onlineUpdate;

GtkWidget *getWidget() { return m_box; }

- Versions()
+ Versions (bool onlineUpdate) : m_onlineUpdate (onlineUpdate)
{
GtkWidget *label = gtk_label_new (_("Versions:"));
YGUtils::setWidgetFont (label, PANGO_STYLE_NORMAL,
PANGO_WEIGHT_BOLD, PANGO_SCALE_MEDIUM);
@@ -1281,11 +1282,17 @@
gtk_box_pack_start (GTK_BOX (m_box), m_versions_box,
TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (m_box), button_box, FALSE,
TRUE, 0);

- Ypp::get()->getPackages
(Ypp::Package::PACKAGE_TYPE).addListener (this);
+ // PkgList::addListeners() isn't currently working for
ordinary PkgList
+ // other than getPackages(), thus this hack.
+ if (!m_onlineUpdate)
+ Ypp::get()->getPackages
(Ypp::Package::PACKAGE_TYPE).addListener (this);
}

~Versions()
- { Ypp::get()->getPackages
(Ypp::Package::PACKAGE_TYPE).removeListener (this); }
+ {
+ if (!m_onlineUpdate)
+ Ypp::get()->getPackages
(Ypp::Package::PACKAGE_TYPE).removeListener (this);
+ }

void setPackages (Ypp::PkgList packages)
{
@@ -1544,7 +1551,7 @@
: m_verMode (false)
{
m_scroll = scroll;
- m_versions = new Versions();
+ m_versions = new Versions (onlineUpdate);
GtkWidget *hbox = gtk_hbox_new (FALSE, 2);
setupScrollAsWhite (scroll, hbox);

@@ -1630,14 +1637,6 @@
setText (m_provides, provides_str);
}

- if (m_contents) { // patches -- "apply to"
- Ypp::PkgQuery::Query *query = new
Ypp::PkgQuery::Query();
- query->addCollection (package);
- m_contents->setList (Ypp::PkgQuery
(Ypp::Package::PACKAGE_TYPE, query), 0);
- gtk_widget_show (gtk_widget_get_ancestor (
- GTK_WIDGET (m_contents),
GTK_TYPE_EXPANDER));
- }
-
gtk_image_clear (GTK_IMAGE (m_icon));
GtkIconTheme *icons = gtk_icon_theme_get_default();
GdkPixbuf *pixbuf = gtk_icon_theme_load_icon (icons,
@@ -1647,6 +1646,14 @@
g_object_unref (G_OBJECT (pixbuf));
gtk_widget_show (m_icon_frame);
}
+
+ if (m_contents) { // patches -- "apply to"
+ Ypp::PkgQuery::Query *query = new
Ypp::PkgQuery::Query();
+ query->addCollection (package);
+ m_contents->setList (Ypp::PkgQuery
(Ypp::Package::PACKAGE_TYPE, query), 0);
+ gtk_widget_show (gtk_widget_get_ancestor (
+ GTK_WIDGET (m_contents),
GTK_TYPE_EXPANDER));
+ }
}
else {
std::string description;

Modified: trunk/gtk/src/yzyppwrapper.h
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/yzyppwrapper.h?rev=58729&r1=58728&r2=58729&view=diff
==============================================================================
--- trunk/gtk/src/yzyppwrapper.h (original)
+++ trunk/gtk/src/yzyppwrapper.h Thu Sep 24 00:21:04 2009
@@ -161,6 +161,7 @@
};
void addListener (Listener *listener) const;
void removeListener (Listener *listener) const;
+ // FIXME: listeners only works for getPackages() lists and
PkgQuery ones.

struct Impl;
Impl *impl;

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages