Bug 94286 - column widths and sorting should be remembered
Summary: column widths and sorting should be remembered
Status: RESOLVED DUPLICATE of bug 152702
Alias: None
Product: akregator
Classification: Unclassified
Component: general (show other bugs)
Version: cvs
Platform: Compiled Sources Linux
: NOR wishlist (vote)
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-02 18:01 UTC by George Staikos
Modified: 2009-01-22 11:25 UTC (History)
2 users (show)

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 George Staikos 2004-12-02 18:01:32 UTC
The width of columns and sort order and column should be remembered across 
launches of akregator.  Just save it via kconfig.
Comment 1 George Staikos 2004-12-02 21:33:50 UTC
CVS commit by staikos: 

Save sorting and column widths
FEATURE: 94286


  M +17 -0     akregator.kcfg   1.27
  M +29 -2     articlelist.cpp   1.30


--- kdenonbeta/akregator/src/akregator.kcfg  #1.26:1.27
@@ -146,3 +146,20 @@
   </entry>
  </group>
+ <group name="Viewer Columns" >
+  <entry key="Title Width" type="Int" >
+   <default>-1</default>
+  </entry>
+  <entry key="Feed Width" type="Int" >
+   <default>-1</default>
+  </entry>
+  <entry key="Date Width" type="Int" >
+   <default>-1</default>
+  </entry>
+  <entry key="Sort Column" type="Int" >
+   <default>2</default>
+  </entry>
+  <entry key="Sort Ascending" type="Bool" >
+   <default>false</default>
+  </entry>
+ </group>
 </kcfg>

--- kdenonbeta/akregator/src/articlelist.cpp  #1.29:1.30
@@ -6,4 +6,5 @@
  ***************************************************************************/
 
+#include "akregatorconfig.h"
 #include "articlelist.h"
 #include "feed.h"
@@ -96,8 +97,27 @@ ArticleList::ArticleList(QWidget *parent
     setAcceptDrops(false); // FIXME before we implement dragging between archived feeds??
     setFullWidth(false);
-    setSorting(2, false);
     setShowSortIndicator(true);
     setDragAutoScroll(true);
     setDropHighlighter(false);
+
+    int c = Settings::sortColumn();
+    setSorting((c >= 0 && c <= 2) ? c : 2, Settings::sortAscending());
+
+    int w;
+    w = Settings::titleWidth();
+    if (w > 0) {
+        setColumnWidth(0, w);
+    }
+    
+    w = Settings::feedWidth();
+    if (w > 0) {
+        setColumnWidth(1, w);
+    }
+    
+    w = Settings::dateWidth();
+    if (w > 0) {
+        setColumnWidth(2, w);
+    }
+    
     m_feedWidth = columnWidth(1);
     hideColumn(1);
@@ -318,5 +338,12 @@ void ArticleList::slotSelectionChanged(Q
 
 ArticleList::~ArticleList()
-{}
+{
+    Settings::setTitleWidth(columnWidth(0));
+    Settings::setFeedWidth(columnWidth(1) > 0 ? columnWidth(1) : m_feedWidth);
+    Settings::setSortColumn(sortColumn());
+    Settings::setSortAscending(sortOrder() == Ascending);
+    Settings::writeConfig();
+}
 
 #include "articlelist.moc"
+// vim: ts=4 sw=4 et


Comment 2 Mark Ziegler 2009-01-14 12:02:50 UTC
I use akregator as module in kontact.
Whenever I start kontact it does not remember my sorting and width of columns.
I prefer sorting by date.

openSUSE 11.0
KDE Version 4.1.87 (KDE 4.1.87 (KDE 4.2 >= 20090101)) "release 78.2"
Akregator: 1.3.50
Comment 3 Christophe Giboudeaux 2009-01-22 11:25:26 UTC
Closing as dup to prevent this bug from being reopened.

*** This bug has been marked as a duplicate of bug 152702 ***