~ubuntu-branches/ubuntu/natty/banshee/natty-201104090814

« back to all changes in this revision

Viewing changes to src/Libraries/Migo/Migo.Syndication/Feed.cs

  • Committer: Bazaar Package Importer
  • Author(s): Chow Loong Jin
  • Date: 2010-12-21 13:22:57 UTC
  • mfrom: (6.3.13 experimental)
  • Revision ID: james.westby@ubuntu.com-20101221132257-r93dkoybpwo0ww35
Tags: 1.9.1-1ubuntu1
* Merge from Debian experimental, remaining changes:
  + Disable notification area by default
  + Disable boo and karma extensions
  + Enable and recommend u1ms and soundmenu extensions
  + Move desktop file for Meego UI to /usr/share/une/applications

Show diffs side-by-side

added added

removed removed

Lines of Context:
77
77
        }
78
78
 
79
79
        protected override int ModelVersion {
80
 
            get { return 3; }
 
80
            get { return 4; }
81
81
        }
82
82
 
83
83
        protected override void MigrateTable (int old_version)
91
91
            if (old_version < 3) {
92
92
                CreateIndex ("PodcastSyndicationsIndex", "IsSubscribed, Title");
93
93
            }
 
94
 
 
95
            if (old_version < 4) {
 
96
                Connection.Execute (String.Format ("UPDATE {0} SET MaxItemCount=0 WHERE MaxItemCount=200", TableName));
 
97
            }
94
98
        }
95
99
    }
96
100
 
129
133
        private string link;
130
134
        //private string local_enclosure_path;
131
135
        private long dbid = -1;
132
 
        private long maxItemCount = 200;
 
136
        private long maxItemCount = 0;
133
137
        private DateTime pubDate;
134
138
        private FeedSyncSetting syncSetting;
135
139
        private string title;
399
403
            }
400
404
 
401
405
            if (added_any) {
 
406
               CheckForItemsToArchive ();
402
407
               Manager.OnFeedsChanged ();
403
408
               CheckForItemsToDownload ();
404
409
            }
556
561
        public void Save (bool notify)
557
562
        {
558
563
            Provider.Save (this);
 
564
            CheckForItemsToArchive ();
559
565
 
560
566
            if (LastBuildDate > LastAutoDownload) {
561
567
                CheckForItemsToDownload ();
566
572
            }
567
573
        }
568
574
 
 
575
        private void CheckForItemsToArchive ()
 
576
        {
 
577
            if (MaxItemCount == 0)
 
578
                return;
 
579
 
 
580
            int i = 0;
 
581
            foreach (var item in Items) {
 
582
                if (!item.IsRead) {
 
583
                    if (i++ >= MaxItemCount) {
 
584
                        item.IsRead = true;
 
585
                        item.Save (false);
 
586
                    }
 
587
                }
 
588
            }
 
589
        }
 
590
 
569
591
        private void CheckForItemsToDownload ()
570
592
        {
571
593
            if (LastDownloadError != FeedDownloadError.None || AutoDownload == FeedAutoDownload.None)