Commit d927cbe0 authored by kocienda's avatar kocienda

Finished initial code clean up. This includes:

	- Adding a no-arg constructor for every class that didn't have one
	- Adding a destructor for every class that didn't have one
	- Adding a private copy constructor for every class that didn't have one
	- Adding a private assignment operator for every class that didn't have one
	- Pretty formatting


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent def7496c
#ifndef CONFIG_H_
#define CONFIG_H_
/* Define for compiling in KWQ land */
#undef _KWQ_
......@@ -847,3 +850,4 @@ int openpty(int *, int *, char *, struct termios *, struct winsize *);
__END_DECLS
#endif
#endif
......@@ -26,6 +26,10 @@
#ifndef QAPPLICATION_H_
#define QAPPLICATION_H_
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "qwidget.h"
#include "qpalette.h"
#include "qsize.h"
......@@ -51,7 +55,12 @@ public:
// constructors, copy constructors, and destructors ------------------------
QApplication();
// add no-arg constructor
#ifdef _KWQ_PEDANTIC_
QApplication() {}
#endif
QApplication( int &argc, char **argv);
virtual ~QApplication();
// member functions --------------------------------------------------------
......@@ -63,6 +72,7 @@ public:
private:
// no copying or assignment
// note that these are "standard" (no pendantic stuff needed)
QApplication(const QApplication &);
QApplication &operator=(const QApplication &);
......
......@@ -26,6 +26,10 @@
#ifndef QASYNCIO_H_
#define QASYNCIO_H_
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <KWQDef.h>
// class QAsyncIO ==============================================================
......@@ -41,7 +45,11 @@ protected:
// constructors, copy constructors, and destructors ------------------------
QAsyncIO() {};
// add no-arg constructor
#ifdef _KWQ_PEDANTIC_
QAsyncIO() {}
#endif
virtual ~QAsyncIO();
// member functions --------------------------------------------------------
......@@ -53,9 +61,18 @@ protected:
// private ---------------------------------------------------------------------
private:
// no copying or assignment
// add copy constructor
// this private declaration prevents copying
#ifdef _KWQ_PEDANTIC_
QAsyncIO(const QAsyncIO &);
#endif
// add assignment operator
// this private declaration prevents assignment
#ifdef _KWQ_PEDANTIC_
QAsyncIO &operator=(const QAsyncIO &);
#endif
}; // class QAsyncIO ===========================================================
......@@ -71,8 +88,15 @@ public:
// constructors, copy constructors, and destructors ------------------------
// add no-arg constructor
#ifdef _KWQ_PEDANTIC_
QDataSource() {}
#endif
// add no-op destructor
#ifdef _KWQ_PEDANTIC_
~QDataSource() {}
#endif
// member functions --------------------------------------------------------
......@@ -85,9 +109,18 @@ public:
// private ---------------------------------------------------------------------
private:
// no copying or assignment
// add copy constructor
// this private declaration prevents copying
#ifdef _KWQ_PEDANTIC_
QDataSource(const QDataSource &);
#endif
// add assignment operator
// this private declaration prevents assignment
#ifdef _KWQ_PEDANTIC_
QDataSource &operator=(const QDataSource &);
#endif
}; // end class QDataSource ====================================================
......@@ -103,8 +136,15 @@ public:
// constructors, copy constructors, and destructors ------------------------
// add no-arg constructor
#ifdef _KWQ_PEDANTIC_
QDataSink() {}
#endif
// add no-op destructor
#ifdef _KWQ_PEDANTIC_
~QDataSink() {}
#endif
// member functions --------------------------------------------------------
......@@ -116,9 +156,18 @@ public:
// private ---------------------------------------------------------------------
private:
// no copying or assignment
// add copy constructor
// this private declaration prevents copying
#ifdef _KWQ_PEDANTIC_
QDataSink(const QDataSink &);
#endif
// add assignment operator
// this private declaration prevents assignment
#ifdef _KWQ_PEDANTIC_
QDataSink &operator=(const QDataSink &);
#endif
}; // class QDataSink ==========================================================
......
......@@ -26,6 +26,10 @@
#ifndef QBRUSH_H_
#define QBRUSH_H_
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "qcolor.h"
#include "qnamespace.h"
......@@ -45,9 +49,7 @@ public:
QBrush();
QBrush(const QColor &);
QBrush(const QBrush &);
QBrush &operator=(const QBrush &);
~QBrush();
// member functions --------------------------------------------------------
......
......@@ -26,6 +26,10 @@
#ifndef QBUFFER_H_
#define QBUFFER_H_
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <KWQDef.h>
#include "qarray.h"
......@@ -44,7 +48,6 @@ public:
// constructors, copy constructors, and destructors ------------------------
QBuffer();
~QBuffer();
// member functions --------------------------------------------------------
......@@ -63,6 +66,7 @@ public:
private:
// no copying or assignment
// note that these are "standard" (no pendantic stuff needed)
QBuffer(const QBuffer &);
QBuffer &operator=(const QBuffer &);
......
......@@ -26,6 +26,10 @@
#ifndef QBUTTON_H_
#define QBUTTON_H_
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "qwidget.h"
#include "qstring.h"
......@@ -41,10 +45,8 @@ public:
// constructors, copy constructors, and destructors ------------------------
QButton();
QButton(QWidget *);
virtual ~QButton();
QButton(QWidget *parent=0);
~QButton();
// member functions --------------------------------------------------------
......@@ -58,6 +60,7 @@ public:
private:
// no copying or assignment
// note that these are "standard" (no pendantic stuff needed)
QButton(const QButton &);
QButton &operator=(const QButton &);
......
......@@ -26,6 +26,10 @@
#ifndef QCSTRING_H_
#define QCSTRING_H_
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
// FIXME: does our implementation of QCString really need to inherit from
// QByteArray and QArray?
......
......@@ -26,6 +26,10 @@
#ifndef QCHECKBOX_H_
#define QCHECKBOX_H_
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <KWQButton.h>
// class QCheckBox =============================================================
......@@ -40,9 +44,18 @@ public:
// constructors, copy constructors, and destructors ------------------------
QCheckBox();
// add no-arg constructor
#ifdef _KWQ_PEDANTIC_
QCheckBox() {}
#endif
QCheckBox(QWidget *);
// add no-op destructor
#ifdef _KWQ_PEDANTIC_
~QCheckBox() {}
#endif
// member functions --------------------------------------------------------
void setChecked(bool);
......@@ -54,8 +67,10 @@ public:
// private ---------------------------------------------------------------------
private:
QCheckBox(const QCheckBox &);
QCheckBox &operator=(const QCheckBox &);
// no copying or assignment
// note that these are "standard" (no pendantic stuff needed)
QCheckBox(const QCheckBox &);
QCheckBox &operator=(const QCheckBox &);
}; // class QCheckBox ==========================================================
......
......@@ -26,6 +26,10 @@
#ifndef QCOLOR_H_
#define QCOLOR_H_
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "qnamespace.h"
#include "qstring.h"
......@@ -48,7 +52,10 @@ public:
QColor(const char *);
QColor(const QColor &);
~QColor();
// add no-op destructor
#ifdef _KWQ_PEDANTIC_
~QColor() {}
#endif
// member functions --------------------------------------------------------
......
......@@ -26,6 +26,10 @@
#ifndef QCOMBOBOX_H_
#define QCOMBOBOX_H_
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <KWQListBox.h>
#include "qwidget.h"
......@@ -43,7 +47,6 @@ public:
QComboBox(QWidget *parent=0, const char *name=0);
QComboBox(bool rw, QWidget *parent=0, const char *name=0);
~QComboBox();
// member functions --------------------------------------------------------
......@@ -64,6 +67,7 @@ public:
private:
// no copying or assignment
// note that these are "standard" (no pendantic stuff needed)
QComboBox(const QComboBox &);
QComboBox &operator=(const QComboBox &);
......
......@@ -26,12 +26,16 @@
#ifndef KWQCOMPLETION_H_
#define KWQCOMPLETION_H_
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <qobject.h>
#include <qstringlist.h>
// class QCompletion ===========================================================
// class KCompletion ===========================================================
class QCompletion : public QObject {
class KCompletion : public QObject {
public:
// structs -----------------------------------------------------------------
......@@ -42,9 +46,8 @@ public:
// constructors, copy constructors, and destructors ------------------------
QCompletion();
~QCompletion();
KCompletion();
virtual ~KCompletion();
// member functions --------------------------------------------------------
......@@ -56,16 +59,25 @@ public:
// private ---------------------------------------------------------------------
private:
// no copying or assignment
QCompletion(const QCompletion &);
QCompletion &operator=(const QCompletion &);
}; // class QCompletion ========================================================
// add copy constructor
// this private declaration prevents copying
#ifdef _KWQ_PEDANTIC_
KCompletion(const KCompletion &);
#endif
// add assignment operator
// this private declaration prevents assignment
#ifdef _KWQ_PEDANTIC_
KCompletion &operator=(const KCompletion &);
#endif
}; // class KCompletion ========================================================
// class QCompletionBase =======================================================
class QCompletionBase {
// class KCompletionBase =======================================================
class KCompletionBase {
public:
// structs -----------------------------------------------------------------
......@@ -76,13 +88,12 @@ public:
// constructors, copy constructors, and destructors ------------------------
QCompletionBase();
~QCompletionBase();
KCompletionBase();
virtual ~KCompletionBase();
// member functions --------------------------------------------------------
QCompletion *completionObject(bool hsig = true);
KCompletion *completionObject(bool hsig = true);
// operators ---------------------------------------------------------------
......@@ -90,11 +101,20 @@ public:
// private ---------------------------------------------------------------------
private:
// no copying or assignment
QCompletionBase(const QCompletionBase &);
QCompletionBase &operator=(const QCompletionBase &);
}; // class QCompletionBase ====================================================
// add copy constructor
// this private declaration prevents copying
#ifdef _KWQ_PEDANTIC_
KCompletionBase(const KCompletionBase &);
#endif
// add assignment operator
// this private declaration prevents assignment
#ifdef _KWQ_PEDANTIC_
KCompletionBase &operator=(const KCompletionBase &);
#endif
}; // class KCompletionBase ====================================================
#endif
......@@ -26,6 +26,10 @@
#ifndef QCURSOR_H
#define QCURSOR_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
// class QCursor ===============================================================
class QCursor {
......@@ -39,9 +43,7 @@ public:
// constructors, copy constructors, and destructors ------------------------
QCursor();
QCursor(const QCursor &);
~QCursor();
// member functions --------------------------------------------------------
......
......@@ -26,6 +26,10 @@
#ifndef DCOPCLIENT_H_
#define DCOPCLIENT_H_
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <qobject.h>
#include <qcstring.h>
......
......@@ -26,6 +26,10 @@
#ifndef KWQDATASTREAM_H_
#define KWQDATASTREAM_H_
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "qarray.h"
#include "qstring.h"
#include "qcstring.h"
......@@ -51,6 +55,7 @@ public:
// constructors, copy constructors, and destructors ------------------------
QDataStream();
QDataStream(QByteArray, int);
virtual ~QDataStream();
......@@ -69,6 +74,7 @@ public:
private:
// no copying or assignment
// note that these are "standard" (no pendantic stuff needed)
QDataStream(const QDataStream &);
QDataStream &operator=(const QDataStream &);
......
......@@ -26,6 +26,10 @@
#ifndef QDATETIME_H_
#define QDATETIME_H_
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
// class QTime =================================================================
class QTime {
......@@ -39,9 +43,11 @@ public:
QTime();
QTime(int, int);
QTime(const QTime &);
~QTime();
// add no-op destructor
#ifdef _KWQ_PEDANTIC_
~QTime() {}
#endif
// member functions --------------------------------------------------------
......@@ -58,6 +64,14 @@ public:
// protected -------------------------------------------------------------------
// private ---------------------------------------------------------------------
private:
// add copy constructor
// this private declaration prevents copying
#ifdef _KWQ_PEDANTIC_
QTime(const QTime &);
#endif
}; // class QTime ==============================================================