binary compatibility issues in kdelibs

Simon Hausmann hausmann at kde.org
Tue Jul 9 17:39:03 BST 2002


Hi,

The recent mail on kde-devel reminded me of something I did with the
2_2 branch back then and wanted to do for 3.1. I took a more or less
close look at 'cvs diff -rKDE_3_0_BRANCH -rHEAD **/*.h' in kdelibs,
trying to find obvious breakages of binary compatibility that
slipped through.

Here's what I found.

Index: arts/kde/kplayobjectfactory.h
===================================================================
RCS file: /home/kde/kdelibs/arts/kde/kplayobjectfactory.h,v
retrieving revision 1.9
retrieving revision 1.11
diff -u -p -b -r1.9 -r1.11
--- arts/kde/kplayobjectfactory.h	2001/10/29 20:57:36	1.9
+++ arts/kde/kplayobjectfactory.h	2002/03/31 20:27:47	1.11
@@ -40,10 +42,20 @@ public:
 
 	bool isAStream() { return m_stream; }
 	
+	/**
+	 * Return the mimetypes that are playable
+	 */
+	static QStringList mimeTypes(void);
+
+private slots:
+	void slotMimeType(const QString &mimetype);
+
 private:
 	Arts::SoundServerV2 m_server;
 	bool m_allowStreaming;
 	bool m_stream;
+	bool m_eventLoopEntered;
+	QString m_mimeType;
 };
 
KPlayObjectFactory is a public class, with the header file being
installed. The addition of the member variables is binary
incompatible.

Index: kabc/addressbook.h
===================================================================
RCS file: /home/kde/kdelibs/kabc/addressbook.h,v
retrieving revision 1.9
retrieving revision 1.22
diff -u -p -b -r1.9 -r1.22
--- kabc/addressbook.h	2002/03/04 09:43:11	1.9
+++ kabc/addressbook.h	2002/07/08 11:22:12	1.22
[ ... snip ... ] 
-  private:
-    QPtrList<Resource> mResources;
+  protected:
+    void deleteRemovedAddressees();
 
+  private:
     struct AddressBookData;
     AddressBookData *d;
 };

The removal of the mResources member is binary incompatible.
Addressbook is a public (abstract base) class.
 
Index: kabc/distributionlisteditor.h
===================================================================
RCS file: /home/kde/kdelibs/kabc/distributionlisteditor.h,v
retrieving revision 1.3
retrieving revision 1.9
diff -u -p -b -r1.3 -r1.9
--- kabc/distributionlisteditor.h	2001/11/22 10:13:57	1.3
+++ kabc/distributionlisteditor.h	2002/07/08 11:22:12	1.9
@@ -32,7 +32,49 @@ namespace KABC {
 
 class AddressBook;
 class DistributionListManager;
+class DistributionListEditorWidget;
 
+/**
+ * @short Frontend to create distribution lists
+ *
+ * Creating a new DistributionListEditor does automatically
+ * load all addressees and distribution lists from the config
+ * files. The changes will be saved when clicking the 'OK'
+ * button.
+ *
+ * Example:
+ *
+ * <pre>
+ * KABC::DistributionListEditor *editor = new
+ *         KABC::DistributionListEditor( KABC::StdAddressBook::self(), this );
+ *
+ * editor->exec();
+ * </pre>
+ */
+class DistributionListEditor : public KDialogBase
+{
+    Q_OBJECT
+public:
+    /**
+     * Constructor.
+     *
+     * @param ab     The addressbook, the addressees should be used from
+     * @param parent The parent widget
+     */
+    DistributionListEditor( AddressBook *ab, QWidget *parent );
+
+    /**
+     * Destructor.
+     */
+    virtual ~DistributionListEditor();
+
+private:
+    DistributionListEditorWidget *mEditor;
+};
+
+/**
+ * @short Helper class
+ */
 class EmailSelectDialog : public KDialogBase
 {
   public:
@@ -48,16 +90,19 @@ class EmailSelectDialog : public KDialog
     QButtonGroup *mButtonGroup;
 };
 
-
-class DistributionListEditor : public QWidget
+/**
+ * @short Helper class
+ */
+class DistributionListEditorWidget : public QWidget
 {
     Q_OBJECT
   public:
-    DistributionListEditor( AddressBook *, QWidget *parent );
-    virtual ~DistributionListEditor();
+    DistributionListEditorWidget( AddressBook *, QWidget *parent );
+    virtual ~DistributionListEditorWidget();
 
   private slots:
     void newList();
[ snip ]

The inheritance of the public DistributionListEditor class changed.

In addition all the public interface classes in libkabc (Format,
Resource, etc.) changed in binary incompatible ways. I find it
confusing though that they are marked as @internal but are still
installed.

Index: kabc/stdaddressbook.h
===================================================================
RCS file: /home/kde/kdelibs/kabc/stdaddressbook.h,v
retrieving revision 1.4
retrieving revision 1.14
diff -u -p -b -r1.4 -r1.14
--- kabc/stdaddressbook.h	2002/03/04 09:43:11	1.4
+++ kabc/stdaddressbook.h	2002/07/08 11:22:12	1.14
[ snip ]
 class StdAddressBook : public AddressBook
[ snip ]
     
-    QString identifier();
-    

Removing of public methods is binary incompatible (in the sense of
that the symbol is no more available) .

Both installed header files in kate/interfaces, document.h and
view.h changed in binary incompatible ways (inheritance changes,
virtual method additions, etc.) .

Index: kdecore/kglobalsettings.h
===================================================================
RCS file: /home/kde/kdelibs/kdecore/kglobalsettings.h,v
retrieving revision 1.36
retrieving revision 1.39
diff -u -p -b -r1.36 -r1.39
--- kdecore/kglobalsettings.h	2002/03/07 16:01:38	1.36
+++ kdecore/kglobalsettings.h	2002/05/26 11:45:37	1.39
@@ -96,9 +97,20 @@ class KGlobalSettings
     static bool singleClick();
 
     /**
+     * This enum describes the return type for insertTearOffHandle() wether to insert
+     * a handle or not. Applications who independently want to use handles in their popup menus
+     * should test for Application level before calling the appropriate function in KPopupMenu.
+     **/
+    enum TearOffHandle {
+      Disable = 0,
+      ApplicationLevel,
+      Enable
+    };
+
+    /**
      * Returns whether tear-off handles are inserted in KPopupMenus.
      **/
-    static bool insertTearOffHandle();
+    static TearOffHandle insertTearOffHandle();
 
     /**
      * @return the KDE setting for "change cursor over icon"

One can argue about this one. I guess it doesn't matter for our main
platform Linux/GCC though, where apparently the return type is not
mangled into the symbol name. Michael, something to worry about?

Index: kdeprint/kmjobmanager.h
===================================================================
RCS file: /home/kde/kdelibs/kdeprint/kmjobmanager.h,v
retrieving revision 1.11
retrieving revision 1.13
diff -u -p -b -r1.11 -r1.13
--- kdeprint/kmjobmanager.h	2001/11/27 16:32:44	1.11
+++ kdeprint/kmjobmanager.h	2002/05/23 16:55:13	1.13
@@ -71,7 +75,7 @@ protected:
 	void removeDiscardedJobs();
 
 protected:
-	virtual bool listJobs(const QString& prname, JobType type);
+	virtual bool listJobs(const QString& prname, JobType type, int limit = 0);
 	virtual bool sendCommandSystemJob(const QPtrList<KMJob>& jobs, int action, const QString& arg = QString::null);
 	bool sendCommandThreadJob(const QPtrList<KMJob>& jobs, int action, const QString& arg = QString::null);
 
One can also argue about this one. While the class is public it is
commonly used as singleton, so it's unlikely that someone inherits
from it. But still.

The same applies to KMManager.

Index: kdeui/kfontdialog.h
===================================================================
RCS file: /home/kde/kdelibs/kdeui/kfontdialog.h,v
retrieving revision 1.55
retrieving revision 1.58
diff -u -p -b -r1.55 -r1.58
--- kdeui/kfontdialog.h	2002/03/13 20:56:48	1.55
+++ kdeui/kfontdialog.h	2002/05/09 10:59:13	1.58
@@ -290,9 +275,9 @@ private:
   KListBox     *familyListBox;
   KListBox     *styleListBox;
   KListBox     *sizeListBox;
-  QComboBox    *charsetsCombo;
   QCheckBox    *sizeIsRelativeCheckBox;
-
+  QComboBox    *charsetsCombo;
+  KIntNumInput *sizeOfFont;
   QFont        selFont;
 
   QString      selectedStyle;

This one is clearly a breakage. The class is KFontChooser, is public
and is meant to be used separately.

Next one in the diff is KFileDialog. See kde-devel for details.

Index: kio/kfile/kopenwith.h
===================================================================
RCS file: /home/kde/kdelibs/kio/kfile/kopenwith.h,v
retrieving revision 1.19
retrieving revision 1.22
diff -u -p -b -r1.19 -r1.22
--- kio/kfile/kopenwith.h	2002/01/11 15:25:07	1.19
+++ kio/kfile/kopenwith.h	2002/06/13 01:04:49	1.22
@@ -141,9 +146,7 @@ protected:
     QString qName, qServiceType;
     bool m_terminaldirty;
     QCheckBox   *terminal, *remember;
-    QPushButton *ok;
     QPushButton *clear;
-    QPushButton *cancel;
 
     KService::Ptr m_pService;
 
(this is for the KOpenWithDlg class, a public one)
 
That's about it. Comments welcome.

Simon




More information about the kde-core-devel mailing list