--------------Boundary-00=_1FNBIJZ7HZGYBVPK53K6 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: quoted-printable The attached patch is for the file koffice/lib/kofficecore/koMainWindow.c= c It gives back, to KOffice CVS HEAD compiled on KDE 3.1.x, the possibility= to=20 save to KOffice 1.1 format and to a directory, however now coded as=20 application/x-tgz and text/xml. (Ugly GUI but not any risk anymore to los= e=20 the document by choosing the "empty file" entries.) Of course this patch does not fix bug #66142, it is still part of a=20 work-around. Please check if there is anything that I would have missed. (Loading seem= s to=20 work when choosing the KOffice format.) I think that this patch will give the possibility to release a KOffice 1.= 3=20 Beta 5 next week. (I am not sure if Luk=E0=A8 would want to call it RC 1.= However=20 it would be his choice.) Have a nice day! --------------Boundary-00=_1FNBIJZ7HZGYBVPK53K6 Content-Type: text/x-diff; charset="iso-8859-15"; name="patch2.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="patch2.diff" Index: koMainWindow.cc =================================================================== RCS file: /home/kde/koffice/lib/kofficecore/koMainWindow.cc,v retrieving revision 1.315 diff -u -r1.315 koMainWindow.cc --- koMainWindow.cc 24 Oct 2003 14:42:48 -0000 1.315 +++ koMainWindow.cc 25 Oct 2003 16:26:19 -0000 @@ -84,6 +84,7 @@ bool modal) : KFileDialog( startDir, filter, parent, name, modal ) { } +#if KDE_IS_VERSION(3,1,92) void setSpecialMimeFilter( QStringList& mimeFilter, const QString& currentFormat, const int specialOutputFlag, const QString& nativeFormat ) @@ -91,7 +92,6 @@ Q_ASSERT( !mimeFilter.isEmpty() ); Q_ASSERT( mimeFilter[0] == nativeFormat ); -#if KDE_IS_VERSION(3,1,92) // Insert two entries with native mimetypes, for the special entries. QStringList::Iterator mimeFilterIt = mimeFilter.at( 1 ); mimeFilter.insert( mimeFilterIt /* before 1 -> after 0 */, 2, nativeFormat ); @@ -120,21 +120,45 @@ if (!compatString.isEmpty ()) filterWidget->changeItem (i18n ("%1 (%2 Compatible)").arg (mime->comment ()).arg (compatString), i); } + } + #else + + QString m_nativeFormat; + + void setSpecialMimeFilter( QStringList& mimeFilter, + const QString& currentFormat, const int specialOutputFlag, + const QString& nativeFormat ) + { + Q_ASSERT( !mimeFilter.isEmpty() ); + Q_ASSERT( mimeFilter[0] == nativeFormat ); + // ### FIXME: KDE 3.1.x crashes on filterWidget->changeItem // ### FIXME: So we must provide a hack to have back a minimum of functionality. // ### FIXME: (Saving to KOffice 1.1 format and to directory are not supported.) // Insert two entries with native mimetypes, for the special entries. QStringList::Iterator mimeFilterIt = mimeFilter.at( 1 ); - mimeFilter.insert( mimeFilterIt /* before 1 -> after 0 */, 2, "application/x-zerosize" ); + mimeFilter.insert( mimeFilterIt, "application/x-tgz" ); + mimeFilter.insert( mimeFilterIt, "text/xml" ); // Fill in filter combo // Note: if currentFormat doesn't exist in mimeFilter, filterWidget // will default to the first item (native format) setMimeFilter( mimeFilter, currentFormat.isEmpty() ? nativeFormat : currentFormat ); -#endif + m_nativeFormat=nativeFormat; + } + + QString currentMimeFilter() const // Note: this is not virtual!!! + { + const QString result ( KFileDialog::currentMimeFilter() ); + if ( (result == "application/x-tgz") || (result == "text/xml")) + return m_nativeFormat; + else + return result; } +#endif + int specialEntrySelected() { int i = filterWidget->currentItem(); @@ -143,6 +167,7 @@ return i; return 0; } + }; class KoMainWindowPrivate --------------Boundary-00=_1FNBIJZ7HZGYBVPK53K6 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ koffice-devel mailing list koffice-devel@mail.kde.org http://mail.kde.org/mailman/listinfo/koffice-devel --------------Boundary-00=_1FNBIJZ7HZGYBVPK53K6--