<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>119724</bug_id>
          
          <creation_ts>2006-01-08 06:50:41 +0000</creation_ts>
          <short_desc>automatically select next item after delete</short_desc>
          <delta_ts>2012-07-11 16:30:51 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>akregator</product>
          <component>general</component>
          <version>unspecified</version>
          <rep_platform>Gentoo Packages</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>triaged</keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="jason fuchs">jasonfuchs</reporter>
          <assigned_to name="kdepim bugs">pim-bugs-null</assigned_to>
          <cc>adeptsmail</cc>
    
    <cc>andreas</cc>
    
    <cc>dominik.tritscher</cc>
    
    <cc>ewoerner</cc>
    
    <cc>kde-2011.08</cc>
    
    <cc>L.Bonnaud</cc>
    
    <cc>lehoangphuongbg</cc>
    
    <cc>montel</cc>
    
    <cc>nicodorn</cc>
    
    <cc>rulatir</cc>
    
    <cc>tlueber</cc>
    
    <cc>xaver.xn</cc>
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin>4.8.5</cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>20</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>404451</commentid>
    <comment_count>0</comment_count>
    <who name="jason fuchs">jasonfuchs</who>
    <bug_when>2006-01-08 06:50:41 +0000</bug_when>
    <thetext>Version:            (using KDE KDE 3.5.0)
Installed from:    Gentoo Packages

When viewing the article list, deleting an item automatically displays the next feed item in the preview window, but the feed item itself is not *selected*, so the user must click on the item to delete it.

For example, browsing the article list, you click on one, see the summary/preview, decide to delete it, you press delete, the next item is displayed, but if you also want to delete this one without reading, you have to click on it in the list, instead of just pressing delete key again.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>404969</commentid>
    <comment_count>1</comment_count>
    <who name="Frank Osterfeld">osterfeld</who>
    <bug_when>2006-01-10 12:41:04 +0000</bug_when>
    <thetext>Classifying as (usability) bug instead wishlist.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>404971</commentid>
    <comment_count>2</comment_count>
    <who name="Frank Osterfeld">osterfeld</who>
    <bug_when>2006-01-10 13:01:35 +0000</bug_when>
    <thetext>SVN commit 496329 by osterfeld:

select the next article in the article list when deleting the only selected article (doesn&apos;t apply when deleting multiple 
articles)

BUG: 119724


 M  +2 -0      ChangeLog  
 M  +48 -1     src/articlelistview.cpp  


--- branches/KDE/3.5/kdepim/akregator/ChangeLog #496328:496329
@@ -7,6 +7,8 @@
 
 Bug fixes:
 
+ 2006/01/10 Select next item in article list when deleting the selected article
+            (single selection mode only) (#119724) -fo
  2006/01/10 Fix item handling in the feed list, avoid crashes as happening 
             after moving a folder and deleting a subitem afterwards 
             (#118659) -fo
--- branches/KDE/3.5/kdepim/akregator/src/articlelistview.cpp #496328:496329
@@ -368,6 +368,12 @@
 {
     setUpdatesEnabled(false);
 
+    // if only one item is selected and this selected item
+    // is deleted, we will select the next item in the list
+    bool singleSelected = selectedArticles().count() == 1;
+    
+    QListViewItem* next = 0; // the item to select if a selected item is deleted
+    
     for (QValueList&lt;Article&gt;::ConstIterator it = list.begin(); it != list.end(); ++it)
     {
         
@@ -375,8 +381,16 @@
         {
             ArticleItem* ali = d-&gt;articleMap[*it];
 
-            if ((*it).isDeleted()) // if article was set to deleted, delete item
+            if (ali &amp;&amp; (*it).isDeleted()) // if article was set to deleted, delete item
             {
+                if (singleSelected &amp;&amp; ali-&gt;isSelected())
+                {
+                    if (ali-&gt;itemBelow())
+                        next = ali-&gt;itemBelow();
+                    else if (ali-&gt;itemAbove())
+                        next = ali-&gt;itemAbove();
+                }
+                
                 d-&gt;articleMap.remove(*it);
                 delete ali;
             }
@@ -390,22 +404,55 @@
         }
     }
 
+    // if the only selected item was deleted, select
+    // an item next to it
+    if (singleSelected &amp;&amp; next != 0)
+    {
+        setSelected(next, true);
+        setCurrentItem(next);
+    }
+
     setUpdatesEnabled(true);
     triggerUpdate();
 }
 
 void ArticleListView::slotArticlesRemoved(TreeNode* /*node*/, const QValueList&lt;Article&gt;&amp; list)
 {
+    // if only one item is selected and this selected item
+    // is deleted, we will select the next item in the list
+    bool singleSelected = selectedArticles().count() == 1;
+
+    QListViewItem* next = 0; // the item to select if a selected item is deleted
+    
     setUpdatesEnabled(false);
+    
     for (QValueList&lt;Article&gt;::ConstIterator it = list.begin(); it != list.end(); ++it)
     {
         if (d-&gt;articleMap.contains(*it))
         {
             ArticleItem* ali = d-&gt;articleMap[*it];
             d-&gt;articleMap.remove(*it);
+            
+            if (singleSelected &amp;&amp; ali-&gt;isSelected())
+            {
+                if (ali-&gt;itemBelow())
+                    next = ali-&gt;itemBelow();
+                else if (ali-&gt;itemAbove())
+                    next = ali-&gt;itemAbove();
+            }
+            
             delete ali;
         }
     }
+    
+    // if the only selected item was deleted, select
+    // an item next to it
+    if (singleSelected &amp;&amp; next != 0)
+    {
+        setSelected(next, true);
+        setCurrentItem(next);
+    }
+
     setUpdatesEnabled(true);
     triggerUpdate();
 }
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>406487</commentid>
    <comment_count>3</comment_count>
    <who name="Frank Osterfeld">osterfeld</who>
    <bug_when>2006-01-16 01:49:39 +0000</bug_when>
    <thetext>*** Bug 118229 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>622826</commentid>
    <comment_count>4</comment_count>
    <who name="Dotan Cohen">kde-2011.08</who>
    <bug_when>2008-07-09 23:52:52 +0000</bug_when>
    <thetext>This bug seems to have cropped up again in Akregator 1.2.50 on KDE 4.1 beta 2. Should I start a new bug, or reopen this one?

To clarify, when deleting an entry, the next entry shows in the view pane, however, it is not selected. Therefore, the entry cannot be scrolled nor deleted.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>662365</commentid>
    <comment_count>5</comment_count>
    <who name="Dominik Tritscher">dominik.tritscher</who>
    <bug_when>2008-11-09 15:49:17 +0000</bug_when>
    <thetext>This bug still exists in Akregator 1.3.3 from KDE 4.1.3</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>701932</commentid>
    <comment_count>6</comment_count>
    <who name="Thomas">tlueber</who>
    <bug_when>2009-01-18 17:04:17 +0000</bug_when>
    <thetext>This Bug still exists in Akregator 1.3.4 on KDE 4.1.4 (Kubuntu-Packages)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>707708</commentid>
    <comment_count>7</comment_count>
    <who name="Dotan Cohen">kde-2011.08</who>
    <bug_when>2009-01-30 04:25:27 +0000</bug_when>
    <thetext>Fixed in KDE 4.2.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>942009</commentid>
    <comment_count>8</comment_count>
    <who name="Eckhart Wörner">ewoerner</who>
    <bug_when>2010-03-29 13:53:14 +0000</bug_when>
    <thetext>http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=529227 says the bug is still present in 4.2.2 and 4.3.4</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>942010</commentid>
    <comment_count>9</comment_count>
    <who name="Eckhart Wörner">ewoerner</who>
    <bug_when>2010-03-29 13:54:05 +0000</bug_when>
    <thetext>And I can reproduce it in KDE SC 4.4.1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>942022</commentid>
    <comment_count>10</comment_count>
    <who name="Christophe Marin">christophe</who>
    <bug_when>2010-03-29 14:13:33 +0000</bug_when>
    <thetext>Reopening this KDE3 report is not needed. There&apos;s already bug 190616 for KDE4.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>942032</commentid>
    <comment_count>11</comment_count>
    <who name="Eckhart Wörner">ewoerner</who>
    <bug_when>2010-03-29 14:30:49 +0000</bug_when>
    <thetext>(In reply to comment #10)
&gt; Reopening this KDE3 report is not needed. There&apos;s already bug 190616 for KDE4.

I don&apos;t want to nitpick, but everything from comment #4 on is related to KDE 4. Comment #4 is from 2008 which predates bug 190616 by almost a year and therefore makes it a duplicate.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>942034</commentid>
    <comment_count>12</comment_count>
    <who name="Eckhart Wörner">ewoerner</who>
    <bug_when>2010-03-29 14:31:00 +0000</bug_when>
    <thetext>*** Bug 190616 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>958817</commentid>
    <comment_count>13</comment_count>
    <who name="Nico Dorn">nicodorn</who>
    <bug_when>2010-05-08 17:03:54 +0000</bug_when>
    <thetext>Unfortunately, I can confirm this behaviour for Akregator 1.6.2/KDE SC 4.4.2 (Kubuntu).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>958886</commentid>
    <comment_count>14</comment_count>
    <who name="Andreas Pietzowski">andreas</who>
    <bug_when>2010-05-08 19:21:47 +0000</bug_when>
    <thetext>This bug still exists in KDE 4.4.3 ;-(</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1067641</commentid>
    <comment_count>15</comment_count>
    <who name="Nico Dorn">nicodorn</who>
    <bug_when>2011-01-03 23:25:57 +0000</bug_when>
    <thetext>Confirmed also for 4.5.4.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1148242</commentid>
    <comment_count>16</comment_count>
    <who name="Christophe Marin">christophe</who>
    <bug_when>2011-08-01 12:27:13 +0000</bug_when>
    <thetext>*** Bug 278937 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1148623</commentid>
    <comment_count>17</comment_count>
    <who name="Laurent Bonnaud">L.Bonnaud</who>
    <bug_when>2011-08-02 05:58:53 +0000</bug_when>
    <thetext>This bug still exists in akregator 4.7.0.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1220727</commentid>
    <comment_count>18</comment_count>
    <who name="Szczepan Hołyszewski">rulatir</who>
    <bug_when>2012-01-30 13:38:41 +0000</bug_when>
    <thetext>This bug still exists in Akregator 4.8.0, and is now 3.5 years old. Developers helllloooooooo? Is it really that hard to fix?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1247790</commentid>
    <comment_count>19</comment_count>
    <who name="Yuriy Vidineev">adeptsmail</who>
    <bug_when>2012-04-20 07:13:18 +0000</bug_when>
    <thetext>Akregator 4.8.2, Kubuntu 12.04. Bug still here</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1275196</commentid>
    <comment_count>20</comment_count>
    <who name="Lê Hoàng Phương">lehoangphuongbg</who>
    <bug_when>2012-07-11 15:59:41 +0000</bug_when>
    <thetext>The bug is fixed in latest commit. 
KDE 4.9: http://commits.kde.org/kdepim/244f18a4d9813f064c95dce0db426d52bda84617
KDE 4.8.5: http://commits.kde.org/kdepim/807c0aa23de75a9eb67c8e3f00fc992efbb4c930
KDE 4.10: http://commits.kde.org/kdepim/86f5008a2558e488c2fae82cd0df3caff252bf6a
Please help me close this bug because I do not have the permission to do that.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>