Browse Source

Rename KShared

pull/1/head
Timothy Pearson 10 years ago
parent
commit
8f78d8aa94
  1. 2
      ChangeLog.2001-4
  2. 2
      THANKS
  3. 2
      configure.py
  4. 4
      doc/classref/allclasses.html
  5. 2
      doc/classref/kio/KSycocaEntry.html
  6. 2
      doc/classref/tdecore/KLockFile.html
  7. 2
      doc/classref/tdecore/KMountPoint.html
  8. 24
      doc/classref/tdecore/KShared.html
  9. 16
      doc/classref/tdecore/KSharedConfig.html
  10. 2
      doc/classref/tdecore/KTimezone.html
  11. 2
      doc/classref/tdecore/KTimezoneSource.html
  12. 2
      doc/classref/tdecore/TDEConfigSkeleton.html
  13. 2
      doc/classref/tdecore/TDEGlobal.html
  14. 2
      doc/classref/tdecore/TDEInstance.html
  15. 4
      doc/classref/tdecore/index.html
  16. 2
      doc/classref/tderesources/KRES.ResourcePageInfo.html
  17. 2
      doc/classref/tdeui/KPanelApplet.html
  18. 10
      doc/classref/tdeui/KSharedPixmap.html
  19. 2
      examples/README
  20. 4
      examples/mimetype.py
  21. 4
      examples/pytde-sampler/qt_widgets/CONTRIB
  22. 2
      examples/uimodules/uimisc.py
  23. 2
      examples/uisampler.py
  24. 66
      extra/kde320/ksharedptr.h
  25. 66
      extra/kde321/ksharedptr.h
  26. 66
      extra/kde322/ksharedptr.h
  27. 66
      extra/kde323/ksharedptr.h
  28. 68
      extra/kde330/ksharedptr.h
  29. 68
      extra/kde331/ksharedptr.h
  30. 68
      extra/kde332/ksharedptr.h
  31. 68
      extra/kde340/ksharedptr.h
  32. 68
      extra/kde341/ksharedptr.h
  33. 68
      extra/kde342/ksharedptr.h
  34. 68
      extra/kde343/ksharedptr.h
  35. 68
      extra/kde350/ksharedptr.h
  36. 68
      extra/kde351/ksharedptr.h
  37. 68
      extra/kde352/ksharedptr.h
  38. 68
      extra/kde353/ksharedptr.h
  39. 6
      postproc
  40. 6
      sip/kio/kmimetype.sip
  41. 6
      sip/kio/kprotocolinfo.sip
  42. 14
      sip/kio/kservice.sip
  43. 14
      sip/kio/kservicegroup.sip
  44. 4
      sip/kio/kservicetype.sip
  45. 20
      sip/kio/tdesycocaentry.sip
  46. 2
      sip/tdecore/kglobal.sip
  47. 2
      sip/tdecore/kinstance.sip
  48. 8
      sip/tdecore/klockfile.sip
  49. 8
      sip/tdecore/kmountpoint.sip
  50. 16
      sip/tdecore/ksharedptr.sip
  51. 14
      sip/tdecore/ktimezones.sip
  52. 26
      sip/tdecore/tdeconfig.sip
  53. 2
      sip/tdecore/tdeconfigskeleton.sip
  54. 2
      sip/tderesources/configpage.sip
  55. 8
      sip/tdespell2/broker.sip
  56. 4
      sip/tdespell2/settings.sip
  57. 2
      sip/tdeui/kaboutapplication.sip
  58. 2
      sip/tdeui/kpanelapplet.sip
  59. 2
      sip/tdeui/krootpixmap.sip
  60. 6
      sip/tdeui/ksharedpixmap.sip

2
ChangeLog.2001-4

@ -139,7 +139,7 @@ fixes for gcc2.96 compatiblility
2002/3/11 11:01:00 jim
3.0beta1: versioning to KDE3.0beta2; mapped types
for KSharedPtr descendants; KParts modified - now
for TDESharedPtr descendants; KParts modified - now
works; KTrader added; support for long long added;
created PyKDE2generic and revised build system;
new examples; removed inaccessible member classes;

2
THANKS

@ -68,7 +68,7 @@ Jonathan Gardner, Hans-Peter Janssen, Marc Schmitt
(let me know if I've left out any names)
Daniel Naber
For bug reports and testing (KSharedPtr related)
For bug reports and testing (TDESharedPtr related)
Roberto Alsina
For an interim KDE3.1.1 compatible release

2
configure.py

@ -144,7 +144,7 @@ postProcess = {
["-p ", "tdecore", "-o", "fixSignal", "tdecorepart0.*"]],
# "tdesu": None,
"tdefx": None,
"tdeui": None, #[["-p ", "tdeui", "-o", "shpix", "siptdeuiKSharedPixmap.cpp"]],
"tdeui": None, #[["-p ", "tdeui", "-o", "shpix", "siptdeuiTDESharedPixmap.cpp"]],
"tderesources": None,
"kabc": None,
"kio": None,

4
doc/classref/allclasses.html

@ -680,8 +680,8 @@
<tr ><td><a href="tdeio/KServiceType.html">KServiceType</A></td></tr>
<tr ><td><a href="tdeio/KServiceTypeProfile.html">KServiceTypeProfile</A></td></tr>
<tr ><td><a href="tdecore/KSessionManaged.html">KSessionManaged</A></td></tr>
<tr ><td><a href="tdecore/KShared.html">KShared</A></td></tr>
<tr ><td><a href="tdecore/KSharedConfig.html">KSharedConfig</A></td></tr>
<tr ><td><a href="tdecore/TDEShared.html">TDEShared</A></td></tr>
<tr ><td><a href="tdecore/TDESharedConfig.html">TDESharedConfig</A></td></tr>
<tr ><td><a href="tdecore/KShell.html">KShell</A></td></tr>
<tr ><td><a href="tdeio/KShellCompletion.html">KShellCompletion</A></td></tr>
<tr ><td><a href="tdecore/KShellProcess.html">KShellProcess</A></td></tr>

2
doc/classref/kio/KSycocaEntry.html

@ -31,7 +31,7 @@
<td>KSycocaEntry <a href = "sip/glossary.html#abstract">(<i>abstract</i>)</a></td>
</tr>
<tr><td>Inherits</td>
<td>KShared </td>
<td>TDEShared </td>
</tr>
</table>
<h3>methods</h3><ul>

2
doc/classref/tdecore/KLockFile.html

@ -31,7 +31,7 @@
<td>KLockFile</td>
</tr>
<tr><td>Inherits</td>
<td>KShared </td>
<td>TDEShared </td>
</tr>
</table>
<h3>enums</h3><ul>

2
doc/classref/tdecore/KMountPoint.html

@ -31,7 +31,7 @@
<td>KMountPoint</td>
</tr>
<tr><td>Inherits</td>
<td>KShared </td>
<td>TDEShared </td>
</tr>
</table>
<h3>enums</h3><ul>

24
doc/classref/tdecore/KShared.html

@ -3,7 +3,7 @@
"http://www.w3.org/TR/html4/loose.dtd"">
<html>
<head>
<title>class KShared</title>
<title>class TDEShared</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta name="GENERATOR" content="wabbit dumphtml">
</head>
@ -12,7 +12,7 @@
<hr>
<table width="100%"><tr>
<td width ="70%">
<h1>class KShared</h1><hr>
<h1>class TDEShared</h1><hr>
</td>
<td width="30%" valign="top" align="right">
<table>
@ -28,32 +28,32 @@
<td width="30%" align=left>tdecore</td>
</tr>
<tr><td>Class</td>
<td>KShared</td>
<td>TDEShared</td>
</tr>
<tr><td>Inherits</td>
<td> </td>
</tr>
</table>
<h3>methods</h3><ul>
<li><b>KShared</b> ()
<table width = "100%"><tr><td width="50%" valign="top"><table><tr><td>returns <i>a KShared instance</i></td></tr>
<li><b>TDEShared</b> ()
<table width = "100%"><tr><td width="50%" valign="top"><table><tr><td>returns <i>a TDEShared instance</i></td></tr>
</table></td><td width="50%"><table><tr><td></td></tr></table></td></tr></table></li><hr>
<li><b>KShared</b> (a0)
<table width = "100%"><tr><td width="50%" valign="top"><table><tr><td>returns <i>a KShared instance</i></td></tr>
<li><b>TDEShared</b> (a0)
<table width = "100%"><tr><td width="50%" valign="top"><table><tr><td>returns <i>a TDEShared instance</i></td></tr>
</table><table><tr bgcolor="#fff0ff"><th>Argument</th><th>Type</th><th>Default</th></tr>
<tr><td>a0</td><td>KShared</td><td></td></tr>
<tr><td>a0</td><td>TDEShared</td><td></td></tr>
</table>
</td><td width="50%"><table><tr><td></td></tr></table></td></tr></table></li><hr>
<li><b>_KShared_count</b> ()
<li><b>_TDEShared_count</b> ()
<table width = "100%"><tr><td width="50%" valign="top"><table><tr><td>returns <i>(int)</i></td></tr>
</table></td><td width="50%"><table><tr><td></td></tr></table></td></tr></table></li><hr>
<li><b>_KShared_ref</b> ()
<li><b>_TDEShared_ref</b> ()
<table width = "100%"><tr><td width="50%" valign="top"><table><tr><td>returns <i>nothing</i></td></tr>
</table></td><td width="50%"><table><tr><td></td></tr></table></td></tr></table></li><hr>
<li><b>_KShared_unref</b> ()
<li><b>_TDEShared_unref</b> ()
<table width = "100%"><tr><td width="50%" valign="top"><table><tr><td>returns <i>nothing</i></td></tr>
</table></td><td width="50%"><table><tr><td></td></tr></table></td></tr></table></li><hr>
<li><b>~KShared</b> ()
<li><b>~TDEShared</b> ()
<table width = "100%"><tr><td width="50%" valign="top"><table><tr><td>returns <i>nothing</i></td></tr>
</table></td><td width="50%"><table><tr><td></td></tr></table></td></tr></table></li><hr>
</ul>

16
doc/classref/tdecore/KSharedConfig.html

@ -3,7 +3,7 @@
"http://www.w3.org/TR/html4/loose.dtd"">
<html>
<head>
<title>class KSharedConfig</title>
<title>class TDESharedConfig</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta name="GENERATOR" content="wabbit dumphtml">
</head>
@ -12,7 +12,7 @@
<hr>
<table width="100%"><tr>
<td width ="70%">
<h1>class KSharedConfig</h1><hr>
<h1>class TDESharedConfig</h1><hr>
</td>
<td width="30%" valign="top" align="right">
<table>
@ -28,15 +28,15 @@
<td width="30%" align=left>tdecore</td>
</tr>
<tr><td>Class</td>
<td>KSharedConfig</td>
<td>TDESharedConfig</td>
</tr>
<tr><td>Inherits</td>
<td>TDEConfig, KShared </td>
<td>TDEConfig, TDEShared </td>
</tr>
</table>
<h3>methods</h3><ul>
<li><b>KSharedConfig</b> (fileName, immutable, useKDEGlobals)
<table width = "100%"><tr><td width="50%" valign="top"><table><tr><td>returns <i>a KSharedConfig instance</i></td></tr>
<li><b>TDESharedConfig</b> (fileName, immutable, useKDEGlobals)
<table width = "100%"><tr><td width="50%" valign="top"><table><tr><td>returns <i>a TDESharedConfig instance</i></td></tr>
<tr><td>In versions KDE 3.2.0 and above only</td></tr>
</table><table><tr bgcolor="#fff0ff"><th>Argument</th><th>Type</th><th>Default</th></tr>
<tr><td>fileName</td><td>TQString</td><td></td></tr>
@ -45,7 +45,7 @@
</table>
</td><td width="50%"><table><tr><td></td></tr></table></td></tr></table></li><hr>
<li><b>openConfig</b> (fileName, immutable = 0, bUseKDEGlobals = 1)
<table width = "100%"><tr><td width="50%" valign="top"><table><tr><td>returns <i>(KSharedConfig.Ptr)</i></td></tr>
<table width = "100%"><tr><td width="50%" valign="top"><table><tr><td>returns <i>(TDESharedConfig.Ptr)</i></td></tr>
<tr><td>In versions KDE 3.2.0 and above only</td></tr>
<tr><td><i>static</i></td></tr>
</table><table><tr bgcolor="#fff0ff"><th>Argument</th><th>Type</th><th>Default</th></tr>
@ -54,7 +54,7 @@
<tr><td>bUseKDEGlobals</td><td>bool</td><td>1</td></tr>
</table>
</td><td width="50%"><table><tr><td></td></tr></table></td></tr></table></li><hr>
<li><b>~KSharedConfig</b> ()
<li><b>~TDESharedConfig</b> ()
<table width = "100%"><tr><td width="50%" valign="top"><table><tr><td>returns <i>nothing</i></td></tr>
<tr><td>In versions KDE 3.2.0 and above only</td></tr>
</table></td><td width="50%"><table><tr><td></td></tr></table></td></tr></table></li><hr>

2
doc/classref/tdecore/KTimezone.html

@ -39,7 +39,7 @@
<table width = "100%"><tr><td width="50%" valign="top"><table><tr><td>returns <i>a KTimezone instance</i></td></tr>
<tr><td>In versions KDE 3.5.0 and above only</td></tr>
</table><table><tr bgcolor="#fff0ff"><th>Argument</th><th>Type</th><th>Default</th></tr>
<tr><td>db</td><td>KSharedPtr<KTimezoneSource></td><td></td></tr>
<tr><td>db</td><td>TDESharedPtr<KTimezoneSource></td><td></td></tr>
<tr><td>name</td><td>TQString</td><td></td></tr>
<tr><td>countryCode</td><td>TQString</td><td>TQString ()</td></tr>
<tr><td>latitude</td><td>float</td><td>KTimezone .UNKNOWN</td></tr>

2
doc/classref/tdecore/KTimezoneSource.html

@ -31,7 +31,7 @@
<td>KTimezoneSource</td>
</tr>
<tr><td>Inherits</td>
<td>KShared </td>
<td>TDEShared </td>
</tr>
</table>
<h3>methods</h3><ul>

2
doc/classref/tdecore/TDEConfigSkeleton.html

@ -46,7 +46,7 @@
<table width = "100%"><tr><td width="50%" valign="top"><table><tr><td>returns <i>a TDEConfigSkeleton instance</i></td></tr>
<tr><td>In versions KDE 3.2.0 and above only</td></tr>
</table><table><tr bgcolor="#fff0ff"><th>Argument</th><th>Type</th><th>Default</th></tr>
<tr><td>config</td><td>KSharedConfig.Ptr</td><td></td></tr>
<tr><td>config</td><td>TDESharedConfig.Ptr</td><td></td></tr>
</table>
</td><td width="50%"><table><tr><td></td></tr></table></td></tr></table></li><hr>
<li><b>addItem</b> (a0, name = TQString .null)

2
doc/classref/tdecore/TDEGlobal.html

@ -82,7 +82,7 @@
</table>
</td><td width="50%"><table><tr><td></td></tr></table></td></tr></table></li><hr>
<li><b>sharedConfig</b> ()
<table width = "100%"><tr><td width="50%" valign="top"><table><tr><td>returns <i>(KSharedConfig)</i></td></tr>
<table width = "100%"><tr><td width="50%" valign="top"><table><tr><td>returns <i>(TDESharedConfig)</i></td></tr>
<tr><td>In versions KDE 3.2.0 and above only</td></tr>
<tr><td><i>static</i></td></tr>
</table></td><td width="50%"><table><tr><td></td></tr></table></td></tr></table></li><hr>

2
doc/classref/tdecore/TDEInstance.html

@ -94,7 +94,7 @@
</table>
</td><td width="50%"><table><tr><td></td></tr></table></td></tr></table></li><hr>
<li><b>sharedConfig</b> ()
<table width = "100%"><tr><td width="50%" valign="top"><table><tr><td>returns <i>(KSharedConfig)</i></td></tr>
<table width = "100%"><tr><td width="50%" valign="top"><table><tr><td>returns <i>(TDESharedConfig)</i></td></tr>
<tr><td>In versions KDE 3.2.0 and above only</td></tr>
</table></td><td width="50%"><table><tr><td></td></tr></table></td></tr></table></li><hr>
</ul>

4
doc/classref/tdecore/index.html

@ -137,8 +137,8 @@
<tr ><td><a href="KSelectionOwner.html">KSelectionOwner</a></td></tr>
<tr ><td><a href="KSelectionWatcher.html">KSelectionWatcher</a></td></tr>
<tr ><td><a href="KSessionManaged.html">KSessionManaged</a></td></tr>
<tr ><td><a href="KShared.html">KShared</a></td></tr>
<tr ><td><a href="KSharedConfig.html">KSharedConfig</a></td></tr>
<tr ><td><a href="TDEShared.html">TDEShared</a></td></tr>
<tr ><td><a href="TDESharedConfig.html">TDESharedConfig</a></td></tr>
<tr ><td><a href="KShell.html">KShell</a></td></tr>
<tr ><td><a href="KShellProcess.html">KShellProcess</a></td></tr>
<tr ><td><a href="KShortcut.html">KShortcut</a></td></tr>

2
doc/classref/tderesources/KRES.ResourcePageInfo.html

@ -31,7 +31,7 @@
<td>KRES.ResourcePageInfo</td>
</tr>
<tr><td>Inherits</td>
<td>KShared </td>
<td>TDEShared </td>
</tr>
</table>
<h3>methods</h3><ul>

2
doc/classref/tdeui/KPanelApplet.html

@ -168,7 +168,7 @@
</table>
</td><td width="50%"><table><tr><td></td></tr></table></td></tr></table></li><hr>
<li><b>sharedConfig</b> ()
<table width = "100%"><tr><td width="50%" valign="top"><table><tr><td>returns <i>(KSharedConfig.Ptr)</i></td></tr>
<table width = "100%"><tr><td width="50%" valign="top"><table><tr><td>returns <i>(TDESharedConfig.Ptr)</i></td></tr>
<tr><td>In versions KDE 3.2.0 and above only</td></tr>
</table></td><td width="50%"><table><tr><td></td></tr></table></td></tr></table></li><hr>
<li><b>type</b> ()

10
doc/classref/tdeui/KSharedPixmap.html

@ -3,7 +3,7 @@
"http://www.w3.org/TR/html4/loose.dtd"">
<html>
<head>
<title>class KSharedPixmap</title>
<title>class TDESharedPixmap</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta name="GENERATOR" content="wabbit dumphtml">
</head>
@ -12,7 +12,7 @@
<hr>
<table width="100%"><tr>
<td width ="70%">
<h1>class KSharedPixmap</h1><hr>
<h1>class TDESharedPixmap</h1><hr>
</td>
<td width="30%" valign="top" align="right">
<table>
@ -27,15 +27,15 @@
<td width="30%" align=left>tdeui</td>
</tr>
<tr><td>Class</td>
<td>KSharedPixmap</td>
<td>TDESharedPixmap</td>
</tr>
<tr><td>Inherits</td>
<td>TQWidget, KPixmap </td>
</tr>
</table>
<h3>methods</h3><ul>
<li><b>KSharedPixmap</b> ()
<table width = "100%"><tr><td width="50%" valign="top"><table><tr><td>returns <i>a KSharedPixmap instance</i></td></tr>
<li><b>TDESharedPixmap</b> ()
<table width = "100%"><tr><td width="50%" valign="top"><table><tr><td>returns <i>a TDESharedPixmap instance</i></td></tr>
</table></td><td width="50%"><table><tr><td></td></tr></table></td></tr></table></li><hr>
<li><b>done</b> (success)
<table width = "100%"><tr><td width="50%" valign="top"><table><tr><td>returns <i>nothing</i></td></tr>

2
examples/README

@ -6,7 +6,7 @@ uisampler.py - demos of most of the tdeui widgets,
including dialogs, menus (KAction, KStdAction, etc)
widgets, and xml ui definition
mimetest.py - tests KSharedPtr related classes/methods
mimetest.py - tests TDESharedPtr related classes/methods
such as KMimetype, KService, etc
menudemo.py

4
examples/mimetype.py

@ -1,5 +1,5 @@
"""
This program tests/demos some of the KSharedPtr related classes and
This program tests/demos some of the TDESharedPtr related classes and
methods (KMimeType, KService, etc). It generally tests the *::List
methods for these classes (eg KService::List) since that also tests
the *::Ptr mapped type code (eg KService::Ptr) at the same time.
@ -253,7 +253,7 @@ class KMimeTypeTab (TQWidget):
#-------------------- main ------------------------------------------------
description = "Test/demo KSharedPtr related methods/classes"
description = "Test/demo TDESharedPtr related methods/classes"
version = "1.0"
aboutData = TDEAboutData ("", "",\
version, description, TDEAboutData.License_GPL,\

4
examples/pytde-sampler/qt_widgets/CONTRIB

@ -88,8 +88,8 @@ tdecore,KSelectionOwner,,,
tdecore,KSelectionWatcher,,,
tdecore,TDEServerSocket,,,
tdecore,KSessionManaged,,,
tdecore,KShared,,,
tdecore,KSharedConfig,,,
tdecore,TDEShared,,,
tdecore,TDESharedConfig,,,
tdecore,KShell,,,
tdecore,KShellProcess,,,
tdecore,KShortcut,,,

2
examples/uimodules/uimisc.py

@ -221,7 +221,7 @@ def miscKIntValidator (parent):
def miscKPixmapIO (parent):
parent.currentPageObj = PageNotImpl (parent)
def miscKSharedPixmap (parent):
def miscTDESharedPixmap (parent):
parent.currentPageObj = PageNotImpl (parent)
def miscKSystemTray (parent):

2
examples/uisampler.py

@ -114,7 +114,7 @@ listItems = {"Dialogs":
"KFloatValidator": [],\
"KIntValidator": [],\
"KPixmapIO": [],\
"KSharedPixmap": [],\
"TDESharedPixmap": [],\
"KSystemTray": [],\
"KThemeBase": ["KThemeCache", "KThemePixmap", "KThemeStyle"],\
"QXEmbed": []}}

66
extra/kde320/ksharedptr.h

@ -15,128 +15,128 @@
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KSharedPTR_H
#define KSharedPTR_H
#ifndef TDESharedPTR_H
#define TDESharedPTR_H
/**
* Reference counting for shared objects. If you derive your object
* 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
* 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
* released.
*
* You should probably not ever use any of the methods in this class
* directly -- let the KSharedPtr take care of that. Just derive
* your class from KShared and forget about it.
* directly -- let the TDESharedPtr take care of that. Just derive
* your class from TDEShared and forget about it.
*
* @author Waldo Bastian <bastian@kde.org>
* @version $Id: ksharedptr.h,v 1.22 2003/08/20 08:01:42 coolo Exp $
*/
class KShared {
class TDEShared {
public:
/**
* Standard constructor. This will initialize the reference count
* on this object to 0.
*/
KShared() : count(0) { }
TDEShared() : count(0) { }
/**
* Copy constructor. This will @em not actually copy the objects
* 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.
*/
KShared &operator=(const KShared & ) { return *this; }
TDEShared &operator=(const TDEShared & ) { return *this; }
/**
* 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
* 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 Number of references
*/
int _KShared_count() const { return count; }
int _TDEShared_count() const { return count; }
protected:
virtual ~KShared() { }
virtual ~TDEShared() { }
private:
mutable int count;
};
/**
* 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
* count is 0. This struct emulates C++ pointers perfectly. So just
* use it like a simple C++ pointer.
*
* KShared and KSharedPtr are preferred over TQShared / TQSharedPtr
* TDEShared and TDESharedPtr are preferred over TQShared / TQSharedPtr
* since they are more safe.
*
* @author Waldo Bastian <bastian@kde.org>
* @version $Id: ksharedptr.h,v 1.22 2003/08/20 08:01:42 coolo Exp $
*/
template< class T >
struct KSharedPtr
struct TDESharedPtr
{
public:
/**
* Creates a null pointer.
*/
KSharedPtr()
TDESharedPtr()
: ptr(0) { }
/**
* Creates a new pointer.
* @param t the pointer
*/
KSharedPtr( T* t )
: ptr(t) { if ( ptr ) ptr->KShared::_KShared_ref(); }
TDESharedPtr( T* t )
: ptr(t) { if ( ptr ) ptr->TDEShared::_TDEShared_ref(); }
/**
* Copies a pointer.
* @param p the pointer to copy
*/
KSharedPtr( const KSharedPtr& p )
: ptr(p.ptr) { if ( ptr ) ptr->KShared::_KShared_ref(); }
TDESharedPtr( const TDESharedPtr& p )
: ptr(p.ptr) { if ( ptr ) ptr->TDEShared::_TDEShared_ref(); }
/**
* Unreferences the object that this pointer points to. If it was
* the last reference, the object will be deleted.
*/
~KSharedPtr() { if ( ptr ) ptr->KShared::_KShared_unref(); }
~TDESharedPtr() { if ( ptr ) ptr->TDEShared::_TDEShared_unref(); }
KSharedPtr<T>& operator= ( const KSharedPtr<T>& p ) {
TDESharedPtr<T>& operator= ( const TDESharedPtr<T>& p ) {
if ( ptr == p.ptr ) return *this;
if ( ptr ) ptr->KShared::_KShared_unref();
if ( ptr ) ptr->TDEShared::_TDEShared_unref();
ptr = p.ptr;
if ( ptr ) ptr->KShared::_KShared_ref();
if ( ptr ) ptr->TDEShared::_TDEShared_ref();
return *this;
}
KSharedPtr<T>& operator= ( T* p ) {
TDESharedPtr<T>& operator= ( T* p ) {
if ( ptr == p ) return *this;
if ( ptr ) ptr->KShared::_KShared_unref();
if ( ptr ) ptr->TDEShared::_TDEShared_unref();
ptr = p;
if ( ptr ) ptr->KShared::_KShared_ref();
if ( ptr ) ptr->TDEShared::_TDEShared_ref();
return *this;
}
bool operator== ( const KSharedPtr<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 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 { return ( ptr == 0 ); }
@ -163,7 +163,7 @@ public:
* Returns the number of references.
* @return the number of references
*/
int count() const { return ptr->KShared::_KShared_count(); } // for debugging purposes
int count() const { return ptr->TDEShared::_TDEShared_count(); } // for debugging purposes
private:
T* ptr;
};

66
extra/kde321/ksharedptr.h

@ -15,128 +15,128 @@
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KSharedPTR_H
#define KSharedPTR_H
#ifndef TDESharedPTR_H
#define TDESharedPTR_H
/**
* Reference counting for shared objects. If you derive your object
* 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
* 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
* released.
*
* You should probably not ever use any of the methods in this class
* directly -- let the KSharedPtr take care of that. Just derive
* your class from KShared and forget about it.
* directly -- let the TDESharedPtr take care of that. Just derive
* your class from TDEShared and forget about it.
*
* @author Waldo Bastian <bastian@kde.org>
* @version $Id: ksharedptr.h,v 1.22 2003/08/20 08:01:42 coolo Exp $
*/
class KShared {
class TDEShared {
public:
/**
* Standard constructor. This will initialize the reference count
* on this object to 0.
*/
KShared() : count(0) { }
TDEShared() : count(0) { }
/**
* Copy constructor. This will @em not actually copy the objects
* 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.
*/
KShared &operator=(const KShared & ) { return *this; }
TDEShared &operator=(const TDEShared & ) { return *this; }
/**
* 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
* 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 Number of references
*/
int _KShared_count() const { return count; }
int _TDEShared_count() const { return count; }
protected:
virtual ~KShared() { }
virtual ~TDEShared() { }
private:
mutable int count;
};
/**
* 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
* count is 0. This struct emulates C++ pointers perfectly. So just
* use it like a simple C++ pointer.
*
* KShared and KSharedPtr are preferred over TQShared / TQSharedPtr
* TDEShared and TDESharedPtr are preferred over TQShared / TQSharedPtr
* since they are more safe.
*
* @author Waldo Bastian <bastian@kde.org>
* @version $Id: ksharedptr.h,v 1.22 2003/08/20 08:01:42 coolo Exp $
*/
template< class T >
struct KSharedPtr
struct TDESharedPtr
{
public:
/**
* Creates a null pointer.
*/
KSharedPtr()
TDESharedPtr()
: ptr(0) { }
/**
* Creates a new pointer.
* @param t the pointer
*/
KSharedPtr( T* t )
: ptr(t) { if ( ptr ) ptr->_KShared_ref(); }
TDESharedPtr( T* t )
: ptr(t) { if ( ptr ) ptr->_TDEShared_ref(); }
/**
* Copies a pointer.
* @param p the pointer to copy
*/
KSharedPtr( const KSharedPtr& p )
: ptr(p.ptr) { if ( ptr ) ptr->_KShared_ref(); }
TDESharedPtr( const TDESharedPtr& p )
: ptr(p.ptr) { if ( ptr ) ptr->_TDEShared_ref(); }
/**
* Unreferences the object that this pointer points to. If it was
* 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 ) ptr->_KShared_unref();
if ( ptr ) ptr->_TDEShared_unref();
ptr = p.ptr;
if ( ptr ) ptr->_KShared_ref();
if ( ptr ) ptr->_TDEShared_ref();
return *this;
}
KSharedPtr<T>& operator= ( T* p ) {
TDESharedPtr<T>& operator= ( T* p ) {
if ( ptr == p ) return *this;
if ( ptr ) ptr->_KShared_unref();
if ( ptr ) ptr->_TDEShared_unref();
ptr = p;
if ( ptr ) ptr->_KShared_ref();
if ( ptr ) ptr->_TDEShared_ref();
return *this;
}
bool operator== ( const KSharedPtr<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 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 { return ( ptr == 0 ); }
@ -163,7 +163,7 @@ public:
* Returns 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:
T* ptr;
};

66
extra/kde322/ksharedptr.h

@ -15,128 +15,128 @@
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KSharedPTR_H
#define KSharedPTR_H
#ifndef TDESharedPTR_H
#define TDESharedPTR_H
/**
* Reference counting for shared objects. If you derive your object
* 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
* 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
* released.
*
* You should probably not ever use any of the methods in this class
* directly -- let the KSharedPtr take care of that. Just derive
* your class from KShared and forget about it.
* directly -- let the TDESharedPtr take care of that. Just derive
* your class from TDEShared and forget about it.
*
* @author Waldo Bastian <bastian@kde.org>
* @version $Id: ksharedptr.h,v 1.22 2003/08/20 08:01:42 coolo Exp $
*/
class KShared {
class TDEShared {
public:
/**
* Standard constructor. This will initialize the reference count
* on this object to 0.
*/
KShared() : count(0) { }
TDEShared() : count(0) { }
/**
* Copy constructor. This will @em not actually copy the objects
* 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.
*/
KShared &operator=(const KShared & ) { return *this; }
TDEShared &operator=(const TDEShared & ) { return *this; }
/**
* 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
* 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 Number of references
*/
int _KShared_count() const { return count; }
int _TDEShared_count() const { return count; }
protected:
virtual ~KShared() { }
virtual ~TDEShared() { }
private:
mutable int count;
};
/**
* 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
* count is 0. This struct emulates C++ pointers perfectly. So just
* use it like a simple C++ pointer.
*
* KShared and KSharedPtr are preferred over TQShared / TQSharedPtr
* TDEShared and TDESharedPtr are preferred over TQShared / TQSharedPtr
* since they are more safe.
*
* @author Waldo Bastian <bastian@kde.org>
* @version $Id: ksharedptr.h,v 1.22 2003/08/20 08:01:42 coolo Exp $
*/
template< class T >
struct KSharedPtr
struct TDESharedPtr
{
public:
/**
* Creates a null pointer.
*/
KSharedPtr()
TDESharedPtr()
: ptr(0) { }
/**
* Creates a new pointer.
* @param t the pointer
*/
KSharedPtr( T* t )
: ptr(t) { if ( ptr ) ptr->_KShared_ref(); }
TDESharedPtr( T* t )
: ptr(t) { if ( ptr ) ptr->_TDEShared_ref(); }
/**
* Copies a pointer.
* @param p the pointer to copy
*/
KSharedPtr( const KSharedPtr& p )
: ptr(p.ptr) { if ( ptr ) ptr->_KShared_ref(); }
TDESharedPtr( const TDESharedPtr& p )
: ptr(p.ptr) { if ( ptr ) ptr->_TDEShared_ref(); }
/**
* Unreferences the object that this pointer points to. If it was
* 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 ) ptr->_KShared_unref();
if ( ptr ) ptr->_TDEShared_unref();
ptr = p.ptr;
if ( ptr ) ptr->_KShared_ref();
if ( ptr ) ptr->_TDEShared_ref();
return *this;
}
KSharedPtr<T>& operator= ( T* p ) {
TDESharedPtr<T>& operator= ( T* p ) {
if ( ptr == p ) return *this;
if ( ptr ) ptr->_KShared_unref();
if ( ptr ) ptr->_TDEShared_unref();
ptr = p;
if ( ptr ) ptr->_KShared_ref();
if ( ptr ) ptr->_TDEShared_ref();
return *this;
}
bool operator== ( const KSharedPtr<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 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 { return ( ptr == 0 ); }
@ -163,7 +163,7 @@ public:
* Returns 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:
T* ptr;
};

66
extra/kde323/ksharedptr.h

@ -15,128 +15,128 @@
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KSharedPTR_H
#define KSharedPTR_H
#ifndef TDESharedPTR_H
#define TDESharedPTR_H
/**
* Reference counting for shared objects. If you derive your object
* 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
* 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
* released.
*
* You should probably not ever use any of the methods in this class
* directly -- let the KSharedPtr take care of that. Just derive
* your class from KShared and forget about it.
* directly -- let the TDESharedPtr take care of that. Just derive
* your class from TDEShared and forget about it.
*
* @author Waldo Bastian <bastian@kde.org>
* @version $Id: ksharedptr.h,v 1.22 2003/08/20 08:01:42 coolo Exp $
*/
class KShared {
class TDEShared {
public:
/**
* Standard constructor. This will initialize the reference count
* on this object to 0.
*/
KShared() : count(0) { }
TDEShared() : count(0) { }
/**
* Copy constructor. This will @em not actually copy the objects
* 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.
*/
KShared &operator=(const KShared & ) { return *this; }
TDEShared &operator=(const TDEShared & ) { return *this; }
/**
* 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
* 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 Number of references
*/
int _KShared_count() const { return count; }
int _TDEShared_count() const { return count; }
protected:
virtual ~KShared() { }
virtual ~TDEShared() { }
private:
mutable int count;
};
/**
* 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
* count is 0. This struct emulates C++ pointers perfectly. So just
* use it like a simple C++ pointer.
*
* KShared and KSharedPtr are preferred over TQShared / TQSharedPtr
* TDEShared and TDESharedPtr are preferred over TQShared / TQSharedPtr
* since they are more safe.
*
* @author Waldo Bastian <bastian@kde.org>
* @version $Id: ksharedptr.h,v 1.22 2003/08/20 08:01:42 coolo Exp $
*/
template< class T >
struct KSharedPtr
struct TDESharedPtr
{
public:
/**
* Creates a null pointer.
*/
KSharedPtr()
TDESharedPtr()
: ptr(0) { }
/**
* Creates a new pointer.
* @param t the pointer
*/
KSharedPtr( T* t )
: ptr(t) { if ( ptr ) ptr->_KShared_ref(); }
TDESharedPtr( T* t )
: ptr(t) { if ( ptr ) ptr->_TDEShared_ref(); }
/**
* Copies a pointer.
* @param p the pointer to copy
*/
KSharedPtr( const KSharedPtr& p )
: ptr(p.ptr) { if ( ptr ) ptr->_KShared_ref(); }
TDESharedPtr( const TDESharedPtr& p )
: ptr(p.ptr) { if ( ptr ) ptr->_TDEShared_ref(); }
/**
* Unreferences the object that this pointer points to. If it was
* the last reference, the object will be deleted.
*/
~KSharedPtr() { if ( ptr ) ptr->_KShared_unref(); }
~TDESharedPtr() { if ( ptr ) ptr->_