Author: rpmcruz
Date: Mon Mar 10 00:00:21 2008
New Revision: 45316
URL: http://svn.opensuse.org/viewcvs/yast?rev=45316&view=rev
Log:
* src/yzyppwrapper.cc: packagers tend to list Authors in the description
field; work around that.
Modified:
trunk/gtk/ChangeLog
trunk/gtk/src/yzyppwrapper.cc
Modified: trunk/gtk/ChangeLog
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/ChangeLog?rev=45316&r1=45315&r2=45316&view=diff
==============================================================================
--- trunk/gtk/ChangeLog (original)
+++ trunk/gtk/ChangeLog Mon Mar 10 00:00:21 2008
@@ -16,6 +16,18 @@
* src/YGPackageSelector.cc (Filters): italic for available versions
repositories.
+ * src/YGPackageSelector.cc: de-activate some of the popup items when a package
+ is locked.
+
+ * src/YGPackageSelector.cc (PackageControl): set installed version label
+ selectable.
+
+ * src/YGPackageSelector.cc (PackageControl): bug fix: force packages control
+ to be re-loaded on change.
+
+ * src/yzyppwrapper.cc: packagers tend to list Authors in the description
+ field; work around that.
+
2008-03-04 Ricardo Cruz
* src/YGPackageSelector.cc (resolveProblems): zypp changed the semantics of
Modified: trunk/gtk/src/yzyppwrapper.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/yzyppwrapper.cc?rev=45316&r1=45315&r2=45316&view=diff
==============================================================================
--- trunk/gtk/src/yzyppwrapper.cc (original)
+++ trunk/gtk/src/yzyppwrapper.cc Mon Mar 10 00:00:21 2008
@@ -267,8 +267,20 @@
if (!text.compare (0, header_len, header, header_len))
;
else {
+ // cut authors block
+ std::string::size_type i = text.find ("\nAuthors:", 0);
+ if (i != std::string::npos) {
+ int j = i + sizeof ("\nAuthors:\n");
+ if (text.compare (j, sizeof ("-----"), "-----")) {
+ text.erase (i);
+ }
+ }
+ while (text.length() > 0 && text [text.length()-1] == '\n')
+ text.erase (text.length()-1);
+
YGUtils::escapeMarkup (text);
YGUtils::replace (text, "\n\n", 2, "<br>"); // break every double line
+ text += "<br>";
}
if (impl->type == PACKAGE_TYPE) {
@@ -391,13 +403,27 @@
authors += "<br>";
authors += author;
}
- // Some packagers put Authors over the Descriptions field. This seems to be rare
- // on, so I'm not even going to bother.
+ // look for Authors line in description
+ std::string description = package->description();
+ std::string::size_type i = description.find ("\nAuthors:", 0);
+ if (i != std::string::npos) {
+ i += sizeof ("\nAuthors:\n");
+ if (description.compare (i, sizeof ("-----"), "-----")) {
+ i = description.find ("\n", i+1);
+ if (i != std::string::npos) {
+ std::string str = description.substr (i+1);
+ YGUtils::escapeMarkup (str);
+ YGUtils::replace (str, "\n", 1, "<br>");
+ authors += str;
+
+ }
+ }
+ }
- if (!packager.empty())
- text += _("Packaged by:") + ("<blockquote>" + packager) + "</blockquote>";
if (!authors.empty())
text += _("Developed by:") + ("<blockquote>" + authors) + "</blockquote>";
+ if (!packager.empty())
+ text += _("Packaged by:") + ("<blockquote>" + packager) + "</blockquote>";
}
return text;
}
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org