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

Backport QIcon-related Qt fixes #97

Merged
merged 7 commits into from
Aug 5, 2016
Merged

Backport QIcon-related Qt fixes #97

merged 7 commits into from
Aug 5, 2016

Conversation

paulolieuthier
Copy link
Contributor

No description provided.

…orted

We still have a bunch of Q_WS_ ifdefs in our code, which are easy to
mistake for Q_OS_ ifdefs when quickly scanning the code. By renaming
the ifdefs we make it clear that the code in question is dead.

In incremental follow-ups, we can then selectively either remove, or
port, the pieces that are dead code.

Change-Id: Ib5ef3e9e0662d321f179f3e25122cacafff0f41f
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
To avoid source-incompatibilites, wrap in QT_DEPRECATED_SINCE(5, 5)
in public headers.

Change-Id: I6117e8a6b11200d2f1a0a94a0e87d5c27538218e
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Currently all icon resolving is passed thru to the platform icon engine,
even in the case where the application developer has set their own
requested icon theme. In that case, the application developer
specifically does not want to follow the icon theme of the system, so
don't ask the platform, but rely on Qt code instead.

It leads to bugs reported to platform icon theme providers like this:
MMC: MultiMC/Launcher#796
KDE: https://bugs.kde.org/show_bug.cgi?id=344469

Thanks to the multimc people (Jan Dalheimer and Peterix) for the
reports and testcases.
There was an attempt to allow static instances of QIcon in
7727a4355876607a1a022ff54e2570dae883f79c (Qt 4). This patch does only
solve some of the corner cases and broke with
aa5f70c00a88edcddd26e8fea767a40e8c5c31b8. Since the "breakage" has been
there for two years, let's officially declare it unsupported instead of
trying to work around the issue.

Change-Id: I61e12fd03953763ee2e70eae58bcaecabdcb85b8
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
It doesn't save any space, is not required for ABI compat
(because it's private API), generates more code to extract
the field, and triggers a bug in older GCCs when synthesizing
a move constructor for this type:

src/gui/image/qiconloader_p.h:64:8: error: invalid conversion from 'unsigned char:4' to 'QIconDirInfo::Type' [-fpermissive]
src/corelib/tools/qvector.h:641:13: note: synthesized method 'QIconDirInfo& QIconDirInfo::operator=(QIconDirInfo&&)' first required here

Change-Id: I61e886566b67c7a18a318a3d026dc762600f8ab4
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
…e a null icon

Implement it in the QIconLoader

We have to change detach() because some code does:
icon = QIcon::fromTheme("foobar"); if (icon.isNull()) icon.addPixmap(...);
so addPixmap and addFile have to work on a null QIcon by resetting
the iconEngine.

    Change-Id: I07719bef93930cf4692384a8c64e21a97dcce25c
    Reviewed-by: David Faure <david.faure@kdab.com>
Loading icons is quite slow because we need to stat many files in many directories.
That's why gtk adds a cache in the icon theme directory so it avoids stating lots
of files.

The cache file can be generated with gtk-update-icon-cache utility on a theme
directory. If the cache is not present, corrupted, or outdated, the normal slow lookup
is still run.

[ChangeLog][QtGui][QIcon] fromTheme gained the ability to use the GTK icon cache
to speed up lookups.

Change-Id: I3ab8a9910be67a34034556023be61a86789a7893
Reviewed-by: David Faure <david.faure@kdab.com>
@paulolieuthier
Copy link
Contributor Author

@luis-pereira is this mergeable?

@luis-pereira
Copy link
Member

@paulolieuthier Yes it is.

@paulolieuthier
Copy link
Contributor Author

GTM.

@luis-pereira
Copy link
Member

It must also land on master. I've been testing for a week now. Working without problems.
Does anyone have any feedback ?

@tsujan
Copy link
Member

tsujan commented Aug 5, 2016

GTM.

@luis-pereira luis-pereira merged commit 8111276 into master Aug 5, 2016
@luis-pereira luis-pereira deleted the backport branch August 5, 2016 18:30
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.

3 participants