Bug 83972 - KOffice 1.3.1 does not compile on KDE 3.1/Qt 3.1
Summary: KOffice 1.3.1 does not compile on KDE 3.1/Qt 3.1
Status: RESOLVED FIXED
Alias: None
Product: koffice
Classification: Applications
Component: general (show other bugs)
Version: 1.3.1
Platform: RedHat Enterprise Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Nicolas Goutte
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-06-25 08:57 UTC by Ulrich Heinen
Modified: 2004-10-06 01:16 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
qt-3.1 fixes (708 bytes, patch)
2004-10-01 21:59 UTC, Jens Koerber
Details
KDE-3.1 fixes (1.72 KB, patch)
2004-10-01 22:00 UTC, Jens Koerber
Details
make.err (2.83 KB, text/plain)
2004-10-03 18:26 UTC, Nicolas Goutte
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ulrich Heinen 2004-06-25 08:57:33 UTC
Version:           1.3.1 (using KDE KDE 3.2.1KDE 1.2)
Installed from:    I Don't KnowRedHat RPMs
Compiler:          gcc 3.2.3 
OS:                Linux

configure.in lists KDE/Qt 3.1 as minimum requirement for Koffice 1.3.1, but compilation fails in lib/kofficecore/koDocument.cc, lines 432, 1146 , 1349, because QString::arg(const QString &, const QString &) is not available in Qt < 3.2. Either the version requirement should be stepped up, or the respective lines should be modified to call arg(const QString &) separately for each argument.
Will provide a patch, if this is the only issue occuring during compilation (currently underway.)
Comment 1 Laurent Montel 2004-06-25 09:47:39 UTC
Fixed into koffice 1.3 branch.
I continue to compile koffice 1.3 with qt 3.1.
Regards.
Comment 2 Jens Koerber 2004-10-01 21:59:22 UTC
Created attachment 7750 [details]
qt-3.1 fixes
Comment 3 Jens Koerber 2004-10-01 22:00:09 UTC
Created attachment 7751 [details]
KDE-3.1 fixes
Comment 4 Jens Koerber 2004-10-01 22:02:20 UTC
the above issues are introduced in koffice-3.1.2 ...
Comment 5 Nicolas Goutte 2004-10-01 22:21:37 UTC
CVS commit by goutte: 

Compile again with Qt 3.1. (I am sorry to have broken it.)
CCMAIL:83972@bugs.kde.org


  M +5 -0      koUnitWidgets.cc   1.5.2.4


--- koffice/lib/kofficeui/koUnitWidgets.cc  #1.5.2.3:1.5.2.4
@@ -131,5 +131,10 @@ KoUnitDoubleValidator::validate( QString
 QString KoUnitDoubleBase::getVisibleText( double value ) const
 {
+#if QT_VERSION > 0x030102
     const QString num ( QString( "%1%2").arg( KGlobal::locale()->formatNumber( value, m_precision ), KoUnit::unitName( m_unit ) ) );
+#else
+    const QString num ( QString( "%1%2").arg( KGlobal::locale()->formatNumber( value, m_precision ) ).arg( KoUnit::unitName( m_unit ) ) );
+#endif
+
     kdDebug(30004) << "getVisibleText: " << QString::number( value, 'f', 12 ) << " => " << num << endl;
     return num;


Comment 6 Nicolas Goutte 2004-10-01 22:24:13 UTC
KDE 3.1 still missing...
Comment 7 Nicolas Goutte 2004-10-01 22:38:43 UTC
CVS commit by goutte: 

Make it compile on KDE 3.1
CCMAIL:83972@bugs.kde.org


  M +5 -5      webpresentation.cc   1.103.2.8


--- koffice/kpresenter/webpresentation.cc  #1.103.2.7:1.103.2.8
@@ -256,5 +256,5 @@ void KPWebPresentation::initCreation( KP
     int p;
     KURL str(  path + "/html"  );
-    KIO::NetAccess::mkdir( str,( QWidget* )0L  );
+    KIO::NetAccess::mkdir( str  );
 
     p = progressBar->progress();
@@ -263,5 +263,5 @@ void KPWebPresentation::initCreation( KP
 
     str = path + "/pics";
-    KIO::NetAccess::mkdir( str,( QWidget* )0L );
+    KIO::NetAccess::mkdir( str );
 
 
@@ -911,5 +911,5 @@ void KPWebPresentationWizard::pageChange
 
         // path doesn't exist. ask user if it should be created.
-        if ( !KIO::NetAccess::exists( pathname, true/*write*/,this ) )
+        if ( !KIO::NetAccess::exists( pathname, true/*write*/ ) )
         {
             QString msg = i18n( "<qt>The directory <b>%1</b> does not exist.<br>"
@@ -919,5 +919,5 @@ void KPWebPresentationWizard::pageChange
                 == KMessageBox::Yes)
             {
-                bool ok = KIO::NetAccess::mkdir( pathname, this );
+                bool ok = KIO::NetAccess::mkdir( pathname );
                 if( !ok )
                 {


Comment 8 Nicolas Goutte 2004-10-01 22:41:43 UTC
Now it should work on Qt 3.1 and KDE 3.1.

Can you test that it is really so.

(I am also thinking about a release if KOffice does not work on Qt 3.1/KDE 3.1 for any version after KOffice 1.3.)

Have a nice day!
Comment 9 Nicolas Goutte 2004-10-03 18:25:50 UTC
There are still problems...
Comment 10 Nicolas Goutte 2004-10-03 18:26:59 UTC
The current KOffice in KOFFICE_1_3_BRANCH cannot compile on KDE 3.1 and Qt 3.1 
in the directory koffice/lib/kotext.

I suppose that it is due to the Indic support, which was only introduced in Qt 
3.2.

Have a nice day!


Created an attachment (id=7775)
make.err
Comment 11 Nicolas Goutte 2004-10-03 18:28:29 UTC
Let's assign this bug to myself. (No need to cross-post to the koffice mailing list.)
Comment 12 David Faure 2004-10-04 00:07:44 UTC
You are right, the indic support broke any chance of KOffice-1.3-branch being compilable with Qt 3.1.

Can I suggest to drop Qt-3.1 compatibility? The part of KOffice 1.3.1 which changed most code, *is* the indic support. Trying to support both Qt-3.1 and Qt-3.2 would be basically merging the KOffice-1.3 and KOffice-1.3.1 code, which would be IMHO wasted time. Qt is at 3.3.x now, 3.1 is really getting old.

Sorry that I didn't realize this when I added the Indic support, but there's no going back now.
Comment 13 Nicolas Goutte 2004-10-04 00:47:56 UTC
On Monday 04 October 2004 00:07, David Faure wrote:
(...)
> You are right, the indic support broke any chance of KOffice-1.3-branch
> being compilable with Qt 3.1.
>
> Can I suggest to drop Qt-3.1 compatibility? The part of KOffice 1.3.1 which
> changed most code, *is* the indic support. Trying to support both Qt-3.1
> and Qt-3.2 would be basically merging the KOffice-1.3 and KOffice-1.3.1
> code, which would be IMHO wasted time. Qt is at 3.3.x now, 3.1 is really
> getting old.

Well, Indic came only for KOffice 1.3.3. And 1.3.1 and 1.3.2 are not 
compilable with Qt 3.1, unlike advertised.

>
> Sorry that I didn't realize this when I added the Indic support, but
> there's no going back now.

It still can be trown out. It is one new feature against many bug fixes.

Have a nice day!

Comment 14 Nicolas Goutte 2004-10-04 02:17:59 UTC
CVS commit by goutte: 

Last step to be able to compile KoText on Qt 3.1
CCMAIL:83972@bugs.kde.org


  M +29 -0     kotextobject.cc   1.137.2.3


--- koffice/lib/kotext/kotextobject.cc  #1.137.2.2:1.137.2.3
@@ -18,4 +18,9 @@
 */
 
+#include <qglobal.h>
+#if QT_VERSION >= 0x030200
+#define INDIC
+#endif
+
 #include <qtimer.h>
 #include <qregexp.h>
@@ -454,5 +459,10 @@ void KoTextObject::doKeyboardAction( KoT
                 emit newCommand(cmd);
         }
+#ifndef INDIC
+        else if ( !cursor->atParagStart() || parag->prev() )
+        // Nothing to do if at the beginning of the very first parag
+#else
         else if ( !cursor->atParagStart() )
+#endif
         {
             checkUndoRedoInfo( cursor, UndoRedoInfo::Delete );
@@ -464,4 +474,20 @@ void KoTextObject::doKeyboardAction( KoT
                 undoRedoInfo.oldParagLayouts << parag->paragLayout();
             }
+#ifndef INDIC
+            cursor->gotoPreviousLetter();
+            KoTextStringChar * ch = cursor->parag()->at( cursor->index() );
+            undoRedoInfo.text.prepend( QString( ch->c ) );
+            copyCharFormatting( cursor->parag(), cursor->index(), 0, true );
+            undoRedoInfo.index = cursor->index();
+            KoParagLayout paragLayout = cursor->parag()->paragLayout();
+            if ( cursor->remove() ) {
+                undoRedoInfo.text.remove( 0, 1 );
+                undoRedoInfo.text.prepend( "\n" );
+                undoRedoInfo.index = cursor->index();
+                undoRedoInfo.id = cursor->parag()->paragId();
+                undoRedoInfo.oldParagLayouts.prepend( paragLayout );
+            } else
+                emit paragraphModified( cursor->parag(), RemoveChar, cursor->index(),1 );
+#else
             undoRedoInfo.text.insert( 0, cursor->parag()->at( cursor->index()-1 ) );
             copyCharFormatting( cursor->parag(), cursor->index()-1, 0, true );
@@ -470,5 +496,7 @@ void KoTextObject::doKeyboardAction( KoT
             cursor->removePreviousChar();
             emit paragraphModified( cursor->parag(), RemoveChar, cursor->index(),1 );
+#endif
             m_lastFormatted = cursor->parag();
+#ifdef INDIC
         } else if ( parag->prev() ) { // joining paragraphs
             emit paragraphDeleted( cursor->parag() );
@@ -479,4 +507,5 @@ void KoTextObject::doKeyboardAction( KoT
             removeSelectedText( cursor, KoTextDocument::Temp, i18n( "Delete Text" ) );
             emit paragraphModified( cursor->parag(), AddChar, cursor->index(), cursor->parag()->length() - cursor->index() );
+#endif
         }
     } break;


Comment 15 David Faure 2004-10-04 11:53:55 UTC
On Monday 04 October 2004 00:47, Nicolas Goutte wrote:
> Well, Indic came only for KOffice 1.3.3. And 1.3.1 and 1.3.2 are not 
> compilable with Qt 3.1, unlike advertised.

So? Too late for 1.3.1 and 1.3.2 anyway, so we could simply update our webpages
and say that 1.3.2 (or 1.3.3) require Qt 3.2. But I've seen you ifdef'ed the whole code
(good idea, patch --ifdef). I just hope it doesn't break anything.

> >
> > Sorry that I didn't realize this when I added the Indic support, but
> > there's no going back now.
> 
> It still can be trown out. It is one new feature against many bug fixes.

I disagree. You don't have to choose "one feature" against "many bug fixes".
You can get the feature *and* the many bugfixes, simply by requiring Qt 3.2.

Support for a new language makes the application work for a whole new set
of users for whom it wasn't useable at all previously - that's not just "one new feature",
it's making the application useable for those people.

Comment 16 Nicolas Goutte 2004-10-06 01:16:03 UTC
For me, it compiles now: KDE last KDE_3_1_BRANCH, Qt 3.1.2 (directly from Trolltech)

Have a nice day!