Changing data files location

Asked by sreyesp

HI,

I found that the default data files paths (including thumbs) is ~/.config/Basenji. I would like to have them in a USB stick. Is it GNOME-dependent, or could I modify the source code to change it? Say, I open the database I wish to use and it looks for the settings file and dbdata /thumbs) dir in a path relative to the vdb file I have selected.

Thanks.

Question information

Language:
English Edit question
Status:
Solved
For:
Basenji Edit question
Assignee:
No assignee Edit question
Solved by:
sreyesp
Solved:
Last query:
Last reply:
Revision history for this message
Patrick Ulbrich (pulb) said :
#1

Hi,

to begin with, optional datafiles like thumbnails are stored in this central place so that the user doesn't have to worry about multiple files and directories. The actual indexing data is stored in a single .vdb file that can be copied around and will work without optional cache data like thumbnails.

Is replacing ~/.config/Basenji by a symlink pointing to a directory on your usb drive a solution to your problem (e.g. in ~/.config, type ln -s /media/<usb-drive-name>/basenji_config -n "Basenji")?

Revision history for this message
Patrick Ulbrich (pulb) said :
#2

(In case you haven't noticed: You can always create a new database on the usb drive directly or simply copy the default .vdb to it and select "open database "in Basenji. The thumb data remains on ~/.config/Basenji though)

Revision history for this message
sreyesp (sreyesp) said :
#3

Hi,

Thanks for your prompt response.

I was planning to compile Basenji with Mono on Win32, and to carry arround the USB stick with the Windows mkbundle'd binary, the vdb database and all the additional data (thumbs), so I can access the same database at home on my Linux PC or elsewhere via the Win32 executable, with the same eye-candy the thumbs provide wherever I run Basenji.

If the ~/.config/Basenji path is a limitation due to the way thumbnails are generated (I understand they can be created only on GNOME/Linux), then I will settle for thumbs in my main PC, and the generic icons elsewhere.

Thanks again,

Sergio.

Revision history for this message
Patrick Ulbrich (pulb) said :
#4

Ah, i see.Yes, that should all work well. The only problem here is that thumbnail generation on windows is still on the todo list. There is already a blueprint with a tutorial for that (https://blueprints.launchpad.net/basenji/+spec/win-thumbnail-generation) and should be pretty easy to implement. I'm planning to set up a visual studio project and bundle a win32 binary within my current holidays, so if you have some experince in C# (and of course time) you could contribute by implemeting that class :-).

Revision history for this message
Patrick Ulbrich (pulb) said :
#5

Thumbnail generation on Windows is of course needed only if you're planning to index new media on Windows, browsing already indexed thumbnails in Basenji should work already on windows. Patching Settings.GetSettingsPath() to simply return Environment.CurrentDirectory should be the only change needed to store setting in Basenjis current working direcory (i.e. the usb drive).

Revision history for this message
Patrick Ulbrich (pulb) said :
#6

Err... that should read "...the only change needed to store settings and thumbnails in Basenjis current working direcory (i.e. the usb drive)."

Revision history for this message
Patrick Ulbrich (pulb) said :
#7

Oh, and you won't need mono on Windows, Basenji should work fine with MS .NET.

Revision history for this message
Patrick Ulbrich (pulb) said :
#8

Hmm.. thinking about it, i guess i'll change Settings.GetSettingsPath() to look first into Basenji's current working dir and if no settings dir (including thumbs) is present, use the systems settings dir.

Revision history for this message
Patrick Ulbrich (pulb) said :
#9

Ok, commited. Starting with the next release, settings and thumbnail cache will go into a directory called "user_data" if it exists in the directory of the Basenji executable.

Revision history for this message
sreyesp (sreyesp) said :
#10

Patrick,

> Hmm.. thinking about it, i guess i'll change Settings.GetSettingsPath() to look first
> into Basenji's current working dir and if no settings dir (including thumbs) is present,
> use the systems settings dir.

Thank you very much. That's exactly what I wished for. I will bazaar-out the src trunk and try it out.

I'm not planning to index new media on Windows, only to browse the databases I've created on Linux.

As you point out, it may not be necessary to mkbundle the Basenji executable with Mono, as almost every modern Win machine out there should have a suitable .NET runtime, via Windows Update. I will try to complile Basenji with Win32 Mono, to see if there is any problem or additional requirements with Hal.dll, LibExtractor.dll, or elsewhere.

My programming experience is limited to C++ and PHP, and I don't think I could get up to speed with C# and the Mono project and building framework in the near future, but I can offer you a spanish localization, sometime next week (my holidays are christmas to new year).

Thanks again. It's good to see such a well maintained application. Regards,

Sergio.

Revision history for this message
Patrick Ulbrich (pulb) said :
#11

Great! The default configuration of the makefile is "GNOME_RELEASE" though, which will build a binary that depends on GNOME libraries. Running ./configure --config=RELEASE before make will build a platform independant binary with a few features like thumnail-generation (but not viewing) stripped. This binary should work _with mono_ on windows. As mentioned in a previous post, i'm going to release a windows specifc binary that will run on .NET and will have most of the features enabled, soon.

Revision history for this message
Patrick Ulbrich (pulb) said :
#12

No, just figured out this won't work. The "RELEASE" build will indeed be GNOME-independent but still depends on UNIX technologies like HAL. Seems you have to wait for the binary with #WIN32 code enabled. This binary will link against equivalent windows technologies explicitly. Sorry :-\

Revision history for this message
sreyesp (sreyesp) said :
#13

Patrick,

> No, just figured out this won't work. The "RELEASE" build will indeed be GNOME-independent
> but still depends on UNIX technologies like HAL. Seems you have to wait for the binary with
> #WIN32 code enabled.

Understood. I will wait for your Win32 binary. Next week I'll send you both po files (Basenji and VolumeDB) corresponding to the spanish localization. I'm es_MX, but I'll try to make it country-neutral.

Sergio.

Revision history for this message
Patrick Ulbrich (pulb) said :
#14

Nice, I just updated the po templates :-)
If possible, please translate via launchpads translation page.
Doing so, you get translation suggestions from other projects, all the credits and it's easier to import your translations. It appears someone has already started a spanish translation there, but it is incomplete and I don't know about its quality. It's probably advisable to review and extend that one.
Anyway, many thanks for your support!

Revision history for this message
Patrick Ulbrich (pulb) said :
#15

Hi,
i uploaded a first windows binary -> https://answers.launchpad.net/basenji/+question/93932.
Please check if it solves your problem.