Archive

Posts Tagged ‘win32’

openSUSE to Develop

December 6, 2013 1 comment

Have you ever wondered why openSUSE is the platform for development? Because it offers all that is needed for professional development, also if development goes beyond the basics.

A nice proof that openSUSE has more than others was posted here by our friend Thomas, a convinced Debian user. He writes about setting up openSUSE in vagrant to be easily able to build (master build) the ownCloud Client for Win32 in it. Very easy and cool stuff. But that can be even easier without vagrant through this link ;-).

Btw, there is an appliance in SUSE Studio to ease experiments with vagrant with openSUSE as base. I haven’t tested yet, experiences?

Cross platform again

May 10, 2012 3 comments

Writing cross platform code is easy nowadays. You use Qt, implement stuff, and it compiles and runs almost everywhere. I also enjoy that in my work on the ownCloud desktop client. But, as you know, there is the other part in the client called csync. Its the syncing engine underneath. And that does not build up on Qt, but is plain C. Adventure starts here.

This bug took me on an interesting (well…) journey into what cross platform really means.It is about a complex thing like filenames containing special characters, my favorite example is the directory “Übergröße”. Directories and files like this could not successfully be synced with the latest client.

Windows does not utf8 by default. As far as I understood it, it does a local encoding by default. If you use normal C functions to access the filesystem, something like readdir or so, you get the names in that encoding. But, because that caused problems in some point, there is another set of functions which often start with _w (for example _wreaddir) and that has an interface to deal with wide characters. This is the way to internationalization.

So what needs to be done is to use the wide character implementations everywhere where you deal with filenames (in my case). That, in turn, requires to use wchar_t instead of normal char. But that again requires a lot of #ifdef _WIN32, if its done the naive way at every place it needs to be done. I learned that typedef helps here and a meta type is defined called _TCHAR. And also for all the needed functions, meta functions are defined which are replaced by tricky defines depending on the platform. For example _treaddir becomes readdir on linux and _wreaddir on win32, while _TCHAR becomes wchar_t on Win and char on linux. The code is written using the meta types to not poison it too much with platform ifdefs.

But that is only the first step. Wide character is not utf8! And since utf8 should be used within the software all over, a conversion from wide character to utf8 and back is needed whenever the file system is accessed. Thankfully from csyncs nature, these places are quite nicely concentrated.

All that combines into a larger patch. And now the “Übergröße” folder can be synced correctly from Windows to Linux and back. Great.

What can we learn from that? Well, easy, and once again: If you have no Qt, you’re alone. Better don’t let that happen. If you have Qt, be happy and aware of what it does for you 🙂

Categories: ownCloud, Qt Tags: , , ,

On the road…

March 16, 2012 3 comments

Busy times currently as we’re heading to releases of ownCloud. The syncing client I am working on plays a role for that and thus I was doing a lot of work on csync upstream and mirall to get that going. Meanwhile I succeeded to get mirall running under Win32, it was quite an experience for me digging through the mud of various compilers and environments and the different understandings of C standards, especially since csync is plain C and never run on Win32 before.

Last week I have been on CeBIT for a day, which is a huge and busy event. We had a nice preview running there with syncing between the web client and the desktop clients on Windows and Linux, as well as on an Android device. That already worked quite ok, nevertheless I got quite some bug reports since then. And I still have to work with csync upstream to get patches in there before we’re ready for a public beta.

This weekend I will be at the Chemnitzer Linuxtage together with friends from the openSUSE project. I will show some ownCloud syncing there as well, so if you like show up at the openSUSE booth for a demo and a chat 🙂

Categories: ownCloud Tags: , , , ,