Rename KShared

pull/16/head
Timothy Pearson 11 years ago
parent 21bc754111
commit 12f3d421cd

@ -18,11 +18,11 @@ that we would like to make for the next binary incompatible release.
- Remove all KDE_NO_COMPAT from the KDE2 -> KDE3 port before adding new ones for KDE4. - Remove all KDE_NO_COMPAT from the KDE2 -> KDE3 port before adding new ones for KDE4.
- Remove the smart-to-dumb-pointer conversion operator from KSharedPtr - Remove the smart-to-dumb-pointer conversion operator from TDESharedPtr
and replace it with a T* Get() member function. An implict conversion is and replace it with a T* Get() member function. An implict conversion is
far too dangerous. far too dangerous.
See: http://groups.google.com/groups?selm=4ognb0%243cd%40linda.teleport.com&oe=UTF-8&output=gplain See: http://groups.google.com/groups?selm=4ognb0%243cd%40linda.teleport.com&oe=UTF-8&output=gplain
Also free the client from the requirement to inherit from KShared. Also free the client from the requirement to inherit from TDEShared.
- Remove all TDESocket, TDEServerSocket, KSocks and KExtendedSocket references - Remove all TDESocket, TDEServerSocket, KSocks and KExtendedSocket references
throughout KDE in favor of KNetwork's socket implementations. throughout KDE in favor of KNetwork's socket implementations.

@ -43,7 +43,7 @@ class KDNSSD_EXPORT RemoteService : public TQObject, public ServiceBase
{ {
Q_OBJECT Q_OBJECT
public: public:
typedef KSharedPtr<RemoteService> Ptr; typedef TDESharedPtr<RemoteService> Ptr;
/** /**
Creates unresolved service from given DNS label Creates unresolved service from given DNS label

@ -37,10 +37,10 @@ services of given type are present in given domain.
@short Describes any type of service. @short Describes any type of service.
@author Jakub Stachowski @author Jakub Stachowski
*/ */
class KDNSSD_EXPORT ServiceBase : public KShared class KDNSSD_EXPORT ServiceBase : public TDEShared
{ {
public: public:
typedef KSharedPtr<ServiceBase> Ptr; typedef TDESharedPtr<ServiceBase> Ptr;
/** /**
@param name Service name - empty for metaservices @param name Service name - empty for metaservices

@ -44,7 +44,7 @@ static bool emailsEquals( const TQStringList&, const TQStringList& );
KABC::SortMode *Addressee::mSortMode = 0; KABC::SortMode *Addressee::mSortMode = 0;
struct Addressee::AddresseeData : public KShared struct Addressee::AddresseeData : public TDEShared
{ {
TQString uid; TQString uid;
TQString uri; TQString uri;
@ -68,7 +68,7 @@ Addressee::AddresseeData* Addressee::shared_null = 0;
Addressee::AddresseeData* Addressee::makeSharedNull() Addressee::AddresseeData* Addressee::makeSharedNull()
{ {
Addressee::shared_null = new AddresseeData; Addressee::shared_null = new AddresseeData;
shared_null->_KShared_ref(); //just in case (we should add KSD) shared_null->_TDEShared_ref(); //just in case (we should add KSD)
shared_null->empty = true; shared_null->empty = true;
shared_null->changed = false; shared_null->changed = false;
shared_null->resource = 0; shared_null->resource = 0;

@ -391,7 +391,7 @@ class KABC_EXPORT Addressee
void detach(); void detach();
struct AddresseeData; struct AddresseeData;
mutable KSharedPtr<AddresseeData> mData; mutable TDESharedPtr<AddresseeData> mData;
private: private:
static AddresseeData* shared_null; static AddresseeData* shared_null;

@ -38,13 +38,13 @@ class TQTextStream;
* The attribute stores the index to a table that contains fonts and colors * The attribute stores the index to a table that contains fonts and colors
* and also if a character is selected. * and also if a character is selected.
*/ */
class KateTextLine : public KShared class KateTextLine : public TDEShared
{ {
public: public:
/** /**
* Define a Shared-Pointer type * Define a Shared-Pointer type
*/ */
typedef KSharedPtr<KateTextLine> Ptr; typedef TDESharedPtr<KateTextLine> Ptr;
public: public:
/** /**

@ -26,7 +26,7 @@
#include "kdedmodule.h" #include "kdedmodule.h"
#include "tdeconfigdata.h" #include "tdeconfigdata.h"
typedef TQMap<KEntryKey, KSharedPtr<KShared> > KDEDObjectMap; typedef TQMap<KEntryKey, TDESharedPtr<TDEShared> > KDEDObjectMap;
class KDEDModulePrivate class KDEDModulePrivate
{ {
@ -62,7 +62,7 @@ void KDEDModule::resetIdle()
d->timer.start(d->timeout, true); d->timer.start(d->timeout, true);
} }
void KDEDModule::insert(const TQCString &app, const TQCString &key, KShared *obj) void KDEDModule::insert(const TQCString &app, const TQCString &key, TDEShared *obj)
{ {
if (!d->objMap) if (!d->objMap)
d->objMap = new KDEDObjectMap; d->objMap = new KDEDObjectMap;
@ -74,13 +74,13 @@ void KDEDModule::insert(const TQCString &app, const TQCString &key, KShared *obj
KEntryKey indexKey(app, key); KEntryKey indexKey(app, key);
// Prevent deletion in case the same object is inserted again. // Prevent deletion in case the same object is inserted again.
KSharedPtr<KShared> _obj = obj; TDESharedPtr<TDEShared> _obj = obj;
d->objMap->replace(indexKey, _obj); d->objMap->replace(indexKey, _obj);
resetIdle(); resetIdle();
} }
KShared * KDEDModule::find(const TQCString &app, const TQCString &key) TDEShared * KDEDModule::find(const TQCString &app, const TQCString &key)
{ {
if (!d->objMap) if (!d->objMap)
return 0; return 0;

@ -91,12 +91,12 @@ public:
* Any previous object inserted with the same values for @p app * Any previous object inserted with the same values for @p app
* and @p key will be removed. * and @p key will be removed.
*/ */
void insert(const TQCString &app, const TQCString &key, KShared *obj); void insert(const TQCString &app, const TQCString &key, TDEShared *obj);
/** /**
* Lookup object indexed with @p app and @p key * Lookup object indexed with @p app and @p key
*/ */
KShared *find(const TQCString &app, const TQCString &key); TDEShared *find(const TQCString &app, const TQCString &key);
/** /**
* remove object indexed with @p app and @p key. * remove object indexed with @p app and @p key.

@ -1,6 +1,6 @@
#include "test.h" #include "test.h"
class TestObject : public KShared class TestObject : public TDEShared
{ {
public: public:
TestObject(const TQCString &_app) : app(_app) TestObject(const TQCString &_app) : app(_app)

@ -33,7 +33,7 @@
264 tdecore (KIconLoader) 264 tdecore (KIconLoader)
265 tdecore (KIconEffect) 265 tdecore (KIconEffect)
270 tdeui (KRootPixmap) 270 tdeui (KRootPixmap)
280 tdeui (KSharedPixmap) 280 tdeui (TDESharedPixmap)
281 tdeui (TDECModule) 281 tdeui (TDECModule)
282 tdeui (KDockWidget) 282 tdeui (KDockWidget)
290 tdeui (KPixmapIO) 290 tdeui (KPixmapIO)

@ -67,7 +67,7 @@ TDEConfig *TDEGlobal::config()
return _instance->config(); return _instance->config();
} }
KSharedConfig *TDEGlobal::sharedConfig() TDESharedConfig *TDEGlobal::sharedConfig()
{ {
MYASSERT(_instance); MYASSERT(_instance);

@ -23,7 +23,7 @@
class KCharsets; class KCharsets;
class TDEConfig; class TDEConfig;
class KSharedConfig; class TDESharedConfig;
class KIconLoader; class KIconLoader;
class TDEHardwareDevices; class TDEHardwareDevices;
class TDEGlobalNetworkManager; class TDEGlobalNetworkManager;
@ -71,7 +71,7 @@ public:
* Returns the general config object. * Returns the general config object.
* @return the global configuration object. * @return the global configuration object.
*/ */
static KSharedConfig *sharedConfig(); static TDESharedConfig *sharedConfig();
/** /**
* Returns an iconloader object. * Returns an iconloader object.

@ -43,7 +43,7 @@ public:
TQString example, screenshot; TQString example, screenshot;
TQString linkOverlay, lockOverlay, zipOverlay, shareOverlay; TQString linkOverlay, lockOverlay, zipOverlay, shareOverlay;
bool hidden; bool hidden;
KSharedConfig::Ptr sharedConfig; TDESharedConfig::Ptr sharedConfig;
}; };
/** /**
@ -136,9 +136,9 @@ KIconTheme::KIconTheme(const TQString& name, const TQString& appName)
fileName = mDir + "index.theme"; fileName = mDir + "index.theme";
mainSection="Icon Theme"; mainSection="Icon Theme";
} }
// Use KSharedConfig to avoid parsing the file many times, from each kinstance. // Use TDESharedConfig to avoid parsing the file many times, from each kinstance.
// Need to keep a ref to it to make this useful // Need to keep a ref to it to make this useful
d->sharedConfig = KSharedConfig::openConfig( fileName, true /*readonly*/, false /*useKDEGlobals*/ ); d->sharedConfig = TDESharedConfig::openConfig( fileName, true /*readonly*/, false /*useKDEGlobals*/ );
TDEConfig& cfg = *d->sharedConfig; TDEConfig& cfg = *d->sharedConfig;
//was: KSimpleConfig cfg(fileName); //was: KSimpleConfig cfg(fileName);

@ -65,7 +65,7 @@ public:
KMimeSourceFactory* mimeSourceFactory; KMimeSourceFactory* mimeSourceFactory;
TQString configName; TQString configName;
bool ownAboutdata; bool ownAboutdata;
KSharedConfig::Ptr sharedConfig; TDESharedConfig::Ptr sharedConfig;
}; };
TDEInstance::TDEInstance( const TQCString& name) TDEInstance::TDEInstance( const TQCString& name)
@ -201,7 +201,7 @@ TDEConfig *TDEInstance::config() const
if( _config == 0 ) { if( _config == 0 ) {
if ( !d->configName.isEmpty() ) if ( !d->configName.isEmpty() )
{ {
d->sharedConfig = KSharedConfig::openConfig( d->configName ); d->sharedConfig = TDESharedConfig::openConfig( d->configName );
// Check whether custom config files are allowed. // Check whether custom config files are allowed.
d->sharedConfig->setGroup( "KDE Action Restrictions" ); d->sharedConfig->setGroup( "KDE Action Restrictions" );
@ -220,10 +220,10 @@ TDEConfig *TDEInstance::config() const
if ( d->sharedConfig == 0 ) if ( d->sharedConfig == 0 )
{ {
if ( !_name.isEmpty() ) { if ( !_name.isEmpty() ) {
d->sharedConfig = KSharedConfig::openConfig( _name + "rc", m_configReadOnly ); d->sharedConfig = TDESharedConfig::openConfig( _name + "rc", m_configReadOnly );
} }
else { else {
d->sharedConfig = KSharedConfig::openConfig( TQString::null ); d->sharedConfig = TDESharedConfig::openConfig( TQString::null );
} }
} }
@ -244,7 +244,7 @@ TDEConfig *TDEInstance::config() const
return _config; return _config;
} }
KSharedConfig *TDEInstance::sharedConfig() const TDESharedConfig *TDEInstance::sharedConfig() const
{ {
DEBUG_CHECK_ALIVE DEBUG_CHECK_ALIVE
if (_config == 0) if (_config == 0)

@ -26,7 +26,7 @@ class KCharsets;
class TQFont; class TQFont;
class TDEInstancePrivate; class TDEInstancePrivate;
class KMimeSourceFactory; class KMimeSourceFactory;
class KSharedConfig; class TDESharedConfig;
class TDEHardwareDevices; class TDEHardwareDevices;
class TDEGlobalNetworkManager; class TDEGlobalNetworkManager;
@ -94,7 +94,7 @@ class TDECORE_EXPORT TDEInstance
* Returns the general config object ("appnamerc"). * Returns the general config object ("appnamerc").
* @return the TDEConfig object for the instance. * @return the TDEConfig object for the instance.
*/ */
KSharedConfig *sharedConfig() const; TDESharedConfig *sharedConfig() const;
/** /**
* Set a read-only flag on the configuration files * Set a read-only flag on the configuration files

@ -30,10 +30,10 @@
* @author Waldo Bastian <bastian@kde.org> * @author Waldo Bastian <bastian@kde.org>
* @since 3.3 * @since 3.3
*/ */
class TDECORE_EXPORT KLockFile : public KShared class TDECORE_EXPORT KLockFile : public TDEShared
{ {
public: public:
typedef KSharedPtr<KLockFile> Ptr; typedef TDESharedPtr<KLockFile> Ptr;
KLockFile(const TQString &file); KLockFile(const TQString &file);

@ -32,11 +32,11 @@
* @author Waldo Bastian <bastian@kde.org> * @author Waldo Bastian <bastian@kde.org>
* @since 3.2 * @since 3.2
*/ */
class TDECORE_EXPORT KMountPoint : public KShared class TDECORE_EXPORT KMountPoint : public TDEShared
{ {
typedef signed long long int filesize_t; typedef signed long long int filesize_t;
public: public:
typedef KSharedPtr<KMountPoint> Ptr; typedef TDESharedPtr<KMountPoint> Ptr;
typedef TQValueList<Ptr> List; typedef TQValueList<Ptr> List;
public: public:
enum { NeedMountOptions = 1, NeedRealDeviceName = 2 }; enum { NeedMountOptions = 1, NeedRealDeviceName = 2 };

@ -15,132 +15,132 @@
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. Boston, MA 02110-1301, USA.
*/ */
#ifndef KSharedPTR_H #ifndef TDESharedPTR_H
#define KSharedPTR_H #define TDESharedPTR_H
#include "tdelibs_export.h" #include "tdelibs_export.h"
/** /**
* Reference counting for shared objects. If you derive your object * Reference counting for shared objects. If you derive your object
* from this class, then you may use it in conjunction with * from this class, then you may use it in conjunction with
* KSharedPtr to control the lifetime of your object. * TDESharedPtr to control the lifetime of your object.
* *
* Specifically, all classes that derive from KShared have an internal * Specifically, all classes that derive from TDEShared have an internal
* counter keeping track of how many other objects have a reference to * counter keeping track of how many other objects have a reference to
* their object. If used with KSharedPtr, then your object will * their object. If used with TDESharedPtr, then your object will
* not be deleted until all references to the object have been * not be deleted until all references to the object have been
* released. * released.
* *
* You should probably not ever use any of the methods in this class * You should probably not ever use any of the methods in this class
* directly -- let the KSharedPtr take care of that. Just derive * directly -- let the TDESharedPtr take care of that. Just derive
* your class from KShared and forget about it. * your class from TDEShared and forget about it.
* *
* @author Waldo Bastian <bastian@kde.org> * @author Waldo Bastian <bastian@kde.org>
*/ */
class TDECORE_EXPORT KShared { class TDECORE_EXPORT TDEShared {
public: public:
/** /**
* Standard constructor. This will initialize the reference count * Standard constructor. This will initialize the reference count
* on this object to 0. * on this object to 0.
*/ */
KShared() : count(0) { } TDEShared() : count(0) { }
/** /**
* Copy constructor. This will @em not actually copy the objects * Copy constructor. This will @em not actually copy the objects
* but it will initialize the reference count on this object to 0. * but it will initialize the reference count on this object to 0.
*/ */
KShared( const KShared & ) : count(0) { } TDEShared( const TDEShared & ) : count(0) { }
/** /**
* Overloaded assignment operator. * Overloaded assignment operator.
*/ */
KShared &operator=(const KShared & ) { return *this; } TDEShared &operator=(const TDEShared & ) { return *this; }
/** /**
* Increases the reference count by one. * Increases the reference count by one.
*/ */
void _KShared_ref() const { count++; } void _TDEShared_ref() const { count++; }
/** /**
* Releases a reference (decreases the reference count by one). If * Releases a reference (decreases the reference count by one). If
* the count goes to 0, this object will delete itself. * the count goes to 0, this object will delete itself.
*/ */
void _KShared_unref() const { if (!--count) delete this; } void _TDEShared_unref() const { if (!--count) delete this; }
/** /**
* Return the current number of references held. * Return the current number of references held.
* *
* @return Number of references * @return Number of references
*/ */
int _KShared_count() const { return count; } int _TDEShared_count() const { return count; }
protected: protected:
virtual ~KShared() { } virtual ~TDEShared() { }
private: private:
mutable int count; mutable int count;
}; };
/** /**
* Can be used to control the lifetime of an object that has derived * Can be used to control the lifetime of an object that has derived
* KShared. As long a someone holds a KSharedPtr on some KShared * TDEShared. As long a someone holds a TDESharedPtr on some TDEShared
* object it won't become deleted but is deleted once its reference * object it won't become deleted but is deleted once its reference
* count is 0. This struct emulates C++ pointers virtually perfectly. * count is 0. This struct emulates C++ pointers virtually perfectly.
* So just use it like a simple C++ pointer. * So just use it like a simple C++ pointer.
* *
* KShared and KSharedPtr are preferred over QShared / QSharedPtr * TDEShared and TDESharedPtr are preferred over QShared / QSharedPtr
* since they are more safe. * since they are more safe.
* *
* WARNING: Please note that this class template provides an implicit * WARNING: Please note that this class template provides an implicit
* conversion to T*. Do *not* change this pointer or the pointee (don't * conversion to T*. Do *not* change this pointer or the pointee (don't
* call delete on it, for instance) behind KSharedPtr's back. * call delete on it, for instance) behind TDESharedPtr's back.
* *
* @author Waldo Bastian <bastian@kde.org> * @author Waldo Bastian <bastian@kde.org>
*/ */
template< class T > template< class T >
class KSharedPtr class TDESharedPtr
{ {
public: public:
/** /**
* Creates a null pointer. * Creates a null pointer.
*/ */
KSharedPtr() TDESharedPtr()
: ptr(0) { } : ptr(0) { }
/** /**
* Creates a new pointer. * Creates a new pointer.
* @param t the pointer * @param t the pointer
*/ */
KSharedPtr( T* t ) TDESharedPtr( T* t )
: ptr(t) { if ( ptr ) ptr->_KShared_ref(); } : ptr(t) { if ( ptr ) ptr->_TDEShared_ref(); }
/** /**
* Copies a pointer. * Copies a pointer.
* @param p the pointer to copy * @param p the pointer to copy
*/ */
KSharedPtr( const KSharedPtr& p ) TDESharedPtr( const TDESharedPtr& p )
: ptr(p.ptr) { if ( ptr ) ptr->_KShared_ref(); } : ptr(p.ptr) { if ( ptr ) ptr->_TDEShared_ref(); }
/** /**
* Unreferences the object that this pointer points to. If it was * Unreferences the object that this pointer points to. If it was
* the last reference, the object will be deleted. * the last reference, the object will be deleted.
*/ */
~KSharedPtr() { if ( ptr ) ptr->_KShared_unref(); } ~TDESharedPtr() { if ( ptr ) ptr->_TDEShared_unref(); }
KSharedPtr<T>& operator= ( const KSharedPtr<T>& p ) { TDESharedPtr<T>& operator= ( const TDESharedPtr<T>& p ) {
if ( ptr == p.ptr ) return *this; if ( ptr == p.ptr ) return *this;
if ( ptr ) ptr->_KShared_unref(); if ( ptr ) ptr->_TDEShared_unref();
ptr = p.ptr; ptr = p.ptr;
if ( ptr ) ptr->_KShared_ref(); if ( ptr ) ptr->_TDEShared_ref();
return *this; return *this;
} }
KSharedPtr<T>& operator= ( T* p ) { TDESharedPtr<T>& operator= ( T* p ) {
if ( ptr == p ) return *this; if ( ptr == p ) return *this;
if ( ptr ) ptr->_KShared_unref(); if ( ptr ) ptr->_TDEShared_unref();
ptr = p; ptr = p;
if ( ptr ) ptr->_KShared_ref(); if ( ptr ) ptr->_TDEShared_ref();
return *this; return *this;
} }
bool operator== ( const KSharedPtr<T>& p ) const { return ( ptr == p.ptr ); } bool operator== ( const TDESharedPtr<T>& p ) const { return ( ptr == p.ptr ); }
bool operator!= ( const KSharedPtr<T>& p ) const { return ( ptr != p.ptr ); } bool operator!= ( const TDESharedPtr<T>& p ) const { return ( ptr != p.ptr ); }
bool operator== ( const T* p ) const { return ( ptr == p ); } bool operator== ( const T* p ) const { return ( ptr == p ); }
bool operator!= ( const T* p ) const { return ( ptr != p ); } bool operator!= ( const T* p ) const { return ( ptr != p ); }
bool operator!() const { return ( ptr == 0 ); } bool operator!() const { return ( ptr == 0 ); }
@ -167,7 +167,7 @@ public:
* Returns the number of references. * Returns the number of references.
* @return the number of references * @return the number of references
*/ */
int count() const { return ptr->_KShared_count(); } // for debugging purposes int count() const { return ptr->_TDEShared_count(); } // for debugging purposes
private: private:
T* ptr; T* ptr;
}; };

@ -203,7 +203,7 @@ bool KTimezone::isValidLongitude(float longitude)
} }
KTimezone::KTimezone( KTimezone::KTimezone(
KSharedPtr<KTimezoneSource> db, const TQString& name, TDESharedPtr<KTimezoneSource> db, const TQString& name,
const TQString &countryCode, float latitude, float longitude, const TQString &countryCode, float latitude, float longitude,
const TQString &comment) : const TQString &comment) :
m_db(db), m_db(db),
@ -415,7 +415,7 @@ const KTimezones::ZoneMap KTimezones::allZones()
TQTextStream str(&f); TQTextStream str(&f);
TQRegExp lineSeparator("[ \t]"); TQRegExp lineSeparator("[ \t]");
TQRegExp ordinateSeparator("[+-]"); TQRegExp ordinateSeparator("[+-]");
KSharedPtr<KTimezoneSource> db(new KTimezoneSource(m_zoneinfoDir)); TDESharedPtr<KTimezoneSource> db(new KTimezoneSource(m_zoneinfoDir));
while (!str.atEnd()) while (!str.atEnd())
{ {
TQString line = str.readLine(); TQString line = str.readLine();

@ -49,7 +49,7 @@ class KTimezonesPrivate;
* @author S.R.Haque <srhaque@iee.org>. * @author S.R.Haque <srhaque@iee.org>.
*/ */
class TDECORE_EXPORT KTimezoneSource : class TDECORE_EXPORT KTimezoneSource :
public KShared public TDEShared
{ {
public: public:
KTimezoneSource(const TQString &db); KTimezoneSource(const TQString &db);
@ -114,7 +114,7 @@ public:
* @param comment description of the timezone, if any. * @param comment description of the timezone, if any.
*/ */
KTimezone( KTimezone(
KSharedPtr<KTimezoneSource> db, const TQString &name, TDESharedPtr<KTimezoneSource> db, const TQString &name,
const TQString &countryCode = TQString(), float latitude = UNKNOWN, float longitude = UNKNOWN, const TQString &countryCode = TQString(), float latitude = UNKNOWN, float longitude = UNKNOWN,
const TQString &comment = TQString()); const TQString &comment = TQString());
~KTimezone(); ~KTimezone();
@ -191,7 +191,7 @@ private:
KTimezone(const KTimezone&); KTimezone(const KTimezone&);
KTimezone& operator=(const KTimezone&); KTimezone& operator=(const KTimezone&);
KSharedPtr<KTimezoneSource> m_db; TDESharedPtr<KTimezoneSource> m_db;
TQString m_name; TQString m_name;
TQString m_countryCode; TQString m_countryCode;
float m_latitude; float m_latitude;

@ -32,7 +32,7 @@
#include <grp.h> #include <grp.h>
class KUserPrivate : public KShared class KUserPrivate : public TDEShared
{ {
public: public:
bool valid; bool valid;
@ -271,7 +271,7 @@ TQStringList KUser::allUserNames() {
KUser::~KUser() { KUser::~KUser() {
} }
class KUserGroupPrivate : public KShared class KUserGroupPrivate : public TDEShared
{ {
public: public:
bool valid; bool valid;

@ -233,7 +233,7 @@ public:
static TQStringList allUserNames(); static TQStringList allUserNames();
private: private:
KSharedPtr<KUserPrivate> d; TDESharedPtr<KUserPrivate> d;
void fillPasswd(struct passwd* p); void fillPasswd(struct passwd* p);
void fillName(const char* name); void fillName(const char* name);
}; };
@ -375,7 +375,7 @@ public:
static TQStringList allGroupNames(); static TQStringList allGroupNames();
private: private:
KSharedPtr<KUserGroupPrivate> d; TDESharedPtr<KUserGroupPrivate> d;
void fillGroup(struct group* g); void fillGroup(struct group* g);
void fillName(const char* name); void fillName(const char* name);
}; };

@ -328,14 +328,14 @@ TDEConfig* TDEConfig::copyTo(const TQString &file, TDEConfig *config) const
void TDEConfig::virtual_hook( int id, void* data ) void TDEConfig::virtual_hook( int id, void* data )
{ TDEConfigBase::virtual_hook( id, data ); } { TDEConfigBase::virtual_hook( id, data ); }
static KStaticDeleter< TQValueList<KSharedConfig*> > sd; static KStaticDeleter< TQValueList<TDESharedConfig*> > sd;
TQValueList<KSharedConfig*> *KSharedConfig::s_list = 0; TQValueList<TDESharedConfig*> *TDESharedConfig::s_list = 0;
KSharedConfig::Ptr KSharedConfig::openConfig(const TQString& fileName, bool readOnly, bool useKDEGlobals ) TDESharedConfig::Ptr TDESharedConfig::openConfig(const TQString& fileName, bool readOnly, bool useKDEGlobals )
{ {
if (s_list) if (s_list)
{ {
for(TQValueList<KSharedConfig*>::ConstIterator it = s_list->begin(); for(TQValueList<TDESharedConfig*>::ConstIterator it = s_list->begin();
it != s_list->end(); ++it) it != s_list->end(); ++it)
{ {
if ((*it)->backEnd->fileName() == fileName && if ((*it)->backEnd->fileName() == fileName &&
@ -344,21 +344,21 @@ KSharedConfig::Ptr KSharedConfig::openConfig(const TQString& fileName, bool read
return (*it); return (*it);
} }
} }
return new KSharedConfig(fileName, readOnly, useKDEGlobals); return new TDESharedConfig(fileName, readOnly, useKDEGlobals);
} }
KSharedConfig::KSharedConfig( const TQString& fileName, bool readonly, bool usekdeglobals) TDESharedConfig::TDESharedConfig( const TQString& fileName, bool readonly, bool usekdeglobals)
: TDEConfig(fileName, readonly, usekdeglobals) : TDEConfig(fileName, readonly, usekdeglobals)
{ {
if (!s_list) if (!s_list)
{ {
sd.setObject(s_list, new TQValueList<KSharedConfig*>); sd.setObject(s_list, new TQValueList<TDESharedConfig*>);
} }
s_list->append(this); s_list->append(this);
} }
KSharedConfig::~KSharedConfig() TDESharedConfig::~TDESharedConfig()
{ {
if ( s_list ) if ( s_list )
s_list->remove(this); s_list->remove(this);

@ -267,14 +267,14 @@ private:
/** /**
* TDEConfig variant using shared memory * TDEConfig variant using shared memory
* *
* KSharedConfig provides a reference counted, shared memory variant * TDESharedConfig provides a reference counted, shared memory variant
* of TDEConfig. * of TDEConfig.
*/ */
class TDECORE_EXPORT KSharedConfig : public TDEConfig, public KShared class TDECORE_EXPORT TDESharedConfig : public TDEConfig, public TDEShared
{ {
friend class TQValueList<KSharedConfig*>; friend class TQValueList<TDESharedConfig*>;
public: public:
typedef KSharedPtr<KSharedConfig> Ptr; typedef TDESharedPtr<TDESharedConfig> Ptr;
public: public:
/** /**
@ -283,14 +283,14 @@ public:
* @param readOnly set the config object's read-only status * @param readOnly set the config object's read-only status
* @param bUseKDEGlobals Toggle reading the global KDE configuration file. * @param bUseKDEGlobals Toggle reading the global KDE configuration file.
*/ */
static KSharedConfig::Ptr openConfig(const TQString& fileName, bool readOnly = false, static TDESharedConfig::Ptr openConfig(const TQString& fileName, bool readOnly = false,
bool bUseKDEGlobals = true); bool bUseKDEGlobals = true);
private: private:
KSharedConfig( const TQString& fileName, bool readOnly, bool useKDEGlobals ); TDESharedConfig( const TQString& fileName, bool readOnly, bool useKDEGlobals );
~KSharedConfig(); ~TDESharedConfig();
static TQValueList<KSharedConfig*> *s_list; static TQValueList<TDESharedConfig*> *s_list;
}; };
#endif #endif

@ -1220,7 +1220,7 @@ int main( int argc, char **argv )
if ( !singleton ) { if ( !singleton ) {
h << " " << className << "("; h << " " << className << "(";
if (cfgFileNameArg) if (cfgFileNameArg)
h << " KSharedConfig::Ptr config" << (parameters.isEmpty() ? " = TDEGlobal::sharedConfig()" : ", "); h << " TDESharedConfig::Ptr config" << (parameters.isEmpty() ? " = TDEGlobal::sharedConfig()" : ", ");
for (TQValueList<Param>::ConstIterator it = parameters.begin(); for (TQValueList<Param>::ConstIterator it = parameters.begin();
it != parameters.end(); ++it) it != parameters.end(); ++it)
{ {
@ -1502,7 +1502,7 @@ int main( int argc, char **argv )
cpp << className << "::" << className << "( "; cpp << className << "::" << className << "( ";
if ( cfgFileNameArg ) { if ( cfgFileNameArg ) {
if ( !singleton ) if ( !singleton )
cpp << " KSharedConfig::Ptr config"; cpp << " TDESharedConfig::Ptr config";
else else
cpp << " const char *config"; cpp << " const char *config";
cpp << (parameters.isEmpty() ? " " : ", "); cpp << (parameters.isEmpty() ? " " : ", ");

@ -3,7 +3,7 @@
#include "test8a.h" #include "test8a.h"
Test8a::Test8a( KSharedConfig::Ptr config ) Test8a::Test8a( TDESharedConfig::Ptr config )
: TDEConfigSkeleton( config ) : TDEConfigSkeleton( config )
{ {
setCurrentGroup( TQString::fromLatin1( "Group" ) ); setCurrentGroup( TQString::fromLatin1( "Group" ) );

@ -11,7 +11,7 @@ class Test8a : public TDEConfigSkeleton
{ {
public: public:
Test8a( KSharedConfig::Ptr config = TDEGlobal::sharedConfig() ); Test8a( TDESharedConfig::Ptr config = TDEGlobal::sharedConfig() );
~Test8a(); ~Test8a();
/** /**

@ -26,7 +26,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
int main( int, char*[] ) int main( int, char*[] )
{ {
TDEInstance i("test"); TDEInstance i("test");
Test8a *config1 = new Test8a( KSharedConfig::openConfig( TQString::null ) ); Test8a *config1 = new Test8a( TDESharedConfig::openConfig( TQString::null ) );
Test8a *config2 = new Test8a(); Test8a *config2 = new Test8a();
Test8b::self(); Test8b::self();
delete config1; delete config1;

@ -48,7 +48,7 @@ class TDEConfigBackEndPrivate;
class TDECORE_EXPORT TDEConfigBackEnd class TDECORE_EXPORT TDEConfigBackEnd
{ {
friend class TDEConfig; friend class TDEConfig;
friend class KSharedConfig; friend class TDESharedConfig;
public: public:
/** /**
* Constructs a configuration back end. * Constructs a configuration back end.

@ -46,7 +46,7 @@ class TDEConfigGroup;
* abstract base class, meaning that you cannot directly instantiate * abstract base class, meaning that you cannot directly instantiate
* objects of this class. Either use TDEConfig (for usual %KDE * objects of this class. Either use TDEConfig (for usual %KDE
* configuration) or KSimpleConfig (for special needs as in ksamba), or * configuration) or KSimpleConfig (for special needs as in ksamba), or
* even KSharedConfig (stores values in shared memory). * even TDESharedConfig (stores values in shared memory).
* *
* All configuration entries are key, value pairs. Each entry also * All configuration entries are key, value pairs. Each entry also
* belongs to a specific group of related entries. All configuration * belongs to a specific group of related entries. All configuration
@ -65,7 +65,7 @@ class TDEConfigGroup;
* @see TDEGlobal#config() * @see TDEGlobal#config()
* @see TDEConfig * @see TDEConfig
* @see KSimpleConfig * @see KSimpleConfig
* @see KSharedConfig * @see TDESharedConfig
*/ */
class TDECORE_EXPORT TDEConfigBase : public TQObject class TDECORE_EXPORT TDEConfigBase : public TQObject
{ {

@ -885,7 +885,7 @@ TDEConfigSkeleton::TDEConfigSkeleton( const TQString &configname )
if ( !configname.isEmpty() ) if ( !configname.isEmpty() )
{ {
mConfig = KSharedConfig::openConfig( configname ); mConfig = TDESharedConfig::openConfig( configname );
} }
else else
{ {
@ -893,7 +893,7 @@ TDEConfigSkeleton::TDEConfigSkeleton( const TQString &configname )
} }
} }
TDEConfigSkeleton::TDEConfigSkeleton(KSharedConfig::Ptr config) TDEConfigSkeleton::TDEConfigSkeleton(TDESharedConfig::Ptr config)
: mCurrentGroup( "No Group" ), mUseDefaults(false) : mCurrentGroup( "No Group" ), mUseDefaults(false)
{ {
kdDebug(177) << "Creating TDEConfigSkeleton (" << (void *)this << ")" << endl; kdDebug(177) << "Creating TDEConfigSkeleton (" << (void *)this << ")" << endl;

@ -800,7 +800,7 @@ public:
* *
* @param config configuration object to use. * @param config configuration object to use.
*/ */
TDEConfigSkeleton(KSharedConfig::Ptr config); TDEConfigSkeleton(TDESharedConfig::Ptr config);
/** /**
* Destructor * Destructor
@ -1215,7 +1215,7 @@ protected:
private: private:
TQString mCurrentGroup; TQString mCurrentGroup;
KSharedConfig::Ptr mConfig; // pointer to TDEConfig object TDESharedConfig::Ptr mConfig; // pointer to TDEConfig object
TDEConfigSkeletonItem::List mItems; TDEConfigSkeletonItem::List mItems;
TDEConfigSkeletonItem::Dict mItemDict; TDEConfigSkeletonItem::Dict mItemDict;

@ -34,7 +34,7 @@ class TQDataStream;
* @internal * @internal
* @see http://developer.kde.org/documentation/library/kdeqt/trinityarch/tdesycoca.html * @see http://developer.kde.org/documentation/library/kdeqt/trinityarch/tdesycoca.html
*/ */
class TDECORE_EXPORT KSycocaEntry : public KShared class TDECORE_EXPORT KSycocaEntry : public TDEShared
{ {
public: public:
@ -42,7 +42,7 @@ public:
virtual KSycocaType sycocaType() const { return KST_KSycocaEntry; } virtual KSycocaType sycocaType() const { return KST_KSycocaEntry; }
public: public:
typedef KSharedPtr<KSycocaEntry> Ptr; typedef TDESharedPtr<KSycocaEntry> Ptr;
typedef TQValueList<Ptr> List; typedef TQValueList<Ptr> List;
public: // KDoc seems to barf on those typedefs and generates no docs after them public: // KDoc seems to barf on those typedefs and generates no docs after them
/** /**

@ -26,7 +26,7 @@
#include <kdebug.h> #include <kdebug.h>
template class TQDict<KSycocaEntry>; template class TQDict<KSycocaEntry>;
template class TQDict<KSharedPtr<KSycocaEntry> >; template class TQDict<TDESharedPtr<KSycocaEntry> >;
KSycocaFactory::KSycocaFactory(KSycocaFactoryId factory_id) KSycocaFactory::KSycocaFactory(KSycocaFactoryId factory_id)
: m_resourceList(0), m_entryDict(0), m_sycocaDict(0) : m_resourceList(0), m_entryDict(0), m_sycocaDict(0)

@ -20,7 +20,7 @@ class TDEIO_EXPORT KImageIOFormat : public KSycocaEntry
K_SYCOCATYPE( KST_KImageIOFormat, KSycocaEntry ) K_SYCOCATYPE( KST_KImageIOFormat, KSycocaEntry )
public: public:
typedef KSharedPtr<KImageIOFormat> Ptr; typedef TDESharedPtr<KImageIOFormat> Ptr;
typedef TQValueList<Ptr> List; typedef TQValueList<Ptr> List;
public: // KDoc seems to barf on those typedefs and generates no docs after them public: // KDoc seems to barf on those typedefs and generates no docs after them
/** /**

@ -59,7 +59,7 @@
#include <tdesycoca.h> #include <tdesycoca.h>
#include <kde_file.h> #include <kde_file.h>
template class KSharedPtr<KMimeType>; template class TDESharedPtr<KMimeType>;
template class TQValueList<KMimeType::Ptr>; template class TQValueList<KMimeType::Ptr>;
KMimeType::Ptr KMimeType::s_pDefaultType = 0L; KMimeType::Ptr KMimeType::s_pDefaultType = 0L;

@ -49,7 +49,7 @@ class TDEIO_EXPORT KMimeType : public KServiceType
K_SYCOCATYPE( KST_KMimeType, KServiceType ) K_SYCOCATYPE( KST_KMimeType, KServiceType )
public: public:
typedef KSharedPtr<KMimeType> Ptr; typedef TDESharedPtr<KMimeType> Ptr;
typedef TQValueList<Ptr> List; typedef TQValueList<Ptr> List;
public: public:
/** /**

@ -47,7 +47,7 @@ class TDEIO_EXPORT KProtocolInfo : public KSycocaEntry
K_SYCOCATYPE( KST_KProtocolInfo, KSycocaEntry ) K_SYCOCATYPE( KST_KProtocolInfo, KSycocaEntry )
public: public:
typedef KSharedPtr<KProtocolInfo> Ptr; typedef TDESharedPtr<KProtocolInfo> Ptr;
public: public:
/** /**

@ -52,7 +52,7 @@ class TDEIO_EXPORT KService : public KSycocaEntry
friend class KBuildSycoca; friend class KBuildSycoca;
public: public:
typedef KSharedPtr<KService> Ptr; typedef TDESharedPtr<KService> Ptr;
typedef TQValueList<Ptr> List; typedef TQValueList<Ptr> List;
public: public:
/** /**

@ -71,8 +71,8 @@ class TDEIO_EXPORT KServiceGroup : public KSycocaEntry
K_SYCOCATYPE( KST_KServiceGroup, KSycocaEntry ) K_SYCOCATYPE( KST_KServiceGroup, KSycocaEntry )
public: public:
typedef KSharedPtr<KServiceGroup> Ptr; typedef TDESharedPtr<KServiceGroup> Ptr;
typedef KSharedPtr<KSycocaEntry> SPtr; typedef TDESharedPtr<KSycocaEntry> SPtr;
typedef TQValueList<SPtr> List; typedef TQValueList<SPtr> List;
public: public:
/** /**
@ -332,7 +332,7 @@ class TDEIO_EXPORT KServiceSeparator : public KSycocaEntry
K_SYCOCATYPE( KST_KServiceSeparator, KSycocaEntry ) K_SYCOCATYPE( KST_KServiceSeparator, KSycocaEntry )
public: public:
typedef KSharedPtr<KServiceSeparator> Ptr; typedef TDESharedPtr<KServiceSeparator> Ptr;
public: public:
/** /**
* Construct a service separator * Construct a service separator

@ -47,7 +47,7 @@ class TDEIO_EXPORT KServiceType : public KSycocaEntry
K_SYCOCATYPE( KST_KServiceType, KSycocaEntry ) K_SYCOCATYPE( KST_KServiceType, KSycocaEntry )
public: public:
typedef KSharedPtr<KServiceType> Ptr; typedef TDESharedPtr<KServiceType> Ptr;
typedef TQValueList<Ptr> List; typedef TQValueList<Ptr> List;
public: public:

@ -120,10 +120,10 @@ public:
/** /**
* @internal * @internal
*/ */
class TDEIO_EXPORT ParseTreeBase : public KShared class TDEIO_EXPORT ParseTreeBase : public TDEShared
{ {
public: public:
typedef KSharedPtr<ParseTreeBase> Ptr; typedef TDESharedPtr<ParseTreeBase> Ptr;
ParseTreeBase() { } ParseTreeBase() { }
virtual bool eval( ParseContext *_context ) const = 0; virtual bool eval( ParseContext *_context ) const = 0;

@ -1698,7 +1698,7 @@ private:
KFilePlugin* plugin; KFilePlugin* plugin;
KFileMimeTypeInfo* mimeTypeInfo; KFileMimeTypeInfo* mimeTypeInfo;
// The problem here is that plugin can be shared in multiple instances, // The problem here is that plugin can be shared in multiple instances,
// so the memory management isn't easy. KDE4 solution: use KSharedPtr? // so the memory management isn't easy. KDE4 solution: use TDESharedPtr?
// For now we flag one copy of the KFilePlugin pointer as being "owned". // For now we flag one copy of the KFilePlugin pointer as being "owned".
bool ownsPlugin; bool ownsPlugin;
}; };

@ -45,7 +45,7 @@
namespace KRES { namespace KRES {
ResourcePageInfo::ResourcePageInfo() : KShared() { ResourcePageInfo::ResourcePageInfo() : TDEShared() {
mManager = 0L; mManager = 0L;
mConfig = 0L; mConfig = 0L;
} }
@ -153,7 +153,7 @@ ConfigPage::ConfigPage( TQWidget *parent, const char *name )
ConfigPage::~ConfigPage() ConfigPage::~ConfigPage()
{ {
TQValueList<KSharedPtr<ResourcePageInfo> >::Iterator it; TQValueList<TDESharedPtr<ResourcePageInfo> >::Iterator it;
for ( it = mInfoMap.begin(); it != mInfoMap.end(); ++it ) { for ( it = mInfoMap.begin(); it != mInfoMap.end(); ++it ) {
(*it)->mManager->removeObserver( this ); (*it)->mManager->removeObserver( this );
} }
@ -226,7 +226,7 @@ void ConfigPage::loadManager( const TQString& family )
info->mConfig = new TDEConfig( KRES::ManagerImpl::defaultConfigFile( family ) ); info->mConfig = new TDEConfig( KRES::ManagerImpl::defaultConfigFile( family ) );
info->mManager->readConfig( info->mConfig ); info->mManager->readConfig( info->mConfig );
mInfoMap.append( KSharedPtr<ResourcePageInfo>(info) ); mInfoMap.append( TDESharedPtr<ResourcePageInfo>(info) );
} }
} }
@ -234,7 +234,7 @@ void ConfigPage::save()
{ {
saveResourceSettings(); saveResourceSettings();
TQValueList<KSharedPtr<ResourcePageInfo> >::Iterator it; TQValueList<TDESharedPtr<ResourcePageInfo> >::Iterator it;
for ( it = mInfoMap.begin(); it != mInfoMap.end(); ++it ) for ( it = mInfoMap.begin(); it != mInfoMap.end(); ++it )
(*it)->mManager->writeConfig( (*it)->mConfig ); (*it)->mManager->writeConfig( (*it)->mConfig );

@ -37,7 +37,7 @@ class TQPushButton;
namespace KRES { namespace KRES {
class TDERESOURCES_EXPORT ResourcePageInfo : public KShared class TDERESOURCES_EXPORT ResourcePageInfo : public TDEShared
{ {
public: public:
ResourcePageInfo(); ResourcePageInfo();
@ -93,7 +93,7 @@ class TDERESOURCES_EXPORT ConfigPage : public TQWidget, public ManagerObserver<R
TDEConfig* mConfig; TDEConfig* mConfig;
TQString mFamily; TQString mFamily;
TQStringList mFamilyMap; TQStringList mFamilyMap;
TQValueList<KSharedPtr<ResourcePageInfo> > mInfoMap; TQValueList<TDESharedPtr<ResourcePageInfo> > mInfoMap;
KComboBox* mFamilyCombo; KComboBox* mFamilyCombo;
KListView* mListView; KListView* mListView;

@ -9,7 +9,7 @@ Dictionaries are abstracted in the KSpell::Dictionary object which
encapsulates all spell-checking functionality. encapsulates all spell-checking functionality.
You'll notice that the Broker is being created via the You'll notice that the Broker is being created via the
Broker::Ptr Broker::openBroker( KSharedConfig *config =0 ); Broker::Ptr Broker::openBroker( TDESharedConfig *config =0 );
call. The Broker is a shared object and the reason for this construct call. The Broker is a shared object and the reason for this construct
is very simple: is very simple:
- most application would need to have a few Broker objects (one for - most application would need to have a few Broker objects (one for

@ -56,11 +56,11 @@ public:
TQPtrDict<Broker> *Broker::s_brokers = 0; TQPtrDict<Broker> *Broker::s_brokers = 0;
Broker *Broker::openBroker( KSharedConfig *config ) Broker *Broker::openBroker( TDESharedConfig *config )
{ {
KSharedConfig::Ptr preventDeletion; TDESharedConfig::Ptr preventDeletion;
if ( !config ) { if ( !config ) {
preventDeletion = KSharedConfig::openConfig( DEFAULT_CONFIG_FILE ); preventDeletion = TDESharedConfig::openConfig( DEFAULT_CONFIG_FILE );
} else } else
preventDeletion = config; preventDeletion = config;
@ -74,9 +74,9 @@ Broker *Broker::openBroker( KSharedConfig *config )
return broker; return broker;
} }
Broker::Broker( KSharedConfig *config ) Broker::Broker( TDESharedConfig *config )
{ {
KSharedConfig::Ptr preventDeletion( config ); TDESharedConfig::Ptr preventDeletion( config );
Q_UNUSED( preventDeletion ); Q_UNUSED( preventDeletion );
if ( !s_brokers ) if ( !s_brokers )

@ -28,7 +28,7 @@
#include <tqstringlist.h> #include <tqstringlist.h>
#include <tqstring.h> #include <tqstring.h>
class KSharedConfig; class TDESharedConfig;
template <typename T> template <typename T>
class TQPtrDict; class TQPtrDict;
@ -46,11 +46,11 @@ namespace KSpell2
* of the KSpell2 architecture. * of the KSpell2 architecture.
*/ */
class KDE_EXPORT Broker : public TQObject, class KDE_EXPORT Broker : public TQObject,
public KShared public TDEShared
{ {
Q_OBJECT Q_OBJECT
public: public:
typedef KSharedPtr<Broker> Ptr; typedef TDESharedPtr<Broker> Ptr;
/** /**
* Constructs the broker. * Constructs the broker.
* *
@ -65,7 +65,7 @@ namespace KSpell2
* and default client values. If no value will * and default client values. If no value will
* be passed Broker will use global tdespellrc file. * be passed Broker will use global tdespellrc file.
*/ */
static Broker *openBroker( KSharedConfig *config = 0 ); static Broker *openBroker( TDESharedConfig *config = 0 );
public: public:
~Broker(); ~Broker();
@ -122,7 +122,7 @@ namespace KSpell2
friend class Settings; friend class Settings;
void changed(); void changed();
private: private:
Broker( KSharedConfig *config ); Broker( TDESharedConfig *config );
void loadPlugins(); void loadPlugins();
void loadPlugin( const TQString& ); void loadPlugin( const TQString& );
private: private:

@ -37,7 +37,7 @@ class Settings::Private
{ {
public: public:
Broker* broker; //can't be a Ptr since we don't want to hold a ref on it Broker* broker; //can't be a Ptr since we don't want to hold a ref on it
KSharedConfig::Ptr config; TDESharedConfig::Ptr config;
bool modified; bool modified;
TQString defaultLanguage; TQString defaultLanguage;
@ -50,7 +50,7 @@ public:
TQMap<TQString, bool> ignore; TQMap<TQString, bool> ignore;
}; };
Settings::Settings( Broker *broker, KSharedConfig *config ) Settings::Settings( Broker *broker, TDESharedConfig *config )
{ {
d = new Private; d = new Private;
d->broker = broker; d->broker = broker;
@ -67,7 +67,7 @@ Settings::~Settings()
delete d; d = 0; delete d; d = 0;
} }
KSharedConfig *Settings::sharedConfig() const TDESharedConfig *Settings::sharedConfig() const
{ {
return d->config; return d->config;
} }

@ -26,7 +26,7 @@
#include <tqstring.h> #include <tqstring.h>
#include <tdelibs_export.h> #include <tdelibs_export.h>
class KSharedConfig; class TDESharedConfig;
namespace KSpell2 namespace KSpell2
{ {
@ -59,7 +59,7 @@ namespace KSpell2
void save(); void save();
KSharedConfig *sharedConfig() const; TDESharedConfig *sharedConfig() const;
private: private:
void loadConfig(); void loadConfig();
@ -68,7 +68,7 @@ namespace KSpell2
private: private:
friend class Broker; friend class Broker;
Settings( Broker *broker, KSharedConfig *config ); Settings( Broker *broker, TDESharedConfig *config );
private: private:
class Private; class Private;
Private *d; Private *d;

@ -51,7 +51,7 @@ Highlighter::Highlighter( TQTextEdit *textEdit,
d = new Private; d = new Private;
d->filter = filter; d->filter = filter;
if ( !configFile.isEmpty() ) if ( !configFile.isEmpty() )
d->broker = Broker::openBroker( KSharedConfig::openConfig( configFile ) ); d->broker = Broker::openBroker( TDESharedConfig::openConfig( configFile ) );
else else
d->broker = Broker::openBroker(); d->broker = Broker::openBroker();

@ -37,7 +37,7 @@ public:
{} {}
const TQPopupMenu* customMenu; const TQPopupMenu* customMenu;
KSharedConfig::Ptr sharedConfig; TDESharedConfig::Ptr sharedConfig;
TQPtrList<TQObject> watchedForFocus; TQPtrList<TQObject> watchedForFocus;
bool hasFocus; bool hasFocus;
}; };
@ -60,7 +60,7 @@ KPanelApplet::KPanelApplet(const TQString& configFile, Type type,
} }
setBackgroundOrigin( AncestorOrigin ); setBackgroundOrigin( AncestorOrigin );
d->sharedConfig = KSharedConfig::openConfig(configFile, kapp && kapp->config()->isImmutable()); d->sharedConfig = TDESharedConfig::openConfig(configFile, kapp && kapp->config()->isImmutable());
_config = d->sharedConfig; _config = d->sharedConfig;
} }
@ -188,7 +188,7 @@ bool KPanelApplet::eventFilter(TQObject *o, TQEvent * e)
return TQFrame::eventFilter(o, e); return TQFrame::eventFilter(o, e);
} }
KSharedConfig::Ptr KPanelApplet::sharedConfig() const TDESharedConfig::Ptr KPanelApplet::sharedConfig() const
{ {
return d->sharedConfig; return d->sharedConfig;
} }

@ -185,7 +185,7 @@ public:
* called \<appletname\>\<instanceid\>rc in the user's local %KDE directory. * called \<appletname\>\<instanceid\>rc in the user's local %KDE directory.
**/ **/
TDEConfig* config() const { return _config; } TDEConfig* config() const { return _config; }
KSharedConfig::Ptr sharedConfig() const; TDESharedConfig::Ptr sharedConfig() const;
/** /**
* @return Type indicating the applet's type. * @return Type indicating the applet's type.

@ -61,7 +61,7 @@ void KRootPixmap::init()
m_Fade = 0; m_Fade = 0;
m_BlurRadius = 0; m_BlurRadius = 0;
m_BlurSigma = 0; m_BlurSigma = 0;
m_pPixmap = new KSharedPixmap; //ordinary KPixmap on win32 m_pPixmap = new TDESharedPixmap; //ordinary KPixmap on win32
m_pTimer = new TQTimer( this ); m_pTimer = new TQTimer( this );
m_bInit = false; m_bInit = false;
m_bActive = false; m_bActive = false;
@ -238,7 +238,7 @@ void KRootPixmap::repaint(bool force)
m_Desk = currentDesktop(); m_Desk = currentDesktop();
} }
// KSharedPixmap will correctly generate a tile for us. // TDESharedPixmap will correctly generate a tile for us.
m_pPixmap->loadFromShared(pixmapName(m_Desk), m_Rect); m_pPixmap->loadFromShared(pixmapName(m_Desk), m_Rect);
#else #else
m_Desk = currentDesktop(); m_Desk = currentDesktop();
@ -308,7 +308,7 @@ void KRootPixmap::slotDone(bool success)
updateBackground( m_pPixmap ); updateBackground( m_pPixmap );
} }
void KRootPixmap::updateBackground( KSharedPixmap *spm ) void KRootPixmap::updateBackground( TDESharedPixmap *spm )
{ {
TQPixmap pm = *spm; TQPixmap pm = *spm;

@ -20,7 +20,7 @@
class TQRect; class TQRect;
class TQWidget; class TQWidget;
class TQTimer; class TQTimer;
class KSharedPixmap; class TDESharedPixmap;
class KRootPixmapData; class KRootPixmapData;
/** /**
@ -37,7 +37,7 @@ class KRootPixmapData;
* Instead of using the default behavior, you can ask KRootPixmap * Instead of using the default behavior, you can ask KRootPixmap
* to emit a backgroundUpdated(const TQPixmap &) signal whenever * to emit a backgroundUpdated(const TQPixmap &) signal whenever
* the background needs updating by using setCustomPainting(bool). * the background needs updating by using setCustomPainting(bool).
* Alternatively by reimplementing updateBackground(KSharedPixmap*) * Alternatively by reimplementing updateBackground(TDESharedPixmap*)
* you can take complete control of the behavior. * you can take complete control of the behavior.
* *
* @author Geert Jansen <jansen@kde.org> * @author Geert Jansen <jansen@kde.org>
@ -179,7 +179,7 @@ public slots:
void setCustomPainting( bool enable ) { m_bCustomPaint = enable; } void setCustomPainting( bool enable ) { m_bCustomPaint = enable; }
/** /**
* Asks KDesktop to export the desktop background as a KSharedPixmap. * Asks KDesktop to export the desktop background as a TDESharedPixmap.
* This method uses DCOP to call KBackgroundIface/setExport(int). * This method uses DCOP to call KBackgroundIface/setExport(int).
*/ */
void enableExports(); void enableExports();
@ -209,7 +209,7 @@ protected:
* applies the fade effect, then sets the target's background, or emits * applies the fade effect, then sets the target's background, or emits
* backgroundUpdated(const TQPixmap &) depending on the painting mode. * backgroundUpdated(const TQPixmap &) depending on the painting mode.
*/ */
virtual void updateBackground( KSharedPixmap * ); virtual void updateBackground( TDESharedPixmap * );
private slots: private slots:
void slotBackgroundChanged(int); void slotBackgroundChanged(int);
@ -229,7 +229,7 @@ private:
TQRect m_Rect; TQRect m_Rect;
TQWidget *m_pWidget; TQWidget *m_pWidget;
TQTimer *m_pTimer; TQTimer *m_pTimer;
KSharedPixmap *m_pPixmap; TDESharedPixmap *m_pPixmap;
KRootPixmapData *d; KRootPixmapData *d;
void init(); void init();

@ -49,10 +49,10 @@
#undef FocusOut #undef FocusOut
/** /**
* KSharedPixmap * TDESharedPixmap
*/ */
class KSharedPixmapPrivate class TDESharedPixmapPrivate
{ {
public: public:
Atom pixmap; Atom pixmap;
@ -61,21 +61,21 @@ public:
TQRect rect; TQRect rect;
}; };
KSharedPixmap::KSharedPixmap() TDESharedPixmap::TDESharedPixmap()
: TQWidget(0L, "shpixmap comm window") : TQWidget(0L, "shpixmap comm window")
{ {
d = new KSharedPixmapPrivate; d = new TDESharedPixmapPrivate;
init(); init();
} }
KSharedPixmap::~KSharedPixmap() TDESharedPixmap::~TDESharedPixmap()
{ {
delete d; delete d;
} }
void KSharedPixmap::init() void TDESharedPixmap::init()
{ {
d->pixmap = XInternAtom(tqt_xdisplay(), "PIXMAP", false); d->pixmap = XInternAtom(tqt_xdisplay(), "PIXMAP", false);
TQCString atom; TQCString atom;
@ -85,7 +85,7 @@ void KSharedPixmap::init()
} }
bool KSharedPixmap::isAvailable(const TQString & name) const bool TDESharedPixmap::isAvailable(const TQString & name) const
{ {
TQString str = TQString("KDESHPIXMAP:%1").arg(name); TQString str = TQString("KDESHPIXMAP:%1").arg(name);
Atom sel = XInternAtom(tqt_xdisplay(), str.latin1(), true); Atom sel = XInternAtom(tqt_xdisplay(), str.latin1(), true);
@ -95,7 +95,7 @@ bool KSharedPixmap::isAvailable(const TQString & name) const
} }
bool KSharedPixmap::loadFromShared(const TQString & name, const TQRect & rect) bool TDESharedPixmap::loadFromShared(const TQString & name, const TQRect & rect)
{ {
d->rect = rect; d->rect = rect;
if (d->selection != None) if (d->selection != None)
@ -120,7 +120,7 @@ bool KSharedPixmap::loadFromShared(const TQString & name, const TQRect & rect)
} }
bool KSharedPixmap::x11Event(XEvent *event) bool TDESharedPixmap::x11Event(XEvent *event)
{ {
if (event->type != SelectionNotify) if (event->type != SelectionNotify)
return false; return false;

@ -11,8 +11,8 @@
* version 2 of the License, or (at your option) any later version. * version 2 of the License, or (at your option) any later version.
*/ */
#ifndef __KSharedPixmap_h_Included__ #ifndef __TDESharedPixmap_h_Included__
#define __KSharedPixmap_h_Included__ #define __TDESharedPixmap_h_Included__
#include <kpixmap.h> #include <kpixmap.h>
@ -26,7 +26,7 @@
#include <tqpixmap.h> #include <tqpixmap.h>
#include <tqwidget.h> #include <tqwidget.h>
class KSharedPixmapPrivate; class TDESharedPixmapPrivate;
/** /**
* Shared pixmap client. * Shared pixmap client.
@ -35,7 +35,7 @@ class KSharedPixmapPrivate;
* by a global id string, and can be accessed by all X clients. * by a global id string, and can be accessed by all X clients.
* *
* This class is a client class to shared pixmaps in KDE. You can use it * This class is a client class to shared pixmaps in KDE. You can use it
* to copy (a part of) a shared pixmap into. KSharedPixmap inherits KPixmap * to copy (a part of) a shared pixmap into. TDESharedPixmap inherits KPixmap
* for that purpose. * for that purpose.
* *
* The server part of shared pixmaps is not implemented here. * The server part of shared pixmaps is not implemented here.
@ -44,7 +44,7 @@ class KSharedPixmapPrivate;
* *
* An example: copy from a shared pixmap: * An example: copy from a shared pixmap:
* \code * \code
* KSharedPixmap *pm = new KSharedPixmap; * TDESharedPixmap *pm = new TDESharedPixmap;
* connect(pm, TQT_SIGNAL(done(bool)), TQT_SLOT(slotDone(bool))); * connect(pm, TQT_SIGNAL(done(bool)), TQT_SLOT(slotDone(bool)));
* pm->loadFromShared("My Pixmap"); * pm->loadFromShared("My Pixmap");
* \endcode * \endcode
@ -53,7 +53,7 @@ class KSharedPixmapPrivate;
* @version $Id$ * @version $Id$
* *
*/ */
class TDEUI_EXPORT KSharedPixmap: class TDEUI_EXPORT TDESharedPixmap:
public TQWidget, public TQWidget,
public KPixmap public KPixmap
{ {
@ -65,12 +65,12 @@ public:
/** /**
* Construct an empty pixmap. * Construct an empty pixmap.
*/ */
KSharedPixmap(); TDESharedPixmap();
/** /**
* Destroys the pixmap. * Destroys the pixmap.
*/ */
~KSharedPixmap(); ~TDESharedPixmap();
/** /**
* Load from a shared pixmap reference. The signal done() is emitted * Load from a shared pixmap reference. The signal done() is emitted
@ -80,7 +80,7 @@ public:
* @param rect If you pass a nonzero rectangle, a tile is generated which * @param rect If you pass a nonzero rectangle, a tile is generated which
* is able to fill up the specified rectangle completely. This is solely * is able to fill up the specified rectangle completely. This is solely
* for optimization: in some cases the tile will be much smaller than the * for optimization: in some cases the tile will be much smaller than the
* original pixmap. It reflects KSharedPixmap's original use: sharing * original pixmap. It reflects TDESharedPixmap's original use: sharing
* of the desktop background to achieve pseudo transparency. * of the desktop background to achieve pseudo transparency.
* @return True if the shared pixmap exists and loading has started * @return True if the shared pixmap exists and loading has started
* successfully, false otherwise. * successfully, false otherwise.
@ -110,11 +110,11 @@ private:
bool copy(const TQString & id, const TQRect & rect); bool copy(const TQString & id, const TQRect & rect);
void init(); void init();
KSharedPixmapPrivate *d; TDESharedPixmapPrivate *d;
}; };
#else // WIN32, Qt Embedded #else // WIN32, Qt Embedded
// Let's simply assume KPixmap will do for now. Yes, I know that's broken. // Let's simply assume KPixmap will do for now. Yes, I know that's broken.
#define KSharedPixmap KPixmap #define TDESharedPixmap KPixmap
#endif #endif
#endif #endif

@ -132,7 +132,7 @@ public:
// changed from name() to avoid ambiguity with TQObject::name() on multiple inheritance // changed from name() to avoid ambiguity with TQObject::name() on multiple inheritance
/** /**
* @return a KSharedPtr to KService created from the modules .desktop file * @return a TDESharedPtr to KService created from the modules .desktop file
*/ */
KService::Ptr service() const { return _service; } KService::Ptr service() const { return _service; }

Loading…
Cancel
Save