Bug 75715 - remove "score" column if no score rules are set
Summary: remove "score" column if no score rules are set
Status: RESOLVED UNMAINTAINED
Alias: None
Product: knode
Classification: Miscellaneous
Component: general (show other bugs)
Version: 0.7.6
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-20 14:43 UTC by Gioele Barabucci
Modified: 2018-09-04 18:33 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gioele Barabucci 2004-02-20 14:43:41 UTC
Version:           0.7.6 (using KDE 3.2.0, Gentoo)
Compiler:          gcc version 3.2.3 20030422 (Gentoo Linux 1.4 3.2.3-r4, propolice)
OS:          Linux (ppc) release 2.4.24-ben1

Why should I see a "Score" column if I've set no score rules?
Comment 1 Volker Krause 2004-12-30 13:07:28 UTC
CVS commit by vkrause: 

Don't show score column in local folders, it's always empty there.

CCBUG: 75715


  M +23 -1     headerview.cpp   1.4
  M +2 -0      headerview.h   1.3
  M +6 -8      knarticlemanager.cpp   1.91
  M +5 -0      knarticlemanager.h   1.42


--- kdepim/knode/headerview.cpp  #1.3:1.4
@@ -28,4 +28,5 @@
 #include "kngroupmanager.h"
 #include "knarticle.h"
+#include "knarticlemanager.h"
 #include "knmainwidget.h"
 
@@ -60,4 +61,6 @@ KNHeaderView::KNHeaderView(QWidget *pare
   setSorting( mPaintInfo.dateCol );
   header()->setMovingEnabled( true );
+  setColumnAlignment( mPaintInfo.sizeCol, Qt::AlignRight );
+  setColumnAlignment( mPaintInfo.scoreCol, Qt::AlignRight );
 
   // due to our own column text squeezing we need to repaint on column resizing
@@ -75,4 +78,8 @@ KNHeaderView::KNHeaderView(QWidget *pare
   connect( mPopup, SIGNAL(activated(int)), this, SLOT(toggleColumn(int)) );
 
+  // connect to the article manager
+  connect( knGlobals.articleManager(), SIGNAL(aboutToShowGroup()), SLOT(prepareForGroup()) );
+  connect( knGlobals.articleManager(), SIGNAL(aboutToShowFolder()), SLOT(prepareForFolder()) );
+
   installEventFilter(this);
 }
@@ -419,9 +426,24 @@ void KNHeaderView::toggleColumn( int col
   }
 
-  if ( mode == -1 )
+  if ( mode == -1 ) // save config when toggled
     writeConfig();
 }
 
 
+void KNHeaderView::prepareForGroup()
+{
+  header()->setLabel( mPaintInfo.senderCol, i18n("From") );
+  KNConfig::ReadNewsGeneral *rngConf = knGlobals.configManager()->readNewsGeneral();
+  toggleColumn( KPaintInfo::COL_SCORE, rngConf->showScore() );
+}
+
+
+void KNHeaderView::prepareForFolder()
+{
+  header()->setLabel( mPaintInfo.senderCol, i18n("Newsgroups / To") );
+  toggleColumn( KPaintInfo::COL_SCORE, false ); // local folders have no score
+}
+
+
 bool KNHeaderView::event( QEvent *e )
 {

--- kdepim/knode/headerview.h  #1.2:1.3
@@ -64,4 +64,6 @@ class KNHeaderView : public KListView  {
 
     void toggleColumn( int column, int mode = -1 );
+    void prepareForGroup();
+    void prepareForFolder();
 
   protected:

--- kdepim/knode/knarticlemanager.cpp  #1.90:1.91
@@ -396,9 +396,7 @@ void KNArticleManager::search()
 void KNArticleManager::setGroup(KNGroup *g)
 {
-  g_roup=g;
-
-  if(g) {
-    v_iew->header()->setLabel(1, i18n("From"));
-  }
+  g_roup = g;
+  if ( g )
+    emit aboutToShowGroup();
 }
 
@@ -406,7 +404,7 @@ void KNArticleManager::setGroup(KNGroup 
 void KNArticleManager::setFolder(KNFolder *f)
 {
-  f_older=f;
-  if(f)
-    v_iew->header()->setLabel(1, i18n("Newsgroups/To"));
+  f_older = f;
+  if ( f )
+    emit aboutToShowFolder();
 }
 

--- kdepim/knode/knarticlemanager.h  #1.41:1.42
@@ -95,4 +95,9 @@ class KNArticleManager : public QObject,
     void setView(KNHeaderView* v);
 
+  signals:
+    // signals for the header view to adapt to the upcoming content
+    void aboutToShowGroup();
+    void aboutToShowFolder();
+
   protected:
     void processJob(KNJobData *j);


Comment 2 Gioele Barabucci 2005-05-31 17:29:16 UTC
KNode 0.9.0 (KDE 3.4.0) gives to the user the ability to hide the "score" column.

Does it also auto hide that column if it finds that there is no score rules are set?
Comment 3 Andrew Crouthamel 2018-09-04 18:33:53 UTC
Hello! Sorry to be the bearer of bad news, but this project has been unmaintained for many years so I am closing this bug.