Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Component::iconUrl disfunctional on AppStreamQt #14

Closed
aleixpol opened this issue Oct 29, 2015 · 3 comments
Closed

Component::iconUrl disfunctional on AppStreamQt #14

aleixpol opened this issue Oct 29, 2015 · 3 comments

Comments

@aleixpol
Copy link
Collaborator

This is the current code to fetch the iconUrl:

// Icon urls
    QString concatIconUrlStrings = value(document, XapianValues::ICON_URLS);
    QStringList iconUrlStrings = concatIconUrlStrings.split('\n',QString::SkipEmptyParts);
    if(iconUrlStrings.size() %2 == 0) {
        for(int i = 0; i < iconUrlStrings.size(); i=i+2) {
            QString sizeStr = iconUrlStrings.at(i);
            QUrl url = QUrl::fromUserInput(iconUrlStrings.at(i+1));
            QSize size = parseSizeString(sizeStr);
            component.addIconUrl(url, size);
        }
    } else {
        qCWarning(APPSTREAMQT_DB, "Bad icon-url strings for component: '%s' (%s)", qPrintable(id), qPrintable(concatIconUrlStrings));
    }

I suspect the format has changed internally and the code in Qt side isn't working anymore. Any pointers of how to fix it will be very welcome, in order to get a proper fix.

@aleixpol
Copy link
Collaborator Author

I see it's using IconUrls::ParseFromString (str); comes from ::google::protobuf::MessageLite. Should we also depend on that on the Qt side?

@ximion
Copy link
Owner

ximion commented Oct 29, 2015

Oh, damn - I just wanted to write that I ported the code to the new database layout, but it turns out I missed doing that...
Give me a second, fixing this is trivial (but breaking it is a pretty big regression)

@ximion ximion closed this as completed in bb6cd0b Oct 29, 2015
@ximion
Copy link
Owner

ximion commented Oct 29, 2015

Regarding Protobuf: This is already done, the library links against protobuf-lite.
Reason for using protobuf is much increased performance compared to string-comparisons and string-splitting, while preserving the advantages of Xapian (low memory consumption and fast full-text search with stemming).
I just overlooked iconUrls when adapting the Qt code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants