TDE core libraries
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

673 lines

  1. <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML Level 2//EN//2.0">
  2. <HTML>
  3. <HEAD>
  4. <TITLE>Guide to Porting Applications to KDE 3.0</TITLE>
  5. </HEAD>
  6. <BODY>
  7. <H2>Porting Applications to KDE 3.0</H2>
  8. This document contains the changes you have to apply to programs written for
  9. KDE 2.x when you want to port them to KDE 3.0.<P>
  10. As a start you should have a look at doc/porting.doc in the Qt package,
  11. or <a href="">this page online</a>.<P>
  12. <H3><A NAME="TOC">Table of Contents</A></H3>
  13. <UL>
  14. <LI><A HREF="#gettingstarted">Getting Started</A></LI>
  15. <LI><A HREF="#kab">Changes in kab</A></LI>
  16. <LI><A HREF="#tdecore">Changes in tdecore</A></LI>
  17. <LI><A HREF="#tdeui">Changes in tdeui</A></LI>
  18. <LI><A HREF="#tdeio">Changes in tdeio</A></LI>
  19. <LI><A HREF="#tdeparts">Changes in tdeparts</A></LI>
  20. <LI><A HREF="#tdespell">Changes in tdespell</A></LI>
  21. <LI><A HREF="#tdehtmlpart">API-cleanup in TDEHTML</A></LI>
  22. <LI><A HREF="#tdefile">Changes in tdefile</A></LI>
  23. <LI><A HREF="#kcontrol">Trinity Control Center</A></LI>
  24. <LI><A HREF="#kicker">Panel Applets and Extensions</A></LI>
  25. </UL>
  26. <H3><A NAME="gettingstarted">Getting started</A></H3>
  27. The first step to get your KDE application to compile under KDE 3.0,
  28. is to detect KDE 3.0 and Qt 3.x at configure time. The easiest way to
  29. get a working autoconf/automake framework, is to either use
  30. <a href="">KDevelop</a> or
  31. <a href="">kapptemplate</a>
  32. (available in CVS under the module "tdesdk"), to generate a new
  33. application template. Replace the generated source files by yours
  34. and adapt accordingly.
  35. <p>
  36. Please note that we tried to be mostly source-compatible where it
  37. was possible. To accomplish that, we added commonly used but still
  38. deprecated / removed API parts in a #ifndef KDE_NO_COMPAT-block.
  39. That means you can "test" and adjust your application by #defining
  40. KDE_NO_COMPAT for compiling and see where it breaks. This is
  41. recommended, as those backward compatibility "hacks" are not kept for
  42. long.
  43. </p>
  44. <p>
  45. <b>WARNING:</b>In some cases the names or signatures of signals or slots
  46. have changed. Check your source carefully for this since these changes will
  47. not be discovered by your compiler but will result in incorrect runtime
  48. behavior if left uncorrected in your application.
  49. </p>
  50. <H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
  51. <H3><A NAME="kab">Changes in kab</A></H3>
  52. <H4>AddressBook</H4>
  53. The <i>getStandardFilename()</i> method has been renamed to <i>getStandardFileName()</i>.
  54. The old name will still work unless KDE_NO_COMPAT is defined.
  55. <H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
  56. <H3><A NAME="tdecore">Changes in tdecore</A></H3>
  57. <H4>KDesktopWidget</H4>
  58. KDesktopWidget is obsolete. Include &lt;tqdesktopwidget.h&gt; and use QDesktopWidget
  59. instead, everything else is source compatible.
  60. <H4>Header file names</H4>
  61. <UL>
  62. <LI>kapp.h is now tdeapplication.h</LI>
  63. <LI>kuniqueapp.h is now kuniqueapplication.h</LI>
  64. <LI>kstddirs.h is now kstandarddirs.h</LI>
  65. <LI>kcolorbtn.h is now kcolorbutton.h</LI>
  66. <LI>kxmlgui.h is now kxmlguifactory.h</LI>
  67. <LI>kdatepik.h is now kdatepicker.h</LI>
  68. <LI>kdualcolorbtn.h is now kdualcolorbutton.h</LI>
  69. </UL>
  70. This is to help finding out header files from class names and the other
  71. way round. Compatibility headers have been created. You can use them as
  72. long as you don't compile with KDE_NO_COMPAT.
  73. <H4>DCOP</H4>
  74. The file with the DCOP connection information has been renamed. The new
  75. name is $HOME/.DCOPserver_<hostname>_<display>. The screen part has been
  76. stripped from <display> and the ':' character that separates host and
  77. display-number has been replaced with a '_'. If you access DCOP via
  78. DCOPClient you do not need to change anything.
  79. <p>
  80. It is no longer possible to make calls to an application registered as
  81. "<appid>-<pid>" with "<appid>" only. The full name can be obtained by using
  82. either TDEApplication::startServiceBy...() or DCOPClient::findObject() or
  83. their command line equivalents "dcopstart" and "dcopfind".
  84. <H4>KLibFactory</H4>
  85. KLibFactory's create method is no more virtual and the createObject method
  86. is now pure virtual. The former was marked as deprecated since KDE 2.0.
  87. All it takes in your component is to rename your existing create implementation
  88. to createObject and remove the 'emit objectCreated( yourObject );' line.
  89. <H4>KDesktopFile</H4>
  90. The <i>filename()</i> method has been renamed to <i>fileName()</i>.
  91. The old name will still work unless KDE_NO_COMPAT is defined.
  92. <H4>KPixmapSplitter</H4>
  93. KPixmapSplitter has now been moved to the new tdefx library.
  94. <H4>KStringHandler</H4>
  95. The <i>matchFilename( const TQString& filename, const TQString& pattern )</i> method has been
  96. renamed to <br><i>matchFileName( const TQString& filename, const TQString& pattern )</i>.
  97. The old name will still work unless KDE_NO_COMPAT is defined.
  98. <H4>TDEStyle</H4>
  99. Due to the major changes in the TQStyle API in Qt3, TDEStyle has been completely
  100. re-written. TDEStyle is now a thin wrapper around TQCommonStyle with a few extra
  101. primitive elements and a simple popupMenu transparency engine. All TDEStyles can
  102. now style Qt apps like designer and assistant automatically. TDEStyle is no longer
  103. present in tdecore. It is now in a new library called tdefx to allow Qt apps to
  104. use KDE's styles without having the styles linked to tdecore/tdeui.
  105. <H4>KURL</H4>
  106. The <i>filename( bool _ignore_trailing_slash_in_path = true )</i> method has been
  107. renamed to <br><i>fileName( bool _ignore_trailing_slash_in_path = true )</i>.
  108. The old name will still work unless KDE_NO_COMPAT is defined.
  109. <H4>KMD5</H4>
  110. HASHHEX and HASH has been removed to make this class namespace clean.
  111. They have been replaced by TQCString and KMD5::Digest. <br>
  112. The API has been cleaned up, it is no longer necessary to call finalize().
  113. Simply remove any calls to it.
  114. <H4>TDELocale</H4>
  115. <li>charset() has been removed. You might want to use encoding() instead.
  116. <li>setCharset(const TQString &amp;) has been removed. You might want to use
  117. setEncoding(int) instead.
  118. <li>formatMoney(const TQString &amp;) has been removed.
  119. <li>formatNumber(const TQString &amp;) has been removed.
  120. <li>languages() has been removed. Use languageList() instead.
  121. <li>All references to monthName(), monthNamePossessive(), and weekDayName()
  122. should be replaced with methods from TDELocale::calendar().
  123. <li>Hard coded date handling or date handling with TQDate should in most
  124. cases be replaced by methods in TDELocale::calendar().
  125. <H4>Accelerators Keys</H4>
  126. <h5>TDEAccel</h5>
  127. The following methods of been deprecated, and if KDE_NO_COMPAT is defined they will
  128. not be available.
  129. <ul>
  130. <li> TDEAccel::insertItem() and TDEAccel::connectItem().
  131. <pre>
  132. - tdeaccel-&gt;insertItem( i18n("Scroll Up"), "Scroll Up", "Up" );
  133. - tdeaccel-&gt;connectItem( "Scroll Up", this, TQT_SLOT(scrollUp()) );
  134. + tdeaccel-&gt;insert( "Scroll Up", i18n("Scroll Up"), TQString::null,
  135. Key_Up, this, TQT_SLOT(scrollUp()) );
  136. </pre>
  137. Note that a What's This parameter is now a part of the insert function.
  138. You might replace the TQString::null parameter with
  139. <pre> i18n("Scroll the current document's contents up by one line.") </pre>
  140. for example.</li>
  141. <li> TDEAccel::changeMenuAccel() has been deprecated because it was
  142. never used in cvs. If you've used it in your application, the following
  143. can replace it. Note, however, that this would be handled automatically
  144. by using TDEAction instead.
  145. <pre>
  146. - tdeaccel-&gt;changeMenuAccel( menu, id, "file_open" );
  147. + menu-&gt;setAccel( tdeaccel-&gt;shortcut( "file_open" ).keyCodeQt(), id );
  148. </pre>
  149. </li>
  150. </ul>
  151. The preferred means of defining a shortcut, however, is to use <b>TDEAction</b>.
  152. <pre>
  153. new TDEAction( i18n("Scroll Up"), Key_Up,
  154. this, TQT_SLOT(scrollUp()), actionCollection(), "Scroll Up" );
  155. </pre>
  156. <h5>TDEGlobalAccel</h5>
  157. <ul>
  158. <li>Call <i>updateConnections()</i> after all <i>insert()</i> or
  159. <i>insertItem()</i> (deprecated) calls have been made. This function then performs the
  160. actually key grabbing. In order to improve program startup speed,
  161. grabbing is no longer done automatically: usually <i>readSettings()</i>
  162. is called after the actions have been defined, and this may cause
  163. shortcut reassignments, which in turn used to make an expensive ungrab
  164. of the old key and second grab of the new key necessary.</li>
  165. </ul>
  166. <h5>TDEStdAccel</h5>
  167. <ul>
  168. <li><i>StdAccel::WhatThis</i> has been renamed to <i>StdAccel::WhatsThis</i>.
  169. <li><i>StdAccel::Insert</i> and the corresponding <i>insert()</i>
  170. have been removed. (Nobody on the list knew what its function was
  171. supposed to be.) Calls to <i>insert()</i> and the equivalent
  172. <i>key(TDEStdAccel::Insert)</i> can be replaced with the former default
  173. of <i>Qt::CTRL+Qt::Key_Insert</i>.</li>
  174. <li>The following functions have been deprecated and will need to be changed if KDE_NO_COMPAT is defined:
  175. <table border=1>
  176. <tr><th>Old</th><th>New</th></tr>
  177. <tr><td>TQString action(StdAccel id)</td><td>TQString name(StdAccel id)</td></tr>
  178. <tr><td>int defaultKey(StdAccel accel)</td><td>TDEShortcut shortcutDefault(StdAccel id)</td></tr>
  179. <tr><td>TQString description(StdAccel id)</td><td>TQString label(StdAccel id)</td></tr>
  180. <tr><td>bool isEqual(const TQKeyEvent* pEvent, int keyQt)</td>
  181. <td>The best method for replacing this varies. One possibility is to use
  182. <i>KKey(const TQKeyEvent*) == KKey(int)</i>. Another is to use
  183. <i>TDEShortcut::contains( const KKey&/KKeySequence& )</i>.</td></tr>
  184. <tr><td>int key(StdAccel)</td><td>const TDEShortcut& shortcut(StdAccel)</td></tr>
  185. </table></li-->
  186. </ul>
  187. <H4>TDEIconLoader, TDEIconTheme</H4>
  188. Methods now use TDEIcon::Group and TDEIcon::Context instead of int as types for group and context arguments.
  189. The change should affect only code using hardcoded numeric values instead of using the proper enum constants.
  190. This applies to classes TDEIconLoader, TDEIconTheme and (in tdeio and tdefile) KMimeType, KService, TDEIconDialog, TDEIconButton,
  191. KURLBar and KURLBarItem.
  192. <H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
  193. <H3><A NAME="tdeui">Changes in tdeui</A></H3>
  194. <H4>TDEAccelMenu</H4>
  195. This class has been removed, Qt offers the same functionality.
  196. Use QPopupMenu/TDEPopupMenu or the XML-UI method for building menus.
  197. <H4>TDEAction</H4>
  198. <ul>
  199. <li>The following methods have been deprecated and will need to be
  200. replaced if KDE_NO_COMPAT is defined.
  201. <table border=1>
  202. <tr><th>Old</th><th>New</th></tr>
  203. <tr><td>int accel()</td><td>const TDEShortcut&amp; shortcut()</td></tr>
  204. <tr><td>int menuId()</td><td>int itemId()</td></tr>
  205. <tr><td>void setAccel(int)</td><td>void setShortcut(const TDEShortcut&amp;)</td></tr>
  206. </table></li>
  207. </ul>
  208. <h4>TDEActionCollection</h4>
  209. <ul>
  210. <li>When constructing a TDEActionCollection object, a pointer to the focus widget should be passed.</li>
  211. <li>The insert(), remove(), and take() methods have been deprecated.
  212. If you wish to keep a list of actions, use the TDEActionPtrList container instead.
  213. If you want to configure the shortcuts from multiple actions collections,
  214. pass each collection to KKeyChooser or KKeyDialog via their insert() methods.</li>
  215. </ul>
  216. <H4>KAlphaPainter</H4>
  217. KAlphaPainter has been dropped, since Qt 3 has native support for
  218. hardware accelerated alpha blending.
  219. <H4>KAnimWidget</H4>
  220. This class no longer supports reading a list of images, instead it uses a
  221. single image-file that has been prepared with the kimage_concat tool.
  222. See tdelibs/pics/hicolor/kde for an example of its use.
  223. <H4>KContainerLayout</H4>
  224. This class has been removed, use Qt layouts instead.
  225. <H4>KCommand</H4>
  226. This class has been made lighter: the name isn't stored into the command anymore,
  227. but must be provided by the inherited class, as the result of the virtual name() function.
  228. This saves storing a TQString into each command in memory.
  229. The former behavior is available in the class KNamedCommand, so for a quick port
  230. simply replace KCommand with KNamedCommand.
  231. <H4>KDialogBase</H4>
  232. The deprecated getMainWidget() method has been removed. Use mainWidget() instead.
  233. <H4>KDirectionButton</H4>
  234. gone. Use KArrowButton instead, it offers about the same
  235. functionality.
  236. <H4>KDockWidget</H4>
  237. The WidgetList parameter has been renamed to TQWidgetList. Behaviour
  238. is identical.
  239. <H4>KEdit</H4>
  240. KEdit is now deprecated. You should use use KTextEditor::Editor or
  241. KTextEdit instead.
  242. <H4>KImageEffect</H4>
  243. KImageEffect has now been moved to the new tdefx library.
  244. <H4>KMessageBox</H4>
  245. KMessageBox now does automatic line-breaking. When using plain-text, you should
  246. remove any mid-sentence linebreaks. Only use line-breaks to indicate the end of
  247. a paragraph.
  248. <H4>KPanelApplet</H4>
  249. A new protected member method 'void reportBug()' was added. It gets called by
  250. Kicker if the 'Report Bug' entry in the context menu gets selected and should
  251. be overridden by applets which support the KPanelApplet::ReportBug action. This
  252. means that you don't have to extend KPanelApplet's generic action dispatcher
  253. void KPanelApplet::action() anymore.
  254. <H4>KPanelMenu</H4>
  255. The old KPanelMenu class has been renamed to KPanelAppMenu. The KPanelMenu
  256. class now corresponds to a new Kicker menu extension that is handled
  257. by the panel in a way similar to other applets (shared library loaded
  258. at run-time). See KDE 3.0 documentation
  259. for more informations on this new extension.
  260. <H4>KPixmapEffect</H4>
  261. PixmapEffect has now been moved to the new tdefx library.
  262. <H4>KProgress</H4>
  263. KProgress is now based on TQProgressBar.
  264. This has led to a few API changes. In particular the constructors have been
  265. simplified, you simply need to pass the total number of steps instead of
  266. min / max / initialvalue / orientation. See documentation of both KProgress
  267. and TQProgressBar.
  268. <H4>KRootPixmap</H4>
  269. The KRootPixmap class has been extended to make it more flexible, and the
  270. <i>checkAvailable(bool ignored)</i> method has been renamed to <i>isAvailable()</i>.
  271. The old name will still work unless KDE_NO_COMPAT is defined.
  272. <H4>KThemeBase, KThemeStyle</H4>
  273. KThemeBase and KThemeStyle have been ported over to the new QStyle/TDEStyle API
  274. present in Qt3/KDE3. KThemeBase is no longer in tdeui, but in tdestyles/kthemestyle
  275. as its use is basically limited to KThemeStyle.
  276. <H4>TDEAction, TDEToolBar, TDEToolBarButton and icons</H4>
  277. The preferred way for specifying icons is passing the icon names (and the icons will be loaded by TDEIconLoader),
  278. instead of using TQIconSet or TQPixmap. This results in always using the correct icon size and allows delayed
  279. on-demand icon loading.
  280. <p>
  281. Method TDEAction::hasIconSet() has been renamed to TDEAction::hasIcon(), the old name will still work unless KDE_NO_COMPAT is defined.
  282. TDEAction::iconSet() now has an argument specifying icon group, the old TDEAction::iconSet() is still available unless KDE_NO_COMPAT
  283. is defined and returns TDEIcon::Small iconset, just like in KDE2.
  284. <p>
  285. TDEToolBarButton methods setPixmap(), setDefaultPixmap(), setDisabledPixmap(), setDefaultIcon() and setDisabledIcon() are deprecated.
  286. Use TDEToolBarButton::setIcon() (preferred) or TDEToolBarButton::setIconSet() instead.
  287. <H4>TDEAction and derived classes</H4>
  288. The protected set* methods have been renamed to update* and they now take only one argument (i.e. setText(int, const TQString&)
  289. is now updateText(int) ). Because the former second argument was always the value of the a corresponding data member, you
  290. can simply call the accessor method (i.e. in updateText() call text() to get the text).
  291. <H4>TDEToggleAction</H4>
  292. exclusiveGroup() is no more virtual. setExclusiveGroup(const
  293. TQString&) is not a slot anymore.
  294. <H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
  295. <H3><A NAME="tdeio">Changes in tdeio</A></H3>
  296. <H4>KPropertiesDialog</H4>
  297. <ul>
  298. <li>The header file has been renamed from kpropsdlg.h to kpropertiesdialog.h.</li>
  299. <li>KPropertiesDialog::KPropertiesDialog(const KURL&, mode_t, TQWidget*,
  300. const char*, bool, bool ) has been removed since mode_t was no longer
  301. used. Simply omit the mode_t parameter.</li>
  302. </ul>
  303. <H4>KTarGz/KTarBase/KTarData</H4>
  304. <ul>
  305. <li>The KTarBase and KTarData classes have been removed.</li>
  306. <li>KTarGz is now KTar (#define for source compatibility)</li>
  307. <li>A base class KArchive has been written, to support other archive formats in the future</li>
  308. <li>KTarEntry is now KArchiveEntry, KTarDirectory is now KArchiveDirectory, and KTarFile is now KArchiveFile.</li>
  309. <li>The classes ProgressBase, StatusbarProgress and DefaultProgress have been moved to the TDEIO namespace.</li>
  310. <li>The signal KDirLister::started(const TQString &amp;url) has changed to KDirLister::started(const KURL &amp;url).<li>
  311. <li>KServiceTypeProfile::preferredService( const TQString &amp; serviceType, bool needApp ) has been removed, use
  312. KServiceTypeProfile::preferredService( ..., "Application") if needApp was true, or
  313. KServiceTypeProfile::preferredService( ..., TQString::null) if needApp was false.
  314. <li>The following functions in KProtocolManager have been replaced:
  315. <ul>
  316. <li>ftpProxy(), use proxyFor("ftp") instead.
  317. <li>httpProxy(), use proxyFor("http") instead.
  318. <li>slaveProtocol(const TQString&amp;), use slaveProtocol(const KURL &amp;url, TQString &amp;proxy) instead.
  319. <li>defaultReadTimeout(), use DEFAULT_READ_TIMEOUT instead. (See ioslave_defaults.h)
  320. <li>defaultProxyConnectTimeout(), use DEFAULT_PROXY_CONNECT_TIMEOUT instead. (See ioslave_defaults.h)
  321. <li>defaultResponseTimeout(), use DEFAULT_RESPONSE_TIMEOUT instead. (See ioslave_defaults.h)
  322. <li>minimumTimeoutThreshold(), use MIN_TIMEOUT_VALUE instead. (See ioslave_defaults.h)
  323. </ul>
  324. <li>The following functions in KProtocolManager have been removed:
  325. <ul>
  326. <li>setUserAgentList( const TQStringList&amp; )
  327. <li>userAgentList();
  328. <li>setReadTimeout()
  329. <li>setConnectTimeout( int )
  330. <li>setProxyConnectTimeout( int )
  331. <li>setResponseTimeout( int )
  332. <li>setMarkPartial( bool )
  333. <li>setMinimumKeepSize( int )
  334. <li>setAutoResume( bool )
  335. <li>setPersistentConnections( bool )
  336. <li>setMaxCacheAge( int )
  337. <li>setUseCache( bool )
  338. <li>setMaxCacheSize( int )
  339. <li>setCacheControl( TDEIO::CacheControl )
  340. <li>setUseProxy( bool )
  341. <li>setUseReverseProxy( bool )
  342. <li>setProxyType( ProxyType )
  343. <li>setProxyAuthMode( ProxyAuthMode )
  344. <li>setFtpProxy( const TQString&amp; )
  345. <li>setHttpProxy( const TQString&amp; )
  346. <li>setProxyFor( const TQString&amp;, const TQString&amp; )
  347. <li>setNoProxyFor( const TQString&amp; )
  348. <li>setProxyConfigScript( const TQString&amp; )
  349. </ul>
  350. </li>
  351. <li>In order to support files &gt; 4Gb, the file size / file-offset argument
  352. in the signals totalSize, processedSize and canResume, which are used
  353. by the io-slaves and passed along to jobs, has been changed from
  354. <b>unsigned long</b> to <b>TDEIO::filesize_t</b>.
  355. Make sure to check if you use these signals since your compiler
  356. will typically not generate a compile-time error for these changes,
  357. instead you might get a run-time error when you try to connect to
  358. one of these signals using the old signature.
  359. </li>
  360. </ul>
  361. <H4>KOpenWithHandler / KFileOpenWithHandler</H4>
  362. Those two classes are deprecated, no need to create a KFileOpenWithHandler anymore.
  363. The merging of libtdeio, libtdesycoca, libtdefile and libkssl into a single libtdeio has
  364. allowed to fix this dependency problem: KRun can now use the OpenWith dialog directly.
  365. <H4>KMimeType, KService</H4>
  366. Methods now use TDEIcon::Group and TDEIcon::Context instead of int as types for group and context arguments.
  367. The change should affect only code using hardcoded numeric values instead of using the proper enum constants.
  368. <H4>KFilterDev</H4>
  369. The createFilterDevice method is deprecated. Use deviceForFile instead.
  370. <H4>KDirWatch</H4>
  371. <ul>
  372. <li>The signal fileDirty( const TQString&amp; ) has been removed</li>
  373. <li>The signal created( const TQString&amp; ) has been added</li>
  374. <li>The signal deleted( const TQString&amp; ) has been added</li>
  375. <li>The signal dirty( const TQString&amp; ) may be emitted with a file name, not only
  376. a directory name. This depends on which backend is used but will probably always be
  377. the case in KDE 3.1. You should prepare to receive dirty( dirname ) or dirty( filename )
  378. when a file has changed.
  379. </li>
  380. </ul>
  381. <H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
  382. <H3><A NAME="tdeparts">Changes in tdeparts</A></H3>
  383. <H4>KParts::Factory</H4>
  384. The createPart method is no more virtual and the createPartObject method
  385. is now pure virtual. The former was marked as deprecated since KDE 2.0.
  386. All it takes in your component is to rename your existing createPart implementation
  387. to createPartObject and remove the 'emit objectCreated( yourObject );' line.
  388. <H4>KParts::Part</H4>
  389. The <code>bool isSelectable() const</code> is no more virtual. So when you want to
  390. change the behavior of the selectable property you don't need to re-implement
  391. both virtual functions, setSelectable and isSelectable, but instead just
  392. re-implementing setSelectable does the job. The very same applies for
  393. the <code>KURL url() const</code> and ReadWritePart's <code>bool isReadWrite const</code>
  394. and <code>bool isModified() const</code> methods.
  395. <p>
  396. The <code>void showProgressInfo(bool)</code>
  397. method has been renamed to <code>bool setProgressInfoEnabled(bool)</code>. The old name will
  398. still work unless KDE_NO_COMPAT is defined.
  399. <H4>KParts::BrowserExtension</H4>
  400. The <code>URLArgs urlArgs()</code> method is no more virtual. So when you want to
  401. change the behavior of the urlArgs property you don't need to re-implement
  402. both virtual functions, setURLArgs and urlArgs, but instead just re-implementing
  403. setURLArgs does the job.
  404. <H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
  405. <H3><A NAME="tdespell">Changes in tdespell</A></H3>
  406. <H4>KSpell</H4>
  407. The API has been cleaned up to be in line with the rest of tdelibs, in particular:
  408. <ul>
  409. <li>suggestions() now returns a TQStringList instead of a pointer to a QStringList
  410. <li>intermediateBuffer() now returns a TQString instead of a pointer to a QString
  411. <li>The signal <b>misspelling(TQString, TQStringList *, unsigned)</b> has changed to
  412. misspelling(const TQString &amp;, const TQStringList &amp;, unsigned int)
  413. <li>The signal <b>corrected(TQString, TQString, unsigned)</b> has changed to
  414. corrected(const TQString &amp;, const TQString &amp;, unsigned int)
  415. <li>The signal <b>ignoreall(TQString)</b> has changed to
  416. ignoreall(const TQString &amp;)
  417. <li>The signal <b>ignoreword(TQString)</b> has changed to
  418. ignoreword(const TQString &amp;)
  419. <li>The signal <b>addword(TQString)</b> has changed to
  420. addword(const TQString &amp;)
  421. </ul>
  422. Make sure to check if you use the above signals since your compiler
  423. will typically not generate a compile-time error for these changes,
  424. instead you might get a run-time error when you try to connect to
  425. one of these signals using the old signature.
  426. <H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
  427. <H3><A NAME="tdehtmlpart">API-cleanups in TDEHTML</A></H3>
  428. There were a few relatively minor API-adjustements in TDEHTMLPart. In particular:
  429. <ul><li>enableJScript(bool) has been replaced by setJScriptEnabled(bool)
  430. <li>enableJava(bool) has been replaced by setJavaEnabled(bool)
  431. <li>enablePlugins(bool) has been replaced by setPluginsEnabled(bool)
  432. <li>autoloadImages(bool) has been replaced by setAutoloadImages(bool)
  433. <li>enableMetaRefresh(bool) has been replaced by setMetaRefreshEnabled(bool)
  434. <li>setBaseURL and setBaseTarget have been removed. baseURL(), baseTarget() and
  435. completeURL() are remained for compatibility reasons, but they're deprecated now. use the variants in DOM::HTMLDocument() instead.
  436. <li>the second parameter of TDEHTMLPart::completeURL is removed. it didn't have
  437. any effect before either.
  438. </ul>
  439. Besides that, all methods previously marked as deprecated or were internal
  440. but accidentally part of the public API are now private or removed.
  441. As they were marked as becoming private already you should not experience
  442. any problems. Backward compatibility exists for the common methods, to
  443. disable this use a #define KDE_NO_COMPAT.
  444. <p>In TDEHTMLView, the following changes were done:
  445. <ul>
  446. <li>gotoNextLink has been replaced by gotoLink(true);
  447. <li>gotoPrevLink has been replaced by gotoLink(false);
  448. </ul>
  449. <H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
  450. <H3><A NAME="tdefile">Changes in tdefile</A></H3>
  451. The tdefile-library, as used by the KFileDialog provides classes for directory browsing widgets.
  452. Those classes gained some new features, some parts were merged with other existing classes
  453. and in some cases the API was cleaned up/fixed. The library is now built as part of libtdeio
  454. library (there's no need to modify Makefiles which use $LIB_TDEFILE instead of hardcoding -ltdefile).
  455. <p>
  456. Even if the list of changes is long, the affected code base should be relatively small, as most
  457. parts are rarely used outside of tdefile.
  458. <p>
  459. The changes are:
  460. <H4>KFileItem</H4>
  461. The KFileViewItem class is completely replaced with KFileItem from tdeio. All its functionality has
  462. been merged with its former base class KFileItem. Additionally, some of its methods have been
  463. modified:
  464. <table>
  465. <tr><th>Old:</th><th>New:</th></tr>
  466. <tr><td>access()</td><td>permissionsString()</td></tr>
  467. <tr><td>date()</td><td>timeString()</td></tr>
  468. <tr><td>setViewItem( const KFileView *view, const void *item )</td><td>setExtraData( const void *key, void *value )</td></tr>
  469. <tr><td>pixmap()</td><td>The parameterless method has been removed, use pixmap( int size, int state = 0 ) instead.</td></tr>
  470. </table>
  471. <H4>KFileReader</H4>
  472. This class has been merged with KDirLister from tdeio.
  473. <H4>KDirOperator</H4>
  474. <table>
  475. <tr><th>Old:</th><th>New:</th></tr>
  476. <tr><td>saveConfig()</td><td>writeConfig()</td></tr>
  477. <tr><td>setFileReader()</td><td>setDirLister()</td></tr>
  478. <tr><td>fileReader()</td><td>dirLister()</td></tr>
  479. <tr><td>activatedMenu( const KFileViewItem * )</td><td>activatedMenu( const KFileItem *, const TQPoint& pos )</td></tr>
  480. </table>
  481. <H4>KFileDetailView</H4>
  482. The protected method setSortIndicator() has been removed, it's not needed anymore.
  483. <H4>KFileView</H4>
  484. This is the baseclass for all the views. It changed in many respects to allow for greater
  485. flexibility and efficiency.
  486. <br><br>
  487. Sorting has changed radically. Previously, KFileView had protected methods QuickSort,
  488. compareItems() and mergeLists() to sort directory entries for displaying in the views. Now,
  489. KFileView does not do any sorting anymore. Instead, the view's (i.e. TDEIconView, TDEListView)
  490. sorting is utilized by letting its view-items provide a TQString key() method. Therefore,
  491. KFileView offers the two methods
  492. <ul>
  493. <li>TQString sortingKey( const TQString&amp; value, bool isDir, int sortSpec )</li>
  494. <li>TQString sortingKey( TDEIO::filesize_t value, bool isDir, int sortSpec )</li>
  495. </ul>
  496. which the view-classes can use to generate the string for the key() method. The KFile::SortMode
  497. enum has been removed, as TQDir::SortSpec is used entirely.
  498. <br><br>
  499. Further changes:
  500. <table>
  501. <tr><th>Old:</th><th>New:</th></tr>
  502. <tr><td>not existant</td><td>virtual void readConfig( TDEConfig *, const TQString&amp; group = TQString::null )</td></tr>
  503. <tr><td>not existant</td><td>void writeConfig( TDEConfig *, const TQString&amp; group = TQString::null)</td></tr>
  504. <tr><td>virtual void setCurrentItem( const TQString&amp; filename, KFileViewItem * )</td><td>Replaced with the two methods below.</td></tr>
  505. <tr><td>&nbsp;</td><td>void setCurrentItem( const TQString&amp; filename );</td></tr>
  506. <tr><td>&nbsp;</td><td>virtual void setCurrentItem( const KFileViewItem * ) = 0;</td></tr>
  507. <tr><td>setOperator( TQObject * )</td><td>setParentView( KFileView * )</td></tr>
  508. <tr><td>virtual void insertSorted( KFileViewItem *, uint count )</td><td>virtual void insertItem( KFileItem * )</td></tr>
  509. <tr><td>virtual void addItemList( const KFileViewItemList &amp;list )</td><td>not virtual anymore. Sufficient to reimplement insertItem()</td></tr>
  510. </table>
  511. <br><br>
  512. Three more pure virtual methods have been added:
  513. <ul>
  514. <li>virtual KFileItem * firstFileItem() const = 0</li>
  515. <li>virtual KFileItem * nextItem( const KFileItem * ) const = 0</li>
  516. <li>virtual KFileItem * prevItem( const KFileItem * ) const = 0</li>
  517. </ul>
  518. <p>
  519. State-changes are now signaled solely via the KFileViewSignaler object, that every KFileView
  520. has a protected member of ("sig"). The methods activateMenu(), highlight() and select() have
  521. been removed. If you implemented a KFileView, change your code in the following way:
  522. <table>
  523. <tr><th>Old:</th><th>New:</th></tr>
  524. <tr><td>activateMenu( item )</td><td>sig->activateMenu( item, pos )</td></tr>
  525. <tr><td>highlight( item )</td><td>sig->highlightFile( item )</td></tr>
  526. <tr><td>select( item )</td><td>sig->select( item )</td></tr>
  527. </table>
  528. <H4>KFileViewSignaler</H4>
  529. The methods activateDir( const KFileViewItem * ) and activateFile( const KFileViewItem * )
  530. have been merged into the new method activate( const KFileItem * ).
  531. <br><br>
  532. Carsten Pfeiffer <A HREF=""></A>
  533. <H4>TDEIconDialog, TDEIconButton, KURLBar, KURLBarItem</H4>
  534. Methods now use TDEIcon::Group and TDEIcon::Context instead of int as types for group and context arguments.
  535. The change should affect only code using hardcoded numeric values instead of using the proper enum constants.
  536. <H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
  537. <p>
  538. <H3><A NAME="kcontrol">Changes in KControl</A></H3>
  539. <H4>Modules that require root permission</H4>
  540. The meaning of the <i>X-TDE-RootOnly</i> flag in the .desktop files has changed.
  541. In KControl 2.0 a message was shown if the user did not press the &quot;modify&quot;
  542. button. With the additional flag <i>X-TDE-HasReadOnlyMode</i> it was possible to show
  543. a disabled version of the module instead of the message. The behavior was inconsistent
  544. and has been changed:
  545. <ul>
  546. <li><i>X-TDE-HasReadOnlyMode</i> is not used anymore and is ignored by KControl &gt; 2.0.
  547. <li><i>X-TDE-RootOnly</i> does now show a disabled preview of the widget and a notification box.
  548. <li>If you want the old behavior back set <i>X-TDE-IsHiddenByDefault</i> along with
  549. <i>X-TDE-RootOnly</i>. Please note that this behavior is deprecated the sake of
  550. usability.
  551. </ul>
  552. For more details please consult the HOWTO file in the kcontrol directory.
  553. <H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
  554. <p>
  555. <H3><A NAME="kicker">Panel Applets and Extensions</A></H3>
  556. <p>The API for Kicker panel applets and extensions has changed. Panels can now be
  557. left/top, center, or right/bottom aligned, and applets and extensions may receive
  558. notification about a change in alignment.
  559. <H4>KPanelApplet</H4>
  560. <p>The virtual methods orientationChange() and popupDirectionChange() are deprecated.
  561. Instead you should reimplement positionChange() and alignmentChange() to be
  562. notified of changes in the position and alignment of the panel on which your applet
  563. resides. In addition, the popupDirection() method and the Direction enum are
  564. deprecated. Instead you should use the position() method and Position enum. Applets that use
  565. the deprecated methods will still work with KDE 3, but may not compile or work with
  566. a future version.
  567. <H4>KPanelExtension</H4>
  568. <p>There is a new method alignmentChange() that your extension should reimplement if
  569. it needs to know about changes in alignment.
  570. <H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
  571. <p>
  572. Dirk Mueller <A HREF=""></A>
  573. </BODY>
  574. </HTML>