~ubuntu-branches/debian/sid/f-spot/sid

« back to all changes in this revision

Viewing changes to lib/dpap-sharp/lib/ServerInfo.cs

  • Committer: Bazaar Package Importer
  • Author(s): Iain Lane
  • Date: 2010-05-24 10:35:57 UTC
  • mfrom: (2.4.7 experimental)
  • Revision ID: james.westby@ubuntu.com-20100524103557-1j0i8f66caybci2n
* New upstream release 0.7.0
 + First release of the unstable 0.7 development series. Massive changes.
 + Reparenting and detaching support (Anton Keks) (Closes: #559745)
 + A new Mallard-based documentation (Harold Schreckengost)
 + No longer embeds flickrnet, uses distribution copy (Iain Lane)
 + Adoption of a large amount of Hyena functionality (Paul Lange, Peter
   Goetz)
 + No longer embeds gnome-keyring-sharp
 + Completely rewritten import, much faster and less memory hungry (Ruben
   Vermeersch) (Closes: #559080, #492658, #341790, #357811, #426017) (LP:
   #412091)
 + No longer use gphoto2-sharp, now uses gvfs which is less crash-pron
   (Ruben Vermeersch)
 + Fix Facebook support (Ruben Vermeersch)
 + Modernized unit tests
 + Revamped build (Mike Gemünde)
 + Much improved duplicate detection (much faster too) (Ruben Vermeersch)
 + Mouse selection in Iconview (Vincent Pomey)
 + Image panning support using middle mouse button (Wojciech Dzierżanowski)
 + Timeline slider now restricted to the size of the window (Iain Churcher)
 + Over 100 bugs closed (http://bit.ly/cyVjnD)
   - No more warnings about schema defaults (Closes: #584215) (LP: #586132)
* debian/control: Clean up build deps to match configure checks
* debian/rules: Don't run dh_makeshilbs as we don't ship any shared
  libraries. There are some private ones though, which get picked up and
  result in a useless postinst/postrm call to ldconfig. Thanks, lintian.
* debian/patches/debian_fix-distclean.patch,
  debian/patches/debian_fix_f-spot.exe.config.patch,
  debian/patches/debian_link-system-flickrnet.patch,
  debian/patches/debian_link-system-gnome-keyring.patch,
  debian/patches/debian_disable-unit-tests,
  debian/patches/git_transition_duration.patch,
  debian/patches/ubuntu_fix_folder_export_hang.patch:
  Clean up obsolete patches which are no longer necessary 
* debian/patches/*: Temporarily disable patches which originated from Ubuntu
  and no longer apply cleanly. We will get these back in a future upstream
  development release.
* debian/patches/*: Refresh to apply cleanly 
* debian/rules: Add new include dir to autoreconf call to pick up f-spot
  macros 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// ServerInfo.cs
2
 
//
3
 
// Authors:
4
 
//   Andrzej Wytyczak-Partyka <iapart@gmail.com>
5
 
//   James Willcox <snorp@snorp.net>
6
 
//
7
 
// Copyright (C) 2008 Andrzej Wytyczak-Partyka
8
 
// Copyright (C) 2005  James Willcox <snorp@snorp.net>
9
 
//
10
 
// This program is free software; you can redistribute it and/or modify
11
 
// it under the terms of the GNU General Public License as published by
12
 
// the Free Software Foundation; either version 2 of the License, or
13
 
// (at your option) any later version.
14
 
//
15
 
// This program is distributed in the hope that it will be useful,
16
 
// but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
 
// GNU General Public License for more details.
19
 
// 
20
 
// You should have received a copy of the GNU General Public License
21
 
// along with this program; if not, write to the Free Software
22
 
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23
 
//
24
 
//
25
 
 
26
 
 
27
 
using System;
28
 
using System.Text;
29
 
using System.Net;
30
 
 
31
 
namespace DPAP {
32
 
 
33
 
    public enum AuthenticationMethod : byte {
34
 
        None,
35
 
        UserAndPassword,
36
 
        Password,
37
 
    }
38
 
            
39
 
    internal class ServerInfo {
40
 
 
41
 
        private string name;
42
 
        private AuthenticationMethod auth_method;
43
 
        private bool supports_update;
44
 
        
45
 
        public string Name {
46
 
            get { return name; }
47
 
            set { name = value; }
48
 
        }
49
 
 
50
 
        public AuthenticationMethod AuthenticationMethod {
51
 
            get { return auth_method; }
52
 
            set { auth_method = value; }
53
 
        }
54
 
 
55
 
        public bool SupportsUpdate {
56
 
            get { return supports_update; }
57
 
            set { supports_update = value; }
58
 
        }
59
 
 
60
 
        internal static ServerInfo FromNode (ContentNode node) {
61
 
            ServerInfo info = new ServerInfo ();
62
 
 
63
 
            if (node.Name != "dmap.serverinforesponse")
64
 
                return null;
65
 
 
66
 
            foreach (ContentNode child in (node.Value as ContentNode [])) {
67
 
                switch (child.Name) {
68
 
                case "dmap.itemname":
69
 
                    info.Name = (string) child.Value;
70
 
                    break;
71
 
                case "dmap.authenticationmethod":
72
 
                    info.AuthenticationMethod = (AuthenticationMethod) child.Value;
73
 
                    break;
74
 
                case "dmap.supportsupdate":
75
 
                    info.SupportsUpdate = (byte) child.Value == 1;
76
 
                    break;
77
 
                }
78
 
            }
79
 
 
80
 
            return info;
81
 
        }
82
 
 
83
 
        internal ContentNode ToNode (int dbCount) {
84
 
            return new ContentNode ("dmap.serverinforesponse",
85
 
                                    new ContentNode ("dmap.status", 200),
86
 
                                    new ContentNode ("dmap.protocolversion", new Version (2, 0, 0)),
87
 
                                    new ContentNode ("dpap.protocolversion", new Version (1, 0, 1)),                                            
88
 
                                    new ContentNode ("dmap.itemname", "photos"),
89
 
                                    new ContentNode ("dmap.loginrequired", (byte) 1),
90
 
                                             //    new ContentNode ("dmap.authenticationmethod", (byte) auth_method),
91
 
                                                new ContentNode ("dmap.timeoutinterval", (int) Server.DefaultTimeout.TotalSeconds),
92
 
                                                new ContentNode ("dmap.supportsautologout", (byte) 1),
93
 
                                 //   new ContentNode ("dmap.supportsupdate", (byte) 1),
94
 
                                 //   new ContentNode ("dmap.supportspersistentids", (byte) 1),
95
 
                                 //   new ContentNode ("dmap.supportsextensions", (byte) 1),
96
 
                                 //   new ContentNode ("dmap.supportsbrowse", (byte) 1),
97
 
                                 //   new ContentNode ("dmap.supportsquery", (byte) 1),
98
 
                                    new ContentNode ("dmap.supportsindex", (byte) 1),
99
 
                                 //   new ContentNode ("dmap.supportsresolve", (byte) 0),
100
 
                                    new ContentNode ("dmap.databasescount", dbCount));
101
 
        }
102
 
 
103
 
    }
104
 
}