[Knode-devel] KDE_3_2_BRANCH: kdepim/knode

Volker Krause volker.krause at rwth-aachen.de
Tue Apr 20 13:58:17 CEST 2004


CVS commit by vkrause: 

Backport fix for bug #75333.


  M +10 -7     knconfig.cpp   1.74.8.1
  M +3 -5      knconfig.h   1.68.10.1
  M +0 -1      knconfigwidgets.cpp   1.97.2.2
  M +0 -1      knmainwidget.cpp   1.20.2.3


--- kdepim/knode/knconfig.cpp  #1.74:1.74.8.1
@@ -257,6 +257,4 @@ KNConfig::Appearance::Appearance()
   f_ontNames[articleList]=i18n("Article List");
 
-  updateHexcodes();
-
   //icons
   recreateLVIcons();
@@ -491,10 +489,15 @@ QFont KNConfig::Appearance::articleListF
 
 
-void KNConfig::Appearance::updateHexcodes()
+QString KNConfig::Appearance::quotedTextHexcode(int i)
 {
-  sprintf(h_excodes[quoted1Hex], "#%2x%2x%2x", quoteColor1().red(), quoteColor1().green(), quoteColor1().blue());
-  sprintf(h_excodes[quoted2Hex], "#%2x%2x%2x", quoteColor2().red(), quoteColor2().green(), quoteColor2().blue());
-  sprintf(h_excodes[quoted3Hex], "#%2x%2x%2x", quoteColor3().red(), quoteColor3().green(), quoteColor3().blue());
-  sprintf(h_excodes[headerHex], "#%2x%2x%2x", headerDecoColor().red(), headerDecoColor().green(), headerDecoColor().blue());
+  switch(i) {
+    case quoted1Hex:
+      return quoteColor1().name();
+    case quoted2Hex:
+      return quoteColor2().name();
+    case quoted3Hex:
+      return quoteColor3().name();
+  }
+  return textColor().name();
 }
 

--- kdepim/knode/knconfig.h  #1.68:1.68.10.1
@@ -321,5 +321,5 @@ class Appearance : public Base {
                         unreadArticle=10, readArticle=11, activeItem=12, selectedItem=13 };
 
-    enum HexIndex     { quoted1Hex=0, quoted2Hex=1, quoted3Hex=2, headerHex=3 };
+    enum HexIndex     { quoted1Hex=0, quoted2Hex=1, quoted3Hex=2 };
 
     enum FontIndex    { article=0, articleFixed=1, composer=2, groupList=3, articleList=4 };
@@ -351,7 +351,6 @@ class Appearance : public Base {
     QColor selectedItemColor();
 
-    const char* headerDecoHexcode()       { return h_excodes[headerHex]; }
-    const char* quotedTextHexcode(int i)  { return h_excodes[i]; }
-    void updateHexcodes();
+    QString headerDecoHexcode()       { return headerDecoColor().name(); }
+    QString quotedTextHexcode(int i);
 
     QFont articleFont();
@@ -382,5 +381,4 @@ class Appearance : public Base {
     QFont   f_onts[FNT_CNT];
     QString f_ontNames[FNT_CNT];
-    char    h_excodes[HEX_CNT][8];
     QPixmap i_cons[ICON_CNT];
 

--- kdepim/knode/knconfigwidgets.cpp  #1.97.2.1:1.97.2.2
@@ -792,5 +792,4 @@ void KNConfig::AppearanceWidget::apply()
   d_ata->setDirty(true);
 
-  d_ata->updateHexcodes();
   d_ata->recreateLVIcons();
 }

--- kdepim/knode/knmainwidget.cpp  #1.20.2.2:1.20.2.3
@@ -1008,5 +1008,4 @@ void KNMainWidget::fontChange( const QFo
 void KNMainWidget::paletteChange( const QPalette & )
 {
-  c_fgManager->appearance()->updateHexcodes();
   KNArticleWidget::configChanged();
   configChanged();




More information about the Knode-devel mailing list