Add proper refcounting option to TDEMainWindow

This relates to the discussion at:
http://lists.kde.org/?l=kde-core-devel&m=107208785431497&w=2
Clean up a few minor code formatting issues
pull/16/head
Timothy Pearson 10 years ago
parent 67d3c303f3
commit 7cd4adc908

@ -20,8 +20,6 @@
* Boston, MA 02110-1301, USA. * Boston, MA 02110-1301, USA.
**/ **/
#define KSOCK_INTERNAL_C_COMPILATION 1
#include <config.h> #include <config.h>
#include <sys/types.h> #include <sys/types.h>
@ -42,7 +40,12 @@ extern "C" {
#define KSOCK_NO_BROKEN #define KSOCK_NO_BROKEN
#include "kdebug.h" #include "kdebug.h"
// FIXME
// FOR BINARY COMPATIBILITY ONLY
// REMOVE WHEN PRACTICAL!
#define TDESOCKET_BINARY_COMPAT_HACK 1
#include "ksock.h" #include "ksock.h"
#undef TDESOCKET_BINARY_COMPAT_HACK
#include "kextsock.h" #include "kextsock.h"
#include "ksockaddr.h" #include "ksockaddr.h"

@ -342,10 +342,10 @@ protected:
int sock; int sock;
private: private:
// DEPRECATED // HACK
#ifdef KSOCK_INTERNAL_C_COMPILATION #ifdef TDESOCKET_BINARY_COMPAT_HACK
KDE_EXPORT bool bindAndListen(); KDE_EXPORT bool bindAndListen();
#endif // KSOCK_INTERNAL_C_COMPILATION #endif // TDESOCKET_BINARY_COMPAT_HACK
TDEServerSocket(const TDEServerSocket&); TDEServerSocket(const TDEServerSocket&);
TDEServerSocket& operator=(const TDEServerSocket&); TDEServerSocket& operator=(const TDEServerSocket&);

@ -155,7 +155,7 @@ TQIconSet KGuiItem::iconSet( TDEIcon::Group group, int size, TDEInstance* instan
{ {
if( !d->m_iconName.isEmpty()) if( !d->m_iconName.isEmpty())
{ {
// some caching here would(?) come handy // some caching here would(?) come handy
return instance->iconLoader()->loadIconSet( d->m_iconName, group, size, true, false ); return instance->iconLoader()->loadIconSet( d->m_iconName, group, size, true, false );
} }
else else
@ -164,7 +164,9 @@ TQIconSet KGuiItem::iconSet( TDEIcon::Group group, int size, TDEInstance* instan
} }
} }
else else
{
return TQIconSet(); return TQIconSet();
}
} }
TQString KGuiItem::iconName() const TQString KGuiItem::iconName() const

@ -46,7 +46,7 @@ public:
// It gives the wrong impression that you just change the text. // It gives the wrong impression that you just change the text.
KGuiItem( const TQString &text, KGuiItem( const TQString &text,
const TQString &iconName = TQString::null, const TQString &iconName = TQString::null,
const TQString &toolTip = TQString::null, const TQString &toolTip = TQString::null,
const TQString &whatsThis = TQString::null ); const TQString &whatsThis = TQString::null );
KGuiItem( const TQString &text, const TQIconSet &iconSet, KGuiItem( const TQString &text, const TQIconSet &iconSet,

@ -66,6 +66,7 @@ public:
bool autoSaveWindowSize:1; bool autoSaveWindowSize:1;
bool care_about_geometry:1; bool care_about_geometry:1;
bool shuttingDown:1; bool shuttingDown:1;
bool newStyleRefCounting:1;
TQString autoSaveGroup; TQString autoSaveGroup;
TDEAccel * tdeaccel; TDEAccel * tdeaccel;
TDEMainWindowInterface *m_interface; TDEMainWindowInterface *m_interface;
@ -245,7 +246,7 @@ void TDEMainWindow::initTDEMainWindow(const char *name, int cflags)
d->shuttingDown = false; d->shuttingDown = false;
if ((d->care_about_geometry = being_first)) { if ((d->care_about_geometry = being_first)) {
being_first = false; being_first = false;
if ( kapp->geometryArgument().isNull() ) // if there is no geometry, it doesn't mater if ( kapp->geometryArgument().isNull() ) // if there is no geometry, it doesn't matter
d->care_about_geometry = false; d->care_about_geometry = false;
else else
parseGeometry(false); parseGeometry(false);
@ -257,6 +258,14 @@ void TDEMainWindow::initTDEMainWindow(const char *name, int cflags)
else else
d->m_interface = new TDEMainWindowInterface(this); d->m_interface = new TDEMainWindowInterface(this);
if ( cflags & NewRefCountMode ) {
d->newStyleRefCounting = true;
kapp->ref();
}
else {
d->newStyleRefCounting = false;
}
if (!kapp->authorize("movable_toolbars")) if (!kapp->authorize("movable_toolbars"))
setDockWindowsMovable(false); setDockWindowsMovable(false);
} }

@ -151,7 +151,8 @@ public:
*/ */
enum CreationFlags enum CreationFlags
{ {
NoDCOPObject = 1 NoDCOPObject = 1,
NewRefCountMode = 2
}; };
/** /**

Loading…
Cancel
Save