示例#1
0
void LineEdit::text_changed(const QString& text) {
  if (text.isEmpty()) {
    // Consider empty string as LTR
    set_rtl(false);
  } else {
    // For some reason Qt will detect any text with LTR at the end as LTR, so instead
    // compare only the first character
    set_rtl(QString(text.at(0)).isRightToLeft());
  }
  Resize();
}
示例#2
0
void rss_parser::fill_feed_fields(std::tr1::shared_ptr<rss_feed> feed) {
	/*
	 * we fill all the feed members with the appropriate values from the rsspp data structure
	 */
	if (is_html_type(f.title_type)) {
		feed->set_title(render_xhtml_title(f.title, feed->link()));
	} else {
		feed->set_title(f.title);
	}

	feed->set_description(f.description);

	feed->set_link(utils::absolute_url(my_uri, f.link));

	if (f.pubDate != "")
		feed->set_pubDate(parse_date(f.pubDate));
	else
		feed->set_pubDate(::time(NULL));

	set_rtl(feed, f.language.c_str());

	LOG(LOG_DEBUG, "rss_parser::parse: feed title = `%s' link = `%s'", feed->title().c_str(), feed->link().c_str());
}