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

Different approach for storing the icon size and url relation #56

Merged
merged 1 commit into from Jul 28, 2016

Conversation

aleixpol
Copy link
Collaborator

This way we can return it as a block so that the client can actually
introspect which icons are available.

The code I'm referring to looks like this:

{
    QIcon ret;

    const auto icons = m_appdata.iconUrls();
    if (icons.isEmpty())
        return m_appdata.name();
    else {
        for (auto it = icons.constBegin(), itEnd = icons.constEnd(); it!=itEnd; ++it) {
            if (it->isLocalFile())
                ret.addFile(it->toLocalFile(), it.key());
        }
    }
    return ret;
}

This way we can return it as a block so that the client can actually
introspect which icons are available.
@ximion
Copy link
Owner

ximion commented Jul 28, 2016

Looks good to me, but I wonder if this solution is ideal for the future... Libas has an own AsIcon class, but mainly because it doesn't have a QUrl (because plain C and GLib).
Anyway, it's definitely a useful improvement for the present!

@ximion ximion merged commit 0e20902 into ximion:master Jul 28, 2016
@aleixpol
Copy link
Collaborator Author

TBH, what worries me the most at the moment is the ::isLocalFile, will have to look into how to do it when it's not local. Still not a problem as of today.

Thanks!

@ximion
Copy link
Owner

ximion commented Jul 28, 2016

The thing I thought about the most was stock icons, which are no URLs at all.... :D

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

Successfully merging this pull request may close these issues.

None yet

2 participants