[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/KDE/3.5
From:       David Faure <faure () kde ! org>
Date:       2008-01-17 11:28:57
Message-ID: 1200569337.908244.7170.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 762606 by dfaure:

Don't create static QPixmaps in libraries/DSOs; it requires the one who dlopens the \
DSO to provide a QApplication with GUI enabled. This crashes nspluginscan when it is \
                asked to scan $KDEDIR/lib/kde3
CCBUG: 139042


 M  +2 -2      kdebase/kcontrol/fonts/fonts.cpp  
 M  +6 -5      kdepim/akregator/src/articlelistview.cpp  


--- branches/KDE/3.5/kdebase/kcontrol/fonts/fonts.cpp #762605:762606
@@ -123,7 +123,7 @@
 "aaaaaaaaaaaa",
 "aaaaaaaaaaaa"};
 
-static QPixmap aaPixmaps[]={ QPixmap(aa_rgb_xpm), QPixmap(aa_bgr_xpm), \
QPixmap(aa_vrgb_xpm), QPixmap(aa_vbgr_xpm) }; +static const char** aaPixmaps[]={ \
aa_rgb_xpm, aa_bgr_xpm, aa_vrgb_xpm, aa_vbgr_xpm };  
 /**** DLL Interface ****/
 typedef KGenericFactory<KFonts, QWidget> FontFactory;
@@ -252,7 +252,7 @@
        " have a linear ordering of RGB sub-pixel, some have BGR."));
 
   for(int t=KXftConfig::SubPixel::None+1; t<=KXftConfig::SubPixel::Vbgr; ++t)
-    subPixelType->insertItem(aaPixmaps[t-1], \
KXftConfig::description((KXftConfig::SubPixel::Type)t)); +    \
subPixelType->insertItem(QPixmap(aaPixmaps[t-1]), \
KXftConfig::description((KXftConfig::SubPixel::Type)t));  
 #ifdef HAVE_FONTCONFIG
   QLabel *hintingLabel=new QLabel(i18n("Hinting style: "), mw);
--- branches/KDE/3.5/kdepim/akregator/src/articlelistview.cpp #762605:762606
@@ -148,7 +148,10 @@
         private:
             Article m_article;
             time_t m_pubDate;
-            static QPixmap m_keepFlag;
+            static QPixmap keepFlag() {
+                   static QPixmap s_keepFlag = QPixmap(locate("data", \
"akregator/pics/akregator_flag.png")); +                   return s_keepFlag;
+	    }
 };
 
 // FIXME: Remove resolveEntities for KDE 4.0, it's now done in the parser
@@ -156,7 +159,7 @@
     : KListViewItem( parent, KCharsets::resolveEntities(a.title()), \
a.feed()->title(), KGlobal::locale()->formatDateTime(a.pubDate(), true, false) ), \
m_article(a), m_pubDate(a.pubDate().toTime_t())  {
     if (a.keep())
-        setPixmap(0, m_keepFlag);
+        setPixmap(0, keepFlag());
 }
  
 ArticleListView::ArticleItem::~ArticleItem()
@@ -168,8 +171,6 @@
     return m_article;
 }
 
-QPixmap ArticleListView::ArticleItem::m_keepFlag = QPixmap(locate("data", \
                "akregator/pics/akregator_flag.png"));
-
 // paint ze peons
 void ArticleListView::ArticleItem::paintCell ( QPainter * p, const QColorGroup & cg, \
int column, int width, int align )  {
@@ -193,7 +194,7 @@
 void ArticleListView::ArticleItem::updateItem(const Article& article)
 {
     m_article = article;
-    setPixmap(0, m_article.keep() ? m_keepFlag : QPixmap());
+    setPixmap(0, m_article.keep() ? keepFlag() : QPixmap());
     setText(0, KCharsets::resolveEntities(m_article.title()));
     setText(1, m_article.feed()->title());
     setText(2, KGlobal::locale()->formatDateTime(m_article.pubDate(), true, false));


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic