Esempio n. 1
0
    public void Init(string path, bool create_if_missing)
    {
        bool new_db = !File.Exists(path);

        this.path = path;

        if (new_db && !create_if_missing)
        {
            throw new Exception(path + ": File not found");
        }

        database = new QueuedSqliteDatabase(path);

        // Load or create the meta table
        meta_store = new MetaStore(Database, new_db);

        // Update the database schema if necessary
        FSpot.Database.Updater.Run(this);

        Database.BeginTransaction();

        face_store   = new FaceStore(Database, new_db);
        tag_store    = new TagStore(Database, new_db);
        roll_store   = new RollStore(Database, new_db);
        export_store = new ExportStore(Database, new_db);
        job_store    = new JobStore(Database, new_db);
        photo_store  = new PhotoStore(Database, new_db);

        Database.CommitTransaction();

        empty = new_db;
    }
        protected override bool DoExport()
        {
            ExportStore.AddCopyFile(
                GetExportPath(),
                fileType,
                GetHash()
                );

            return(true);
        }
        protected override bool DoExport()
        {
            ExportStore.AddJSONFile(
                GetExportPath(),
                GetContent(),
                GetHash()
                );

            return(true);
        }
Esempio n. 4
0
        protected override bool DoExport()
        {
            JSONObject json = ExportResource(usingPreset);

            string exportPath = GetExportPath();

            ExportStore.AddResource(
                exportPath,
                GetResourceType(),
                dependencies,
                useFile,
                // 有importSetting的时候才传importSetting
                importSetting == null ? null : importSetting
                );

            return(true);
        }
Esempio n. 5
0
    public void Init(string path, bool create_if_missing)
    {
        uint timer  = Log.DebugTimerStart();
        bool new_db = !File.Exists(path);

        this.path = path;

        if (new_db && !create_if_missing)
        {
            throw new Exception(path + ": File not found");
        }

        database = new QueuedSqliteDatabase(path);
        database.ExceptionThrown += HandleDbException;

        if (database.GetFileVersion(path) == 2)
        {
            SqliteUpgrade();
        }

        // Load or create the meta table
        meta_store = new MetaStore(Database, new_db);

        // Update the database schema if necessary
        FSpot.Database.Updater.Run(this);

        Database.BeginTransaction();

        tag_store    = new TagStore(Database, new_db);
        roll_store   = new RollStore(Database, new_db);
        export_store = new ExportStore(Database, new_db);
        job_store    = new JobStore(Database, new_db);
        photo_store  = new PhotoStore(Database, new_db);

        Database.CommitTransaction();

        empty = new_db;
        Log.DebugTimerPrint(timer, "Db Initialization took {0}");
    }
Esempio n. 6
0
File: Db.cs Progetto: GNOME/f-spot
        public void Init(string path, bool create_if_missing)
        {
            uint timer = Log.DebugTimerStart ();
            bool new_db = !File.Exists (path);
            this.path = path;

            if (new_db && !create_if_missing)
                throw new Exception (path + ": File not found");

            Database = new FSpotDatabaseConnection (path);

            // Load or create the meta table
            Meta = new MetaStore (Database, new_db);

            // Update the database schema if necessary
            FSpot.Database.Updater.Run (Database);

            Database.BeginTransaction ();

            Tags = new TagStore (Database, new_db);
            Rolls = new RollStore (Database, new_db);
            Exports = new ExportStore (Database, new_db);
            Jobs = new JobStore (Database, new_db);
            Photos = new PhotoStore (Database, new_db);

            Database.CommitTransaction ();

            Empty = new_db;
            Log.DebugTimerPrint (timer, "Db Initialization took {0}");
        }
Esempio n. 7
0
	public void Init (string path, bool create_if_missing)
	{
		bool new_db = ! File.Exists (path);
		this.path = path;

		if (new_db && ! create_if_missing)
			throw new Exception (path + ": File not found");

		database = new QueuedSqliteDatabase(path);	

		// Load or create the meta table
 		meta_store = new MetaStore (Database, new_db);

		// Update the database schema if necessary
		FSpot.Database.Updater.Run (this);

		Database.BeginTransaction ();
		
		face_store = new FaceStore (Database, new_db);
		tag_store = new TagStore (Database, new_db);
		roll_store = new RollStore (Database, new_db);
		export_store = new ExportStore (Database, new_db);
		job_store = new JobStore (Database, new_db);
 		photo_store = new PhotoStore (Database, new_db);
		
		Database.CommitTransaction ();

		empty = new_db;
	}
Esempio n. 8
0
	public void Init (string path, bool create_if_missing)
	{
		uint timer = Log.DebugTimerStart ();
		bool new_db = ! File.Exists (path);
		this.path = path;

		if (new_db && ! create_if_missing)
			throw new Exception (path + ": File not found");

		database = new QueuedSqliteDatabase(path);
		database.ExceptionThrown += HandleDbException;

		if (database.GetFileVersion(path) == 2)
			SqliteUpgrade ();

		// Load or create the meta table
 		meta_store = new MetaStore (Database, new_db);

		// Update the database schema if necessary
		FSpot.Database.Updater.Run (this);

		Database.BeginTransaction ();

		tag_store = new TagStore (Database, new_db);
		roll_store = new RollStore (Database, new_db);
		export_store = new ExportStore (Database, new_db);
		job_store = new JobStore (Database, new_db);
 		photo_store = new PhotoStore (Database, new_db);

		Database.CommitTransaction ();

		empty = new_db;
		Log.DebugTimerPrint (timer, "Db Initialization took {0}");
	}