Mailinglist Archive: yast-commit (953 mails)

< Previous Next >
[yast-commit] r49655 - in /trunk/gtk: ChangeLog src/YGUI.cc src/YGUtils.cc src/YGUtils.h src/ygtkrichtext.c src/yzyppwrapper.cc
  • From: rpmcruz@xxxxxxxxxxxxxxxx
  • Date: Mon, 04 Aug 2008 16:14:13 -0000
  • Message-id: <20080804161413.E5BCB39B9E@xxxxxxxxxxxxxxxx>
Author: rpmcruz
Date: Mon Aug 4 18:14:13 2008
New Revision: 49655

URL: http://svn.opensuse.org/viewcvs/yast?rev=49655&view=rev
Log:
* src/YGUtils.cc: convert_to_xhtml() bug fix: allow '=' to be used
inside quoted tag arguments.

* src/yzyppwrapper.cc: show bugzilla entries in patch description.

* src/yzyppwrapper.cc: don't show satisfied candidates if the package
is not installed. And don't show broken installed packages if there is
no candidate to be found.

Modified:
trunk/gtk/ChangeLog
trunk/gtk/src/YGUI.cc
trunk/gtk/src/YGUtils.cc
trunk/gtk/src/YGUtils.h
trunk/gtk/src/ygtkrichtext.c
trunk/gtk/src/yzyppwrapper.cc

Modified: trunk/gtk/ChangeLog
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/gtk/ChangeLog?rev=49655&r1=49654&r2=49655&view=diff
==============================================================================
--- trunk/gtk/ChangeLog (original)
+++ trunk/gtk/ChangeLog Mon Aug 4 18:14:13 2008
@@ -1,3 +1,14 @@
+2008-08-04 Ricardo Cruz <rpmcruz@xxxxxxxxxxxxxxxxxxx>
+
+ * src/YGUtils.cc: convert_to_xhtml() bug fix: allow '=' to be used
+ inside quoted tag arguments.
+
+ * src/yzyppwrapper.cc: show bugzilla entries in patch description.
+
+ * src/yzyppwrapper.cc: don't show satisfied candidates if the package
+ is not installed. And don't show broken installed packages if there is
+ no candidate to be found.
+
2008-08-03 Ricardo Cruz <rpmcruz@xxxxxxxxxxxxxxxxxxx>

* src/yzyppwrapper.cc: translate patch severities.

Modified: trunk/gtk/src/YGUI.cc
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGUI.cc?rev=49655&r1=49654&r2=49655&view=diff
==============================================================================
--- trunk/gtk/src/YGUI.cc (original)
+++ trunk/gtk/src/YGUI.cc Mon Aug 4 18:14:13 2008
@@ -757,7 +757,7 @@
YRichText *rtext = dynamic_cast <YRichText *> (widget);
if (rtext) {
std::string text = rtext->text();
- char *xml = ygutils_convert_to_xhmlt_and_subst
(text.c_str());
+ char *xml = ygutils_convert_to_xhtml
(text.c_str());

GtkWidget *view = gtk_text_view_new();
gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW
(view), GTK_WRAP_WORD);

Modified: trunk/gtk/src/YGUtils.cc
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGUtils.cc?rev=49655&r1=49654&r2=49655&view=diff
==============================================================================
--- trunk/gtk/src/YGUtils.cc (original)
+++ trunk/gtk/src/YGUtils.cc Mon Aug 4 18:14:13 2008
@@ -256,7 +256,7 @@
// We have to:
// + rewrite <br> and <hr> tags
// + deal with <a attrib=noquotes>
-gchar *ygutils_convert_to_xhmlt_and_subst (const char *instr)
+gchar *ygutils_convert_to_xhtml (const char *instr)
{
GString *outp = g_string_new ("");
GQueue *tag_queue = g_queue_new();
@@ -324,11 +324,19 @@
// Add quoting for un-quoted attributes
for (int j = 0; j < (signed) tag->len; j++) {
if (tag->str[j] == '=') {
- if (tag->str[j+1] != '"') {
+ gboolean unquote = tag->str[j+1] != '"';
+ if (unquote)
g_string_insert_c (tag, j+1,
'"');
- for (j++; !g_ascii_isspace
(tag->str[j]) && tag->str[j]; j++) ;
- g_string_insert_c (tag, j, '"');
+ else
+ j++;
+ for (j++; tag->str[j]; j++) {
+ if (unquote && g_ascii_isspace
(tag->str[j]))
+ break;
+ else if (!unquote &&
tag->str[j] == '"')
+ break;
}
+ if (unquote)
+ g_string_insert_c (tag, j, '"');
}
}


Modified: trunk/gtk/src/YGUtils.h
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGUtils.h?rev=49655&r1=49654&r2=49655&view=diff
==============================================================================
--- trunk/gtk/src/YGUtils.h (original)
+++ trunk/gtk/src/YGUtils.h Mon Aug 4 18:14:13 2008
@@ -59,7 +59,7 @@
void ygutils_scrollView (GtkTextView *view, gboolean top);

/* Convert html to xhtml (or at least try) */
- gchar *ygutils_convert_to_xhmlt_and_subst (const char *instr);
+ gchar *ygutils_convert_to_xhtml (const char *instr);
void ygutils_setStockIcon (GtkWidget *button, const char *ycp_str);
};


Modified: trunk/gtk/src/ygtkrichtext.c
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/ygtkrichtext.c?rev=49655&r1=49654&r2=49655&view=diff
==============================================================================
--- trunk/gtk/src/ygtkrichtext.c (original)
+++ trunk/gtk/src/ygtkrichtext.c Mon Aug 4 18:14:13 2008
@@ -17,7 +17,7 @@

// Sucky - but we mix C & C++ so ...
/* Convert html to xhtml (or at least try) */
-gchar *ygutils_convert_to_xhmlt_and_subst (const char *instr);
+gchar *ygutils_convert_to_xhtml (const char *instr);

G_DEFINE_TYPE (YGtkRichText, ygtk_rich_text, GTK_TYPE_TEXT_VIEW)

@@ -554,7 +554,7 @@
GMarkupParseContext *ctx;
ctx = g_markup_parse_context_new (&rt_parser, (GMarkupParseFlags)0,
&state, NULL);

- char *xml = ygutils_convert_to_xhmlt_and_subst (text);
+ char *xml = ygutils_convert_to_xhtml (text);
GError *error = NULL;
if (!g_markup_parse_context_parse (ctx, xml, -1, &error)) {
#ifdef PRINT_WARNINGS

Modified: trunk/gtk/src/yzyppwrapper.cc
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/yzyppwrapper.cc?rev=49655&r1=49654&r2=49655&view=diff
==============================================================================
--- trunk/gtk/src/yzyppwrapper.cc (original)
+++ trunk/gtk/src/yzyppwrapper.cc Mon Aug 4 18:14:13 2008
@@ -334,6 +334,13 @@
ZyppPatch patch = tryCastToZyppPatch (object);
if (patch->rebootSuggested())
text += br + br + "<b>" + _("Reboot needed!") +
"</b>";
+ if (patch->referencesBegin() != patch->referencesEnd())
{
+ text += br + br + "<b>Bugzilla:</b><ul>";
+ for (zypp::Patch::ReferenceIterator it =
patch->referencesBegin();
+ it != patch->referencesEnd(); it++)
+ text += "<li><a href=\"" + it.href() +
"\">" + it.title() + "</a></li>";
+ text += "</ul>";
+ }
break;
}
case PATTERN_TYPE:
@@ -579,12 +586,9 @@

bool Ypp::Package::isInstalled()
{
- if (!impl->zyppSel->installedEmpty()) {
- if (impl->zyppSel->installedObj().isBroken())
- return false;
- return true;
- }
- return impl->zyppSel->candidateObj().isSatisfied();
+ if (!impl->zyppSel->installedEmpty())
+ return !impl->zyppSel->installedObj().isBroken();
+ return false;
}

bool Ypp::Package::hasUpgrade()
@@ -783,8 +787,8 @@
{
if (!impl->installedVersion) {
const ZyppObject installedObj = impl->zyppSel->installedObj();
- if (installedObj)
- impl->installedVersion = constructVersion
(installedObj);
+ assert (installedObj != NULL);
+ impl->installedVersion = constructVersion (installedObj);
}
return impl->installedVersion;
}
@@ -1759,7 +1763,17 @@
}
for (; it != end; it++) {
Ypp::Node *category = 0, *category2 = 0;
- ZyppObject object = (*it)->theObj();
+ ZyppSelectable sel = *it;
+ ZyppObject object = sel->theObj();
+
+ // don't show if installed broken and there is no
available
+ if (!sel->candidateObj()) {
+ if (!sel->installedEmpty() &&
sel->installedObj().isBroken())
+ continue;
+ }
+ else if (sel->installedEmpty() &&
sel->candidateObj().isSatisfied())
+ continue;
+
// add category and test visibility
switch (type) {
case Package::PACKAGE_TYPE:
@@ -1784,7 +1798,7 @@
ZyppPatch patch = tryCastToZyppPatch
(object);
if (!patch)
continue;
- if ((*it)->candidateObj() &&
!(*it)->candidateObj().isRelevant())
+ if (sel->candidateObj() &&
!sel->candidateObj().isRelevant())
continue;
category = addCategory (type,
patch->category());
break;
@@ -1793,7 +1807,7 @@
break;
}

- Package *package = new Package (new Package::Impl
(type, *it, category, category2));
+ Package *package = new Package (new Package::Impl
(type, sel, category, category2));
pool = g_slist_prepend (pool, package);
}
// its faster to prepend then reverse, as we avoid iterating
for each append

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

< Previous Next >
This Thread
  • No further messages