Ignore:
Timestamp:
Aug 2, 2010, 9:27:30 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.3 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/image/qiconloader.cpp

    r651 r769  
    8686
    8787QIconLoader::QIconLoader() :
    88         m_themeKey(1), m_supportsSvg(false)
    89 {
    90     m_systemTheme = qt_guiPlatformPlugin()->systemIconThemeName();
    91     if (m_systemTheme.isEmpty())
    92         m_systemTheme = fallbackTheme();
    93 
     88        m_themeKey(1), m_supportsSvg(false), m_initialized(false)
     89{
     90}
     91
     92// We lazily initialize the loader to make static icons
     93// work. Though we do not officially support this.
     94void QIconLoader::ensureInitialized()
     95{
     96    if (!m_initialized) {
     97        m_initialized = true;
     98
     99        Q_ASSERT(qApp);
     100
     101        m_systemTheme = qt_guiPlatformPlugin()->systemIconThemeName();
     102        if (m_systemTheme.isEmpty())
     103            m_systemTheme = fallbackTheme();
    94104#ifndef QT_NO_LIBRARY
    95     QFactoryLoader iconFactoryLoader(QIconEngineFactoryInterfaceV2_iid,
    96                                      QLatin1String("/iconengines"),
    97                                      Qt::CaseInsensitive);
    98     if (iconFactoryLoader.keys().contains(QLatin1String("svg")))
    99         m_supportsSvg = true;
     105        QFactoryLoader iconFactoryLoader(QIconEngineFactoryInterfaceV2_iid,
     106                                         QLatin1String("/iconengines"),
     107                                         Qt::CaseInsensitive);
     108        if (iconFactoryLoader.keys().contains(QLatin1String("svg")))
     109            m_supportsSvg = true;
    100110#endif //QT_NO_LIBRARY
     111    }
    101112}
    102113
     
    340351void QIconLoaderEngine::ensureLoaded()
    341352{
     353
     354    iconLoaderInstance()->ensureInitialized();
     355
    342356    if (!(iconLoaderInstance()->themeKey() == m_key)) {
    343357
Note: See TracChangeset for help on using the changeset viewer.