#
# Patch managed by http://www.holgerschurig.de/patcher.html
#

--- qt-2.3.10/src/kernel/qgfxlinuxfb_qws.cpp~ramses.patch
+++ qt-2.3.10/src/kernel/qgfxlinuxfb_qws.cpp
@@ -249,20 +249,12 @@
 
 static void writeTerm(const char* termctl, int sizeof_termctl)
 {
-#ifdef QT_QWS_DEVFS
-    const char* tt[]={"/dev/vc/1","/dev/console","/dev/tty",0};
-#else
-    const char* tt[]={"/dev/console","/dev/tty","/dev/tty0",0};
-#endif
-    const char** dev=tt;
-    while (*dev) {
-	int tty=::open(*dev,O_WRONLY);
+qWarning("writeTerm");
+        int tty=::open("/dev/vc/2", O_WRONLY);
 	if ( tty>=0 ) {
 	    ::write(tty,termctl,sizeof_termctl);
 	    ::close(tty);
 	}
-	dev++;
-    }
 }
 
 /*!
@@ -275,6 +267,7 @@
 
 bool QLinuxFbScreen::initDevice()
 {
+qWarning("QLinuxFbScreen::initDevice");
     /* Setting up the VT parameters is done in qapplication_qws.cpp
     const char termctl[]="\033[9;0]\033[?33l\033[?25l";
     writeTerm(termctl,sizeof(termctl)); */
@@ -765,9 +758,12 @@
     }
 */
 
+qWarning("QLinuxFbScreen::shutdownDevice");
+/*
     // Blankin' screen, blinkin' cursor!
     const char termctl[] = "\033[9;15]\033[?33h\033[?25h\033[?0c";
     writeTerm(termctl,sizeof(termctl));
+*/
 }
 
 /*!
--- qt-2.3.10/src/kernel/qapplication_qws.cpp~ramses.patch
+++ qt-2.3.10/src/kernel/qapplication_qws.cpp
@@ -1756,8 +1756,6 @@
      */
     if ( qws_daemon )
     {
-        qWarning( "qt_init() - starting in daemon mode..." );
-
         int pid1 = fork();
         if ( pid1 == -1 )
         {
@@ -1791,7 +1789,6 @@
         }
         if ( pid2 )
         {
-             syslog( 4, "qt_init() [%d] - successfully entered daemon mode", pid2 );
             _exit( 0 ); // ok, second fork performed
         }
     }
@@ -1828,9 +1825,12 @@
     #if defined(_OS_LINUX_)
     if ( qws_terminal_id )
     {
-        qDebug( "qt_init() - terminal specification is '%d'.", qws_terminal_id );
         struct vt_stat console_stat;
+#ifdef QT_QWS_DEVFS
+        int console_fd = ::open( QString().sprintf( "/dev/vc/%d", qws_terminal_id ).latin1(), O_RDWR );
+#else
         int console_fd = ::open( QString().sprintf( "/dev/tty%d", qws_terminal_id ).latin1(), O_RDWR );
+#endif
         if ( console_fd == -1)
         {
             qWarning( "qt_init() - can't open tty: %s", strerror( errno ) );
@@ -1927,7 +1927,11 @@
         {
             qDebug( "qt_cleanup() - switching back to virtual terminal #%d", qws_terminal_old );
 
+#ifdef QT_QWS_DEVFS
+            int console_fd = ::open( "/dev/vc/0", O_RDWR );
+#else
             int console_fd = ::open( "/dev/tty0", O_RDWR );
+#endif
             if ( console_fd == -1)
             {
                 qWarning( "qt_init() - can't open tty: %s", strerror( errno ) );
--- qt-2.3.10/src/kernel/qwindowsystem_qws.cpp~ramses.patch
+++ qt-2.3.10/src/kernel/qwindowsystem_qws.cpp
@@ -1791,6 +1791,7 @@
 }
 
 #ifndef QT_NO_QWS_KEYBOARD
+#ifndef QT_QWS_RAMSES
 static int keyUnicode(int keycode)
 {
     const QWSServer::KeyMap *km = QWSServer::keyMap();
@@ -1803,6 +1804,7 @@
     return 0xffff;
 }
 #endif
+#endif
 /*!
   Send a key event. You can use this to send key events generated by
   "virtual keyboards".
@@ -1845,8 +1847,10 @@
 
     event.simpleData.unicode = 
 #ifndef QT_NO_QWS_KEYBOARD
+#ifndef QT_QWS_RAMSES
 	unicode < 0 ? keyUnicode(keycode) : 
 #endif
+#endif
 	unicode;
     event.simpleData.keycode = keycode;
     event.simpleData.modifiers = modifiers;