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

« back to all changes in this revision

Viewing changes to lib/dpap-sharp/dpap-server/Main.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
 
// Main.cs
2
 
// dpap-sharp server test program
3
 
//
4
 
// Authors:
5
 
//   Andrzej Wytyczak-Partyka <iapart@gmail.com>
6
 
//
7
 
// Copyright (C) 2008 Andrzej Wytyczak-Partyka
8
 
//
9
 
// This program is free software; you can redistribute it and/or modify
10
 
// it under the terms of the GNU General Public License as published by
11
 
// the Free Software Foundation; either version 2 of the License, or
12
 
// (at your option) any later version.
13
 
//
14
 
// This program is distributed in the hope that it will be useful,
15
 
// but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
 
// GNU General Public License for more details.
18
 
// 
19
 
// You should have received a copy of the GNU General Public License
20
 
// along with this program; if not, write to the Free Software
21
 
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22
 
//
23
 
//
24
 
 
25
 
using System;
26
 
using System.IO;
27
 
using System.Collections.Generic;
28
 
using System.Collections;
29
 
using Mono.Unix;
30
 
using System.Text.RegularExpressions;
31
 
//using Gtk;
32
 
 
33
 
using DPAP;
34
 
 
35
 
 
36
 
 
37
 
namespace DPAP {
38
 
        
39
 
        class MainClass
40
 
        {
41
 
                
42
 
                public static void Main(string[] args)
43
 
                {
44
 
                        //Regex dbPhotoRegex = new Regex ("/databases/([0-9]*?)/items?session-id=([0-9]*)&meta=.*&query=('dmap.itemid:([0-9]*)')");
45
 
                        
46
 
//                      string path = "/databases/1/items?session-id=9527&meta=dpap.thumb,dmap.itemid,dpap.filedata&query=('dmap.itemid:35')$";
47
 
                        //string path = "'dmap.itemid:35'";
48
 
        //              Console.WriteLine("regex:"+rg.IsMatch(path));
49
 
                        
50
 
                        Console.WriteLine("Starting DPAP server");
51
 
                        DPAP.Database database = new DPAP.Database("DPAP");
52
 
                        DPAP.Server server = new Server("f-spot photos");
53
 
                        server.Port = 8770;
54
 
                        server.AuthenticationMethod = AuthenticationMethod.None;
55
 
                        int collision_count = 0;
56
 
                        server.Collision += delegate {
57
 
                                server.Name = "f-spot photos" + " [" + ++collision_count + "]";
58
 
                        };
59
 
            
60
 
                        Photo p = new Photo();
61
 
                        p.Thumbnail = "./test3-thumb.jpg";
62
 
                        p.ThumbSize = 44786;
63
 
                        p.FileName = "test3.jpg";
64
 
                        p.Path = "./test3.jpg";
65
 
                        p.Title = "test1";
66
 
                        p.Format = "JPEG";
67
 
                        p.Size = 1088386;
68
 
                        database.AddPhoto(p);
69
 
                        
70
 
                        Photo p1 = new Photo();
71
 
                        p1.Thumbnail = "./test2-thumb.jpg";
72
 
                        p1.ThumbSize = 11357;
73
 
                        p1.FileName = "test2.jpg";
74
 
                        p1.Path = "./test2.jpg";
75
 
                        p1.Title = "test2";
76
 
                        p1.Format = "JPEG";
77
 
                        p1.Size = 35209;
78
 
                        database.AddPhoto(p1);
79
 
                
80
 
                        Album a = new Album("test album");
81
 
                        a.AddPhoto(p);          
82
 
                        a.AddPhoto(p1);
83
 
                        database.AddAlbum(a);
84
 
                        Console.WriteLine("Album count is now " + database.Albums.Count);
85
 
                        Console.WriteLine("Photo name is " + database.Photos[0].FileName);
86
 
                        server.AddDatabase(database);
87
 
                        
88
 
                        //server.GetServerInfoNode();                   
89
 
                        try {
90
 
                server.Start();
91
 
            } catch (System.Net.Sockets.SocketException) {
92
 
                                Console.WriteLine("Server socket exception!");
93
 
                server.Port = 0;
94
 
                server.Start();
95
 
            }
96
 
        
97
 
             //DaapPlugin.ServerEnabledSchema.Set(true);
98
 
            
99
 
          //  if(!initial_db_committed) {
100
 
                server.Commit();
101
 
          //      initial_db_committed = true;
102
 
          //  }
103
 
                        
104
 
 
105
 
                        Console.ReadLine();
106
 
                
107
 
                        
108
 
                }
109
 
        }
110
 
}