Random rants from a KDE user which also works on making KDE more Hebrew friendly.

Saturday, April 16, 2011

clang+Qt+QtCreator binary package - compiled with clang alpha1

To continue what I did last week today I uploaded to GoogleCode (I have a working project there, but not abusing it...?) a snapshot build of clang (trunk) Qt (master) and QtCreator (master). The code was pulled around 2AM (GMT+3), a really random time stamp.

The script I used (which is included in the tarball) first compiles clang using the native compiler, then it compiles clang again using the first generation compiler (2 stage bootstrap), then it compile Qt with the 2nd stage compiler and finally QtCreator with Qt/clang. All compilations are done out of source, and clang/llvm is compiled using "cmake" and not "configure". Someone asked last week what changes are needed to compile this beast, the answer is none, it all compiles out of the box.

A few notes:
  1. I added a script which sets up the environment variables for this beast to work (LD_LIBRARY_PATH, PATH). You get a shell working, from which you can call the new "qmake" and "clang" commands, as well as running the QtCreator.
  2. The build is 64bit linux only, it was built on Ubuntu 10.10, but I think it should run on every modern linux distro. I will try to build 32bit builds in the future.
  3. The code east  kittens, tested very briefly for 20 seconds.Not recommended at all.
  4. The code has been pulled from the corresponding SCM at random times, so it's possible that clang is borked, Qt is borked or CtCreator is borked. Be warned - it is not supposed to work :)
  5. QtCreator picks the correct qmake (the clang bootstrapped) by default. However, even if it picks the correct mkspec, it will not really work as you expect, as QtCreator does not know (yet?) how to parse the output of clang. It should compile your applications though.
  6. The tarball contains the build script, and also the full build log - ~26mb long. If you are interested in re-produce this, look at the script and the output. Contact me for more details, I am available sometimes in IRC (#qt, -> cuco) or email (elcuco -> kde, diegoiast -> gmail)
Again, I cannot stress this enough - this build is very experimental, and not recommended. But still, if you are interested - here is the download link: http://code.google.com/p/qtedit4/downloads/detail?name=qtsdk-clang-amd64-alpha1.tar.xz

Sunday, April 10, 2011

Qt + clang = it compiles!

After more than a year I have been compiling Qt with clang, now I can honestly say it compiles and runs. Not only I can bootstrap clang properly, and it compiles the core Qt4, but it also compiles the WebKit module (and runs flash!), I also saw on the console messages about JDK being loaded, so the browser demo seems very functional to me:



I have also tested the browser using the SubSpider test, and I see that the browser is not that slow (QtSDK/64bit from Nokia runs at 360.0ms +/- 2.5%, and the compiled one in 415.4ms +/- 3.6%, Chromium runs at 249.2ms +/- 11.0%).

As a special bonus, I decided to build Qt-Creator. It compiles and works quite good. I assume you can even use the new toolchain to compile applications, even tough that the error messages will not be recognized by the IDE.


I will try to clean up my build scripts so I can publish it online. I am also thinking of releasing the results as a "qt-clang-sdk" or something. Is anyone interested in such thing?

Saturday, October 2, 2010

Building QtCreator

Whats so cool and new about it...? I build it using clang. Linking to a Qt compilation made with clang. Now that's a big step!

Some details: I compiled yesterday clang, and bootstapped into stage 3 (first compiled clang using gcc = stage 1, then compiled clang using clang from stage 2, and then compiled stage 3 using clang from stage 2, as a stress test to clang).

Then I compiled git cloned qt (http://gitorious.org/~elcuco/qt/llvm-support use clang-support-linux as your branch).  I used this configure line for qt: 


./configure -fast -no-pch -no-webkit -no-mmx -opensource -confirm-license -continue -prefix -platform linux-clang 


Some notes: mxx is disabled, since the the clang runtime does not yet support some MMX functions needed. Also webkit does not compile yet, but some work has been done upstream (in WebKit, not integrated into Qt yet) to compile using clang. I think the PCH support can be re-enabled, I will test in the next weeks.

Note also the "platform", this is an mkspec available from my repository. I also hacked configure.exe's source to have clang support. I still need to rebuild configure.exe using cl.exe and adding this to the repository. This is on my TODO list (also make this whole test under windows as well).


The next step was cloning QtCreator, and then

mkdir build-qmake-clang
cd build-qmake-clang
~/src/build-qt-clang/bin/qmake ..
make -j 10


I used 10 threads to compile, since clang compilations are really slow, and I did not see the 4 cores of my machine working too hard. (when building Qt I used -j4). I will test the next few days how stable, or non-stable is this QtCreator build, but it seems promissing. More stats in the next weeks as I gather more information.



Mandatory screenshot - nothing special here, right? 



PS: as a special bonus - this is a 64bit compilation: clang, Qt and QtCreator. How cool is that?

Friday, March 19, 2010

Tab animation - bad!

I have disabled the tab anymation in my install(s). This was just frustration - the tab has already changed, it's displayed on screen, but it's "slowly" fades in so I can see it.

It become too much distracting and my life is better since. Has anyone else been feeling the same? Do we have a lot of complains on this issue? If we do, this might be a good idea disabling this feature by default.

Sunday, February 28, 2010

Qt + clang

1) What is clang?
It's a c++ compiler that is been developed using llvm. It should be very fast, it consumes less memory, it's BSD licensed, it should eventually provide better optimizations. It's still beeing developed

2) Can it compile Qt?
Dunno, not always. It does not work for me, but some people have reported that it works for them.

3) me too! me too! me too! me too! me too!
ok, shut up and type this:

# get + build clang
mkdir -p ~/src/llvm/
svn co http://llvm.org/svn/llvm-project/llvm/trunk ~/src/llvm
mkdir -p ~/src/llvm/tools/clang/
svn co http://llvm.org/svn/llvm-project/cfe/trunk ~/src/llvm/tools/clang
mkdir -p ~/src/llvm/cmake-build
cd ~/src/llvm/cmake-build
cmake ../
make -j 127

# compile Qt using the new clang
mkdir $QTDIR/qt-build-clang
cd $QTDIR/qt-build-clang
export PATH=~/src/llvm/cmake-build/bin:$PATH
export CC=clang
export CXX=clang++
$QTDIR/configure

# next time, update:
svn up ~/src/llvm/ ~/src/llvm/tools/clang/


As you might guess by now clang is quite compatible with GCC, it behaves more or less like it, uses the same headers, and uses the same command line switches.

4) Yes, but can clang do this? nah nah nah nah nah nah nah ...
OMG... what is wrong with you? are you an orange...?


5) Is it ready for "enterprise"?
No. There are no reported compiles of a Linux kernel, it just recently became self hosting, and I still have problems compiling Qt with it. I even have problems with small applications.


// http://llvm.org/bugs/show_bug.cgi?id=6295
#include < new >
int main( int argc, char *argv[] )
{
return 0;
}


6) So? whats so good about it?
It's an alternative. Freedom is all about alternatives, they mean competition, which means improovement, which means better applications.

Sunday, January 31, 2010

Bootstrapping Qt using clang - part 3

As thiago asked, I run ./configure -no-mmx -no-3dnow -no-sse -no-sse2 && make, here are the warnings/errors found. Ifind it interesting that the inotify code used gcc extensions - as it seems on linux, this is the "only" usable C++ compiler. Second error should be trivial to fix, more on that on the next post.

Still FAIL.


/home/elcuco/src/llvm/build-cmake/bin/clang++ -c -pipe -g -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -O2 -Wall -W -D_REENTRANT -fPIC -DQT_SHARED -DQT_BUILD_CORE_LIB -DQT_NO_USING_NAMESPACE -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT3_SUPPORT -DQT_MOC_COMPAT -DELF_INTERPRETER=\"/lib/ld-linux.so.2\" -DHB_EXPORT=Q_CORE_EXPORT -DQT_NO_DEBUG -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../mkspecs/linux-g++ -I. -I../../include -I../../include/QtCore -I.rcc/release-shared -Iglobal -I../3rdparty/harfbuzz/src -I../3rdparty/md5 -I../3rdparty/md4 -I.moc/release-shared -o .obj/release-shared/qfilesystemwatcher_inotify.o io/qfilesystemwatcher_inotify.cpp In file included from io/qfilesystemwatcher_inotify.cpp:43:                                                                                    
In file included from io/qfilesystemwatcher_inotify_p.h:56:                                                                                    
In file included from io/qfilesystemwatcher_p.h:60:                                                                                            
In file included from ../../include/QtCore/private/qobject_p.h:1:                                                                              
In file included from ../../include/QtCore/private/../../../src/corelib/kernel/qobject_p.h:62:                                                 
In file included from ../../include/QtCore/qvariant.h:1:                                                                                       
In file included from ../../include/QtCore/../../src/corelib/kernel/qvariant.h:49:                                                             
In file included from ../../include/QtCore/qmap.h:1:                                                                                           
../../include/QtCore/../../src/corelib/tools/qmap.h:127:7: warning: field 'value' with variable sized type 'struct inotify_event' not at the   
      end of a struct or class is a GNU extension                                                                                              
    T value;                                                                                                                                   
      ^                                                                                                                                        
../../include/QtCore/../../src/corelib/tools/qmap.h:626:25: note: in instantiation of template class                                           
      'struct QMapNode' requested here                                                                              
            concreteNode->key.~Key();                                                                                                          
                        ^                                                                                                                      
../../include/QtCore/../../src/corelib/tools/qmap.h:167:59: note: in instantiation of member function                                          
      'QMap::freeData' requested here                                                                               
    inline ~QMap() { if (!d) return; if (!d->ref.deref()) freeData(d); }                                                                       
                                                          ^                                                                                    
io/qfilesystemwatcher_inotify.cpp:359:30: note: in instantiation of member function 'QMap::~QMap' requested here    
    QMap eventForId;                                                                                                       
                             ^                                                                                                                 
In file included from io/qfilesystemwatcher_inotify.cpp:43:                                                                                    
In file included from io/qfilesystemwatcher_inotify_p.h:56:                                                                                    
In file included from io/qfilesystemwatcher_p.h:60:                                                                                            
In file included from ../../include/QtCore/private/qobject_p.h:1:                                                                              
In file included from ../../include/QtCore/private/../../../src/corelib/kernel/qobject_p.h:62:                                                 
In file included from ../../include/QtCore/qvariant.h:1:                                                                                       
In file included from ../../include/QtCore/../../src/corelib/kernel/qvariant.h:49:                                                             
In file included from ../../include/QtCore/qmap.h:1:                                                                                           
../../include/QtCore/../../src/corelib/tools/qmap.h:136:7: warning: field 'value' with variable sized type 'struct inotify_event' not at the   
      end of a struct or class is a GNU extension                                                                                              
    T value;                                                                                                                                   
      ^                                                                                                                                        
../../include/QtCore/../../src/corelib/tools/qmap.h:151:42: note: in instantiation of template class 'struct QMapPayloadNode
      inotify_event>' requested here                                                                                                           
    static inline int payload() { return sizeof(PayloadNode) - sizeof(QMapData::Node *); }                                                     
                                         ^                                                                                                     
../../include/QtCore/../../src/corelib/tools/qmap.h:633:25: note: in instantiation of member function                                          
      'QMap::payload' requested here                                                                                
    x->continueFreeData(payload());                                                                                                            
                        ^                                                                                                                      
../../include/QtCore/../../src/corelib/tools/qmap.h:167:59: note: in instantiation of member function                                          
      'QMap::freeData' requested here                                                                               
    inline ~QMap() { if (!d) return; if (!d->ref.deref()) freeData(d); }                                                                       
                                                          ^                                                                                    
io/qfilesystemwatcher_inotify.cpp:359:30: note: in instantiation of member function 'QMap::~QMap' requested here    
    QMap eventForId;                                                                                                       
                             ^                                                                                                                 
9 diagnostics generated.                                                                                                                       
/home/elcuco/src/gitorious/qt/bin/moc -DQT_SHARED -DQT_BUILD_CORE_LIB -DQT_NO_USING_NAMESPACE -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT3_SUPPORT -DQT_MOC_COMPAT -DELF_INTERPRETER=\"/lib/ld-linux.so.2\" -DHB_EXPORT=Q_CORE_EXPORT -DQT_NO_DEBUG -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../mkspecs/linux-g++ -I. -I../../include -I../../include/QtCore -I.rcc/release-shared -Iglobal -I../3rdparty/harfbuzz/src -I../3rdparty/md5 -I../3rdparty/md4 -I.moc/release-shared io/qfilesystemwatcher_dnotify.cpp -o .moc/release-shared/qfilesystemwatcher_dnotify.moc




/home/elcuco/src/llvm/build-cmake/bin/clang++ -c -pipe -g -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -O2 -Wall -W -D_REENTRANT -I/usr/include/freetype2 -fPIC -DQT_SHARED -DQT_BUILD_GUI_LIB -DQT_NO_USING_NAMESPACE -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT3_SUPPORT -DQT_MOC_COMPAT -DQT_NO_OPENTYPE -DQT_NO_STYLE_MAC -DQT_NO_STYLE_WINDOWSVISTA -DQT_NO_STYLE_WINDOWSXP -DQT_NO_STYLE_WINDOWSCE -DQT_NO_STYLE_WINDOWSMOBILE -DQT_NO_STYLE_S60 -DQ_INTERNAL_QAPP_SRC -DQT_NO_DEBUG -DQT_CORE_LIB -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../mkspecs/linux-g++ -I. -I../../include/QtCore -I../../include -I../../include/QtGui -I.rcc/release-shared -I../3rdparty/xorg -I/usr/include/freetype2 -I../3rdparty/harfbuzz/src -Idialogs -I.moc/release-shared -I/usr/X11R6/include -I.uic/release-shared -o .obj/release-shared/qprintengine_ps.o painting/qprintengine_ps.cpp
painting/qprintengine_ps.cpp:686:37: error: allocation of incomplete type 'struct sigaction'
        users_sigpipe_handler = new struct sigaction;
                                    ^
painting/qprintengine_ps.cpp:686:44: note: forward declaration of 'struct sigaction'
        users_sigpipe_handler = new struct sigaction;
                                           ^
painting/qprintengine_ps.cpp:687:26: error: invalid use of incomplete type 'struct sigaction'
        struct sigaction tmp_sigpipe_handler;
                         ^
painting/qprintengine_ps.cpp:686:44: note: forward declaration of 'struct sigaction'
        users_sigpipe_handler = new struct sigaction;
                                           ^
painting/qprintengine_ps.cpp:687:26: warning: unused variable 'tmp_sigpipe_handler' [-Wunused-variable]
        struct sigaction tmp_sigpipe_handler;
                         ^
5 diagnostics generated.
make[1]: *** [.obj/release-shared/qprintengine_ps.o] Error 1
make[1]: Leaving directory `/home/elcuco/src/gitorious/qt/src/gui'
make: *** [sub-gui-make_default-ordered] Error 2
[elcuco@pinky ~/src/gitorious/qt]

Thursday, January 28, 2010

Bootstrapping Qt using clang - part 2

This week it actually compiled a working qmake, configure actually worked. The problem now is Qt


make[1]: Entering directory `/home/elcuco/src/gitorious/qt/src/gui'
/home/elcuco/src/llvm/build-cmake/bin/clang++ -c -Winline -m3dnow -mmmx -pipe -g -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -g -Wall -W -D_REENTRANT -I/usr/include/freetype2 -fPIC -DQT_SHARED -DQT_BUILD_GUI_LIB -DQT_NO_USING_NAMESPACE -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT3_SUPPORT -DQT_MOC_COMPAT -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_NO_OPENTYPE -DQT_NO_STYLE_MAC -DQT_NO_STYLE_WINDOWSVISTA -DQT_NO_STYLE_WINDOWSXP -DQT_NO_STYLE_WINDOWSCE -DQT_NO_STYLE_WINDOWSMOBILE -DQT_NO_STYLE_S60 -DQ_INTERNAL_QAPP_SRC -DQT_CORE_LIB -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../mkspecs/linux-g++ -I. -I../../include/QtCore -I../../include -I../../include/QtGui -I.rcc/debug-shared -I../3rdparty/xorg -I/usr/include/freetype2 -I../3rdparty/harfbuzz/src -Idialogs -I.moc/debug-shared -I/usr/X11R6/include -I.uic/debug-shared painting/qdrawhelper_mmx3dnow.cpp -o .obj/debug-shared/qdrawhelper_mmx3dnow.o
painting/qdrawhelper_mmx3dnow.cpp:47:10: fatal error: 'mm3dnow.h' file not found

Again, nothing done to the code. Great job by the clang guys!

Monday, January 25, 2010

Bootstrapping Qt using clang

Step 1  - checkout LLVM/Clang
mkdir -p ~/src
cd ~/src
svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm
cd llvm/tools
svn co http://llvm.org/svn/llvm-project/cfe/trunk clang
cd ../../
mkdir build-cmake
cd build-cmake ../
make -j 334

Step 2 - checkout Qt, and configure it usig (the non installed) clang
cd ~/src
git clone http://git.gitorious.org/qt/qt.git 
cd qt
CC=/home/elcuco/src/llvm/build-cmake/bin/clang
CXX=/home/elcuco/src/llvm/build-cmake/bin/clang++
export CC
export CXX
./configure 

Step 3
[elcuco@pinky ~/src/gitorious/qt] gdb ./bin/qmake
GNU gdb (GDB) Fedora (7.0.1-29.fc12)
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-redhat-linux-gnu".
For bug reporting instructions, please see:
...
Reading symbols from /home/elcuco/src/gitorious/qt/bin/qmake...(no debugging symbols found)...done.
(gdb) r
Starting program: /home/elcuco/src/gitorious/qt/bin/qmake


Program received signal SIGSEGV, Segmentation fault.
0x08258211 in toLatin1_helper(QChar const*, int) ()
Missing separate debuginfos, use: debuginfo-install glibc-2.11.1-1.i686 libgcc-4.4.2-20.fc12.i686 libstdc++-4.4.2-20.fc12.i686
(gdb) bt
#0  0x08258211 in toLatin1_helper(QChar const*, int) ()
#1  0x08258168 in QString::toLatin1() const ()
#2  0x082582cc in QString::toLocal8Bit() const ()
#3  0x0827d12e in locale_encode(QString const&) ()
#4  0x0827e746 in QFile::encodeName(QString const&) ()
#5  0x0828170b in QFSFileEnginePrivate::nativeInitFileName() ()
#6  0x08288752 in QFSFileEngine::QFSFileEngine(QString const&) ()
#7  0x082c5d5e in QAbstractFileEngine::create(QString const&) ()
#8  0x082b5d4a in QFileInfoPrivate::initFileEngine(QString const&) ()
#9  0x082b68e9 in QFileInfo::QFileInfo(QString const&) ()
#10 0x08126851 in Option::init(int, char**) ()
#11 0x0807f994 in runQMake(int, char**) ()
#12 0x08080bab in main ()
(gdb)

FAIL. At least it compiled without any modification! yay configure!

Friday, December 25, 2009

Removing GPL code

This is an interesting question I have after reading about MonoDevelop removing GPL code:

I have this application which I license under the terms of BSD, and I saw a GPL library (lets call it libbar ) which might help me. I incorporate the library by dinamic linking. Now my application is effectly a GPL binary, sweet.

Now, I write myself a new replacement library and release it under the terms of BSD. I replace the old "legacy" library by my new one.

Scenario 1:
Lets assume, my application uses (derives classes, whatever) code from libbar. If I remove the GPL code and change it by BSD code - my work even tough it does not contain GPL code - it's a derived work, due to compile time constrains. Am I correct?

Scenario 2:
Lets assume that libbar, uses abstract classes/methods from libfoo (which is BSD). Lets assume that my application uses the interfaces exposed in libfoo, then libbar  extends those interfaces, and I am not directly using libbar. When I use my new BSD library, my application is not compiled against any GPL code (just linked to) and it never used it directly. My old code was GPL by run-time constrains and, and the new one is BSD. Am I correct?

The problem wuth scenario 2, is that even if I am wrong, and my BSD code is "forced" to be GPL, this would not held in court. I still remember the wifi drivers issue the freebsd guys had (openbsd? a link in the comments would be a good idea...)

Friday, October 23, 2009

KDE on Windows - making life easier

I just installed on my mom's Desktop KDE games. Now she is happier, and she does not need to touch my computer.

On the laptop I got from work (Windows XP, because of non-supported hardware) I just installed KDE4 as well. Using Konversation on Windows just kicks ass. Kate is by far the best general purpose text editor I used. I am not happy that Okular on 4.3.2 does not open PDF (4.3.0 and 4.2 did open.... funky...), but as soon as it starts working again, it will become my default PDF viewer.

While I think Dolphin is GREAT and I started using back in KDE3, I cannot use it on windows, since sftp:// or fish:// protocols not working there... it's just so sad ... :(

I just wanted to thank the KDE on windows team: great job. Just fix the default colors on XP, the applations look kinda dark. That's all!

Monday, October 5, 2009

Dear lazy web: cannot clone from gitorious

I am trying to clone Qt (and qt-creator) in my hone, and I am getting this (please don't laugh, I know it's Windows...)
diego@BRAIN /c/src
$ rm -fr qt && time git clone git://gitorious.org/qt/qt.git
Initialized empty Git repository in c:/src/qt/.git/
remote: Counting objects: 218976, done.
remote: Compressing objects: 100% (56957/56957), done.
fatal: The remote end hung up unexpectedly.68 MiB | 5 KiB/s
fatal: early EOF

real 41m40.578s
user 0m0.015s
sys 0m0.000s
Now, it only happens at home where my ISP is making nice tricks and probably killing everything that is not "http" (note how slow it works, 1kbs to 5kbs). Just to compare, in my workplace with a business contract I can pull at normally (at 100-180kbs).

Any tricks? I was thinking of using a ppptp connection to work, and then pull from that (or even ssh), but I am sure that there are workarounds for this issue. Yes, I tried http, this is what I get:
diego@BRAIN /c/src
$ rm -fr qt && time git clone http://gitorious.org/qt/qt.git
Initialized empty Git repository in c:/src/qt/.git/
fatal: http://gitorious.org/qt/qt.git/info/refs not found: did you run git updat
e-server-info on the server?

real 0m1.953s
user 0m0.015s
sys 0m0.000s

Any good ideas/workarounds/solutions...?

Tuesday, September 15, 2009

Linus is always right

Linus is always right: SVN users are stupids, GIT is superior. I am now starting to move my personal projects from SVN to GIT. When doing local development, GIT is by FAR much better then SVN: easier to setup ("git init" and you are done, and SVN?), it's the fast and it's branches are super cool. So, lets use it.

In order to learn how to use GIT, the best way is to use it. So I decided to start helping again in Arora (which is hosted in github). The result is that the next version will have a nice RTL user interface (I must admit, the bridge between JS and C++ in Qt is really cool), and you can also have i18n without installing the application. A nice side effect is that you can have local translations (different then the ones in /usr/local/arora/* in ~/.arora/i18n). This may help translators, to finish the translations of the applicaiton, even if they installed from source. If not in practice, at least in theory as the code is more or less there.

Back when I was studying, I had this class which was called "data mining", in which we learned a few clusterization algorithms (KMeans, PAM and a few others). We were given an exercise: to code a program that implements Clara. I decided to code this in Qt4, using QWT. As an exercise, I decided to clean it up, and save it in a git repository. I just finished uploading the project to github, and I am also planing a few other changes (move the code from the Qt containers to STL). The code is GPL3, so feel free to use and abuse. The dataset code is self containing and soon will have no dependency on Qt, so it may be-reused in other projects.

Since this is the KDE planet, here is the mandatory screen shot:

Sunday, July 12, 2009

Stackoverflow and Konqueror

As a huge fan of stackoverflow.com and one that is trying to reduce his usage of Firefox (Konqueror is faster, consumes less memory and looks more native) I had problem browsing to this given site.

When you try and associate the Google account with your stackoverflow account, I was redirected to the front page and I was not recognized. Today, I tried identifying Konqueror as Firefox2 (from Tools/Change Browser Identification) and I was able to login. When I was logged in I removed the false identification and the site is working perfectly. SWEET.

GMail almost works when you identify as Firefox2. The new user interface does not work (you cannot change... directories? folders?) and the chat does not work even with FF2 enabled.
This might work if I identify as a newer Safari... who knows...

This means Google are spoofing for specific browsers and hacking around problems (which do not exactly exist). Anyway, the user agents strings might need a little update... it's like they are stacked in the remote past... when we actually needed to spoof the browser identification ....wait.... what?

Friday, April 24, 2009

A reason to keep KHTML

I have read that people are not happy about KHTML. As one who spoke once against KHTML, and pro QtWebKit (or QWebKit?). This is why I want to keep KHTML:

Native widgets. Not emulated like WebKit/Gecko, but real Qt widgets. This means that I can have a text widget which fully supports BiDi (not gecko, not webkit, only IE has one... and KHTML).

Also, widgets get drawed funky if the direction of the page is opposite to the direction of your desktop on WebKit (you can see it in chrome, Arora and Safari). For example see the combo boxes in http://www.aljazeera.net/Portal.

Still, I think that KHTML is not something we can handle today. Sorry, even tough KHTML is great, WebKit is what the market needs, it's what we as a community need.

Thursday, February 26, 2009

QDevelop 0.27 is out

Get it while it's hot! QDevelop 0.27 has been released!

Sources and builds for Linux/Windows are avialable at the GoogleCode project, as always: http://code.google.com/p/qdevelop/downloads/list


Tuesday, February 10, 2009

Removed Hebrew translations of Plasma 4.2.1

I just removed the Hebrew translation of plasma from the 4.2 branch, which means only plasma will not be translated to Hebrew. The reason, is that QGraphicsScene does not support RTL interfaces in Qt 4.4, and it's still not sure if KDE 4.2 does support Qt 4.5. Even if it does, it's still not tested.

If KDE 4.2 will work with Qt 4.5, the translation will get pulled from trunk again.

I hope that no more files need to be remove, otherwise I am afraid of going bellow 85% and in theory Hebrew will not be a supported language.

Saturday, November 22, 2008

Freeze in KDE4.2 - now lets check out the strings

KDE's trunk is now frozen and no new features can be added, nor visual strings can be modified or added, we are in release mode. Lets see some of those strings:

Inactive contrast effect type, taken from colorsettings.ui:830 in kdebase, the string is found somewhere in kcmcolors.pot. I understand this as the non-active contrast of a type of an effect or the type of the effect for the contrast of non-active (something).  This is how it will sound when translating to my language, it might sound ok in English but it does not always sound good enough in other languages. Looking at the spanish translation it seems the second translation is what the original developer meant.... you see? I need to look into another translation to understand the original string. How can a user understand it?

You have a Logitech Mouse connected, and libusb was found at compile time, but it was not possible to access this mouse. This is probably caused by a permissions problem - you should consult the manual on how to fix this. This one comes from kcminput.pot, and my question is: which manual? ... are you sure it will have information about something like "chmod a+rw /dev/usb-mouse-blabla"?


And then are the giziliion-gazillion technology names we use: plasma, akonadi, strigi, phonon, dbus and more. What am I speaking about this? since some languages leave those names in english even though the langauge is not latin based (for example the Hebrew team is doing this) and others do try to translate the latin letters to the alphabet (the Arabic team does this for example). This is fine, until we start talking about "plasmoids"... and then things get funky. I might need to re-think my policy and translating plasmoid to פלסמואיד and also plasma to פלסמה or פלסמא (the latter sounds more Aramic then Hebrew so I might keep the first one). 


Again, why mumbeling about local decitinos? Because when choosing technology names developers do not think about i18n and l10n (1), what happens when the technology name cannot be transcribed into a specific language? I once heard that CocaCola cannot be transcribed exactly to Chinese and when localizing the trade mark CocaCola used the closes sounds they could find to write the name of the product (2).

Don't get me wrong, KDE 4.2 will kick ass, and the next Mandriva distribution will come with it will get in my laptop (3). But still, as a contributor I am not happy about some decitions, and that's OK.  Since I am using Gnome at work (4) and I see the applications on the other side, and I like the ones KDE is shipping/developing.

(1)  lazy... write the full words!
(2)  any chinese reading this? can you confirm this?
kate and Konsole. Just because the kubuntu-desktop is not stable enough.
(3)  yes, I am still using KDE 3.5.something. Stable and usable, I need to do work and not fight my own system.
(4)  Ubuntu 8.10 (64 bit) with kubuntu-desktop installed, running a GNome session with Dolphin. Dolphin kicked mc's ass.

Friday, October 3, 2008

QTextEdit and QTextCursor fun

My problem is simple: when I open lokalize, it's using the RTL interface and I see the original English text in RTL mode. This just looks bad, as it always needs to be LTR. Should be simple, not?

So I started writing some small tests (yes David, I do small scale tests!). In this test I am doing the exact opposite: I am forcing an RTL paragraph on an LTR interface.

First test:
QTextEdit *e1 = new QTextEdit;
QTextOption o;

o = e1->document()->defaultTextOption();
o.setAlignment(Qt::AlignLeft);
o.setTextDirection(Qt::RightToLeft);
e1->document()->setDefaultTextOption(o);
e1->setText( QLatin1String("1) Currect direction on QTextEdit, wanted RTL!") );

This seems to work fine. However, lokalize creates a QTextCursor and inserts text to that cursor. Ok, second test:
QTextEdit *e2 = new QTextEdit;
QTextCursor tc = e2->textCursor();
QTextCharFormat tcf = tc.blockCharFormat();

tcf.setLayoutDirection( Qt::RightToLeft );
tc.insertText( QLatin1String("2) Wrong direction on QTextEdit, wanted RTL!"), tcf );
e2->setTextCursor(tc);

This does not work. The text is still LTR, even tough I modified the text char format of this text cursor. I sent a bug to Nokia with this mini-application, and it's marked there as N229677.

I talked with a fellow hacker here, and he sent me this piece of code (which does work), third test:
QTextEdit *e3 = new QTextEdit;
QTextCursor tc = e3->textCursor();
QTextBlockFormat tbf = tc.blockFormat();

tbf.setLayoutDirection( Qt::RightToLeft );
tc.setBlockFormat(tbf);
tc.insertText( QLatin1String("3) Correct direction on QTextEdit, wanted RTL!") );
e3->setTextCursor(tc);
Now, I don't really understand why the second test does not work. IMHO, the higher level API used in the second test should work, but I assume that using this low level (which is used in the third test) is fine as well... I will commit this to lokalize as soon as I test on a live lokalize, but it's just crashing on startup since 3 days ago (yes, I am using runk). Is this a known issue?

Friday, September 12, 2008

lokalize goodies!

I just upgraded my SVN, and I saw that lokalize got lot's of new bling-blings in trunk (KDE 4.2)! Now by default it loads the project in the main window, and when you need to edit a PO file it gets opened in a tab. SWEET, way to go to the usability guys! Way to go Nick!

BTW:
I decided to move my English writing to this blog, and keep the old one for Hebrew posts.