Bug 101988

Summary: "Add flux" dialog box should strip spaces in url
Product: [Applications] akregator Reporter: Nicolas Girard <nicolas.girard>
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: dimsuz
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:

Description Nicolas Girard 2005-03-20 16:21:49 UTC
Version:           1.0 beta10 (using KDE 3.3.2, Mandrake Linux Cooker i586 - Cooker)
Compiler:          gcc version 3.4.3 (Mandrakelinux 10.2 3.4.3-3mdk)
OS:                Linux (i686) release 2.6.10-1mdk-i686-up-64GB

Title says it all.

When adding a new flux through Flux -> Add a flux, a modal dialog box appears, whose sole field is to be filled with the url of the new feed.

Currently, an error is returned when adding an url with leading or trailing spaces ; one would expect akregator to strip the field value before using it.
Comment 1 Nicolas Girard 2005-03-20 16:25:25 UTC
To be more precise, currently only *leading* spaces cause problems.
Comment 2 Frank Osterfeld 2005-03-20 16:47:51 UTC
CVS commit by osterfeld: 

strip whitespace from entered URL (AddFeedDialog)
BUG: 101988


  M +1 -1      addfeeddialog.cpp   1.21


--- kdepim/akregator/src/addfeeddialog.cpp  #1.20:1.21
@@ -69,5 +69,5 @@ void AddFeedDialog::slotOk( )
 {
     enableButtonOK(false);
-    feedURL = widget->urlEdit->text();
+    feedURL = widget->urlEdit->text().stripWhiteSpace();
 
     Feed *f=new Feed();
Comment 3 Frank Osterfeld 2005-03-20 16:54:36 UTC
CVS commit by osterfeld: 

backport of 101988 (strip whitespace in addfeeddialog)
compile fix (oups)
CCBUG: 101988


  M +1 -1      addfeeddialog.cpp   1.19.6.2
  M +5 -0      articlelist.cpp   1.37.6.3


--- kdepim/akregator/src/addfeeddialog.cpp  #1.19.6.1:1.19.6.2
@@ -69,5 +69,5 @@ void AddFeedDialog::slotOk( )
 {
     enableButtonOK(false);
-    feedURL = widget->urlEdit->text();
+    feedURL = widget->urlEdit->text().stripWhiteSpace();
 
     Feed *f=new Feed();

--- kdepim/akregator/src/articlelist.cpp  #1.37.6.2:1.37.6.3
@@ -377,4 +377,8 @@ void ArticleList::slotPreviousUnreadArti
 
         for ( ; it.current(); --it )
+        {
+            ArticleListItem* ali = static_cast<ArticleListItem*> (it.current());
+            if (!ali)
+                break;
             if ((ali->article().status()==MyArticle::Unread) ||
                 (ali->article().status()==MyArticle::New))
@@ -385,4 +389,5 @@ void ArticleList::slotPreviousUnreadArti
             }
     }
+    }
 }
 
Comment 4 Eckhart Wörner 2005-09-25 01:22:28 UTC
*** Bug 113257 has been marked as a duplicate of this bug. ***