~ubuntu-branches/ubuntu/quantal/minitube/quantal

« back to all changes in this revision

Viewing changes to src/SearchView.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jakob Haufe
  • Date: 2010-12-17 00:23:23 UTC
  • mfrom: (1.2.3 upstream)
  • mto: This revision was merged to the branch mainline in revision 6.
  • Revision ID: james.westby@ubuntu.com-20101217002323-vpwwfdqdp8ady29d
New upstream version (Closes: #606670)

Show diffs side-by-side

added added

removed removed

Lines of Context:
135
135
    The::globalActions()->value("clearRecentKeywords")->setEnabled(!keywords.isEmpty());
136
136
 
137
137
    foreach (QString keyword, keywords) {
138
 
        QLabel *itemLabel = new QLabel("<a href=\"" + keyword
 
138
        QString link = keyword;
 
139
        QString display = keyword;
 
140
        if (keyword.startsWith("http://")) {
 
141
            int separator = keyword.indexOf("|");
 
142
            if (separator > 0 && separator + 1 < keyword.length()) {
 
143
                link = keyword.left(separator);
 
144
                display = keyword.mid(separator+1);
 
145
            }
 
146
        }
 
147
        QLabel *itemLabel = new QLabel("<a href=\"" + link
139
148
                                       + "\" style=\"color:palette(text); text-decoration:none\">"
140
 
                                       + keyword + "</a>", this);
 
149
                                       + display + "</a>", this);
141
150
 
142
151
        itemLabel->setMaximumWidth(queryEdit->width() + watchButton->width());
143
152
        // itemLabel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);