Bug 116203 - problem with display of frequency "Never" setting
Summary: problem with display of frequency "Never" setting
Status: RESOLVED FIXED
Alias: None
Product: akregator
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-12 21:36 UTC by John Belmonte
Modified: 2005-11-19 11:32 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Patch fixes conversion to int (750 bytes, patch)
2005-11-13 10:52 UTC, Eckhart Wörner
Details

Note You need to log in before you can comment on or make changes to this bug.
Description John Belmonte 2005-11-12 21:36:15 UTC
Version:           1.1.3 (using KDE KDE 3.4.2)
Installed from:    Debian testing/unstable Packages

1) in the "Feed Properties" dialog for an individual feed, set a custom update interval of "Never"

2) quit Akregator and restart

3) view the properies for the same feed.  The interval is displayed as "1 Minutes".
Comment 1 Eckhart Wörner 2005-11-13 10:07:44 UTC
Confirmed for current 3.5 branch.
Comment 2 Eckhart Wörner 2005-11-13 10:52:31 UTC
Created attachment 13409 [details]
Patch fixes conversion to int
Comment 3 Felix Berger 2005-11-18 19:59:38 UTC
Neither is the number text field disabled when the edit dialog is opened for a feed whose update interval has been set to "Never" previously.

Felix
Comment 4 Eckhart Wörner 2005-11-18 22:12:02 UTC
Yeah, that's another bug that can now be seen.
Comment 5 Frank Osterfeld 2005-11-19 11:29:27 UTC
SVN commit 481501 by osterfeld:

fix autofetch setting "never". Fix the enabling/disabling of widgets in the dialog.
The toUint()/toInt() error was spotted by Eckhart Woerner
BUG: 116203


 M  +1 -1      feed.cpp  
 M  +21 -11    propertiesdialog.cpp  


--- branches/KDE/3.5/kdepim/akregator/src/feed.cpp #481500:481501
@@ -133,7 +133,7 @@
 
         QString htmlUrl = e.attribute("htmlUrl");
         QString description = e.attribute("description");
-        int fetchInterval = e.attribute("fetchInterval").toUInt();
+        int fetchInterval = e.attribute("fetchInterval").toInt();
         ArchiveMode archiveMode = stringToArchiveMode(e.attribute("archiveMode"));
         int maxArticleAge = e.attribute("maxArticleAge").toUInt();
         int maxArticleNumber = e.attribute("maxArticleNumber").toUInt();
--- branches/KDE/3.5/kdepim/akregator/src/propertiesdialog.cpp #481500:481501
@@ -223,43 +223,53 @@
    widget->urlEdit->setText(url);
 }
 
-void FeedPropertiesDialog::setAutoFetch(bool w)
+void FeedPropertiesDialog::setAutoFetch(bool customFetchEnabled)
 {
-   widget->upChkbox->setChecked(w);
-   widget->updateSpinBox->setEnabled(w);
+    widget->upChkbox->setChecked(customFetchEnabled);
+    widget->updateComboBox->setEnabled(customFetchEnabled);
+
+    if (widget->updateSpinBox->value() > -1)
+        widget->updateSpinBox->setEnabled(customFetchEnabled);
+    else
+        widget->updateSpinBox->setEnabled(false);
 }
 
-void FeedPropertiesDialog::setFetchInterval(int i)
+void FeedPropertiesDialog::setFetchInterval(int interval)
 {
-    if (i == -1)
+    if (interval == -1) // never update
     {
         widget->updateSpinBox->setValue(0);
+        widget->updateSpinBox->setDisabled(true);
         widget->updateComboBox->setCurrentItem(3); // never
         return;
     }
 
-    if (i == 0)
+    if (interval == 0)
     {
         widget->updateSpinBox->setValue(0);
+        widget->updateSpinBox->setEnabled(widget->upChkbox->isChecked());
         widget->updateComboBox->setCurrentItem(0); // minutes
         return;
     }
 
-   if (i % (60*24) == 0)
+   if (interval % (60*24) == 0)
    {
-       widget->updateSpinBox->setValue(i / (60*24) );
+       widget->updateSpinBox->setValue(interval / (60*24) );
+       widget->updateSpinBox->setEnabled(widget->upChkbox->isChecked());
        widget->updateComboBox->setCurrentItem(2); // days
        return;
    }
 
-   if (i % 60 == 0)
+   if (interval % 60 == 0)
    {
-       widget->updateSpinBox->setValue(i / 60 );
+       widget->updateSpinBox->setValue(interval / 60 );
+       widget->updateSpinBox->setEnabled(widget->upChkbox->isChecked());
        widget->updateComboBox->setCurrentItem(1); // hours
        return;
    }
 
-   widget->updateSpinBox->setValue(i);
+   widget->updateSpinBox->setValue(interval);
+   widget->updateSpinBox->setEnabled(widget->upChkbox->isChecked());
    widget->updateComboBox->setCurrentItem(0); // minutes
 }
 
Comment 6 Frank Osterfeld 2005-11-19 11:32:24 UTC
SVN commit 481504 by osterfeld:

forwardport of 116203 (fix "never" setting)
CCBUG: 116203


 M  +1 -1      feed.cpp  
 M  +21 -11    propertiesdialog.cpp  


--- trunk/KDE/kdepim/akregator/src/feed.cpp #481503:481504
@@ -132,7 +132,7 @@
 
         QString htmlUrl = e.attribute("htmlUrl");
         QString description = e.attribute("description");
-        int fetchInterval = e.attribute("fetchInterval").toUInt();
+        int fetchInterval = e.attribute("fetchInterval").toInt();
         ArchiveMode archiveMode = stringToArchiveMode(e.attribute("archiveMode"));
         int maxArticleAge = e.attribute("maxArticleAge").toUInt();
         int maxArticleNumber = e.attribute("maxArticleNumber").toUInt();
--- trunk/KDE/kdepim/akregator/src/propertiesdialog.cpp #481503:481504
@@ -225,43 +225,53 @@
    widget->urlEdit->setText(url);
 }
 
-void FeedPropertiesDialog::setAutoFetch(bool w)
+void FeedPropertiesDialog::setAutoFetch(bool customFetchEnabled)
 {
-   widget->upChkbox->setChecked(w);
-   widget->updateSpinBox->setEnabled(w);
+    widget->upChkbox->setChecked(customFetchEnabled);
+    widget->updateComboBox->setEnabled(customFetchEnabled);
+
+    if (widget->updateSpinBox->value() > -1)
+        widget->updateSpinBox->setEnabled(customFetchEnabled);
+    else
+        widget->updateSpinBox->setEnabled(false);
 }
 
-void FeedPropertiesDialog::setFetchInterval(int i)
+void FeedPropertiesDialog::setFetchInterval(int interval)
 {
-    if (i == -1)
+    if (interval == -1) // never update
     {
         widget->updateSpinBox->setValue(0);
+        widget->updateSpinBox->setDisabled(true);
         widget->updateComboBox->setCurrentItem(3); // never
         return;
     }
 
-    if (i == 0)
+    if (interval == 0)
     {
         widget->updateSpinBox->setValue(0);
+        widget->updateSpinBox->setEnabled(widget->upChkbox->isChecked());
         widget->updateComboBox->setCurrentItem(0); // minutes
         return;
     }
 
-   if (i % (60*24) == 0)
+   if (interval % (60*24) == 0)
    {
-       widget->updateSpinBox->setValue(i / (60*24) );
+       widget->updateSpinBox->setValue(interval / (60*24) );
+       widget->updateSpinBox->setEnabled(widget->upChkbox->isChecked());
        widget->updateComboBox->setCurrentItem(2); // days
        return;
    }
 
-   if (i % 60 == 0)
+   if (interval % 60 == 0)
    {
-       widget->updateSpinBox->setValue(i / 60 );
+       widget->updateSpinBox->setValue(interval / 60 );
+       widget->updateSpinBox->setEnabled(widget->upChkbox->isChecked());
        widget->updateComboBox->setCurrentItem(1); // hours
        return;
    }
 
-   widget->updateSpinBox->setValue(i);
+   widget->updateSpinBox->setValue(interval);
+   widget->updateSpinBox->setEnabled(widget->upChkbox->isChecked());
    widget->updateComboBox->setCurrentItem(0); // minutes
 }