From b10a61b1fd2fe561ba61a384d4a344bae2a4aa29 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sun, 27 Jan 2013 01:04:58 -0600 Subject: Rename a number of libraries and executables to avoid conflicts with KDE4 --- CMakeLists.txt | 4 +- dcoprss/service.cpp | 2 +- dcoprss/xmlrpciface.cpp | 2 +- doc/kopete/index.docbook | 2 +- filesharing/Makefile.am | 2 +- .../advanced/kcm_sambaconf/hiddenfileview.cpp | 2 +- .../advanced/kcm_sambaconf/hiddenfileview.h | 2 +- .../advanced/kcm_sambaconf/kcmsambaconf.cpp | 2 +- .../advanced/kcm_sambaconf/kcmsambaconf.desktop | 2 +- filesharing/advanced/kcm_sambaconf/sambafile.cpp | 2 +- filesharing/advanced/kcm_sambaconf/sambafile.h | 2 +- .../advanced/kcm_sambaconf/sharedlgimpl.cpp | 2 +- .../advanced/kcm_sambaconf/smbconfconfigwidget.cpp | 2 +- filesharing/advanced/nfs/nfsdialog.cpp | 2 +- filesharing/advanced/propsdlgplugin/CMakeLists.txt | 2 +- .../advanced/propsdlgplugin/propertiespage.cpp | 4 +- .../advanced/propsdlgplugin/propertiespage.h | 2 +- .../propsdlgplugin/propsdlgshareplugin.cpp | 6 +- filesharing/simple/CMakeLists.txt | 2 +- filesharing/simple/fileshare.cpp | 4 +- filesharing/simple/fileshare.desktop | 2 +- filesharing/simple/fileshare.h | 2 +- kdict/applet/kdictapplet.cpp | 2 +- kdict/options.cpp | 2 +- kdict/queryview.cpp | 4 +- kfile-plugins/CMakeLists.txt | 12 - kfile-plugins/Makefile.am | 1 - kfile-plugins/RETURNED_ITEMS | 15 - kfile-plugins/torrent/CMakeLists.txt | 38 -- kfile-plugins/torrent/Makefile.am | 22 -- kfile-plugins/torrent/README | 7 - kfile-plugins/torrent/bbase.h | 91 ----- kfile-plugins/torrent/bdict.cpp | 220 ----------- kfile-plugins/torrent/bdict.h | 203 ----------- kfile-plugins/torrent/bint.cpp | 104 ------ kfile-plugins/torrent/bint.h | 111 ------ kfile-plugins/torrent/blist.cpp | 178 --------- kfile-plugins/torrent/blist.h | 200 ---------- kfile-plugins/torrent/bstring.cpp | 128 ------- kfile-plugins/torrent/bstring.h | 138 ------- kfile-plugins/torrent/bytetape.cpp | 158 -------- kfile-plugins/torrent/bytetape.h | 194 ---------- kfile-plugins/torrent/kfile_torrent.cpp | 404 --------------------- kfile-plugins/torrent/kfile_torrent.desktop | 58 --- kfile-plugins/torrent/kfile_torrent.h | 85 ----- kget/CMakeLists.txt | 4 +- kget/Makefile.am | 4 +- kget/dlgAdvanced.cpp | 2 +- kget/dlgDirectories.cpp | 2 +- kget/dlgIndividual.cpp | 2 +- kget/dlgIndividual.h | 2 +- kget/droptarget.cpp | 2 +- kget/getfilejob.h | 2 +- kget/kfileio.cpp | 174 --------- kget/kfileio.h | 44 --- kget/kmainwidget.cpp | 16 +- kget/safedelete.cpp | 2 +- kget/settings.cpp | 2 +- kget/slave.cpp | 2 +- kget/tdefileio.cpp | 174 +++++++++ kget/tdefileio.h | 44 +++ kget/transfer.cpp | 8 +- kget/transfer.h | 2 +- kget/transferlist.cpp | 4 +- knewsticker/CMakeLists.txt | 2 +- knewsticker/Makefile.am | 2 +- knewsticker/common/configaccess.h | 4 +- knewsticker/common/newsengine.h | 2 +- knewsticker/common/newsiconmgr.h | 2 +- knewsticker/common/xmlnewsaccess.h | 2 +- knewsticker/knewstickerstub/CMakeLists.txt | 2 +- kopete/INSTALL | 4 +- kopete/kopete/CMakeLists.txt | 2 +- kopete/kopete/Makefile.am | 2 +- .../kopete/addcontactwizard/addcontactwizard.cpp | 2 +- kopete/kopete/chatwindow/chatmessagepart.cpp | 6 +- kopete/kopete/chatwindow/chatview.cpp | 2 +- kopete/kopete/chatwindow/kopetechatwindow.cpp | 2 +- .../chatwindow/kopetechatwindowstylemanager.cpp | 4 +- .../chatwindow/kopetechatwindowstylemanager.h | 2 +- kopete/kopete/chatwindow/kopeteemailwindow.cpp | 2 +- kopete/kopete/chatwindow/krichtexteditpart.cpp | 2 +- .../kopete/config/appearance/appearanceconfig.cpp | 10 +- .../config/appearance/emoticonseditdialog.cpp | 4 +- kopete/kopete/config/avdevice/avdeviceconfig.cpp | 2 +- kopete/kopete/config/behavior/behaviorconfig.cpp | 2 +- .../config/identity/kopeteidentityconfig.cpp | 4 +- .../kopete/config/identity/kopeteidentityconfig.h | 2 +- .../identity/kopeteidentityconfigpreferences.kcfgc | 2 +- .../kopete/contactlist/customnotificationprops.cpp | 2 +- kopete/kopete/contactlist/kopetelviprops.cpp | 4 +- kopete/kopete/contactlist/kopetemetacontactlvi.cpp | 2 +- kopete/kopete/kconf_update/CMakeLists.txt | 64 ---- kopete/kopete/kconf_update/Makefile.am | 32 -- kopete/kopete/kconf_update/kopete-account-0.10.pl | 26 -- .../kconf_update/kopete-account-kconf_update.cpp | 247 ------------- .../kconf_update/kopete-account-kconf_update.sh | 10 - .../kconf_update/kopete-account-kconf_update.upd | 9 - .../kopete-jabberpriorityaddition-kconf_update.sh | 2 - .../kopete-jabberpriorityaddition-kconf_update.upd | 4 - .../kopete-jabberproxytype-kconf_update.sh | 2 - .../kopete-jabberproxytype-kconf_update.upd | 4 - kopete/kopete/kconf_update/kopete-nameTracking.cpp | 135 ------- kopete/kopete/kconf_update/kopete-nameTracking.upd | 3 - kopete/kopete/kconf_update/kopete-pluginloader.pl | 28 -- kopete/kopete/kconf_update/kopete-pluginloader.upd | 4 - .../kopete/kconf_update/kopete-pluginloader2.cpp | 89 ----- kopete/kopete/kconf_update/kopete-pluginloader2.sh | 10 - .../kopete/kconf_update/kopete-pluginloader2.upd | 4 - kopete/kopete/kopeteapplication.cpp | 2 +- kopete/kopete/kopeteeditglobalidentitywidget.cpp | 4 +- kopete/kopete/kopeteiface.cpp | 2 +- kopete/kopete/kopetewindow.cpp | 2 +- kopete/kopete/tdeconf_update/CMakeLists.txt | 64 ++++ kopete/kopete/tdeconf_update/Makefile.am | 32 ++ .../kopete/tdeconf_update/kopete-account-0.10.pl | 26 ++ .../kopete-account-tdeconf_update.cpp | 247 +++++++++++++ .../kopete-account-tdeconf_update.sh | 10 + .../kopete-account-tdeconf_update.upd | 9 + ...kopete-jabberpriorityaddition-tdeconf_update.sh | 2 + ...opete-jabberpriorityaddition-tdeconf_update.upd | 4 + .../kopete-jabberproxytype-tdeconf_update.sh | 2 + .../kopete-jabberproxytype-tdeconf_update.upd | 4 + .../kopete/tdeconf_update/kopete-nameTracking.cpp | 135 +++++++ .../kopete/tdeconf_update/kopete-nameTracking.upd | 3 + .../kopete/tdeconf_update/kopete-pluginloader.pl | 28 ++ .../kopete/tdeconf_update/kopete-pluginloader.upd | 4 + .../kopete/tdeconf_update/kopete-pluginloader2.cpp | 89 +++++ .../kopete/tdeconf_update/kopete-pluginloader2.sh | 10 + .../kopete/tdeconf_update/kopete-pluginloader2.upd | 4 + kopete/libkopete/avdevice/videodevicepool.h | 2 +- kopete/libkopete/kautoconfig.cpp | 6 +- kopete/libkopete/kautoconfig.h | 4 +- kopete/libkopete/knotification.cpp | 2 +- kopete/libkopete/kopeteaccount.cpp | 2 +- kopete/libkopete/kopeteaccountmanager.cpp | 2 +- kopete/libkopete/kopeteaway.cpp | 2 +- kopete/libkopete/kopeteblacklister.cpp | 2 +- kopete/libkopete/kopetecontactlistelement.cpp | 2 +- kopete/libkopete/kopeteglobal.cpp | 2 +- kopete/libkopete/kopetemimetypehandler.cpp | 2 +- kopete/libkopete/kopetepassword.cpp | 2 +- kopete/libkopete/kopetepluginmanager.cpp | 2 +- kopete/libkopete/kopeteprefs.cpp | 2 +- kopete/libkopete/kopetetransfermanager.cpp | 6 +- kopete/libkopete/kopetetransfermanager.h | 2 +- kopete/libkopete/kopeteutils.cpp | 2 +- kopete/libkopete/private/kopeteviewmanager.cpp | 2 +- kopete/libkopete/ui/addressbookselectorwidget.cpp | 2 +- kopete/libkopete/ui/kopetefileconfirmdialog.cpp | 4 +- kopete/libkopete/ui/kopetelistview.cpp | 2 +- kopete/libkopete/ui/metacontactselectorwidget.cpp | 2 +- kopete/plugins/addbookmarks/CMakeLists.txt | 2 +- kopete/plugins/addbookmarks/Makefile.am | 2 +- kopete/plugins/addbookmarks/addbookmarksplugin.h | 2 +- .../addbookmarks/addbookmarksprefssettings.cpp | 2 +- kopete/plugins/alias/CMakeLists.txt | 2 +- kopete/plugins/alias/Makefile.am | 2 +- kopete/plugins/alias/aliaspreferences.cpp | 2 +- kopete/plugins/autoreplace/CMakeLists.txt | 2 +- kopete/plugins/autoreplace/Makefile.am | 2 +- kopete/plugins/autoreplace/autoreplaceconfig.cpp | 2 +- kopete/plugins/cryptography/CMakeLists.txt | 2 +- kopete/plugins/cryptography/Makefile.am | 2 +- .../plugins/cryptography/cryptographyguiclient.cpp | 2 +- kopete/plugins/cryptography/cryptographyplugin.cpp | 2 +- kopete/plugins/cryptography/popuppublic.cpp | 2 +- kopete/plugins/highlight/CMakeLists.txt | 2 +- kopete/plugins/highlight/Makefile.am | 2 +- kopete/plugins/history/CMakeLists.txt | 2 +- kopete/plugins/history/Makefile.am | 2 +- kopete/plugins/history/converter.cpp | 2 +- kopete/plugins/history/historyconfig.kcfgc | 2 +- kopete/plugins/history/historyplugin.cpp | 2 +- kopete/plugins/latex/CMakeLists.txt | 2 +- kopete/plugins/latex/Makefile.am | 2 +- kopete/plugins/latex/latexconfig.kcfgc | 2 +- kopete/plugins/latex/latexguiclient.h | 2 +- kopete/plugins/motionautoaway/CMakeLists.txt | 2 +- kopete/plugins/motionautoaway/Makefile.am | 2 +- kopete/plugins/motionautoaway/motionawayplugin.cpp | 12 +- kopete/plugins/netmeeting/CMakeLists.txt | 2 +- kopete/plugins/netmeeting/Makefile.am | 2 +- kopete/plugins/netmeeting/netmeetinginvitation.cpp | 2 +- .../plugins/netmeeting/netmeetingpreferences.cpp | 2 +- kopete/plugins/nowlistening/CMakeLists.txt | 2 +- kopete/plugins/nowlistening/Makefile.am | 2 +- .../plugins/nowlistening/nowlisteningconfig.kcfgc | 2 +- kopete/plugins/smpppdcs/CMakeLists.txt | 2 +- kopete/plugins/smpppdcs/Makefile.am | 2 +- kopete/plugins/smpppdcs/detectorsmpppd.cpp | 2 +- kopete/plugins/texteffect/CMakeLists.txt | 2 +- kopete/plugins/texteffect/Makefile.am | 2 +- kopete/plugins/texteffect/texteffectconfig.cpp | 2 +- kopete/plugins/translator/CMakeLists.txt | 2 +- kopete/plugins/translator/Makefile.am | 2 +- kopete/plugins/translator/translatorguiclient.h | 2 +- kopete/plugins/translator/translatorplugin.cpp | 2 +- kopete/plugins/translator/translatorplugin.h | 2 +- kopete/plugins/webpresence/CMakeLists.txt | 2 +- kopete/plugins/webpresence/Makefile.am | 2 +- kopete/plugins/webpresence/webpresenceplugin.cpp | 28 +- kopete/plugins/webpresence/webpresenceplugin.h | 2 +- kopete/protocols/gadu/gaduaccount.cpp | 4 +- kopete/protocols/gadu/gaduaccount.h | 2 +- kopete/protocols/gadu/gaducontact.cpp | 2 +- kopete/protocols/gadu/gaduprotocol.cpp | 2 +- kopete/protocols/groupwise/gwaccount.cpp | 2 +- .../protocols/groupwise/ui/gweditaccountwidget.cpp | 2 +- .../groupwise/ui/gwreceiveinvitationdialog.cpp | 2 +- kopete/protocols/irc/ircaccount.cpp | 2 +- kopete/protocols/irc/irccontactmanager.cpp | 4 +- kopete/protocols/irc/ircprotocol.cpp | 2 +- kopete/protocols/irc/ircusercontact.cpp | 2 +- kopete/protocols/irc/libkirc/kircengine.cpp | 2 +- kopete/protocols/irc/libkirc/ksslsocket.cpp | 12 +- kopete/protocols/irc/libkirc/ksslsocket.h | 2 +- kopete/protocols/irc/ui/CMakeLists.txt | 2 +- kopete/protocols/irc/ui/Makefile.am | 2 +- kopete/protocols/irc/ui/irceditaccountwidget.cpp | 2 +- kopete/protocols/irc/ui/networkconfig.ui | 382 ------------------- kopete/protocols/irc/ui/networkconfig.ui.h | 26 -- kopete/protocols/irc/ui/networtdeconfig.ui | 382 +++++++++++++++++++ kopete/protocols/irc/ui/networtdeconfig.ui.h | 26 ++ kopete/protocols/jabber/CMakeLists.txt | 2 +- kopete/protocols/jabber/Makefile.am | 2 +- kopete/protocols/jabber/jabberaccount.cpp | 2 +- kopete/protocols/jabber/jabberbasecontact.cpp | 2 +- kopete/protocols/jabber/jabberchatsession.cpp | 4 +- kopete/protocols/jabber/jabbercontact.cpp | 4 +- kopete/protocols/jabber/jabberfiletransfer.cpp | 2 +- kopete/protocols/jabber/jabbergroupcontact.cpp | 2 +- .../protocols/jabber/jabbergroupmembercontact.cpp | 2 +- kopete/protocols/jabber/jabberprotocol.cpp | 2 +- kopete/protocols/jabber/jabbertransport.cpp | 2 +- kopete/protocols/jabber/kioslave/CMakeLists.txt | 42 --- kopete/protocols/jabber/kioslave/Makefile.am | 25 -- kopete/protocols/jabber/kioslave/jabberdisco.cpp | 399 -------------------- kopete/protocols/jabber/kioslave/jabberdisco.h | 83 ----- .../protocols/jabber/kioslave/jabberdisco.protocol | 53 --- kopete/protocols/jabber/tdeioslave/CMakeLists.txt | 42 +++ kopete/protocols/jabber/tdeioslave/Makefile.am | 25 ++ kopete/protocols/jabber/tdeioslave/jabberdisco.cpp | 399 ++++++++++++++++++++ kopete/protocols/jabber/tdeioslave/jabberdisco.h | 83 +++++ .../jabber/tdeioslave/jabberdisco.protocol | 53 +++ kopete/protocols/jabber/ui/dlgjabbervcard.cpp | 4 +- kopete/protocols/jabber/ui/jabberchooseserver.cpp | 6 +- .../jabber/ui/jabbereditaccountwidget.cpp | 2 +- kopete/protocols/meanwhile/meanwhileaccount.cpp | 2 +- kopete/protocols/msn/config/CMakeLists.txt | 2 +- kopete/protocols/msn/config/Makefile.am | 2 +- kopete/protocols/msn/msnaccount.cpp | 2 +- kopete/protocols/msn/msnchatsession.cpp | 2 +- kopete/protocols/msn/msncontact.cpp | 6 +- kopete/protocols/msn/msnfiletransfersocket.cpp | 2 +- kopete/protocols/msn/msnnotifysocket.cpp | 4 +- kopete/protocols/msn/msnprotocol.cpp | 2 +- kopete/protocols/msn/msnsecureloginhandler.cpp | 2 +- kopete/protocols/msn/msnsocket.cpp | 2 +- kopete/protocols/msn/msnswitchboardsocket.cpp | 2 +- kopete/protocols/msn/ui/msneditaccountwidget.cpp | 6 +- kopete/protocols/msn/webcam.cpp | 2 +- kopete/protocols/oscar/aim/aimaccount.cpp | 2 +- .../oscar/aim/ui/aimeditaccountwidget.cpp | 2 +- kopete/protocols/oscar/icq/icqaccount.cpp | 2 +- .../oscar/icq/ui/icqeditaccountwidget.cpp | 2 +- kopete/protocols/oscar/oscaraccount.cpp | 2 +- kopete/protocols/oscar/oscarversionupdater.cpp | 4 +- kopete/protocols/sms/services/gsmlib.cpp | 2 +- kopete/protocols/sms/services/smsclient.cpp | 2 +- kopete/protocols/sms/services/smssend.cpp | 2 +- kopete/protocols/sms/services/smssendprovider.cpp | 2 +- kopete/protocols/sms/smsaccount.cpp | 2 +- kopete/protocols/sms/smscontact.cpp | 2 +- kopete/protocols/sms/smseditaccountwidget.cpp | 2 +- kopete/protocols/sms/smsprotocol.cpp | 2 +- .../protocols/winpopup/libwinpopup/libwinpopup.h | 2 +- kopete/protocols/winpopup/wpaccount.cpp | 2 +- kopete/protocols/winpopup/wpeditaccount.cpp | 2 +- kopete/protocols/yahoo/libkyahoo/logintask.cpp | 2 +- kopete/protocols/yahoo/libkyahoo/modifyyabtask.cpp | 6 +- .../protocols/yahoo/libkyahoo/receivefiletask.cpp | 6 +- kopete/protocols/yahoo/libkyahoo/sendfiletask.cpp | 2 +- .../protocols/yahoo/libkyahoo/sendpicturetask.cpp | 6 +- kopete/protocols/yahoo/libkyahoo/yabtask.cpp | 6 +- .../yahoo/libkyahoo/yahoobuddyiconloader.cpp | 6 +- kopete/protocols/yahoo/libkyahoo/yahoochattask.cpp | 6 +- kopete/protocols/yahoo/yahooaccount.cpp | 2 +- kopete/protocols/yahoo/yahoochatsession.cpp | 2 +- .../yahoo/yahooconferencemessagemanager.cpp | 2 +- kopete/protocols/yahoo/yahoocontact.cpp | 8 +- kopete/protocols/yahoo/yahooeditaccount.cpp | 4 +- kopete/protocols/yahoo/yahooverifyaccount.cpp | 6 +- kpf/src/Applet.cpp | 2 +- kpf/src/CMakeLists.txt | 4 +- kpf/src/ConfigDialogPage.cpp | 2 +- kpf/src/ErrorMessageConfigDialog.cpp | 2 +- kpf/src/PropertiesDialogPlugin.cpp | 2 +- kpf/src/Response.cpp | 2 +- kpf/src/ServerWizard.cpp | 2 +- kpf/src/WebServer.cpp | 2 +- kpf/src/WebServerManager.cpp | 2 +- kppp/CMakeLists.txt | 2 +- kppp/ChangeLog | 2 +- kppp/kpppwidget.cpp | 2 +- kppp/logview/CMakeLists.txt | 2 +- kppp/logview/export.h | 2 +- kppp/modemdb.cpp | 2 +- kppp/pppdata.cpp | 2 +- krdc/hostpreferences.cpp | 2 +- krdc/krdc.cpp | 2 +- krdc/main.cpp | 2 +- krdc/rdp/rdphostpref.cpp | 2 +- krdc/vnc/vnchostpref.cpp | 2 +- krfb/kcm_krfb/CMakeLists.txt | 2 +- krfb/kcm_krfb/kcm_krfb.cpp | 2 +- krfb/kcm_krfb/kcmkrfb.desktop | 2 +- krfb/kinetd/kinetd.cpp | 2 +- krfb/krfb/CMakeLists.txt | 2 +- krfb/krfb/configuration.cc | 2 +- krfb/krfb/configuration.h | 2 +- krfb/krfb/invitation.h | 2 +- ksirc/CMakeLists.txt | 2 +- ksirc/FilterRuleEditor.cpp | 2 +- ksirc/KSOpenkSirc/open_ksirc.cpp | 2 +- ksirc/KSPrefs/page_autoconnect.cpp | 2 +- ksirc/KSPrefs/page_colors.cpp | 2 +- ksirc/KSPrefs/page_irccolors.cpp | 2 +- ksirc/KSPrefs/page_looknfeel.cpp | 2 +- ksirc/KSPrefs/page_servchan.cpp | 2 +- ksirc/KSPrefs/page_startup.cpp | 2 +- ksirc/KSTicker/ksticker.cpp | 2 +- ksirc/KSTicker/ksttest.cpp | 2 +- ksirc/NewWindowDialog.cpp | 2 +- ksirc/dccNew.cpp | 2 +- ksirc/iocontroller.cpp | 2 +- ksirc/ksirc.cpp | 2 +- ksirc/ksircprocess.cpp | 2 +- ksirc/ksopts.cpp | 2 +- ksirc/ksview.cpp | 4 +- ksirc/mditoplevel.cpp | 2 +- ksirc/puke/Makefile.am | 4 +- ksirc/puke/controller.cpp | 2 +- ksirc/puke/dcc_status.pm | 2 +- ksirc/puke/load_all.pm | 2 +- ksirc/puke/pkfiledialog-cmd.h | 56 --- ksirc/puke/pkfiledialog.cpp | 123 ------- ksirc/puke/pkfiledialog.h | 32 -- ksirc/puke/pkfiledialog.pm | 76 ---- ksirc/puke/ptdefiledialog-cmd.h | 56 +++ ksirc/puke/ptdefiledialog.cpp | 123 +++++++ ksirc/puke/ptdefiledialog.h | 32 ++ ksirc/puke/ptdefiledialog.pm | 76 ++++ ksirc/servercontroller.cpp | 2 +- ksirc/topic.cpp | 4 +- ksirc/toplevel.cpp | 4 +- ksirc/usercontrolmenu.cpp | 2 +- ktalkd/kcmktalkd/CMakeLists.txt | 2 +- ktalkd/kcmktalkd/kcmktalkd.desktop | 2 +- ktalkd/ktalkd/readcfg++.cpp | 2 +- ktalkd/ktalkdlg/ktalkdlg.cpp | 2 +- lanbrowsing/kcmlisa/kcmkiolan.desktop | 4 +- lanbrowsing/kcmlisa/kcmkiolan.h | 2 +- lanbrowsing/kcmlisa/kcmlisa.desktop | 2 +- lanbrowsing/kcmlisa/kcmlisa.h | 2 +- lanbrowsing/kcmlisa/kcmreslisa.desktop | 2 +- lanbrowsing/kcmlisa/kcmreslisa.h | 2 +- lanbrowsing/kio_lan/CMakeLists.txt | 2 +- lanbrowsing/kio_lan/Makefile.am | 4 +- lanbrowsing/kio_lan/README | 6 +- lanbrowsing/kio_lan/kio_lan.cpp | 2 +- lanbrowsing/kio_lan/kio_lan.h | 6 +- lanbrowsing/kio_lan/lan.protocol | 2 +- lanbrowsing/kio_lan/rlan.protocol | 2 +- librss/CMakeLists.txt | 2 +- librss/image.cpp | 2 +- librss/loader.cpp | 2 +- librss/loader.h | 2 +- tdednssd/ioslave/CMakeLists.txt | 2 +- tdednssd/ioslave/CONFIG_FORMAT | 2 +- tdednssd/ioslave/Makefile.am | 2 +- tdednssd/ioslave/dnssd.cpp | 2 +- tdednssd/ioslave/dnssd.h | 4 +- tdednssd/ioslave/zeroconf.protocol | 52 +-- tdefile-plugins/CMakeLists.txt | 12 + tdefile-plugins/Makefile.am | 1 + tdefile-plugins/RETURNED_ITEMS | 15 + tdefile-plugins/torrent/CMakeLists.txt | 38 ++ tdefile-plugins/torrent/Makefile.am | 22 ++ tdefile-plugins/torrent/README | 7 + tdefile-plugins/torrent/bbase.h | 91 +++++ tdefile-plugins/torrent/bdict.cpp | 220 +++++++++++ tdefile-plugins/torrent/bdict.h | 203 +++++++++++ tdefile-plugins/torrent/bint.cpp | 104 ++++++ tdefile-plugins/torrent/bint.h | 111 ++++++ tdefile-plugins/torrent/blist.cpp | 178 +++++++++ tdefile-plugins/torrent/blist.h | 200 ++++++++++ tdefile-plugins/torrent/bstring.cpp | 128 +++++++ tdefile-plugins/torrent/bstring.h | 138 +++++++ tdefile-plugins/torrent/bytetape.cpp | 158 ++++++++ tdefile-plugins/torrent/bytetape.h | 194 ++++++++++ tdefile-plugins/torrent/tdefile_torrent.cpp | 404 +++++++++++++++++++++ tdefile-plugins/torrent/tdefile_torrent.desktop | 58 +++ tdefile-plugins/torrent/tdefile_torrent.h | 85 +++++ wifi/kcmwifi/CMakeLists.txt | 2 +- wifi/kcmwifi/kcmwifi.desktop | 2 +- wifi/kwifimanager.cpp | 6 +- wifi/kwireless/kwireless.cpp | 2 +- wifi/kwireless/kwireless.h | 2 +- 409 files changed, 4995 insertions(+), 4995 deletions(-) delete mode 100644 kfile-plugins/CMakeLists.txt delete mode 100644 kfile-plugins/Makefile.am delete mode 100644 kfile-plugins/RETURNED_ITEMS delete mode 100644 kfile-plugins/torrent/CMakeLists.txt delete mode 100644 kfile-plugins/torrent/Makefile.am delete mode 100644 kfile-plugins/torrent/README delete mode 100644 kfile-plugins/torrent/bbase.h delete mode 100644 kfile-plugins/torrent/bdict.cpp delete mode 100644 kfile-plugins/torrent/bdict.h delete mode 100644 kfile-plugins/torrent/bint.cpp delete mode 100644 kfile-plugins/torrent/bint.h delete mode 100644 kfile-plugins/torrent/blist.cpp delete mode 100644 kfile-plugins/torrent/blist.h delete mode 100644 kfile-plugins/torrent/bstring.cpp delete mode 100644 kfile-plugins/torrent/bstring.h delete mode 100644 kfile-plugins/torrent/bytetape.cpp delete mode 100644 kfile-plugins/torrent/bytetape.h delete mode 100644 kfile-plugins/torrent/kfile_torrent.cpp delete mode 100644 kfile-plugins/torrent/kfile_torrent.desktop delete mode 100644 kfile-plugins/torrent/kfile_torrent.h delete mode 100644 kget/kfileio.cpp delete mode 100644 kget/kfileio.h create mode 100644 kget/tdefileio.cpp create mode 100644 kget/tdefileio.h delete mode 100644 kopete/kopete/kconf_update/CMakeLists.txt delete mode 100644 kopete/kopete/kconf_update/Makefile.am delete mode 100755 kopete/kopete/kconf_update/kopete-account-0.10.pl delete mode 100644 kopete/kopete/kconf_update/kopete-account-kconf_update.cpp delete mode 100644 kopete/kopete/kconf_update/kopete-account-kconf_update.sh delete mode 100644 kopete/kopete/kconf_update/kopete-account-kconf_update.upd delete mode 100644 kopete/kopete/kconf_update/kopete-jabberpriorityaddition-kconf_update.sh delete mode 100644 kopete/kopete/kconf_update/kopete-jabberpriorityaddition-kconf_update.upd delete mode 100644 kopete/kopete/kconf_update/kopete-jabberproxytype-kconf_update.sh delete mode 100644 kopete/kopete/kconf_update/kopete-jabberproxytype-kconf_update.upd delete mode 100644 kopete/kopete/kconf_update/kopete-nameTracking.cpp delete mode 100644 kopete/kopete/kconf_update/kopete-nameTracking.upd delete mode 100755 kopete/kopete/kconf_update/kopete-pluginloader.pl delete mode 100644 kopete/kopete/kconf_update/kopete-pluginloader.upd delete mode 100644 kopete/kopete/kconf_update/kopete-pluginloader2.cpp delete mode 100644 kopete/kopete/kconf_update/kopete-pluginloader2.sh delete mode 100644 kopete/kopete/kconf_update/kopete-pluginloader2.upd create mode 100644 kopete/kopete/tdeconf_update/CMakeLists.txt create mode 100644 kopete/kopete/tdeconf_update/Makefile.am create mode 100755 kopete/kopete/tdeconf_update/kopete-account-0.10.pl create mode 100644 kopete/kopete/tdeconf_update/kopete-account-tdeconf_update.cpp create mode 100644 kopete/kopete/tdeconf_update/kopete-account-tdeconf_update.sh create mode 100644 kopete/kopete/tdeconf_update/kopete-account-tdeconf_update.upd create mode 100644 kopete/kopete/tdeconf_update/kopete-jabberpriorityaddition-tdeconf_update.sh create mode 100644 kopete/kopete/tdeconf_update/kopete-jabberpriorityaddition-tdeconf_update.upd create mode 100644 kopete/kopete/tdeconf_update/kopete-jabberproxytype-tdeconf_update.sh create mode 100644 kopete/kopete/tdeconf_update/kopete-jabberproxytype-tdeconf_update.upd create mode 100644 kopete/kopete/tdeconf_update/kopete-nameTracking.cpp create mode 100644 kopete/kopete/tdeconf_update/kopete-nameTracking.upd create mode 100755 kopete/kopete/tdeconf_update/kopete-pluginloader.pl create mode 100644 kopete/kopete/tdeconf_update/kopete-pluginloader.upd create mode 100644 kopete/kopete/tdeconf_update/kopete-pluginloader2.cpp create mode 100644 kopete/kopete/tdeconf_update/kopete-pluginloader2.sh create mode 100644 kopete/kopete/tdeconf_update/kopete-pluginloader2.upd delete mode 100644 kopete/protocols/irc/ui/networkconfig.ui delete mode 100644 kopete/protocols/irc/ui/networkconfig.ui.h create mode 100644 kopete/protocols/irc/ui/networtdeconfig.ui create mode 100644 kopete/protocols/irc/ui/networtdeconfig.ui.h delete mode 100644 kopete/protocols/jabber/kioslave/CMakeLists.txt delete mode 100644 kopete/protocols/jabber/kioslave/Makefile.am delete mode 100644 kopete/protocols/jabber/kioslave/jabberdisco.cpp delete mode 100644 kopete/protocols/jabber/kioslave/jabberdisco.h delete mode 100644 kopete/protocols/jabber/kioslave/jabberdisco.protocol create mode 100644 kopete/protocols/jabber/tdeioslave/CMakeLists.txt create mode 100644 kopete/protocols/jabber/tdeioslave/Makefile.am create mode 100644 kopete/protocols/jabber/tdeioslave/jabberdisco.cpp create mode 100644 kopete/protocols/jabber/tdeioslave/jabberdisco.h create mode 100644 kopete/protocols/jabber/tdeioslave/jabberdisco.protocol delete mode 100644 ksirc/puke/pkfiledialog-cmd.h delete mode 100644 ksirc/puke/pkfiledialog.cpp delete mode 100644 ksirc/puke/pkfiledialog.h delete mode 100644 ksirc/puke/pkfiledialog.pm create mode 100644 ksirc/puke/ptdefiledialog-cmd.h create mode 100644 ksirc/puke/ptdefiledialog.cpp create mode 100644 ksirc/puke/ptdefiledialog.h create mode 100644 ksirc/puke/ptdefiledialog.pm create mode 100644 tdefile-plugins/CMakeLists.txt create mode 100644 tdefile-plugins/Makefile.am create mode 100644 tdefile-plugins/RETURNED_ITEMS create mode 100644 tdefile-plugins/torrent/CMakeLists.txt create mode 100644 tdefile-plugins/torrent/Makefile.am create mode 100644 tdefile-plugins/torrent/README create mode 100644 tdefile-plugins/torrent/bbase.h create mode 100644 tdefile-plugins/torrent/bdict.cpp create mode 100644 tdefile-plugins/torrent/bdict.h create mode 100644 tdefile-plugins/torrent/bint.cpp create mode 100644 tdefile-plugins/torrent/bint.h create mode 100644 tdefile-plugins/torrent/blist.cpp create mode 100644 tdefile-plugins/torrent/blist.h create mode 100644 tdefile-plugins/torrent/bstring.cpp create mode 100644 tdefile-plugins/torrent/bstring.h create mode 100644 tdefile-plugins/torrent/bytetape.cpp create mode 100644 tdefile-plugins/torrent/bytetape.h create mode 100644 tdefile-plugins/torrent/tdefile_torrent.cpp create mode 100644 tdefile-plugins/torrent/tdefile_torrent.desktop create mode 100644 tdefile-plugins/torrent/tdefile_torrent.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 9156d227..458cd9f2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -112,7 +112,7 @@ option( BUILD_DOC "Build doc" ${BUILD_ALL} ) option( BUILD_FILESHARING "Build filesharing" ${BUILD_ALL} ) option( BUILD_KDICT "Build kdict" ${BUILD_ALL} ) option( BUILD_KDNSSD "Build tdednssd" ${BUILD_ALL} ) -option( BUILD_KFILE_PLUGINS "Build kfile-plugins" ${BUILD_ALL} ) +option( BUILD_KFILE_PLUGINS "Build tdefile-plugins" ${BUILD_ALL} ) option( BUILD_KGET "Build kget" ${BUILD_ALL} ) option( BUILD_KNEWSTICKER "Build knewsticker" ${BUILD_ALL} ) option( BUILD_KOPETE "Build kopete" ${BUILD_ALL} ) @@ -150,7 +150,7 @@ tde_conditional_add_subdirectory( BUILD_DOC doc ) tde_conditional_add_subdirectory( BUILD_FILESHARING filesharing ) tde_conditional_add_subdirectory( BUILD_KDICT kdict ) tde_conditional_add_subdirectory( BUILD_KDNSSD tdednssd ) -tde_conditional_add_subdirectory( BUILD_KFILE_PLUGINS kfile-plugins ) +tde_conditional_add_subdirectory( BUILD_KFILE_PLUGINS tdefile-plugins ) tde_conditional_add_subdirectory( BUILD_KGET kget ) tde_conditional_add_subdirectory( BUILD_KNEWSTICKER knewsticker ) tde_conditional_add_subdirectory( BUILD_KOPETE kopete ) diff --git a/dcoprss/service.cpp b/dcoprss/service.cpp index de9f0499..00e56281 100644 --- a/dcoprss/service.cpp +++ b/dcoprss/service.cpp @@ -17,7 +17,7 @@ ***************************************************************************/ #include #include -#include +#include #include "service.h" #include "cache.h" diff --git a/dcoprss/xmlrpciface.cpp b/dcoprss/xmlrpciface.cpp index fa024f5d..a3ba3956 100644 --- a/dcoprss/xmlrpciface.cpp +++ b/dcoprss/xmlrpciface.cpp @@ -25,7 +25,7 @@ #include "xmlrpciface.h" #include -#include +#include #include #include diff --git a/doc/kopete/index.docbook b/doc/kopete/index.docbook index 2933c94e..c083c7dc 100644 --- a/doc/kopete/index.docbook +++ b/doc/kopete/index.docbook @@ -873,7 +873,7 @@ Shortcuts.... Web Presence Web Presence allows you to publicize your &im; presence on the Web. Give it the path to a file on an FTP server (for example), and it will upload a short piece of HTML to that file, which you can include in your homepage. &kde;'s network transparency makes this simple. Useful for bloggers to make friends with, or you could use it to use &im; in your business. Example: sftp://username@somehost.org/path/to/homes/user/im.html uses the SFTP protocol to upload your presence directly onto the webserver. -See the KIO manuals for tips on specific network protocols. +See the KIO manuals for tips on specific network protocols. diff --git a/filesharing/Makefile.am b/filesharing/Makefile.am index 61d66854..9b214a50 100644 --- a/filesharing/Makefile.am +++ b/filesharing/Makefile.am @@ -2,4 +2,4 @@ SUBDIRS = advanced simple messages: rc.cpp $(EXTRACTRC) `find . -name '*.ui'` > rc.cpp - $(XGETTEXT) rc.cpp `find . -name '*.cpp' -or -name '*.h'` -o $(podir)/kfileshare.pot + $(XGETTEXT) rc.cpp `find . -name '*.cpp' -or -name '*.h'` -o $(podir)/tdefileshare.pot diff --git a/filesharing/advanced/kcm_sambaconf/hiddenfileview.cpp b/filesharing/advanced/kcm_sambaconf/hiddenfileview.cpp index 2006e1a0..ba0f760c 100644 --- a/filesharing/advanced/kcm_sambaconf/hiddenfileview.cpp +++ b/filesharing/advanced/kcm_sambaconf/hiddenfileview.cpp @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/filesharing/advanced/kcm_sambaconf/hiddenfileview.h b/filesharing/advanced/kcm_sambaconf/hiddenfileview.h index ed65f016..3d3d0aa8 100644 --- a/filesharing/advanced/kcm_sambaconf/hiddenfileview.h +++ b/filesharing/advanced/kcm_sambaconf/hiddenfileview.h @@ -29,7 +29,7 @@ #ifndef _HIDDENFILEVIEW_H_ #define _HIDDENFILEVIEW_H_ -#include +#include #include #include "qmultichecklistitem.h" diff --git a/filesharing/advanced/kcm_sambaconf/kcmsambaconf.cpp b/filesharing/advanced/kcm_sambaconf/kcmsambaconf.cpp index 7940952f..622e1f08 100644 --- a/filesharing/advanced/kcm_sambaconf/kcmsambaconf.cpp +++ b/filesharing/advanced/kcm_sambaconf/kcmsambaconf.cpp @@ -1434,7 +1434,7 @@ extern "C" { KDE_EXPORT TDECModule *create_KcmSambaConf(TQWidget *parent, const char *name) { - TDEGlobal::locale()->insertCatalogue("kfileshare"); + TDEGlobal::locale()->insertCatalogue("tdefileshare"); return new KcmSambaConf(parent, name); } } diff --git a/filesharing/advanced/kcm_sambaconf/kcmsambaconf.desktop b/filesharing/advanced/kcm_sambaconf/kcmsambaconf.desktop index 722679ac..8c4404ec 100644 --- a/filesharing/advanced/kcm_sambaconf/kcmsambaconf.desktop +++ b/filesharing/advanced/kcm_sambaconf/kcmsambaconf.desktop @@ -1,5 +1,5 @@ [Desktop Entry] -Exec=kcmshell kcmsambaconf +Exec=tdecmshell kcmsambaconf Icon=samba Type=Application diff --git a/filesharing/advanced/kcm_sambaconf/sambafile.cpp b/filesharing/advanced/kcm_sambaconf/sambafile.cpp index 6252209e..2cb66bec 100644 --- a/filesharing/advanced/kcm_sambaconf/sambafile.cpp +++ b/filesharing/advanced/kcm_sambaconf/sambafile.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/filesharing/advanced/kcm_sambaconf/sambafile.h b/filesharing/advanced/kcm_sambaconf/sambafile.h index df890129..34a82f7d 100644 --- a/filesharing/advanced/kcm_sambaconf/sambafile.h +++ b/filesharing/advanced/kcm_sambaconf/sambafile.h @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include "sambashare.h" diff --git a/filesharing/advanced/kcm_sambaconf/sharedlgimpl.cpp b/filesharing/advanced/kcm_sambaconf/sharedlgimpl.cpp index 2604a34d..099bc0bf 100644 --- a/filesharing/advanced/kcm_sambaconf/sharedlgimpl.cpp +++ b/filesharing/advanced/kcm_sambaconf/sharedlgimpl.cpp @@ -58,7 +58,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/filesharing/advanced/kcm_sambaconf/smbconfconfigwidget.cpp b/filesharing/advanced/kcm_sambaconf/smbconfconfigwidget.cpp index 02203bbd..ddfb7219 100644 --- a/filesharing/advanced/kcm_sambaconf/smbconfconfigwidget.cpp +++ b/filesharing/advanced/kcm_sambaconf/smbconfconfigwidget.cpp @@ -32,7 +32,7 @@ #include #include -#include +#include #include #include diff --git a/filesharing/advanced/nfs/nfsdialog.cpp b/filesharing/advanced/nfs/nfsdialog.cpp index bd4c3cbd..69ec1032 100644 --- a/filesharing/advanced/nfs/nfsdialog.cpp +++ b/filesharing/advanced/nfs/nfsdialog.cpp @@ -27,7 +27,7 @@ #include #include -#include +#include #include #include #include diff --git a/filesharing/advanced/propsdlgplugin/CMakeLists.txt b/filesharing/advanced/propsdlgplugin/CMakeLists.txt index bd96ae62..52be30f9 100644 --- a/filesharing/advanced/propsdlgplugin/CMakeLists.txt +++ b/filesharing/advanced/propsdlgplugin/CMakeLists.txt @@ -43,6 +43,6 @@ tde_add_kpart( fileshare_propsdlgplugin AUTOMOC SOURCES propsdlgshareplugin.cpp LINK propsdlgplugin_common-static filesharenfs-static - filesharesamba-static kio-shared + filesharesamba-static tdeio-shared DESTINATION ${PLUGIN_INSTALL_DIR} ) diff --git a/filesharing/advanced/propsdlgplugin/propertiespage.cpp b/filesharing/advanced/propsdlgplugin/propertiespage.cpp index 91ce79d3..0bf740ef 100644 --- a/filesharing/advanced/propsdlgplugin/propertiespage.cpp +++ b/filesharing/advanced/propsdlgplugin/propertiespage.cpp @@ -25,13 +25,13 @@ #include #include -#include +#include #include #include #include #include #include -#include +#include #include #include #include diff --git a/filesharing/advanced/propsdlgplugin/propertiespage.h b/filesharing/advanced/propsdlgplugin/propertiespage.h index ba34ed04..a0717c2d 100644 --- a/filesharing/advanced/propsdlgplugin/propertiespage.h +++ b/filesharing/advanced/propsdlgplugin/propertiespage.h @@ -20,7 +20,7 @@ #ifndef PROPERTIESPAGE_H #define PROPERTIESPAGE_H -#include +#include #include "propertiespagegui.h" class NFSFile; diff --git a/filesharing/advanced/propsdlgplugin/propsdlgshareplugin.cpp b/filesharing/advanced/propsdlgplugin/propsdlgshareplugin.cpp index 59155329..96b1f198 100644 --- a/filesharing/advanced/propsdlgplugin/propsdlgshareplugin.cpp +++ b/filesharing/advanced/propsdlgplugin/propsdlgshareplugin.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include #include @@ -49,7 +49,7 @@ PropsDlgSharePlugin::PropsDlgSharePlugin( KPropertiesDialog *dlg, const char *, const TQStringList & ) : KPropsDlgPlugin(dlg), d(0) { - TDEGlobal::locale()->insertCatalogue("kfileshare"); + TDEGlobal::locale()->insertCatalogue("tdefileshare"); if (KFileShare::shareMode() == KFileShare::Simple) { kdDebug(5009) << "PropsDlgSharePlugin: Sharing mode is simple. Aborting." << endl; @@ -101,7 +101,7 @@ PropsDlgSharePlugin::PropsDlgSharePlugin( KPropertiesDialog *dlg, void PropsDlgSharePlugin::slotConfigureFileSharing() { TDEProcess proc; - proc << KStandardDirs::findExe("tdesu") << locate("exe", "kcmshell") << "fileshare"; + proc << KStandardDirs::findExe("tdesu") << locate("exe", "tdecmshell") << "fileshare"; proc.start( TDEProcess::DontCare ); } diff --git a/filesharing/simple/CMakeLists.txt b/filesharing/simple/CMakeLists.txt index 093a80c8..dd06eeb2 100644 --- a/filesharing/simple/CMakeLists.txt +++ b/filesharing/simple/CMakeLists.txt @@ -36,6 +36,6 @@ tde_add_kpart( kcm_fileshare AUTOMOC krichtextlabel.cpp LINK propsdlgplugin_common-static filesharenfs-static filesharesamba-static - kio-shared + tdeio-shared DESTINATION ${PLUGIN_INSTALL_DIR} ) diff --git a/filesharing/simple/fileshare.cpp b/filesharing/simple/fileshare.cpp index dc0c4cbe..6f39975a 100644 --- a/filesharing/simple/fileshare.cpp +++ b/filesharing/simple/fileshare.cpp @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #include #include @@ -63,7 +63,7 @@ K_EXPORT_COMPONENT_FACTORY (kcm_fileshare, ShareFactory("kcmfileshare") ) KFileShareConfig::KFileShareConfig(TQWidget *parent, const char *name, const TQStringList &): TDECModule(ShareFactory::instance(), parent, name) { - TDEGlobal::locale()->insertCatalogue("kfileshare"); + TDEGlobal::locale()->insertCatalogue("tdefileshare"); TQBoxLayout* layout = new TQVBoxLayout(this,0, KDialog::spacingHint()); diff --git a/filesharing/simple/fileshare.desktop b/filesharing/simple/fileshare.desktop index 2fa28fd9..cf78fc4f 100644 --- a/filesharing/simple/fileshare.desktop +++ b/filesharing/simple/fileshare.desktop @@ -1,5 +1,5 @@ [Desktop Entry] -Exec=kcmshell fileshare +Exec=tdecmshell fileshare Icon=share Type=Application diff --git a/filesharing/simple/fileshare.h b/filesharing/simple/fileshare.h index 283d5125..1877362c 100644 --- a/filesharing/simple/fileshare.h +++ b/filesharing/simple/fileshare.h @@ -19,7 +19,7 @@ #ifndef __fileshare_h__ #define __fileshare_h__ -#include +#include #include "tdecmodule.h" class TQRadioButton; diff --git a/kdict/applet/kdictapplet.cpp b/kdict/applet/kdictapplet.cpp index db53f284..8499e23e 100644 --- a/kdict/applet/kdictapplet.cpp +++ b/kdict/applet/kdictapplet.cpp @@ -23,7 +23,7 @@ #include #include -#include +#include #include #include #include diff --git a/kdict/options.cpp b/kdict/options.cpp index a9037d97..aeff39a9 100644 --- a/kdict/options.cpp +++ b/kdict/options.cpp @@ -27,7 +27,7 @@ #include #include -#include +#include #include #include #include diff --git a/kdict/queryview.cpp b/kdict/queryview.cpp index 5b2303c8..88dc69de 100644 --- a/kdict/queryview.cpp +++ b/kdict/queryview.cpp @@ -18,9 +18,9 @@ #include #include -#include +#include #include -#include +#include #include #include #include diff --git a/kfile-plugins/CMakeLists.txt b/kfile-plugins/CMakeLists.txt deleted file mode 100644 index 26723ebe..00000000 --- a/kfile-plugins/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -################################################# -# -# (C) 2010-2011 Serghei Amelian -# serghei (DOT) amelian (AT) gmail.com -# -# Improvements and feedback are welcome -# -# This file is released under GPL >= 2 -# -################################################# - -add_subdirectory( torrent ) diff --git a/kfile-plugins/Makefile.am b/kfile-plugins/Makefile.am deleted file mode 100644 index d092f6a0..00000000 --- a/kfile-plugins/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -SUBDIRS=torrent diff --git a/kfile-plugins/RETURNED_ITEMS b/kfile-plugins/RETURNED_ITEMS deleted file mode 100644 index 13a579ca..00000000 --- a/kfile-plugins/RETURNED_ITEMS +++ /dev/null @@ -1,15 +0,0 @@ -If you make a new plugin, please add the list of returned items to this list. - -torrent plugin: -=========== - -type tag comment -============================================================================== -String name Default file/directory name. -Int length In Bytes, not the size of the .torrent. -String announce URL of the tracker server. -Date creation date Date the .torrent was generated. -Int NumFiles The number of files the .torrent will download. -Int piece length The block size used for this torrent. Each block - is downloaded and hashed separately. -String comment diff --git a/kfile-plugins/torrent/CMakeLists.txt b/kfile-plugins/torrent/CMakeLists.txt deleted file mode 100644 index 92f07537..00000000 --- a/kfile-plugins/torrent/CMakeLists.txt +++ /dev/null @@ -1,38 +0,0 @@ -################################################# -# -# (C) 2010-2011 Serghei Amelian -# serghei (DOT) amelian (AT) gmail.com -# -# Improvements and feedback are welcome -# -# This file is released under GPL >= 2 -# -################################################# - -include_directories( - ${CMAKE_CURRENT_BINARY_DIR} - ${TDE_INCLUDE_DIR} - ${TQT_INCLUDE_DIRS} -) - -link_directories( - ${TQT_LIBRARY_DIRS} -) - - -##### other data ################################ - -install( FILES - kfile_torrent.desktop - DESTINATION ${SERVICES_INSTALL_DIR} ) - - -##### kfile_torrent (module) #################### - -tde_add_kpart( kfile_torrent AUTOMOC - SOURCES - bytetape.cpp bint.cpp bstring.cpp blist.cpp - bdict.cpp kfile_torrent.cpp - LINK kio-shared - DESTINATION ${PLUGIN_INSTALL_DIR} -) diff --git a/kfile-plugins/torrent/Makefile.am b/kfile-plugins/torrent/Makefile.am deleted file mode 100644 index 3b76c814..00000000 --- a/kfile-plugins/torrent/Makefile.am +++ /dev/null @@ -1,22 +0,0 @@ -## Makefile.am for folder file meta info plugin - -INCLUDES = $(all_includes) - -# these are the headers for your project -noinst_HEADERS = kfile_torrent.h bbase.h bdict.h bytetape.h \ - bstring.h bint.h blist.h - -kde_module_LTLIBRARIES = kfile_torrent.la - -kfile_torrent_la_SOURCES = bytetape.cpp bint.cpp bstring.cpp blist.cpp bdict.cpp kfile_torrent.cpp -kfile_torrent_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -kfile_torrent_la_LIBADD = $(LIB_KIO) - -# let automoc handle all of the meta source files (moc) -METASOURCES = AUTO - -services_DATA = kfile_torrent.desktop -servicesdir = $(kde_servicesdir) - -messages: - $(XGETTEXT) *.cpp -o $(podir)/kfile_torrent.pot diff --git a/kfile-plugins/torrent/README b/kfile-plugins/torrent/README deleted file mode 100644 index c7147c9d..00000000 --- a/kfile-plugins/torrent/README +++ /dev/null @@ -1,7 +0,0 @@ -This is a meta information plugin for BitTorrent files (*.torrent). - -It doesn't depend on BitTorrent or any non-standard library being installed. - -The .torrent files used by BitTorrent are coded in what is called a b-encoding -by the BitTorrent author. Please see the actual kfile plugin source code for -more information on the encoding. diff --git a/kfile-plugins/torrent/bbase.h b/kfile-plugins/torrent/bbase.h deleted file mode 100644 index 30da7528..00000000 --- a/kfile-plugins/torrent/bbase.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (c) 2003, 2004 Michael Pyne - * - * This software is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; see the file COPYING. - * If not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -#ifndef _BBASE_H -#define _BBASE_H - -#include - -class TQIODevice; - -/** - * Abstract base class for the b-encoded types. Re-implemented - * by BInt, BList, BDict, and BString. Derive from this class in - * order to make a new type for the b-encoding suite. Classes - * derived from this one should not throw exceptions. Instead, - * they should implement isValid(), and allow calling modules to - * check error status that way. - * - * @author Michael Pyne - * @see BInt, BList, BDict, BString, KSharedPtr - */ - -// Derive from KShared to enable use of KSharedPtr. -class BBase : public KShared -{ - public: - - /** - * Identifies the particular class that has been instantiated. All - * subclasses of this class should have an identifier here. - */ - enum classID { - bBase, /**< This class is BBase. No subclass should return this. */ - bString, /**< This class is a BString. */ - bInt, /**< This class is a BInt. */ - bList, /**< This class is a BList. */ - bDict /**< This class is a BDict. (Dictionary/Map) */ - }; - - /** - * Returns the type identification of the object. It will - * be a value in the classID enum. A subclass of this class - * must implement this function. - * - * @return type identifier of the class - * @see classID - */ - virtual classID type_id() const = 0; - - /** - * Destructor for the class. This function must be reimplemented - * in subclasses. - */ - virtual ~BBase () { ; } - - /** - * Returns the validity status of the object. Newly constructed - * objects are invalid unless the initialization sequence completed - * successfully. - * - * @return the validity status of the object - */ - virtual bool isValid() const = 0; - - /** - * Outputs the b-encoded representation of the object to the given - * TQIODevice. - * @param device the TQIODevice to write to - * @return true on a successful write, false otherwise - */ - virtual bool writeToDevice (TQIODevice &device) = 0; -}; - -#endif /* _BBASE_H */ - -// vim: set et sw=4 ts=4: diff --git a/kfile-plugins/torrent/bdict.cpp b/kfile-plugins/torrent/bdict.cpp deleted file mode 100644 index 712fd526..00000000 --- a/kfile-plugins/torrent/bdict.cpp +++ /dev/null @@ -1,220 +0,0 @@ -/* - * Copyright (c) 2003, 2004 Michael Pyne - * - * This software is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; see the file COPYING. - * If not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -#include -#include - -#include - -#include "bbase.h" -#include "bdict.h" -#include "bstring.h" -#include "bint.h" -#include "blist.h" - -BDict::BDict (TQByteArray &dict, int start) - : m_map(), m_valid(false) -{ - ByteTape tape(dict, start); - - init (tape); -} - -BDict::BDict (ByteTape &tape) - : m_map(), m_valid (false) -{ - init (tape); -} - -void BDict::init (ByteTape &tape) -{ - if (*tape != 'd') - { - kdDebug(7034) << "This isn't a dictionary!" << endl; - return; // This isn't a dictionary - } - - tape++; - - // We need to loop and read in a string, then read in some data - while (*tape != 'e') - { - BBase *temp_item = 0; - - // Read in string - KSharedPtr str (new BString (tape)); - - // Ensure str will be automatically deleted - if (!str || !str->isValid()) - { - kdDebug(7034) << (str ? "Invalid string" : "Unable to read String!") << endl; - return; - } - - // Read in data - switch (*tape) - { - case 'l': - temp_item = new BList (tape); - break; - - case 'i': - temp_item = new BInt (tape); - break; - - case 'd': - temp_item = new BDict (tape); - break; - - default: - // Hopefully this is a string - temp_item = new BString (tape); - } - - if (!temp_item || !temp_item->isValid()) - { - kdDebug(7034) << (temp_item ? "Invalid item!" - : "Unable to create keyed data!") << endl; - return; - } - - m_map.insert(str->get_string(), temp_item); - } - - // Move past the 'e' - tape++; - - // Let the map delete the items - m_map.setAutoDelete (true); - - // Oh yeah, we're valid now, too. :-) - m_valid = true; -} - -BDict::~BDict () -{ - // TQDict will take care of deleting each entry that - // it holds. -} - -BInt *BDict::findInt (const char *key) -{ - BBase *base = find(key); - - if (base && base->type_id() == bInt) - return dynamic_cast(base); - - return 0; -} - -BList *BDict::findList (const char *key) -{ - BBase *base = find(key); - - if (base && base->type_id() == bList) - return dynamic_cast(base); - - return 0; -} - -BDict *BDict::findDict (const char *key) -{ - BBase *base = find(key); - - if (base && base->type_id() == bDict) - return dynamic_cast(base); - - return 0; -} - -BString *BDict::findStr (const char *key) -{ - BBase *base = find(key); - - if (base && base->type_id() == bString) - return dynamic_cast(base); - - return 0; -} - -bool BDict::writeToDevice(TQIODevice &device) -{ - if (!isValid()) - return false; - - const char *d_str = "d"; - const char *e_str = "e"; - TQ_LONG written = 0, result = 0; - - written = device.writeBlock (d_str, 1); - while (written < 1) - { - if (written < 0 || result < 0) - return false; - - result = device.writeBlock (d_str, 1); - written += result; - } - - // Strings are supposed to be written in the dictionary such that - // the keys are in sorted order. TQDictIterator doesn't support an - // ordering, so we have to get a list of all the keys, sort it, and - // then go by the list. - - BBaseHashIterator iter (m_map); - TQStringList key_list; - - for ( ; iter.current(); ++iter) - key_list.append(iter.currentKey()); - - key_list.sort(); - - TQStringList::Iterator key_iter; - for (key_iter = key_list.begin(); key_iter != key_list.end(); ++key_iter) - { - TQCString utfString = (*key_iter).utf8(); - TQString str = TQString("%1:").arg(utfString.size() - 1); - - TQCString lenString = str.utf8(); - - // Write out length of key - device.writeBlock(lenString.data(), lenString.size() - 1); - - // Write out actual key - device.writeBlock(utfString.data(), utfString.size() - 1); - - // Write out the key's data - BBase *base = m_map.find(*key_iter); - if (!base->writeToDevice (device)) - return false; - } - - written = device.writeBlock (e_str, 1); - while ((uint) written < 1) - { - if (written < 0 || result < 0) - return false; - - result = device.writeBlock (e_str, 1); - written += result; - } - - return true; -} - -// vim: set et sw=4 ts=4: diff --git a/kfile-plugins/torrent/bdict.h b/kfile-plugins/torrent/bdict.h deleted file mode 100644 index 61be065b..00000000 --- a/kfile-plugins/torrent/bdict.h +++ /dev/null @@ -1,203 +0,0 @@ -/* - * Copyright (c) 2003, 2004 Michael Pyne - * - * This software is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; see the file COPYING. - * If not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -#ifndef _BDICT_H -#define _BDICT_H - -#include -#include // TQByteArray -#include "bytetape.h" -#include "bbase.h" - -// Some useful typedefs -typedef TQDict BBaseHash; -typedef TQDictIterator BBaseHashIterator; - -// Forward declarations -class BInt; -class BList; -class BString; - -/** - * Class to handle the BitTorrent b-encoded dictionary. It is keyed - * using const char *strings, and stores pointers to a class descended - * from BBase, such as BInt, BString, BList, or even more BDicts. - * - * @author Michael Pyne - * @see BBase, BInt, BString, BList - */ -class BDict : public BBase -{ - public: - - /** - * Construct a dictionary based on the b-encoded data contained in - * @p dict. You need to pass a value for @p start if the b-encoded - * dictionary doesn't start at the beginning of @p dict. - * - * @param dict the buffer containing the b-encoded dictionary - * @param start the position of the data within the buffer - */ - BDict (TQByteArray &dict, int start = 0); - - /** - * Construct a dictionary from a ByteTape. The data and current - * position of @p tape will be shared with all objects using it. - * @p tape should already be positioned to the b-encoded dictionary. - * After construction, @p tape will point to the byte after the - * dictionary if successful. If not successful, @p tape will have - * an undefined position. - * - * @param tape the ByteTape to read from - * @see ByteTape - */ - BDict (ByteTape &tape); - - /** - * Destroys the object and frees all memory allocated to it. - */ - virtual ~BDict(); - - /** - * Returns the type of this class. - * - * @return bDict. This value is only returned by this class. - */ - virtual classID type_id() const { return bDict; } - - /** - * Returns the number of keyed values contained within this - * dictionary. - * - * @return the number of items in this dictionary - */ - virtual int count() const { return m_map.count(); } - - /** - * This function should be called to determine whether the - * dictionary was successfully created, since no exceptions - * are thrown. - * - * @return true if this is a valid (possibly empty!) dictionary, - * false otherwise - */ - virtual bool isValid() const { return m_valid; } - - /** - * This function determines whether or not a value with a - * certain key exists in the dictionary. The key is case-sensitive. - * - * @param key the key to search for a value for - * @return true, if there is a value for the @p key in the - * dictionary, false otherwise - */ - virtual bool contains (const char *key) { return m_map.find(key) != 0; } - - /** - * Returns a pointer to the BBase descendant keyed by @p key. You - * can use the type_id() method to determine the type of the - * object returned. - * - * @param key the key to search the dictionary for - * @return a pointer to the matching object, or 0 if no object - * matches the key - * @see BBase - */ - virtual BBase *find (const char *key) { return m_map.find(key); } - - /** - * Convienience function to find and return a BInt keyed by @p key. - * - * @param key the key to find a value for - * @return 0 if the key doesn't match a value, or if the value isn't - * a BInt. Otherwise, a pointer to the matching BInt is - * returned. - * @see BInt - */ - BInt* findInt (const char *key); - - /** - * Convienience function to find and return a BList keyed by @p key. - * - * @param key the key to find a value for - * @return 0 if the key doesn't match a value, or if the value isn't - * a BList. Otherwise, a pointer to the matching BList is - * returned. - * @see BList - */ - BList* findList (const char *key); - - /** - * Convienience function to find and return a BDict keyed by @p key. - * - * @param key the key to find a value for - * @return 0 if the key doesn't match a value, or if the value isn't - * a BDict. Otherwise, a pointer to the matching BDict is - * returned. - * @see BDict - */ - BDict* findDict (const char *key); - - /** - * Convienience function to find and return a BString keyed by @p key. - * - * @param key the key to find a value for - * @return 0 if the key doesn't match a value, or if the value isn't - * a BString. Otherwise, a pointer to the matching BString is - * returned. - * @see BString - */ - BString* findStr (const char *key); - - /** - * Outputs the b-encoded representation of the object to the given - * TQIODevice. - * @param device the TQIODevice to write to - * @return true on a successful write, false otherwise - */ - virtual bool writeToDevice (TQIODevice &device); - - /** - * Returns a TQDictIterator that you can use to iterate through - * the items in the dictionary. - * - * @return TQDictIterator, which can be used to iterate through - * the items in the dictionary. - */ - BBaseHashIterator iterator() const - { - return BBaseHashIterator(m_map); - } - - private: - - /** - * This function handles the actual initialization of the object upon - * construction, and set the m_valid flag if successful. - * - * @param tape the ByteTape to read from - */ - void init (ByteTape &tape); - - BBaseHash m_map; /// The TQDict that actually store the data - bool m_valid; /// Store initialization status -}; - -#endif /* _BDICT_H */ - -// vim: set et sw=4 ts=4: diff --git a/kfile-plugins/torrent/bint.cpp b/kfile-plugins/torrent/bint.cpp deleted file mode 100644 index db73aa72..00000000 --- a/kfile-plugins/torrent/bint.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (c) 2003, 2004 Michael Pyne - * - * This software is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; see the file COPYING. - * If not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -#include -#include -#include - -#include "bytetape.h" -#include "bint.h" - -// A bencoded int is (approximately) as follows: -// i(\d)+e -BInt::BInt (TQByteArray &dict, int start) - : m_value (0), m_valid(false) -{ - ByteTape tape (dict, start); - init (tape); -} - -BInt::BInt (ByteTape &tape) - : m_value(0), m_valid(false) -{ - init(tape); -} - -void BInt::init (ByteTape &tape) -{ - if (*tape != 'i') - return; - - tape ++; // Move to start of digits - - TQByteArray &dict (tape.data()); - if (dict.find('e', tape.pos()) == -1) - return; - - // Copy the part from the start to the e. The values in-between - // should be digits, perhaps preceded by a negative sign. - int length = dict.find('e', tape.pos()) - tape.pos(); - char *ptr = dict.data(); // Get start of buffer - ptr += tape.pos(); // Advance to current position in tape - - // Allocate temporary data buffer - TQByteArray buffer(length + 1); - - tqmemmove (buffer.data(), ptr, length); - buffer[length] = 0; // Null-terminate - - TQString numberString (buffer); - bool a_isValid; // We want to make sure the string is a valid number - - m_value = numberString.toLongLong(&a_isValid); - - tape += length; // Move to 'e' - tape ++; // Move to next char - - m_valid = a_isValid; // Now we're good, if it was a number -} - -BInt::~BInt() -{ - /* Nothing yet */ -} - -bool BInt::writeToDevice (TQIODevice &device) -{ - if (!m_valid) - return false; - - /* Write out i234e, and such */ - TQString str = TQString("i%1e"). - arg (m_value); - - TQ_LONG written = 0, result = 0; - written = device.writeBlock (str.latin1(), str.length()); - while ((uint) written < str.length()) - { - if (written < 0 || result < 0) - return false; - - result = device.writeBlock(str.latin1() + written, - str.length() - written); - written += result; - } - - return true; -} - -// vim: set et ts=4 sw=4: diff --git a/kfile-plugins/torrent/bint.h b/kfile-plugins/torrent/bint.h deleted file mode 100644 index e2ce2cc3..00000000 --- a/kfile-plugins/torrent/bint.h +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright (c) 2003, 2004 Michael Pyne - * - * This software is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; see the file COPYING. - * If not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -#ifndef _BINT_H -#define _BINT_H - -#include -#include "bbase.h" -#include "bytetape.h" - -/** - * Class to represent a b-encoded integer. - * - * @author Michael Pyne - * @see BBase - */ -class BInt : public BBase -{ - public: - - /** - * Constructs a BInt by reading a b-encoded integer from @p dict. - * You can start reading from a position other than the beginning - * by passing that position to the constructor. - * - * @param dict the buffer to read from - * @param start the position within the buffer of the beginning - * of the b-encoded integer. - */ - BInt (TQByteArray &dict, int start = 0); - - /** - * Constructs a BInt by reading a b-encoded integer from @p tape. - * - * @param tape the ByteTape to read from. It should already be - * positioned at the beginning of the b-encoded integer data. - * After construction, @p tape will point to the byte after - * the b-encoded integer on success. If construction was - * not successful, @p tape will have an undefined position. - */ - BInt (ByteTape &tape); - - /** - * Destructor for this class. No special action is taken. - */ - virtual ~BInt (); - - /** - * Returns the integer value of the data used to construct this - * object. - * - * @return this object's integer value - */ - TQ_LLONG get_value () const { return m_value; } - - /** - * Returns the type of this class. - * - * @return bInt. This value is only returned by this class. - */ - virtual classID type_id() const { return bInt; } - - /** - * This function should be called to determine whether the - * integer was successfully created, since no exceptions - * are thrown. - * - * @return true if this is a valid integer, false otherwise - */ - virtual bool isValid() const { return m_valid; } - - /** - * Outputs the b-encoded representation of the object to the given - * TQIODevice. - * @param device the TQIODevice to write to - * @return true on a successful write, false otherwise - */ - virtual bool writeToDevice (TQIODevice &device); - - private: - - /** - * Initialization function for the class, called to handle the - * actual work of reading the b-encoded data from @p tape. - * - * @param tape the ByteTape to read from - */ - void init(ByteTape &tape); - - TQ_LLONG m_value; - bool m_valid; -}; - -#endif /* _BINT_H */ - -// vim: set et ts=4 sw=4: diff --git a/kfile-plugins/torrent/blist.cpp b/kfile-plugins/torrent/blist.cpp deleted file mode 100644 index 4b510e76..00000000 --- a/kfile-plugins/torrent/blist.cpp +++ /dev/null @@ -1,178 +0,0 @@ -/* - * Copyright (c) 2003, 2004 Michael Pyne - * - * This software is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; see the file COPYING. - * If not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -#include - -#include "bytetape.h" -#include "blist.h" -#include "bdict.h" -#include "bstring.h" -#include "bint.h" - -BList::BList (ByteTape &tape) - : m_valid(false), m_array() -{ - init (tape); -} - -BList::BList (TQByteArray &dict, unsigned int start) - : m_valid(false), m_array() -{ - ByteTape tape (dict, start); - - init (tape); -} - -void BList::init (ByteTape &tape) -{ - BBase *temp; - - if (*tape != 'l') - return; - - tape++; - - /* Repeat circling over the string until the list is over */ - while (*tape != 'e') - { - switch (*tape) - { - case 'd': - temp = new BDict (tape); - break; - - case 'l': /* This element is a list */ - temp = new BList (tape); - break; - - case 'i': /* This element is an int */ - temp = new BInt (tape); - break; - - default: /* Maybe a string? */ - temp = new BString (tape); - } - - if (!temp || !temp->isValid()) - return; // Invalid list element - - m_array.append (temp); - } - - m_valid = true; - - // Only way out is to detect 'e', so we need to increment tape past that. - tape++; -} - -BList::~BList() -{ - BBaseVectorIterator iter; - - for (iter = begin(); iter != end(); ++iter) - delete *iter; -} - -BBase* BList::index (unsigned int i) -{ - if (i >= count()) - return 0; - else - return m_array[i]; -} - -BList * BList::indexList (unsigned int i) -{ - BBase *base = index(i); - - if (base && base->type_id() == bList) - return dynamic_cast(base); - - return 0; -} - -BInt * BList::indexInt (unsigned int i) -{ - BBase *base = index(i); - - if (base && base->type_id() == bInt) - return dynamic_cast(base); - - return 0; -} - -BDict * BList::indexDict (unsigned int i) -{ - BBase *base = index(i); - - if (base && base->type_id() == bDict) - return dynamic_cast(base); - - return 0; -} - -BString * BList::indexStr (unsigned int i) -{ - BBase *base = index(i); - - if (base && base->type_id() == bString) - return dynamic_cast(base); - - return 0; -} - -bool BList::writeToDevice(TQIODevice &device) -{ - if (!m_valid) - return false; - - const char *l_str = "l"; - const char *e_str = "e"; - TQ_LONG written = 0, result = 0; - - written = device.writeBlock (l_str, 1); - while (written < 1) - { - if (written < 0 || result < 0) - return false; - - result = device.writeBlock (l_str, 1); - written += result; - } - - BBaseVectorIterator iter; - for (iter = begin(); iter != end(); ++iter) - { - if (!((*iter)->writeToDevice (device))) - return false; - } - - written = device.writeBlock (e_str, 1); - while (written < 1) - { - if (written < 0 || result < 0) - return false; - - result = device.writeBlock (e_str, 1); - written += result; - } - - return true; -} - -// vim: set et sw=4 ts=4: diff --git a/kfile-plugins/torrent/blist.h b/kfile-plugins/torrent/blist.h deleted file mode 100644 index 89721822..00000000 --- a/kfile-plugins/torrent/blist.h +++ /dev/null @@ -1,200 +0,0 @@ -/* - * Copyright (c) 2003, 2004 Michael Pyne - * - * This software is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; see the file COPYING. - * If not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -#ifndef _BLIST_H -#define _BLIST_H - -#include -#include -#include "bbase.h" -#include "bytetape.h" - -typedef TQValueList BBaseVector; -typedef TQValueList::iterator BBaseVectorIterator; - -// Predeclare the following classes -class BDict; -class BString; -class BInt; - -/** - * Class to construct a list of BBase objects from a b-encoded - * list. - * - * @author Michael Pyne - * @see BBase - */ -class BList : public BBase -{ - public: - - /** - * Construct a BList from @p dict. - * - * @param dict the buffer to read from - * @param start the position in the buffer to start - * reading from - */ - BList (TQByteArray &dict, unsigned int start = 0); - - /** - * Construct a BList from @p tape. Any changes made to - * @p tape, such as its current position and data, will be - * shared with the object that called this constructor. @p tape - * should already be positioned at the position to read from. - * If construction was successful, @p tape will point to the - * byte after the list data. If construction was unsuccessful, - * the position of the tape is undefined. - * - * @param tape the ByteTape to read from. - */ - BList (ByteTape &tape); - - /** - * Destroys the list, and deletes all of the items that had - * been contained within. - */ - virtual ~BList (); - - /** - * Returns the type of this class. - * - * @return bList. This value is only returned by this class. - */ - virtual classID type_id() const { return bList; } - - /** - * Returns the number of items contained within the list. - * - * @return number of items in the list - */ - virtual unsigned int count() const { return m_array.count(); } - - /** - * This function should be called to determine whether the - * list was successfully created, since no exceptions - * are thrown. - * - * @return true if this is a valid list, false otherwise - */ - virtual bool isValid() const { return m_valid; } - - /** - * This function returns a pointer to the appropriate - * item in the list. - * - * @param i index of the item to return - * @return pointer to the appropriate BBase, or 0 if - * the index is out-of-bounds - */ - inline BBase * index (unsigned int i); - - /** - * Convience function to return a pointer to the appropriate - * item in the list, already casted. - * - * @param i index of the item to return - * @return pointer to the appropriate BBase, downcasted to - * BList. If the element is not a BList, 0 - * will be returned instead, even if it was a valid - * BBase. - */ - BList * indexList (unsigned int i); - - /** - * Convience function to return a pointer to the appropriate - * item in the list, already casted. - * - * @param i index of the item to return - * @return pointer to the appropriate BBase, downcasted to - * BInt. If the element is not a BInt, 0 - * will be returned instead, even if it was a valid - * BBase. - */ - BInt * indexInt (unsigned int i); - - /** - * Convience function to return a pointer to the appropriate - * item in the list, already casted. - * - * @param i index of the item to return - * @return pointer to the appropriate BBase, downcasted to - * BDict. If the element is not a BDict, 0 - * will be returned instead, even if it was a valid - * BBase. - */ - BDict * indexDict (unsigned int i); - - /** - * Convience function to return a pointer to the appropriate - * item in the list, already casted. - * - * @param i index of the item to return - * @return pointer to the appropriate BBase, downcasted to - * BString. If the element is not a BString, 0 - * will be returned instead, even if it was a valid - * BBase. - */ - BString * indexStr (unsigned int i); - - /** - * Returns an iterator to the first element in the list. - * There is no particular sorting associated with the list - * at this time. - * - * @return iterator pointing to the beginning of the list - * @see TQValueList - */ - BBaseVectorIterator begin(void) { return m_array.begin(); } - - /** - * Returns an iterator pointing one element past the end of - * the list. Although this element belongs to the list, - * you should never dereference this iterator. Instead, treat - * it as a boundary condition to avoid. - * - * @return iterator pointing one element past the end of the list - * @see TQValueList - */ - BBaseVectorIterator end(void) { return m_array.end(); } - - /** - * Outputs the b-encoded representation of the object to the given - * TQIODevice. - * @param device the TQIODevice to write to - * @return true on a successful write, false otherwise - */ - virtual bool writeToDevice (TQIODevice &device); - - private: - - /** - * This function handles the actual initialization of the object upon - * construction, and set the m_valid flag if successful. - * - * @param tape the ByteTape to read from - */ - void init(ByteTape &tape); - - bool m_valid; - BBaseVector m_array; -}; - -#endif /* _BLIST_H */ - -// vim: set et sw=4 ts=4: diff --git a/kfile-plugins/torrent/bstring.cpp b/kfile-plugins/torrent/bstring.cpp deleted file mode 100644 index 0b40b46a..00000000 --- a/kfile-plugins/torrent/bstring.cpp +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright (c) 2003, 2004 Michael Pyne - * - * This software is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; see the file COPYING. - * If not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -#include -#include - -#include - -#include "bstring.h" -#include "bytetape.h" - -BString::BString (TQByteArray &dict, int start) : - m_data(), m_valid(false) -{ - ByteTape tape (dict, start); - init (tape); -} - -BString::BString (ByteTape &tape) - : m_data(), m_valid(false) -{ - init (tape); -} - -// The reason we don't store stuff in a TQString is because BitTorrent -// b-encoded strings may contain zeroes within the string, which makes -// a BString more of a buffer than a true string. -void BString::init (ByteTape &tape) -{ - TQByteArray &dict(tape.data()); - - if (dict.find(':', tape.pos()) == -1) - { - kdDebug(7034) << "Can't find : for string!" << endl; - return; - } - - // Copy the part from start to :, as it will be a number - // That number is the number of characters to read - int length = dict.find(':', tape.pos()) - tape.pos(); - char *ptr = dict.data(); - - ptr += tape.pos(); - - TQByteArray buffer (length + 1); - tqmemmove (buffer.data(), ptr, length); - buffer[length] = 0; - - TQString numberString (buffer); - bool a_isValid; - ulong len = numberString.toULong (&a_isValid); - - if (!a_isValid) - { - kdDebug(7034) << "Invalid string length!" << endl; - return; - } - - // Now that we have the length, we need to advance the tape - // past the colon - tape += length; // Move to colon - if (*tape != ':') - { - // Sanity check - kdError(7034) << "SANITY CHECK FAILED. *tape != ':'!" << endl; - return; - } - - tape++; // Move past colon - - // Time to copy the data - char *textBuffer = tape.at(tape.pos()); - if (!m_data.resize(len + 1)) - return; - - tqmemmove (m_data.data(), textBuffer, len); - m_data[len] = 0; // Null terminate for convienience - - tape += len; - m_valid = true; -} - -BString::~BString () -{ -} - -bool BString::writeToDevice(TQIODevice &device) -{ - if (!m_valid) - return false; - - TQString str = TQString("%1:"). - arg(get_len()); - - TQCString utfString = str.utf8(); - - /* Don't write null terminator */ - device.writeBlock (utfString.data(), utfString.size() - 1); - - // Output the actual data - device.writeBlock (m_data.data(), m_data.size() - 1); - - // Done - return true; -} - -bool BString::setValue (const TQString &str) -{ - m_data = str.utf8(); - return true; -} - -// vim: set et ts=4 sw=4: diff --git a/kfile-plugins/torrent/bstring.h b/kfile-plugins/torrent/bstring.h deleted file mode 100644 index c51311fc..00000000 --- a/kfile-plugins/torrent/bstring.h +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Copyright (c) 2003, 2004 Michael Pyne - * - * This software is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; see the file COPYING. - * If not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -#ifndef _BSTRING_H -#define _BSTRING_H - -#include -#include - -#include "bytetape.h" -#include "bbase.h" - -/** - * A class to handle the b-encoded strings used by BitTorrent. - * It implements BBase, and although the class is referred to - * as a string, it can hold arbitrary data, since b-encoded strings - * are stored with a length, instead of using a terminator character. - * - * @author Michael Pyne - * @see BBase - */ -class BString : public BBase -{ - public: - - /** - * Construct a BString from @p dict. - * - * @param dict the buffer to read from - * @param start the position in the buffer to start - * reading from - */ - BString (TQByteArray &dict, int start = 0); - - /** - * Construct a BString from @p tape. Any changes made to - * @p tape, such as its current position and data, will be - * shared with the object that called this constructor. @p tape - * should already be positioned at the position to read from. - * If construction was successful, @p tape will point to the - * byte after the string data. If construction was unsuccessful, - * the position of the tape is undefined. - * - * @param tape the ByteTape to read from. - */ - BString (ByteTape &tape); - - /** - * Destroys the BString, and deallocates all memory that had - * been used. - */ - virtual ~BString (); - - /** - * Returns a TQString representation of the data in the - * BString. It is the responsibility of the caller to ensure - * that the data is convertible to a TQString. More specifically, - * the data should not contain any embedded NULLs. - * - * @return TQString containing the data from this BString. - */ - TQString get_string() const { return TQString::fromUtf8(m_data.data()); } - - /** - * Returns the amount of data held by the string. It would be - * perhaps more appropriate to call this size(), since this is - * a buffer, not a true text string. - * - * @return the size of the string, not including the NULL - * terminator. - */ - const int get_len() const { return m_data.size() - 1; } - - /** - * Returns the type of this class. - * - * @return bString. This value is only returned by this class. - */ - virtual classID type_id() const { return bString; } - - /** - * This function should be called to determine whether the - * string was successfully created, since no exceptions - * are thrown. - * - * @return true if this is a valid string, false otherwise - */ - virtual bool isValid() const { return m_valid; } - - /** - * Outputs the b-encoded representation of the object to the given - * TQIODevice. - * @param device the TQIODevice to write to - * @return true on a successful write, false otherwise - */ - virtual bool writeToDevice (TQIODevice &device); - - /** - * Changes the value of the string to the given TQString. - * - * @param str the TQString containing the new value - * @return true if the value was successfully changed, - * false otherwise. - */ - bool setValue (const TQString &str); - - private: - - /** - * This function handles the actual initialization of the object upon - * construction, and set the m_valid flag if successful. - * - * @param tape the ByteTape to read from - */ - void init (ByteTape &tape); - - TQByteArray m_data; - bool m_valid; -}; - -#endif /* _BSTRING_H */ - -// vim: set et ts=4 sw=4: diff --git a/kfile-plugins/torrent/bytetape.cpp b/kfile-plugins/torrent/bytetape.cpp deleted file mode 100644 index 5d6b8099..00000000 --- a/kfile-plugins/torrent/bytetape.cpp +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Copyright (c) 2003, 2004 Michael Pyne - * - * This software is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; see the file COPYING. - * If not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#include - -#include "bytetape.h" - -ByteTape::ByteTape (TQByteArray &array, int pos) - : m_array(array), m_shared(new ByteTapeShared) -{ - m_shared->pos = pos; -} - -ByteTape::ByteTape (const ByteTape &tape) - : m_array(tape.m_array), m_shared(tape.m_shared) -{ -} - -ByteTape& ByteTape::operator += (const unsigned int i) -{ - m_shared->pos += i; - if (m_array.size() <= m_shared->pos) - { - kdDebug(7034) << "Whoops. Advanced too far." << endl; - m_shared->pos = m_array.size() - 1; - } - - return *this; -} - -ByteTape& ByteTape::operator -= (const unsigned int i) -{ - if (i > m_shared->pos) - { - kdDebug(7034) << "Whoops, tried to back up too far." << endl; - m_shared->pos = 0; - } - else - m_shared->pos -= i; - - return *this; -} - -char ByteTape::operator [] (const unsigned int i) -{ - if (i < m_array.size()) - return m_array[i]; - else - { - kdWarning() << "Can't dereference tape at " << i - << ", size is " << m_array.size() << endl; - return 0; - } -} - -char &ByteTape::operator * () -{ - return m_array[m_shared->pos]; -} - -// Postfix increment -ByteTape ByteTape::operator ++ (int) -{ - // Can't use copy ctor, as we'll be copying shared data, which defeats - // the semantics of the postfix operator. - ByteTape temp(m_array, m_shared->pos); - m_shared->pos ++; - - if (m_shared->pos >= m_array.size()) - { - m_shared->pos = m_array.size() - 1; - kdDebug(7034) << "Tape already at end!" << endl; - kdDebug(7034) << "Tape size is " << m_array.size() << endl; - } - - return temp; -} - -// Prefix increment -ByteTape & ByteTape::operator ++() -{ - m_shared->pos ++; - if (m_shared->pos >= m_array.size()) - { - m_shared->pos = m_array.size() - 1; - kdDebug(7034) << "Tape already at end!" << endl; - kdDebug(7034) << "Tape size is " << m_array.size() << endl; - } - - return *this; -} - -// Postfix decrement -ByteTape ByteTape::operator -- (int) -{ - // Can't use copy ctor, as we'll be copying shared data, which defeats - // the semantics of the postfix operator. - ByteTape temp(m_array, m_shared->pos); - - if (m_shared->pos != 0) - m_shared->pos --; - else - kdDebug(7034) << "Tape already at beginning!" << endl; - - return temp; -} - -// Prefix decrement -ByteTape & ByteTape::operator -- () -{ - if (m_shared->pos != 0) - m_shared->pos --; - else - kdDebug(7034) << "Tape already at beginning!" << endl; - - return *this; -} - -bool ByteTape::setPos (unsigned int pos) -{ - if (pos >= m_array.size()) - { - kdDebug(7034) << "Can't set tape to " << pos << endl; - return false; - } - - m_shared->pos = pos; - return true; -} - -char* ByteTape::at (const unsigned int i) -{ - if (i >= m_array.size()) - { - kdDebug(7034) << "Access to tape at " << i << " out-of-range." << endl; - return 0; - } - - return m_array.data() + i; -} - -// vim: set et ts=4 sw=4: diff --git a/kfile-plugins/torrent/bytetape.h b/kfile-plugins/torrent/bytetape.h deleted file mode 100644 index f7309b11..00000000 --- a/kfile-plugins/torrent/bytetape.h +++ /dev/null @@ -1,194 +0,0 @@ -/* - * Copyright (c) 2003, 2004 Michael Pyne - * - * This software is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; see the file COPYING. - * If not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -#ifndef _BYTETAPE_H -#define _BYTETAPE_H - -#include - -#include - -class ByteTapeShared : public KShared -{ - public: - - unsigned int pos; -}; - -/** - * Class to simulate a seekable byte stream. Very similar to TQByteArray, - * but the difference is that this class "knows" what a current position - * is. Also, the copy constructor will share the byte stream of the - * ByteTape being copied. This means that any copies made of an object of - * this class will share BOTH the data and the current position. This is - * by design. - * - * @author Michael Pyne - * @see TQByteArray - */ -class ByteTape -{ - public: - - /** - * Constructs a new ByteTape object from @p array. The - * current position will be set to @p pos. - * - * @param array a data buffer to use for reading and writing. - * The tape will be fixed to the size of this buffer. - * @param pos the initial position of the tape head. It must be - * a position within the buffer contained in @p array. - */ - ByteTape (TQByteArray &array, int pos = 0); - - /** - * Creates a ByteTape as a copy of @p tape. The newly created - * object will share both data and the current position with @p tape. - * This is done using reference counts. - * - * @param tape the ByteTape to copy - */ - ByteTape (const ByteTape &tape); - - /** - * Increments the current position by @p i. It is the responsibility - * of the function caller to ensure that the new position is in bounds. - * The position will be capped to remain in bounds regardless. - * - * @param i the amount to increment the current position by - * @return t reference to the object incremented - */ - ByteTape & operator += (const unsigned int i); - - /** - * Decrements the current position by @p i. It is the responsibility - * of the function caller to ensure that the new position is in bounds. - * Unlike a real Turing machine, attempting to decrement past the - * start will be capped to the beginning instead of crashing the - * computer. - * - * @param i the amount to decrement the current position by - * @return a reference to the object decremented - */ - ByteTape & operator -= (const unsigned int i); - - /** - * Increments the current position by 1. This is a postfix - * operator (i++). The current position will be capped to the end - * of the buffer. - * - * @return the object before the increment operation - */ - ByteTape operator ++ (int); - - /** - * Increments the current position by 1. This is a prefix - * operator (++i). The current position will be capped to the end - * of the buffer. - * - * @return a reference to the object incremented - */ - ByteTape & operator ++ (); - - /** - * Decrements the current position by 1. This is a postfix - * operator (i--). The current position will be capped to the start - * of the buffer. - * - * @return the object before the decrement operation - */ - ByteTape operator -- (int); - - /** - * Decrements the current position by 1. This is a prefix - * operator (--i). The current position will be capped to the start - * of the buffer. - * - * @return a reference to the object decremented - */ - ByteTape & operator -- (); - - /** - * Returns the byte within the array indexed by @p i. It is - * the responsibility of the caller to ensure that @p i is in bounds. - * Although out-of-range errors will be detected, no exceptions will - * be thrown. Since a reference is not returned, you won't be able - * to assign to the result. Example: tape[i] = 'a' will not work. - * - * The reason a reference isn't returned is because no exceptions are - * thrown by this class, and we can't return a reference to an out-of- - * bounds character. - * - * @param i the index of the byte to return - * @return the byte at the given index. 0 may be returned on error, - * but does not necessarily indicate an error. - */ - char operator [] (const unsigned int i); - - /** - * Returns the byte at the tape's current position. You can assign - * to the reference returned. - * - * @return a reference to the byte at the tape head's current position - */ - char &operator * (); - - /** - * Returns the position in memory of data at the given index, @p i. - * Unlike operator [], this function returns a pointer, so it can be - * used to access memory. - * - * @param i index of the byte to lookup. - * @return 0 if @p i is out of range, else the address of memory - * at that index - */ - char *at(const unsigned int i); - - /** - * Returns the current position of the tape head. - * - * @return the tape head's current position - */ - unsigned int pos() const { return m_shared->pos; } - - /** - * Sets the current position of the tape head to @p pos. If the - * position given is out-of-bounds, it will be capped to be within - * the array. - * - * @param pos the new position of the tape head - * @return whether the set operation was successful - */ - bool setPos(unsigned int pos); - - /** - * Returns a reference to the TQByteArray used to hold all the data. - * - * @return the TQByteArray used to hold the data - * @see TQByteArray - */ - TQByteArray &data() { return m_array; } - - private: - TQByteArray &m_array; - KSharedPtr m_shared; -}; - -#endif /* _BYTETAPE_H */ - -// vim: set et ts=4 sw=4: diff --git a/kfile-plugins/torrent/kfile_torrent.cpp b/kfile-plugins/torrent/kfile_torrent.cpp deleted file mode 100644 index 69767129..00000000 --- a/kfile-plugins/torrent/kfile_torrent.cpp +++ /dev/null @@ -1,404 +0,0 @@ -/* - * Copyright (c) 2003, 2004 2004 Michael Pyne - * - * This software is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; see the file COPYING. - * If not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -#include -#include -#include -#include -#include - -#include -#include - -#include "kfile_torrent.h" -#include "bdict.h" -#include "blist.h" -#include "bint.h" -#include "bstring.h" - -typedef KGenericFactory TorrentFactory; -K_EXPORT_COMPONENT_FACTORY(kfile_torrent, TorrentFactory("kfile_torrent")) - -TQStringList filesList (BList *list); -TQ_ULLONG filesLength (BList *list); - -KTorrentPlugin::KTorrentPlugin (TQObject *parent, const char *name, - const TQStringList &args) - : KFilePlugin (parent, name, args), m_failed(true), m_dict(0) -{ - KFileMimeTypeInfo *info = addMimeTypeInfo ("application/x-bittorrent"); - if (!info) - { - kdError() << "Error creating application/x-bittorrent mime type info!\n"; - return; - } - - KFileMimeTypeInfo::GroupInfo* group = - addGroupInfo (info, "TorrentInfo", i18n("Torrent Information")); - if (!group) - { - kdError() << "Error creating TorrentInfo group!\n"; - return; - } - setAttributes (group, KFileMimeTypeInfo::Modifiable); - - KFileMimeTypeInfo::ItemInfo *item = 0; - - item = addItemInfo(group, "name", i18n("Name"), TQVariant::String); - if (!item) - { - kdError() << "Error adding Name to group!\n"; - return; - } - setHint (item, KFileMimeTypeInfo::Name); - setAttributes (item, KFileMimeTypeInfo::Modifiable); - - item = addItemInfo(group, "length", i18n("Torrent Length"), TQVariant::ULongLong); - if (!item) - { - kdError() << "Error adding Length to group!\n"; - return; - } - setHint (item, KFileMimeTypeInfo::Length); - setUnit (item, KFileMimeTypeInfo::Bytes); - - item = addItemInfo(group, "announce", i18n("Tracker URL"), TQVariant::String); - if (!item) - { - kdError() << "Error adding Announce to group!\n"; - return; - } - - item = addItemInfo(group, "creation date", i18n("Date Created"), TQVariant::DateTime); - if (!item) - { - kdError() << "Error adding DateCreated to group!\n"; - return; - } - - item = addItemInfo(group, "NumFiles", i18n("Number of Files"), TQVariant::Int); - if (!item) - { - kdError() << "Error adding NumFiles to group!\n"; - return; - } - - item = addItemInfo(group, "piece length", i18n("File Piece Length"), TQVariant::Int); - if (!item) - { - kdError() << "Error adding PieceLength to group!\n"; - return; - } - setUnit (item, KFileMimeTypeInfo::Bytes); - - item = addItemInfo(group, "comment", i18n("Comment"), TQVariant::String); - if (!item) - { - kdError() << "Error adding Comment to group!\n"; - return; - } - setAttributes (item, KFileMimeTypeInfo::MultiLine | KFileMimeTypeInfo::Modifiable); - - m_failed = false; -} - -bool KTorrentPlugin::readInfo (KFileMetaInfo &info, unsigned int) -{ - /* Since we don't throw during the ctor, check here whether we actually - * are valid are not. If not, die. - */ - if (m_failed) - { - kdError() << "Construction of KTorrentPlugin failed for " << info.path() << endl; - kdError() << "Aborting meta-info read.\n"; - return false; - } - - TQFile file (info.path()); - if (!file.open(IO_ReadOnly)) - { - kdError() << "Unable to open given file!\n"; - return false; - } - - // We need to read in the entire file to parse the dictionary structure. - TQByteArray buf = file.readAll(); - file.close(); - - if (buf.isEmpty()) - { - kdError() << "Empty file: " << info.path() << endl; - return false; - } - - m_dict = new BDict(buf); - - if (!m_dict) - { - kdError() << "Error creating dictionary from open file: " << info.path() << endl; - return false; - } - - if (!m_dict->isValid()) - { - kdDebug(7034) << "Invalid torrent file: " << info.path() << endl; - return false; - } - - KFileMetaInfoGroup group = appendGroup(info, "TorrentInfo"); - - // The remainder of this function will consist of a lot of redundancy checks. - // If a torrent has a key, but it is of the wrong type, then it isn't a valid - // torrent, and so we should just die. - - if (m_dict->contains("announce")) - { - BString *str = m_dict->findStr ("announce"); - if (!str) - return false; - appendItem (group, "announce", TQString(str->get_string())); - } - - if (m_dict->contains("creation date")) - { - BInt *the_data = m_dict->findInt ("creation date"); - TQDateTime my_date; - - if (!the_data) - return false; - - unsigned int the_time = the_data->get_value(); - - /* Hopefully the_time is UTC, because that's what TQDateTime does. */ - my_date.setTime_t (the_time); - appendItem (group, "creation date", my_date); - } - - // A valid torrent must have the info dict, no reason to check twice for - // it. - BDict *info_dict = m_dict->findDict("info"); - int num_files = 1; - TQ_ULLONG length = 0; - - if (!info_dict) - return false; - - if (!info_dict->contains("length")) - { - /* Has more than one file. The list of files is contained in a - * list called, appropriately enough, 'files' - */ - BList *info_list = info_dict->findList("files"); - if (!info_list) - return false; - - num_files = info_list->count(); - length = filesLength (info_list); - } - else - { - /* Only one file, let's put its length */ - BInt *blength = info_dict->findInt("length"); - if (!blength) - return false; - - length = blength->get_value(); - } - - appendItem (group, "NumFiles", num_files); - appendItem (group, "length", length); - - if (info_dict->contains("name")) - { - BString *str = info_dict->findStr("name"); - if (!str) - return false; - - TQString real_str (str->get_string()); - - if (num_files > 1 && !real_str.endsWith("/")) - real_str.append('/'); - - appendItem (group, "name", real_str); - } - - // piece length is required as well - BInt *piece_length = info_dict->findInt("piece length"); - if (!piece_length) - return false; - - appendItem (group, "piece length", piece_length->get_value()); - - if (m_dict->contains("comment")) - { - BString *comment = m_dict->findStr("comment"); - if (!comment) - return false; - - appendItem (group, "comment", comment->get_string()); - } - else - appendItem (group, "comment", TQString()); - - return true; -} - -/* Returns a TQStringList containing file names within the list. The list - * should be the one contained within the info dictionary of the torrent, - * keyed by 'files' - */ -TQStringList filesList (BList *list) -{ - TQStringList str_list, failList; - - for (unsigned int i = 0; i < list->count(); ++i) - { - /* Each item in this list is a dictionary, composed as follows: - * length -> BInt (size of file) - * path -> BList (list of strings) - * The list of strings is used to construct directory paths. The - * last element of the list is the file name. - */ - - BDict *list_dict = list->indexDict(i); - if (!list_dict) - return failList; - - BList *list_path = list_dict->findList("path"); - if (!list_path) - return failList; - - TQString str; - BString *temp_str; - - if (list_path->count() > 0) - { - temp_str = list_path->indexStr (0); - if (!temp_str) - return failList; - - str.append (temp_str->get_string()); - } - - /* Construct TQString consisting of path and file name */ - for (unsigned int j = 1; j < list_path->count(); ++j) - { - str.append (TQDir::separator()); - temp_str = list_path->indexStr (j); - if (!temp_str) - return failList; - - str.append (temp_str->get_string()); - } - - str_list += str; - } - - return str_list; -} - -/* This function determines the total length of a torrent stream. - * The list provided should be the same one provided for filesList. - */ -TQ_ULLONG filesLength (BList *list) -{ - TQ_ULLONG length = 0; - - for (unsigned int i = 0; i < list->count(); ++i) - { - /* Each item in this list is a dictionary, composed as follows: - * length -> BInt (size of file) - * path -> BList (list of strings) - */ - - BDict *list_dict = list->indexDict(i); - if (!list_dict) - return 0; - - BInt *bfile_len = list_dict->findInt("length"); - if (!bfile_len) - return 0; - - length += bfile_len->get_value(); - } - - return length; -} - -bool KTorrentPlugin::writeInfo(const KFileMetaInfo &info) const -{ - if (m_failed || !m_dict) - return false; - - // The m_dict is ready, all we have to do is open a file, and - // let 'er go. - TQStringList list = info.groups(); - TQStringList::Iterator it = list.begin(); - - for (; it != list.end(); ++it) - { - TQStringList list2 = info[*it].keys(); - TQStringList::Iterator it2 = list2.begin(); - - for (; it2 != list2.end(); ++it2) - { - TQString key = *it2; - - if (info[*it][key].isModified()) - { - // Re-enter the entry in the dictionary. - if (key == "comment") - { - BString *b_str = m_dict->findStr("comment"); - if (!b_str) - return false; - - b_str->setValue (info[*it][key].value().toString()); - } - else if (key == "name") - { - BDict *info_dict = m_dict->findDict ("info"); - if (!info_dict) - return false; - - BString *name_str = info_dict->findStr ("name"); - if (!name_str) - return false; - - TQString the_name = info[*it][key].value().toString(); - - // Remove trailing slashes - the_name.replace (TQRegExp("/*$"), ""); - - name_str->setValue (the_name); - } - } - } - } - - TQFile output (info.path()); - - if (!output.open(IO_WriteOnly | IO_Truncate)) - return false; - - return m_dict->writeToDevice(*TQT_TQIODEVICE(&output)); -} - -#include "kfile_torrent.moc" - -// vim: set ts=4 sw=4 et: diff --git a/kfile-plugins/torrent/kfile_torrent.desktop b/kfile-plugins/torrent/kfile_torrent.desktop deleted file mode 100644 index 6fc78639..00000000 --- a/kfile-plugins/torrent/kfile_torrent.desktop +++ /dev/null @@ -1,58 +0,0 @@ -[Desktop Entry] -Type=Service -Name=Bit Torrent Info -Name[be]=Звесткі Bit Torrent -Name[bn]=বিট টোরেন্ট তথ্য -Name[br]=Titouriñ diwar-benn Bit Torrent -Name[bs]=Bit Torrent informacije -Name[ca]=Informació de Bit Torrent -Name[cs]=Bit Torrent informace -Name[da]=Info om bittorrent -Name[de]=Bit Torrent Informationen -Name[el]=Πληροφορίες Bit Torrent -Name[es]=Información Bit Torrent -Name[et]=Bit Torrenti info -Name[eu]=Bit-torrent informazioa -Name[fa]=اطلاعات جریان بیتی -Name[fi]=Bit Torrent -Name[fr]=Infos Bit Torrent -Name[gl]=Información de Bit Torrent -Name[he]=מידע ביטטורנט -Name[hu]=Bit Torrent-jellemzők -Name[is]=Bit Torrent upplýsingar -Name[it]=Informazioni Bittorrent -Name[ja]=Bit Torrent 情報 -Name[ka]=Bit Torrent ინფორმაცია -Name[kk]=Bit Torrent мәліметі -Name[km]=ព័ត៌មាន Bit Torrent -Name[lt]=Bit Torrent Informacija -Name[mk]=Информации за Bit Torrent -Name[nds]=BitTorrent-Info -Name[ne]=बिट टोरेन्ट सूचना -Name[nl]=Bittorent-informatie -Name[nn]=Bit Torrent-info -Name[pa]=Bit Torrent ਜਾਣਕਾਰੀ -Name[pl]=Informacja o Bit Torrent -Name[pt]=Informações Bit Torrent -Name[pt_BR]=Informações do Bit Torrent -Name[ro]=Informaţii Bit Torrent -Name[ru]=Сведения о BitTorrent -Name[sk]=Bit Torrent informácie -Name[sl]=Podatki o BitTorrentu -Name[sr]=Bit Torrent информације -Name[sr@Latn]=Bit Torrent informacije -Name[sv]=Information om Bit Torrent -Name[ta]=பிட் டோர்ரெண்ட் தகவல் -Name[tr]=Bit Torrent Bilgisi -Name[uk]=Інформація про Bit Torrent -Name[zh_CN]=BitTorrent 信息 -Name[zh_HK]=Bit Torrent 資訊 -Name[zh_TW]=Bit Torrent 資訊 -ServiceTypes=KFilePlugin -X-TDE-Library=kfile_torrent -# change MimeType here! (example: inode/directory) -MimeType=application/x-bittorrent -# change PreferredGroups here! (example: FolderInfo) -PreferredGroups= -# change PreferredItems here! (example: Items;Size) -PreferredItems= diff --git a/kfile-plugins/torrent/kfile_torrent.h b/kfile-plugins/torrent/kfile_torrent.h deleted file mode 100644 index 9b16e4e4..00000000 --- a/kfile-plugins/torrent/kfile_torrent.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) 2003, 2004 Michael Pyne - * - * This software is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; see the file COPYING. - * If not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -#ifndef _KFILE_TORRENT_H -#define _KFILE_TORRENT_H - -#include - -#include "bdict.h" - -class TQStringList; - -/** - * Class to provide meta info for BitTorrent files within Konqueror. - * Handles the mime type application/x-bittorrent, files typically - * have the extension .torrent - * - * @author Michael Pyne - * @todo Handle editing the meta info as well - * @bug The comment meta info should be Multi Line, but that only - * works when the comment can also be edited. - */ -class KTorrentPlugin : public KFilePlugin -{ - Q_OBJECT - - - public: - /** - * Constructs the class, and prepares for reading info on a torrent. - * - * @param parent the parent of this object - * @param name the name of this object (not user-readable) - * @param args unused by this class - */ - KTorrentPlugin (TQObject *parent, const char *name, const TQStringList &args); - - /** - * Destructor that closes the dictionary holding the torrent information. - */ - ~KTorrentPlugin () { delete m_dict; } - - /** - * Reads information on a torrent file given by @p info. - * - * @param info information on the file to decode - * @return true if the meta info was successfully detected and added, - * false otherwise. - */ - virtual bool readInfo (KFileMetaInfo& info, unsigned int); - - /** - * Writes information on a torrent file given by @p info. - * BitTorrent are practically nothing but meta information. - * Therefore, the entire file might be changed. - * - * @param info information on the file to encode - * @return true if the meta info was successfully updated, - * false otherwise - */ - virtual bool writeInfo (const KFileMetaInfo& info) const; - - private: - bool m_failed; - BDict *m_dict; -}; - -#endif /* _KFILE_TORRENT_H */ - -// vim: set et ts=4 sw=4: diff --git a/kget/CMakeLists.txt b/kget/CMakeLists.txt index 95fc2d67..de86db18 100644 --- a/kget/CMakeLists.txt +++ b/kget/CMakeLists.txt @@ -39,13 +39,13 @@ install( FILES kgetui.rc eventsrc DESTINATION ${DATA_INSTALL_DIR}/kget ) tde_add_executable( kget AUTOMOC SOURCES getfilejob.cpp slaveevent.cpp slave.cpp transferlist.cpp - transfer.cpp settings.cpp logwindow.cpp kmainwidget.cpp kfileio.cpp + transfer.cpp settings.cpp logwindow.cpp kmainwidget.cpp tdefileio.cpp droptarget.cpp docking.cpp dlgconnectionbase.ui dlgautomationbase.ui dlglimitsbase.ui dlgadvancedbase.ui dlgdirectoriesbase.ui dlgsystembase.ui dlgSystem.cpp dlgPreferences.cpp dlgLimits.cpp dlgIndividual.cpp dlgDirectories.cpp dlgConnection.cpp dlgAutomation.cpp dlgAdvanced.cpp main.cpp dockindividual.cpp kget_iface.skel safedelete.cpp - LINK kio-shared Xext + LINK tdeio-shared Xext DESTINATION ${BIN_INSTALL_DIR} ) diff --git a/kget/Makefile.am b/kget/Makefile.am index 90f8a364..25adb7aa 100644 --- a/kget/Makefile.am +++ b/kget/Makefile.am @@ -8,7 +8,7 @@ kget_LDFLAGS = $(all_libraries) $(KDE_RPATH) -lDCOP $(LIB_QT) kget_LDADD = $(LIB_KFILE) $(LIB_TDEUI) $(LIB_TDECORE) $(LIBSOCKET) kget_SOURCES = getfilejob.cpp slaveevent.cpp slave.cpp transferlist.cpp \ transfer.cpp settings.cpp logwindow.cpp \ - kmainwidget.cpp kfileio.cpp droptarget.cpp docking.cpp \ + kmainwidget.cpp tdefileio.cpp droptarget.cpp docking.cpp \ dlgconnectionbase.ui dlgautomationbase.ui dlglimitsbase.ui \ dlgadvancedbase.ui dlgdirectoriesbase.ui dlgsystembase.ui \ dlgSystem.cpp dlgPreferences.cpp dlgLimits.cpp \ @@ -20,7 +20,7 @@ noinst_HEADERS = common.h \ dlgAdvanced.h dlgAutomation.h dlgConnection.h \ dlgDirectories.h dlgIndividual.h dlgLimits.h \ dlgPreferences.h dlgSystem.h docking.h droptarget.h \ - kfileio.h kmainwidget.h logwindow.h settings.h \ + tdefileio.h kmainwidget.h logwindow.h settings.h \ transfer.h transferlist.h version.h slave.h \ slaveevent.h http_defaults.h getfilejob.h dockindividual.h diff --git a/kget/dlgAdvanced.cpp b/kget/dlgAdvanced.cpp index 9a1f7efe..45cbe5c5 100644 --- a/kget/dlgAdvanced.cpp +++ b/kget/dlgAdvanced.cpp @@ -30,7 +30,7 @@ #include #include -#include +#include #include "settings.h" #include "kmainwidget.h" diff --git a/kget/dlgDirectories.cpp b/kget/dlgDirectories.cpp index a373cc67..61688190 100644 --- a/kget/dlgDirectories.cpp +++ b/kget/dlgDirectories.cpp @@ -31,7 +31,7 @@ #include -#include +#include #include #include #include diff --git a/kget/dlgIndividual.cpp b/kget/dlgIndividual.cpp index a22bccea..5acd3b7a 100644 --- a/kget/dlgIndividual.cpp +++ b/kget/dlgIndividual.cpp @@ -43,7 +43,7 @@ #include #include #include -#include +#include #include "common.h" #include "transfer.h" diff --git a/kget/dlgIndividual.h b/kget/dlgIndividual.h index 91d7f8e3..399e548b 100644 --- a/kget/dlgIndividual.h +++ b/kget/dlgIndividual.h @@ -31,7 +31,7 @@ #include -#include +#include class Transfer; diff --git a/kget/droptarget.cpp b/kget/droptarget.cpp index ee0c05f5..c731938a 100644 --- a/kget/droptarget.cpp +++ b/kget/droptarget.cpp @@ -28,7 +28,7 @@ #include #include -#include +#include #include #include #include diff --git a/kget/getfilejob.h b/kget/getfilejob.h index fbfd2dca..ab42ca4b 100644 --- a/kget/getfilejob.h +++ b/kget/getfilejob.h @@ -18,7 +18,7 @@ #ifndef GETFILEJOB_H #define GETFILEJOB_H -#include +#include namespace TDEIO diff --git a/kget/kfileio.cpp b/kget/kfileio.cpp deleted file mode 100644 index ac8b0f70..00000000 --- a/kget/kfileio.cpp +++ /dev/null @@ -1,174 +0,0 @@ -/*************************************************************************** -* kfileio.cpp -* ------------------- -* -* Revision : $Id$ -* begin : Tue Jan 29 2002 -* copyright : (C) 2002 by Patrick Charbonnier -* -* email : pch@freeshell.org -* -***************************************************************************/ - -// Author: Stefan Taferner - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include "kfileio.h" - -//----------------------------------------------------------------------------- -TQString kFileToString(const TQString & aFileName, bool aEnsureNL, bool aVerbose) -{ - TQCString result; - - TQFileInfo info(aFileName); - unsigned int readLen; - unsigned int len = info.size(); - TQFile file(aFileName); - - // assert(aFileName!=NULL); - if (aFileName == NULL) - return ""; - - if (!info.exists()) { - if (aVerbose) - KMessageBox::error(tqApp->mainWidget(), i18n("The specified file does not exist:\n%1").arg(aFileName)); - return TQString(); - } - if (info.isDir()) { - if (aVerbose) - KMessageBox::error(tqApp->mainWidget(), i18n("This is a folder and not a file:\n%1").arg(aFileName)); - return TQString(); - } - if (!info.isReadable()) { - if (aVerbose) - KMessageBox::error(tqApp->mainWidget(), i18n("You do not have read permission for the file:\n%1").arg(aFileName)); - return TQString(); - } - if (len <= 0) - return TQString(); - - if (!file.open(IO_Raw | IO_ReadOnly)) { - if (aVerbose) - switch (file.status()) { - case IO_ReadError: - KMessageBox::error(tqApp->mainWidget(), i18n("Could not read file:\n%1").arg(aFileName)); - break; - case IO_OpenError: - KMessageBox::error(tqApp->mainWidget(), i18n("Could not open file:\n%1").arg(aFileName)); - break; - default: - KMessageBox::error(tqApp->mainWidget(), i18n("Error while reading file:\n%1").arg(aFileName)); - } - return TQString(); - } - - result.resize(len + (int) aEnsureNL + 1); - readLen = file.readBlock(result.data(), len); - if (aEnsureNL && result[len - 1] != '\n') { - result[len++] = '\n'; - readLen++; - } - result[len] = '\0'; - - if (readLen < len) { - TQString msg = i18n("Could only read %1 bytes of %2.").arg(TDEGlobal::locale()->formatNumber(readLen, - 0)).arg(TDEGlobal::locale()->formatNumber(len, 0)); - - KMessageBox::error(tqApp->mainWidget(), msg); - return TQString(); - } - - kdDebug() << "kFileToString: " << readLen << " bytes read" << endl; - return result; -} - - -//----------------------------------------------------------------------------- -static bool kBytesToFile(const char *aBuffer, int len, const TQString & aFileName, bool aAskIfExists, bool aBackup, bool aVerbose) -{ - TQFile file(aFileName); - TQFileInfo info(aFileName); - int writeLen, rc; - - // assert(aFileName!=NULL); - if (aFileName.isNull()) - return false; - - if (info.exists()) { - if (aAskIfExists) { - TQString str = i18n("File %1 exists.\nDo you want to replace it?").arg(aFileName); - - rc = KMessageBox::questionYesNo(tqApp->mainWidget(), str, TQString(), i18n("Replace"),KStdGuiItem::cancel()); - if (rc != KMessageBox::Yes) - return FALSE; - } - if (aBackup) { - // make a backup copy - TQString bakName = aFileName; - - bakName += '~'; - TQFile::remove(bakName); - rc = rename(TQFile::encodeName(aFileName), TQFile::encodeName(bakName)); - if (rc) { - // failed to rename file - if (!aVerbose) - return FALSE; - rc = KMessageBox::warningContinueCancel(tqApp->mainWidget(), i18n("Failed to make a backup copy of %1.\nContinue anyway?").arg(aFileName)); - if (rc != KMessageBox::Continue) - return FALSE; - } - } - } - - if (!file.open(IO_Raw | IO_WriteOnly)) { - if (aVerbose) - switch (file.status()) { - case IO_WriteError: - KMessageBox::error(tqApp->mainWidget(), i18n("Could not write to file:\n%1").arg(aFileName)); - break; - case IO_OpenError: - KMessageBox::error(tqApp->mainWidget(), i18n("Could not open file for writing:\n%1").arg(aFileName)); - break; - default: - KMessageBox::error(tqApp->mainWidget(), i18n("Error while writing file:\n%1").arg(aFileName)); - } - return FALSE; - } - - writeLen = file.writeBlock(aBuffer, len); - - if (writeLen < 0) { - KMessageBox::error(tqApp->mainWidget(), i18n("Could not write to file:\n%1").arg(aFileName)); - return FALSE; - } else if (writeLen < len) { - TQString msg = i18n("Could only write %1 bytes of %2.").arg(TDEGlobal::locale()->formatNumber(writeLen, - 0)).arg(TDEGlobal::locale()->formatNumber(len, - 0)); - - KMessageBox::error(tqApp->mainWidget(), msg); - return FALSE; - } - - return TRUE; -} - -bool kCStringToFile(const TQCString & aBuffer, const TQString & aFileName, bool aAskIfExists, bool aBackup, bool aVerbose) -{ - return kBytesToFile(aBuffer, aBuffer.length(), aFileName, aAskIfExists, aBackup, aVerbose); -} - -bool kByteArrayToFile(const TQByteArray & aBuffer, const TQString & aFileName, bool aAskIfExists, bool aBackup, bool aVerbose) -{ - return kBytesToFile(aBuffer, aBuffer.size(), aFileName, aAskIfExists, aBackup, aVerbose); -} diff --git a/kget/kfileio.h b/kget/kfileio.h deleted file mode 100644 index 84a50cd2..00000000 --- a/kget/kfileio.h +++ /dev/null @@ -1,44 +0,0 @@ -/*************************************************************************** -* kfileio.h -* ------------------- -* -* Revision : $Id$ -* begin : Tue Jan 29 2002 -* copyright : (C) 2002 by Patrick Charbonnier -* -* email : pch@freeshell.org -* -***************************************************************************/ - -/* Load / save entire (local) files with nice diagnostics dialog messages. - * These functions load/save the whole buffer in one i/o call, so they - * should be pretty efficient. - * - * Author: Stefan Taferner - * This code is under GPL. - */ -#ifndef kfileio_h -#define kfileio_h - -/** Load a file. Returns a pointer to the memory-block that contains - * the loaded file. Returns a NULL string if the file could not be loaded. - * If withDialogs is FALSE no warning dialogs are opened if there are - * problems. - * The string returned is always zero-terminated and therefore one - * byte longer than the file itself. - * If ensureNewline is TRUE the string will always have a trailing newline. - */ -TQString kFileToString(const TQString & fileName, bool ensureNewline = TRUE, bool withDialogs = TRUE); - -/** Save a file. If withDialogs is FALSE no warning dialogs are opened if - * there are problems. Returns TRUE on success and FALSE on failure. - * Replaces existing files without warning if askIfExists==FALSE. - * Makes a copy if the file exists to filename~ if createBackup==TRUE. - */ -bool kCStringToFile(const TQCString & buffer, const TQString & fileName, bool askIfExists = FALSE, bool createBackup = TRUE, bool withDialogs = TRUE); - -// Does not stop at NUL -bool kByteArrayToFile(const TQByteArray & buffer, const TQString & fileName, bool askIfExists = FALSE, bool createBackup = TRUE, bool withDialogs = TRUE); - - -#endif /* kfileio_h */ diff --git a/kget/kmainwidget.cpp b/kget/kmainwidget.cpp index 1865e6f9..382faa20 100644 --- a/kget/kmainwidget.cpp +++ b/kget/kmainwidget.cpp @@ -50,7 +50,7 @@ #include #include -#include +#include #include #include #include @@ -64,19 +64,19 @@ #include #include #include -#include -#include +#include +#include #include #include #include -#include +#include #include "safedelete.h" #include "settings.h" #include "transfer.h" #include "transferlist.h" #include "kmainwidget.h" -#include "kfileio.h" +#include "tdefileio.h" #include "dlgPreferences.h" #include "logwindow.h" #include "docking.h" @@ -85,8 +85,8 @@ -#include -#include +#include +#include #include #include "version.h" @@ -128,7 +128,7 @@ KMainWidget::KMainWidget(bool bStartDocked) #endif { - TDEConfig cfg( "kioslaverc", false, false); + TDEConfig cfg( "tdeioslaverc", false, false); cfg.setGroup(TQString()); cfg.writeEntry("AutoResume", true); cfg.sync(); diff --git a/kget/safedelete.cpp b/kget/safedelete.cpp index d6b2d138..53fbbbc3 100644 --- a/kget/safedelete.cpp +++ b/kget/safedelete.cpp @@ -1,7 +1,7 @@ #include #include #include -#include +#include #include diff --git a/kget/settings.cpp b/kget/settings.cpp index efc0086c..35451760 100644 --- a/kget/settings.cpp +++ b/kget/settings.cpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/kget/slave.cpp b/kget/slave.cpp index df0846d4..96ba3547 100644 --- a/kget/slave.cpp +++ b/kget/slave.cpp @@ -26,7 +26,7 @@ #include -#include +#include #include "getfilejob.h" #include "slave.h" diff --git a/kget/tdefileio.cpp b/kget/tdefileio.cpp new file mode 100644 index 00000000..ee4b4096 --- /dev/null +++ b/kget/tdefileio.cpp @@ -0,0 +1,174 @@ +/*************************************************************************** +* tdefileio.cpp +* ------------------- +* +* Revision : $Id$ +* begin : Tue Jan 29 2002 +* copyright : (C) 2002 by Patrick Charbonnier +* +* email : pch@freeshell.org +* +***************************************************************************/ + +// Author: Stefan Taferner + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "tdefileio.h" + +//----------------------------------------------------------------------------- +TQString kFileToString(const TQString & aFileName, bool aEnsureNL, bool aVerbose) +{ + TQCString result; + + TQFileInfo info(aFileName); + unsigned int readLen; + unsigned int len = info.size(); + TQFile file(aFileName); + + // assert(aFileName!=NULL); + if (aFileName == NULL) + return ""; + + if (!info.exists()) { + if (aVerbose) + KMessageBox::error(tqApp->mainWidget(), i18n("The specified file does not exist:\n%1").arg(aFileName)); + return TQString(); + } + if (info.isDir()) { + if (aVerbose) + KMessageBox::error(tqApp->mainWidget(), i18n("This is a folder and not a file:\n%1").arg(aFileName)); + return TQString(); + } + if (!info.isReadable()) { + if (aVerbose) + KMessageBox::error(tqApp->mainWidget(), i18n("You do not have read permission for the file:\n%1").arg(aFileName)); + return TQString(); + } + if (len <= 0) + return TQString(); + + if (!file.open(IO_Raw | IO_ReadOnly)) { + if (aVerbose) + switch (file.status()) { + case IO_ReadError: + KMessageBox::error(tqApp->mainWidget(), i18n("Could not read file:\n%1").arg(aFileName)); + break; + case IO_OpenError: + KMessageBox::error(tqApp->mainWidget(), i18n("Could not open file:\n%1").arg(aFileName)); + break; + default: + KMessageBox::error(tqApp->mainWidget(), i18n("Error while reading file:\n%1").arg(aFileName)); + } + return TQString(); + } + + result.resize(len + (int) aEnsureNL + 1); + readLen = file.readBlock(result.data(), len); + if (aEnsureNL && result[len - 1] != '\n') { + result[len++] = '\n'; + readLen++; + } + result[len] = '\0'; + + if (readLen < len) { + TQString msg = i18n("Could only read %1 bytes of %2.").arg(TDEGlobal::locale()->formatNumber(readLen, + 0)).arg(TDEGlobal::locale()->formatNumber(len, 0)); + + KMessageBox::error(tqApp->mainWidget(), msg); + return TQString(); + } + + kdDebug() << "kFileToString: " << readLen << " bytes read" << endl; + return result; +} + + +//----------------------------------------------------------------------------- +static bool kBytesToFile(const char *aBuffer, int len, const TQString & aFileName, bool aAskIfExists, bool aBackup, bool aVerbose) +{ + TQFile file(aFileName); + TQFileInfo info(aFileName); + int writeLen, rc; + + // assert(aFileName!=NULL); + if (aFileName.isNull()) + return false; + + if (info.exists()) { + if (aAskIfExists) { + TQString str = i18n("File %1 exists.\nDo you want to replace it?").arg(aFileName); + + rc = KMessageBox::questionYesNo(tqApp->mainWidget(), str, TQString(), i18n("Replace"),KStdGuiItem::cancel()); + if (rc != KMessageBox::Yes) + return FALSE; + } + if (aBackup) { + // make a backup copy + TQString bakName = aFileName; + + bakName += '~'; + TQFile::remove(bakName); + rc = rename(TQFile::encodeName(aFileName), TQFile::encodeName(bakName)); + if (rc) { + // failed to rename file + if (!aVerbose) + return FALSE; + rc = KMessageBox::warningContinueCancel(tqApp->mainWidget(), i18n("Failed to make a backup copy of %1.\nContinue anyway?").arg(aFileName)); + if (rc != KMessageBox::Continue) + return FALSE; + } + } + } + + if (!file.open(IO_Raw | IO_WriteOnly)) { + if (aVerbose) + switch (file.status()) { + case IO_WriteError: + KMessageBox::error(tqApp->mainWidget(), i18n("Could not write to file:\n%1").arg(aFileName)); + break; + case IO_OpenError: + KMessageBox::error(tqApp->mainWidget(), i18n("Could not open file for writing:\n%1").arg(aFileName)); + break; + default: + KMessageBox::error(tqApp->mainWidget(), i18n("Error while writing file:\n%1").arg(aFileName)); + } + return FALSE; + } + + writeLen = file.writeBlock(aBuffer, len); + + if (writeLen < 0) { + KMessageBox::error(tqApp->mainWidget(), i18n("Could not write to file:\n%1").arg(aFileName)); + return FALSE; + } else if (writeLen < len) { + TQString msg = i18n("Could only write %1 bytes of %2.").arg(TDEGlobal::locale()->formatNumber(writeLen, + 0)).arg(TDEGlobal::locale()->formatNumber(len, + 0)); + + KMessageBox::error(tqApp->mainWidget(), msg); + return FALSE; + } + + return TRUE; +} + +bool kCStringToFile(const TQCString & aBuffer, const TQString & aFileName, bool aAskIfExists, bool aBackup, bool aVerbose) +{ + return kBytesToFile(aBuffer, aBuffer.length(), aFileName, aAskIfExists, aBackup, aVerbose); +} + +bool kByteArrayToFile(const TQByteArray & aBuffer, const TQString & aFileName, bool aAskIfExists, bool aBackup, bool aVerbose) +{ + return kBytesToFile(aBuffer, aBuffer.size(), aFileName, aAskIfExists, aBackup, aVerbose); +} diff --git a/kget/tdefileio.h b/kget/tdefileio.h new file mode 100644 index 00000000..b8310137 --- /dev/null +++ b/kget/tdefileio.h @@ -0,0 +1,44 @@ +/*************************************************************************** +* tdefileio.h +* ------------------- +* +* Revision : $Id$ +* begin : Tue Jan 29 2002 +* copyright : (C) 2002 by Patrick Charbonnier +* +* email : pch@freeshell.org +* +***************************************************************************/ + +/* Load / save entire (local) files with nice diagnostics dialog messages. + * These functions load/save the whole buffer in one i/o call, so they + * should be pretty efficient. + * + * Author: Stefan Taferner + * This code is under GPL. + */ +#ifndef tdefileio_h +#define tdefileio_h + +/** Load a file. Returns a pointer to the memory-block that contains + * the loaded file. Returns a NULL string if the file could not be loaded. + * If withDialogs is FALSE no warning dialogs are opened if there are + * problems. + * The string returned is always zero-terminated and therefore one + * byte longer than the file itself. + * If ensureNewline is TRUE the string will always have a trailing newline. + */ +TQString kFileToString(const TQString & fileName, bool ensureNewline = TRUE, bool withDialogs = TRUE); + +/** Save a file. If withDialogs is FALSE no warning dialogs are opened if + * there are problems. Returns TRUE on success and FALSE on failure. + * Replaces existing files without warning if askIfExists==FALSE. + * Makes a copy if the file exists to filename~ if createBackup==TRUE. + */ +bool kCStringToFile(const TQCString & buffer, const TQString & fileName, bool askIfExists = FALSE, bool createBackup = TRUE, bool withDialogs = TRUE); + +// Does not stop at NUL +bool kByteArrayToFile(const TQByteArray & buffer, const TQString & fileName, bool askIfExists = FALSE, bool createBackup = TRUE, bool withDialogs = TRUE); + + +#endif /* tdefileio_h */ diff --git a/kget/transfer.cpp b/kget/transfer.cpp index 218a5561..477183f3 100644 --- a/kget/transfer.cpp +++ b/kget/transfer.cpp @@ -12,7 +12,7 @@ /*************************************************************************** * * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public Lkio/global.h:icense as published by + * it under the terms of the GNU General Public Ltdeio/global.h:icense as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * @@ -45,9 +45,9 @@ #include "transfer.h" #include -#include -#include -#include +#include +#include +#include extern Settings ksettings; diff --git a/kget/transfer.h b/kget/transfer.h index 7c8eb7f5..f147f011 100644 --- a/kget/transfer.h +++ b/kget/transfer.h @@ -34,7 +34,7 @@ #include #include -#include +#include #include "slave.h" diff --git a/kget/transferlist.cpp b/kget/transferlist.cpp index 60d62943..768460d1 100644 --- a/kget/transferlist.cpp +++ b/kget/transferlist.cpp @@ -29,10 +29,10 @@ #include #include #include -#include +#include #include #include -#include +#include #include "transfer.h" #include "transferlist.h" diff --git a/knewsticker/CMakeLists.txt b/knewsticker/CMakeLists.txt index 116a1dad..912d0a36 100644 --- a/knewsticker/CMakeLists.txt +++ b/knewsticker/CMakeLists.txt @@ -43,6 +43,6 @@ tde_add_kpart( knewsticker_panelapplet AUTOMOC newsscroller.cpp knewsticker.cpp knewsticker.skel knewstickerconfig.cpp knewstickerconfigwidget.ui newssourcedlgimpl.cpp newssourcedlg.ui - LINK knewstickercommon-static kio-shared + LINK knewstickercommon-static tdeio-shared DESTINATION ${PLUGIN_INSTALL_DIR} ) diff --git a/knewsticker/Makefile.am b/knewsticker/Makefile.am index ffc15272..28be1fd8 100644 --- a/knewsticker/Makefile.am +++ b/knewsticker/Makefile.am @@ -18,7 +18,7 @@ knewsticker_panelapplet_la_LIBADD = common/libknewstickercommon.la \ appdatadir = $(kde_datadir)/knewsticker appdata_DATA = eventsrc -updatedir = $(kde_datadir)/kconf_update +updatedir = $(kde_datadir)/tdeconf_update update_DATA = knewsticker.upd update_SCRIPTS = knt-0.1-0.2.pl diff --git a/knewsticker/common/configaccess.h b/knewsticker/common/configaccess.h index cebce895..b9be6d49 100644 --- a/knewsticker/common/configaccess.h +++ b/knewsticker/common/configaccess.h @@ -14,8 +14,8 @@ #include "configiface.h" #include "newsengine.h" -#include -#include +#include +#include #include #include diff --git a/knewsticker/common/newsengine.h b/knewsticker/common/newsengine.h index e9175317..6cb3f3af 100644 --- a/knewsticker/common/newsengine.h +++ b/knewsticker/common/newsengine.h @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include diff --git a/knewsticker/common/newsiconmgr.h b/knewsticker/common/newsiconmgr.h index f2997479..2cc90cf2 100644 --- a/knewsticker/common/newsiconmgr.h +++ b/knewsticker/common/newsiconmgr.h @@ -15,7 +15,7 @@ #include #include -#include +#include #include class DCOPClient; diff --git a/knewsticker/common/xmlnewsaccess.h b/knewsticker/common/xmlnewsaccess.h index 4af60fcf..954727c3 100644 --- a/knewsticker/common/xmlnewsaccess.h +++ b/knewsticker/common/xmlnewsaccess.h @@ -18,7 +18,7 @@ #include #include -#include +#include #include class TQBuffer; diff --git a/knewsticker/knewstickerstub/CMakeLists.txt b/knewsticker/knewstickerstub/CMakeLists.txt index 970db280..d25f25a6 100644 --- a/knewsticker/knewstickerstub/CMakeLists.txt +++ b/knewsticker/knewstickerstub/CMakeLists.txt @@ -33,6 +33,6 @@ install( FILES tde_add_executable( knewstickerstub AUTOMOC SOURCES knewstickerstub.cpp - LINK knewstickercommon-static kio-shared + LINK knewstickercommon-static tdeio-shared DESTINATION ${BIN_INSTALL_DIR} ) diff --git a/kopete/INSTALL b/kopete/INSTALL index 8c75ea29..1523effd 100644 --- a/kopete/INSTALL +++ b/kopete/INSTALL @@ -193,9 +193,9 @@ directory where TDE doesn't look for additional resources like plugins. It's also possible that you've just been too impatient :) Kopete installs several .desktop files that have to be processed by a -TDE application called 'kbuildsycoca'. If you run Kopete directly +TDE application called 'tdebuildsycoca'. If you run Kopete directly after installing it this process might still be running and Kopete -doesn't see the new plugins yet. Try running 'kbuildsycoca' from a +doesn't see the new plugins yet. Try running 'tdebuildsycoca' from a console and restart Kopete when it finishes. If that doesn't help, please read on. diff --git a/kopete/kopete/CMakeLists.txt b/kopete/kopete/CMakeLists.txt index b88714c2..8f7f6b98 100644 --- a/kopete/kopete/CMakeLists.txt +++ b/kopete/kopete/CMakeLists.txt @@ -14,7 +14,7 @@ add_subdirectory( addcontactwizard ) add_subdirectory( contactlist ) add_subdirectory( chatwindow ) add_subdirectory( config ) -add_subdirectory( kconf_update ) +add_subdirectory( tdeconf_update ) include_directories( ${CMAKE_CURRENT_BINARY_DIR} diff --git a/kopete/kopete/Makefile.am b/kopete/kopete/Makefile.am index ed4305c6..0dbf8f13 100644 --- a/kopete/kopete/Makefile.am +++ b/kopete/kopete/Makefile.am @@ -23,7 +23,7 @@ AM_CPPFLAGS = $(KOPETE_INCLUDES) \ KDE_ICON = AUTO METASOURCES = AUTO -SUBDIRS = addaccountwizard addcontactwizard contactlist chatwindow config . kconf_update +SUBDIRS = addaccountwizard addcontactwizard contactlist chatwindow config . tdeconf_update bin_PROGRAMS = kopete kopete_SOURCES = main.cpp kopeteapplication.cpp kopeteiface.cpp \ diff --git a/kopete/kopete/addcontactwizard/addcontactwizard.cpp b/kopete/kopete/addcontactwizard/addcontactwizard.cpp index 1c011f99..02523865 100644 --- a/kopete/kopete/addcontactwizard/addcontactwizard.cpp +++ b/kopete/kopete/addcontactwizard/addcontactwizard.cpp @@ -46,7 +46,7 @@ #include #include #include -#include +#include #include #include diff --git a/kopete/kopete/chatwindow/chatmessagepart.cpp b/kopete/kopete/chatwindow/chatmessagepart.cpp index 01361872..7a6235f1 100644 --- a/kopete/kopete/chatwindow/chatmessagepart.cpp +++ b/kopete/kopete/chatwindow/chatmessagepart.cpp @@ -50,7 +50,7 @@ #include #include #include -#include +#include #include #include #include @@ -60,8 +60,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/kopete/kopete/chatwindow/chatview.cpp b/kopete/kopete/chatwindow/chatview.cpp index 34324b45..136a9b4e 100644 --- a/kopete/kopete/chatwindow/chatview.cpp +++ b/kopete/kopete/chatwindow/chatview.cpp @@ -32,7 +32,7 @@ #include "kopetecontactlist.h" #include "kopeteviewmanager.h" -#include +#include #include #include #include diff --git a/kopete/kopete/chatwindow/kopetechatwindow.cpp b/kopete/kopete/chatwindow/kopetechatwindow.cpp index e205fb5a..a330dc43 100644 --- a/kopete/kopete/chatwindow/kopetechatwindow.cpp +++ b/kopete/kopete/chatwindow/kopetechatwindow.cpp @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/kopete/kopete/chatwindow/kopetechatwindowstylemanager.cpp b/kopete/kopete/chatwindow/kopetechatwindowstylemanager.cpp index 7ed0e931..6a5b4534 100644 --- a/kopete/kopete/chatwindow/kopetechatwindowstylemanager.cpp +++ b/kopete/kopete/chatwindow/kopetechatwindowstylemanager.cpp @@ -30,9 +30,9 @@ #include #include #include -#include +#include #include -#include +#include #include #include "kopetechatwindowstyle.h" diff --git a/kopete/kopete/chatwindow/kopetechatwindowstylemanager.h b/kopete/kopete/chatwindow/kopetechatwindowstylemanager.h index 3cf5d6e9..7c9a181f 100644 --- a/kopete/kopete/chatwindow/kopetechatwindowstylemanager.h +++ b/kopete/kopete/chatwindow/kopetechatwindowstylemanager.h @@ -20,7 +20,7 @@ #include #include -#include +#include #include class ChatWindowStyle; diff --git a/kopete/kopete/chatwindow/kopeteemailwindow.cpp b/kopete/kopete/chatwindow/kopeteemailwindow.cpp index 7cb9a03f..b70313b9 100644 --- a/kopete/kopete/chatwindow/kopeteemailwindow.cpp +++ b/kopete/kopete/chatwindow/kopeteemailwindow.cpp @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/kopete/kopete/chatwindow/krichtexteditpart.cpp b/kopete/kopete/chatwindow/krichtexteditpart.cpp index 6f3bdf25..152570a8 100644 --- a/kopete/kopete/chatwindow/krichtexteditpart.cpp +++ b/kopete/kopete/chatwindow/krichtexteditpart.cpp @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/kopete/kopete/config/appearance/appearanceconfig.cpp b/kopete/kopete/config/appearance/appearanceconfig.cpp index 63c51b89..0aff7691 100644 --- a/kopete/kopete/config/appearance/appearanceconfig.cpp +++ b/kopete/kopete/config/appearance/appearanceconfig.cpp @@ -43,11 +43,11 @@ #include #include #include -#include // for KNewStuff emoticon fetching +#include // for KNewStuff emoticon fetching #include #include #include -#include +#include #include #include #include @@ -59,7 +59,7 @@ #include #include #include -#include +#include #include // knewstuff emoticon and chatwindow fetching #include // " @@ -696,7 +696,7 @@ void AppearanceConfig::slotGetChatStyles() // you have to do this by hand when providing your own Engine KNS::ProviderLoader *provider = new KNS::ProviderLoader( this ); TQObject::connect( provider, TQT_SIGNAL( providersLoaded(Provider::List*) ), downloadDialog, TQT_SLOT( slotProviders (Provider::List *) ) ); - provider->load( "kopete/chatstyle", "http://download.kde.org/khotnewstuff/kopetestyles12-providers.xml" ); + provider->load( "kopete/chatstyle", "http://download.kde.org/tdehotnewstuff/kopetestyles12-providers.xml" ); downloadDialog->exec(); } @@ -856,7 +856,7 @@ void AppearanceConfig::slotGetEmoticonThemes() TDEConfig* config = TDEGlobal::config(); config->setGroup( "KNewStuff" ); config->writeEntry( "ProvidersUrl", - "http://download.kde.org/khotnewstuff/emoticons-providers.xml" ); + "http://download.kde.org/tdehotnewstuff/emoticons-providers.xml" ); config->writeEntry( "StandardResource", "emoticons" ); config->writeEntry( "Uncompress", "application/x-gzip" ); config->sync(); diff --git a/kopete/kopete/config/appearance/emoticonseditdialog.cpp b/kopete/kopete/config/appearance/emoticonseditdialog.cpp index d432d22e..f0510a5f 100644 --- a/kopete/kopete/config/appearance/emoticonseditdialog.cpp +++ b/kopete/kopete/config/appearance/emoticonseditdialog.cpp @@ -23,8 +23,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/kopete/kopete/config/avdevice/avdeviceconfig.cpp b/kopete/kopete/config/avdevice/avdeviceconfig.cpp index cf619fd7..cf5f98ed 100644 --- a/kopete/kopete/config/avdevice/avdeviceconfig.cpp +++ b/kopete/kopete/config/avdevice/avdeviceconfig.cpp @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/kopete/kopete/config/behavior/behaviorconfig.cpp b/kopete/kopete/config/behavior/behaviorconfig.cpp index bae2d832..f3d61b44 100644 --- a/kopete/kopete/config/behavior/behaviorconfig.cpp +++ b/kopete/kopete/config/behavior/behaviorconfig.cpp @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include "kopeteprefs.h" diff --git a/kopete/kopete/config/identity/kopeteidentityconfig.cpp b/kopete/kopete/config/identity/kopeteidentityconfig.cpp index da13d3cc..1d513964 100644 --- a/kopete/kopete/config/identity/kopeteidentityconfig.cpp +++ b/kopete/kopete/config/identity/kopeteidentityconfig.cpp @@ -30,7 +30,7 @@ // KDE includes #include -#include +#include #include #include #include @@ -45,7 +45,7 @@ #include // KDE KIO includes -#include +#include // KDE KABC(AddressBook) includes #include diff --git a/kopete/kopete/config/identity/kopeteidentityconfig.h b/kopete/kopete/config/identity/kopeteidentityconfig.h index d0795412..37f4e7df 100644 --- a/kopete/kopete/config/identity/kopeteidentityconfig.h +++ b/kopete/kopete/config/identity/kopeteidentityconfig.h @@ -19,7 +19,7 @@ #define _IDENTITYCONFIG_H #include -#include +#include #include "kopetemetacontact.h" diff --git a/kopete/kopete/config/identity/kopeteidentityconfigpreferences.kcfgc b/kopete/kopete/config/identity/kopeteidentityconfigpreferences.kcfgc index 6f93d40f..ffa89670 100644 --- a/kopete/kopete/config/identity/kopeteidentityconfigpreferences.kcfgc +++ b/kopete/kopete/config/identity/kopeteidentityconfigpreferences.kcfgc @@ -1,4 +1,4 @@ -# Code generation options for kconfig_compiler +# Code generation options for tdeconfig_compiler File=kopeteidentityconfigpreferences.kcfg ClassName=KopeteIdentityConfigPreferences Singleton=true diff --git a/kopete/kopete/contactlist/customnotificationprops.cpp b/kopete/kopete/contactlist/customnotificationprops.cpp index bc5ed895..82851eb4 100644 --- a/kopete/kopete/contactlist/customnotificationprops.cpp +++ b/kopete/kopete/contactlist/customnotificationprops.cpp @@ -23,7 +23,7 @@ #include #include -#include +#include #include #include "customnotifications.h" diff --git a/kopete/kopete/contactlist/kopetelviprops.cpp b/kopete/kopete/contactlist/kopetelviprops.cpp index a731b504..f64af84d 100644 --- a/kopete/kopete/contactlist/kopetelviprops.cpp +++ b/kopete/kopete/contactlist/kopetelviprops.cpp @@ -33,7 +33,7 @@ #include #include -#include +#include #include #include #include @@ -521,7 +521,7 @@ void KopeteMetaLVIProps::slotFromKABCClicked() void KopeteMetaLVIProps::slotOpenSoundDialog( KURLRequester *requester ) { - // taken from tdelibs/kio/kfile/knotifydialog.cpp + // taken from tdelibs/tdeio/tdefile/knotifydialog.cpp // only need to init this once requester->disconnect( TQT_SIGNAL( openFileDialog( KURLRequester * )), this, TQT_SLOT( slotOpenSoundDialog( KURLRequester * ))); diff --git a/kopete/kopete/contactlist/kopetemetacontactlvi.cpp b/kopete/kopete/contactlist/kopetemetacontactlvi.cpp index 7daabb61..3f2165c4 100644 --- a/kopete/kopete/contactlist/kopetemetacontactlvi.cpp +++ b/kopete/kopete/contactlist/kopetemetacontactlvi.cpp @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include #include diff --git a/kopete/kopete/kconf_update/CMakeLists.txt b/kopete/kopete/kconf_update/CMakeLists.txt deleted file mode 100644 index 000654da..00000000 --- a/kopete/kopete/kconf_update/CMakeLists.txt +++ /dev/null @@ -1,64 +0,0 @@ -################################################# -# -# (C) 2010-2011 Serghei Amelian -# serghei (DOT) amelian (AT) gmail.com -# -# Improvements and feedback are welcome -# -# This file is released under GPL >= 2 -# -################################################# - -add_definitions( -DKDE_NO_COMPAT ) - -include_directories( - ${TDE_INCLUDE_DIR} - ${TQT_INCLUDE_DIRS} -) - -link_directories( - ${TQT_LIBRARY_DIRS} -) - - -##### other data ################################ - -install( FILES - kopete-pluginloader.upd kopete-account-kconf_update.upd - kopete-pluginloader2.upd kopete-jabberproxytype-kconf_update.upd - kopete-jabberpriorityaddition-kconf_update.upd - kopete-nameTracking.upd - DESTINATION ${KCONF_UPDATE_INSTALL_DIR} ) - -install( PROGRAMS - kopete-pluginloader.pl kopete-jabberpriorityaddition-kconf_update.sh - kopete-pluginloader2.sh kopete-jabberproxytype-kconf_update.sh - kopete-account-0.10.pl kopete-account-kconf_update.sh - DESTINATION ${KCONF_UPDATE_INSTALL_DIR} ) - - -##### kopete_account_kconf_update (executable) ## - -tde_add_executable( "kopete-account-kconf_update" - SOURCES kopete-account-kconf_update.cpp - LINK ${TQT_LIBRARIES} - DESTINATION ${LIB_INSTALL_DIR}/kconf_update_bin -) - - -##### kopete_pluginloader2_kconf_update (executable) - -tde_add_executable( "kopete-pluginloader2-kconf_update" - SOURCES kopete-pluginloader2.cpp - LINK ${TQT_LIBRARIES} - DESTINATION ${LIB_INSTALL_DIR}/kconf_update_bin -) - - -##### kopete_nameTracking_kconf_update (executable) - -tde_add_executable( "kopete-nameTracking-kconf_update" - SOURCES kopete-nameTracking.cpp - LINK tdecore-shared - DESTINATION ${LIB_INSTALL_DIR}/kconf_update_bin -) diff --git a/kopete/kopete/kconf_update/Makefile.am b/kopete/kopete/kconf_update/Makefile.am deleted file mode 100644 index 7ae291dd..00000000 --- a/kopete/kopete/kconf_update/Makefile.am +++ /dev/null @@ -1,32 +0,0 @@ -AM_CPPFLAGS = -DKDE_NO_COMPAT -DQT_NO_COMPAT $(all_includes) - -update_DATA = kopete-pluginloader.upd kopete-account-kconf_update.upd \ - kopete-pluginloader2.upd kopete-jabberproxytype-kconf_update.upd \ - kopete-jabberpriorityaddition-kconf_update.upd kopete-nameTracking.upd -update_SCRIPTS = kopete-pluginloader.pl kopete-account-kconf_update.sh \ - kopete-pluginloader2.sh kopete-jabberproxytype-kconf_update.sh \ - kopete-jabberpriorityaddition-kconf_update.sh kopete-account-0.10.pl -updatedir = $(kde_datadir)/kconf_update - -# The Qt app cannot go into kde_datadir, that is not portable. -# install to kde_bindir/kconf_update_bin instead. -# KDE 3.2 will allow kconf_update scripts to run directly from there, -# but for us that's too late. Use the .sh script as a workaround. -kconf_PROGRAMS = kopete-account-kconf_update kopete-pluginloader2-kconf_update \ - kopete-nameTracking-kconf_update -kconfdir = $(libdir)/kconf_update_bin - -kopete_account_kconf_update_SOURCES = kopete-account-kconf_update.cpp -kopete_account_kconf_update_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -kopete_account_kconf_update_LDADD = $(LIB_QT) - -kopete_pluginloader2_kconf_update_SOURCES = kopete-pluginloader2.cpp -kopete_pluginloader2_kconf_update_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -kopete_pluginloader2_kconf_update_LDADD = $(LIB_QT) - -kopete_nameTracking_kconf_update_SOURCES = kopete-nameTracking.cpp -kopete_nameTracking_kconf_update_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -kopete_nameTracking_kconf_update_LDADD = $(LIB_QT) $(LIB_TDECORE) - -# vim: set noet: - diff --git a/kopete/kopete/kconf_update/kopete-account-0.10.pl b/kopete/kopete/kconf_update/kopete-account-0.10.pl deleted file mode 100755 index 3925a52f..00000000 --- a/kopete/kopete/kconf_update/kopete-account-0.10.pl +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/perl -w -# Olivier Goffart -# License: GPL - -use strict; - -# This script rename old plugin datas key. -# It remove the PlguinData_PLUGINID_ prefix from keys. - -# read the whole config file -my $currentGroup = ""; -my %configFile; -while ( <> ) { - chomp; # eat the trailing '\n' - next if ( /^$/ ); # skip empty lines - next if ( /^\#/ ); # skip comments - if ( /^\[/ ) { # group begin - $currentGroup = $_; - next; - } elsif ( $currentGroup =~ /^\[Account_/ and /^PluginData\_.+_(.+)=(.+)$/ ) - { - print "$currentGroup\n$1=$2\n"; - my ($key,$value) = split /=/; - print "# DELETE $currentGroup$key\n"; - } -} diff --git a/kopete/kopete/kconf_update/kopete-account-kconf_update.cpp b/kopete/kopete/kconf_update/kopete-account-kconf_update.cpp deleted file mode 100644 index 4e0daa55..00000000 --- a/kopete/kopete/kconf_update/kopete-account-kconf_update.cpp +++ /dev/null @@ -1,247 +0,0 @@ -/* - kconf_update app for migrating kopete 0.6.x accounts to 0.7. Code is - not up to my normal standards, but it does the job, and since it's - supposed to run exactly once on each system that's good enough for me :) - - Copyright (c) 2003 by Martijn Klingens - - Kopete (c) 2002-2003 by the Kopete developers - - ************************************************************************* - * * - * This library is free software; you can redistribute it and/or * - * modify it under the terms of the GNU Lesser General Public * - * License as published by the Free Software Foundation; either * - * version 2 of the License, or (at your option) any later version. * - * * - ************************************************************************* -*/ - -#include -#include -#include - -static TQTextStream qcin ( stdin, IO_ReadOnly ); -static TQTextStream qcout( stdout, IO_WriteOnly ); -static TQTextStream qcerr( stderr, IO_WriteOnly ); - -// Group cache. Yes, I know global vars are ugly :) -bool needFlush = false; -TQString accountId; -TQString password; -TQString autoConnect; -TQString protocol; -TQMap pluginData; - -// Global vars to hold separate IRC vars until we have read all of them -TQString ircNick; -TQString ircServer; -TQString ircPort; - -/* - * Function for (en/de)crypting strings for config file, taken from KMail - * Author: Stefan Taferner - */ -TQString cryptStr(const TQString &aStr) -{ - TQString result; - for (unsigned int i = 0; i < aStr.length(); i++) - result += (aStr[i].unicode() < 0x20) ? aStr[i] : - TQChar(0x1001F - aStr[i].unicode()); - return result; -} - -void parseGroup( const TQString &group, const TQString &rawLine ) -{ - // Groups that are converted can almost certainly be removed entirely - - if ( group == "MSN" || group == "ICQ" || group == "Oscar" || group == "Gadu" || group == "Jabber" || group == "IRC" ) - { - accountId = "EMPTY"; - autoConnect = "true"; - - if ( group == "Oscar" ) - protocol = "AIMProtocol"; - else - protocol = group + "Protocol"; - - password = TQString(); - pluginData.clear(); - - needFlush = true; - - qcout << "# DELETEGROUP [" << group << "]" << endl; - } - else - { - // Groups we don't convert. Output the raw line instead. - qcout << rawLine << endl; - } -} - -void parseKey( const TQString &group, const TQString &key, const TQString &value, const TQString &rawLine ) -{ - //qcerr << "*** group='" << group << "'" << endl; - if ( group == "MSN" ) - { - if ( key == "UserID" ) - accountId = value; - else if ( key == "Password" ) - password = value; - else if ( key == "AutoConnect" ) - autoConnect = value; - else if ( key == "Nick" ) - pluginData[ "displayName" ] = value; - - // All other keys are ignored for MSN, as these apply to stuff that's - // now in libkopete (and the main app) instead. - } - else if ( group == "ICQ" ) - { - if ( key == "UIN" ) - accountId = value; - else if ( key == "Password" ) - password = value; - else if ( key == "AutoConnect" ) - autoConnect = value; - else if ( key == "Nick" ) - pluginData[ "NickName" ] = value; - else if ( key == "Server" ) - pluginData[ key ] = value; - else if ( key == "Port" ) - pluginData[ key ] = value; - } - else if ( group == "Oscar" ) - { - if ( key == "ScreenName" ) - accountId = value; - else if ( key == "Password" ) - password = value; - else if ( key == "Server" ) - pluginData[ key ] = value; - else if ( key == "Port" ) - pluginData[ key ] = value; - } - else if ( group == "Jabber" ) - { - if ( key == "UserID" ) - accountId = value; - else if ( key == "Password" ) - password = value; - if ( key == "Server" || - key == "Port" || key == "UseSSL" || key == "Resource" ) - pluginData[ key ] = value; - } - else if ( group == "Gadu" ) - { - if ( key == "UIN" ) - accountId = value; - else if ( key == "Password" ) - password = value; - else if ( key == "Nick" ) - pluginData[ "displayName" ] = value; - } - else if ( group == "IRC" ) - { - if ( key == "Nickname" ) - ircNick = value; - if ( key == "Server" ) - ircServer = value; - if ( key == "Port" ) - ircPort = value; - if ( accountId == "EMPTY" && - !ircNick.isEmpty( ) && !ircServer.isEmpty() && - !ircPort.isEmpty() ) - { - accountId = TQString::fromLatin1( "%1@%2:%3" ).arg( ircNick, ircServer, ircPort ); - } - } - /* - fixme: insert all other plugins here - martijn - */ - else if ( key == "Modules" ) - { - TQString newValue = value; - newValue.replace ( ".plugin", ".desktop" ); - qcout << "Plugins=" << newValue; - } - else - { - // groups we don't convert. output the raw line instead. - qcout << rawLine << endl; - } -} - -void flushData( const TQString &group ) -{ - - qcout << "[Account_" << protocol << "_" << accountId << "]" << endl; - qcout << "Protocol=" << protocol << endl; - - if( group == "Jabber" ) - qcout << "AccountId=" << accountId << "@" << pluginData["Server"] << endl; - else - qcout << "AccountId=" << accountId << endl; - - qcout << "Password=" << cryptStr( password ) << endl; - qcout << "AutoConnect=" << autoConnect << endl; - - TQMap::ConstIterator it; - for ( it = pluginData.begin(); it != pluginData.end(); ++it ) - qcout << "PluginData_" << protocol << "_" << it.key() << "=" << it.data() << endl; - -} - -int main() -{ - qcin.setEncoding( TQTextStream::UnicodeUTF8 ); - qcout.setEncoding( TQTextStream::UnicodeUTF8 ); - - TQString curGroup; - - TQRegExp groupRegExp( "^\\[(.*)\\]" ); - TQRegExp keyRegExp( "^([a-zA-Z0-9:, _-]*)\\s*=\\s*(.*)\\s*" ); - TQRegExp commentRegExp( "^(#.*)?$" ); - - while ( !qcin.atEnd() ) - { - TQString line = qcin.readLine(); - - if ( commentRegExp.exactMatch( line ) ) - { - // We found a comment, leave unchanged - qcout << line << endl; - } - else if ( groupRegExp.exactMatch( line ) ) - { - // We found the start of a group, parse it - if ( needFlush ) - { - // ... but we were already working on a group, so finish what - // we were doing - flush existing group first - flushData ( curGroup ); - needFlush = false; - } - - curGroup = groupRegExp.capturedTexts()[ 1 ]; - parseGroup( curGroup, line ); - } - else if ( keyRegExp.exactMatch( line ) ) - { - // We found the a key line - parseKey( curGroup, keyRegExp.capturedTexts()[ 1 ], keyRegExp.capturedTexts()[ 2 ], line ); - } - else - { - qcerr << "** Unknown input line: " << line << endl; - } - } - - if ( needFlush ) - flushData ( curGroup ); - - return 0; -} - -// vim: set noet ts=4 sts=4 sw=4: - diff --git a/kopete/kopete/kconf_update/kopete-account-kconf_update.sh b/kopete/kopete/kconf_update/kopete-account-kconf_update.sh deleted file mode 100644 index e47477b8..00000000 --- a/kopete/kopete/kconf_update/kopete-account-kconf_update.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -IFS=: -SUFF=kconf_update_bin/kopete-account-kconf_update -for path in `tde-config --path lib`; do - if test -x "$path/$SUFF"; then - exec "$path/$SUFF" - fi -done - diff --git a/kopete/kopete/kconf_update/kopete-account-kconf_update.upd b/kopete/kopete/kconf_update/kopete-account-kconf_update.upd deleted file mode 100644 index ed1f3ac7..00000000 --- a/kopete/kopete/kconf_update/kopete-account-kconf_update.upd +++ /dev/null @@ -1,9 +0,0 @@ -Id=kopete0.7/r1 -File=kopeterc -Script=kopete-account-kconf_update.sh,sh - -#remove the PluginData_ProtocolID_ prefix from config keys -Id=kopete0.10/r1 -File=kopeterc -Script=kopete-account-0.10.pl,perl - diff --git a/kopete/kopete/kconf_update/kopete-jabberpriorityaddition-kconf_update.sh b/kopete/kopete/kconf_update/kopete-jabberpriorityaddition-kconf_update.sh deleted file mode 100644 index 2ba47416..00000000 --- a/kopete/kopete/kconf_update/kopete-jabberpriorityaddition-kconf_update.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -sed -e 's/^\(PluginData_JabberProtocol_Resource=.*\)$/\1\nPluginData_JabberProtocol_Priority=5/' diff --git a/kopete/kopete/kconf_update/kopete-jabberpriorityaddition-kconf_update.upd b/kopete/kopete/kconf_update/kopete-jabberpriorityaddition-kconf_update.upd deleted file mode 100644 index 8e761e6f..00000000 --- a/kopete/kopete/kconf_update/kopete-jabberpriorityaddition-kconf_update.upd +++ /dev/null @@ -1,4 +0,0 @@ -Id=kopete0.9/r1 -File=kopeterc -Script=kopete-jabberpriorityaddition-kconf_update.sh,sh - diff --git a/kopete/kopete/kconf_update/kopete-jabberproxytype-kconf_update.sh b/kopete/kopete/kconf_update/kopete-jabberproxytype-kconf_update.sh deleted file mode 100644 index 3cbf8a55..00000000 --- a/kopete/kopete/kconf_update/kopete-jabberproxytype-kconf_update.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -sed "s/PluginData_JabberProtocol_ProxyType=SOCKS4/PluginData_JabberProtocol_ProxyType=SOCKS/" | sed "s/PluginData_JabberProtocol_ProxyType=SOCKS5/PluginData_JabberProtocol_ProxyType=SOCKS/" diff --git a/kopete/kopete/kconf_update/kopete-jabberproxytype-kconf_update.upd b/kopete/kopete/kconf_update/kopete-jabberproxytype-kconf_update.upd deleted file mode 100644 index c39ce69b..00000000 --- a/kopete/kopete/kconf_update/kopete-jabberproxytype-kconf_update.upd +++ /dev/null @@ -1,4 +0,0 @@ -Id=kopete0.9/r1 -File=kopeterc -Script=kopete-jabberproxytype-kconf_update.sh,sh - diff --git a/kopete/kopete/kconf_update/kopete-nameTracking.cpp b/kopete/kopete/kconf_update/kopete-nameTracking.cpp deleted file mode 100644 index d56dfc76..00000000 --- a/kopete/kopete/kconf_update/kopete-nameTracking.cpp +++ /dev/null @@ -1,135 +0,0 @@ -/* - kconf_update app for updating the contactlist format ( <= 0.9.0) for MetaContacts to - track the name of a subcontact. - - Kopete (c) 2002-2004 by the Kopete developers - - ************************************************************************* - * * - * This library is free software; you can redistribute it and/or * - * modify it under the terms of the GNU Lesser General Public * - * License as published by the Free Software Foundation; either * - * version 2 of the License, or (at your option) any later version. * - * * - ************************************************************************* -*/ - -#include -#include -#include - -#include - -static TQTextStream qcerr( stderr, IO_WriteOnly ); - -int main() -{ - TDEInstance* inst = new TDEInstance( "Update script" ); - TQString filename = locateLocal( "data", TQString::fromLatin1( "kopete/contactlist.xml" ) ); - - // Load contact list & save backup. - TQFile contactListFile( filename ); - contactListFile.open( IO_ReadOnly ); - TQDomDocument contactList; - contactList.setContent( &contactListFile ); - contactListFile.close(); - TQDir().rename( filename, filename + TQString::fromLatin1( ".bak" ) ); - - // parse the XML file - TQDomElement list = contactList.documentElement(); - TQDomElement mcElement = list.firstChild().toElement(); - - while( !mcElement.isNull() ) - { - - // update all the MetaContacts - if( mcElement.tagName() == TQString::fromLatin1("meta-contact") ) - { - TQDomElement displayName; - TQDomElement subcontact; - - TQDomElement elem = mcElement.firstChild().toElement(); - while( !elem.isNull() ) - { - if( elem.tagName() == TQString::fromLatin1( "display-name" ) ) - displayName = elem; - if( elem.tagName() == TQString::fromLatin1( "plugin-data" ) ) - { - // check if it's a contact by checking for "protocol" substring in the tag, - // and the presence of a contactId child element. - TQString pluginId = elem.attribute( TQString::fromLatin1( "plugin-id" ) ); - bool isProtocol = ( pluginId.contains( "protocol", false ) > 0 ); // case-insensitive search - bool hasContactId = false; - TQDomNode field = elem.firstChild(); - while( !field.isNull() ) - { - TQDomElement fieldElem = field.toElement(); - - if( !fieldElem.isNull() && - fieldElem.tagName() == TQString::fromLatin1( "plugin-data-field" ) && - fieldElem.attribute( TQString::fromLatin1( "key" ) ) == TQString::fromLatin1( "contactId" ) ) - { - hasContactId = true; - break; - } - field = field.nextSibling(); - } - - if( isProtocol && hasContactId ) - subcontact = elem; - } - - elem = elem.nextSibling().toElement(); - } // end while - - // check if we're even tracking the subcontact's name - // if displayName.isNull(), it simply won't find the attribute; no harm done - bool tracking = - ( displayName.attribute( TQString::fromLatin1( "trackChildNameChanges" ), - TQString::fromLatin1( "0" ) ) == TQString::fromLatin1( "1" ) ); - if( !displayName.isNull() && !subcontact.isNull() && tracking ) - { - // collect info - TQString nsCID; - TQString nsPID; - TQString nsAID; - - nsPID = subcontact.attribute( TQString::fromLatin1( "plugin-id" ) ); - TQDomNode field = subcontact.firstChild(); - while( !field.isNull() ) - { - TQDomElement fieldElem = field.toElement(); - - if( !fieldElem.isNull() && fieldElem.tagName() == TQString::fromLatin1( "plugin-data-field" ) ) - { - if( fieldElem.attribute( TQString::fromLatin1( "key" ) ) == TQString::fromLatin1( "contactId" ) ) - nsCID = fieldElem.text(); - if( fieldElem.attribute( TQString::fromLatin1( "key" ) ) == TQString::fromLatin1( "accountId" ) ) - nsAID = fieldElem.text(); - } - field = field.nextSibling(); - } - - // create the tracking info - displayName.setAttribute( TQString::fromLatin1( "nameSourceContactId" ), nsCID ); - displayName.setAttribute( TQString::fromLatin1( "nameSourcePluginId" ), nsPID ); - displayName.setAttribute( TQString::fromLatin1( "nameSourceAccountId" ), nsAID ); - } - } - - mcElement = mcElement.nextSibling().toElement(); - } - - // Save converted contactlist - contactListFile.open( IO_WriteOnly ); - TQTextStream stream( &contactListFile ); - stream.setEncoding( TQTextStream::UnicodeUTF8 ); - stream << contactList.toString( 4 ); - contactListFile.flush(); - contactListFile.close(); - - return 0; -} - -// vim: set noet ts=4 sts=4 sw=4: - diff --git a/kopete/kopete/kconf_update/kopete-nameTracking.upd b/kopete/kopete/kconf_update/kopete-nameTracking.upd deleted file mode 100644 index da0a0e2d..00000000 --- a/kopete/kopete/kconf_update/kopete-nameTracking.upd +++ /dev/null @@ -1,3 +0,0 @@ -Id=kopete0.9/r1 -File=kopeterc -Script=kopete-nameTracking-kconf_update diff --git a/kopete/kopete/kconf_update/kopete-pluginloader.pl b/kopete/kopete/kconf_update/kopete-pluginloader.pl deleted file mode 100755 index 19709d3a..00000000 --- a/kopete/kopete/kconf_update/kopete-pluginloader.pl +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/perl -my $logging = "false"; -my $moduleLine; - -while( my $line = <> ) -{ - if( $line =~ /LogAll/ ) - { - $logging = "true"; - } - if( $line =~ /^Modules=/ ) - { - $moduleLine = $line; - } -} - -$moduleLine =~ s/^Modules/Plugins/; -$moduleLine =~ s/\.plugin/\.desktop/g; -$moduleLine =~ s/oscar/aim/; -if ( $logging == "true" ) -{ - chomp $moduleLine; - $moduleLine = $moduleLine . ",history.desktop\n"; -} -print $moduleLine; - -print "# DELETE Modules\n"; - diff --git a/kopete/kopete/kconf_update/kopete-pluginloader.upd b/kopete/kopete/kconf_update/kopete-pluginloader.upd deleted file mode 100644 index cc739414..00000000 --- a/kopete/kopete/kconf_update/kopete-pluginloader.upd +++ /dev/null @@ -1,4 +0,0 @@ -Id=kopete0.7/r1 -File=kopeterc -Script=kopete-pluginloader.pl,perl - diff --git a/kopete/kopete/kconf_update/kopete-pluginloader2.cpp b/kopete/kopete/kconf_update/kopete-pluginloader2.cpp deleted file mode 100644 index d9b0fb39..00000000 --- a/kopete/kopete/kconf_update/kopete-pluginloader2.cpp +++ /dev/null @@ -1,89 +0,0 @@ -/* - kconf_update app for migrating the list of loaded plugins in - kopete 0.7.x to the new KPluginSelector format. - - Copyright (c) 2003 by Martijn Klingens - - Kopete (c) 2002-2003 by the Kopete developers - - ************************************************************************* - * * - * This library is free software; you can redistribute it and/or * - * modify it under the terms of the GNU Lesser General Public * - * License as published by the Free Software Foundation; either * - * version 2 of the License, or (at your option) any later version. * - * * - ************************************************************************* -*/ - -#include -#include - -static TQTextStream qcin ( stdin, IO_ReadOnly ); -static TQTextStream qcout( stdout, IO_WriteOnly ); -static TQTextStream qcerr( stderr, IO_WriteOnly ); - -void parseKey( const TQString &group, const TQString &key, const TQString &value, const TQString &rawLine ) -{ - //qcerr << "*** group='" << group << "'" << endl; - if ( group.isEmpty() && key == "Plugins" ) - { - TQStringList plugins = TQStringList::split( ',', value ); - if ( !plugins.isEmpty() ) - { - qcout << "[Plugins]" << endl; - for ( TQStringList::Iterator it = plugins.begin(); it != plugins.end(); ++it ) - qcout << "kopete_" << ( *it ).remove( ".desktop" ) << "Enabled=true" << endl; - } - qcout << "# DELETE []Plugins" << endl; - } - else - { - // groups we don't convert. output the raw line instead. - qcout << rawLine << endl; - } -} - -int main() -{ - qcin.setEncoding( TQTextStream::UnicodeUTF8 ); - qcout.setEncoding( TQTextStream::UnicodeUTF8 ); - - TQString curGroup; - - TQRegExp groupRegExp( "^\\[(.*)\\]" ); - TQRegExp keyRegExp( "^([a-zA-Z0-9:, _-]*)\\s*=\\s*(.*)\\s*" ); - TQRegExp commentRegExp( "^(#.*)?$" ); - - while ( !qcin.atEnd() ) - { - TQString line = qcin.readLine(); - - if ( commentRegExp.exactMatch( line ) ) - { - // We found a comment, leave unchanged - qcout << line << endl; - } - else if ( groupRegExp.exactMatch( line ) ) - { - // We found the start of a group, leave unchanged - qcout << line << endl; - - curGroup = groupRegExp.capturedTexts()[ 1 ]; - } - else if ( keyRegExp.exactMatch( line ) ) - { - // We found the a key line - parseKey( curGroup, keyRegExp.capturedTexts()[ 1 ], keyRegExp.capturedTexts()[ 2 ], line ); - } - else - { - qcerr << "** Unknown input line: " << line << endl; - } - } - - return 0; -} - -// vim: set noet ts=4 sts=4 sw=4: - diff --git a/kopete/kopete/kconf_update/kopete-pluginloader2.sh b/kopete/kopete/kconf_update/kopete-pluginloader2.sh deleted file mode 100644 index a6144152..00000000 --- a/kopete/kopete/kconf_update/kopete-pluginloader2.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -IFS=: -SUFF=kconf_update_bin/kopete-pluginloader2-kconf_update -for path in `tde-config --path lib`; do - if test -x "$path/$SUFF"; then - exec "$path/$SUFF" - fi -done - diff --git a/kopete/kopete/kconf_update/kopete-pluginloader2.upd b/kopete/kopete/kconf_update/kopete-pluginloader2.upd deleted file mode 100644 index 3461c7a7..00000000 --- a/kopete/kopete/kconf_update/kopete-pluginloader2.upd +++ /dev/null @@ -1,4 +0,0 @@ -Id=kopete0.8/r1 -File=kopeterc -Script=kopete-pluginloader2.sh,sh - diff --git a/kopete/kopete/kopeteapplication.cpp b/kopete/kopete/kopeteapplication.cpp index 8a41bc49..2e469bf5 100644 --- a/kopete/kopete/kopeteapplication.cpp +++ b/kopete/kopete/kopeteapplication.cpp @@ -23,7 +23,7 @@ #include #include -#include +#include #include #include #include diff --git a/kopete/kopete/kopeteeditglobalidentitywidget.cpp b/kopete/kopete/kopeteeditglobalidentitywidget.cpp index 4e752fa8..c1f181be 100644 --- a/kopete/kopete/kopeteeditglobalidentitywidget.cpp +++ b/kopete/kopete/kopeteeditglobalidentitywidget.cpp @@ -31,9 +31,9 @@ #include #include #include -#include +#include #include -#include +#include #include // Kopete include diff --git a/kopete/kopete/kopeteiface.cpp b/kopete/kopete/kopeteiface.cpp index d532dacd..7995c64e 100644 --- a/kopete/kopete/kopeteiface.cpp +++ b/kopete/kopete/kopeteiface.cpp @@ -17,7 +17,7 @@ #include #include -#include +#include #include #include "kopeteiface.h" diff --git a/kopete/kopete/kopetewindow.cpp b/kopete/kopete/kopetewindow.cpp index 5215d588..5e4c7bd0 100644 --- a/kopete/kopete/kopetewindow.cpp +++ b/kopete/kopete/kopetewindow.cpp @@ -32,7 +32,7 @@ #include #include -#include +#include #include #include #include diff --git a/kopete/kopete/tdeconf_update/CMakeLists.txt b/kopete/kopete/tdeconf_update/CMakeLists.txt new file mode 100644 index 00000000..342178f1 --- /dev/null +++ b/kopete/kopete/tdeconf_update/CMakeLists.txt @@ -0,0 +1,64 @@ +################################################# +# +# (C) 2010-2011 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +add_definitions( -DKDE_NO_COMPAT ) + +include_directories( + ${TDE_INCLUDE_DIR} + ${TQT_INCLUDE_DIRS} +) + +link_directories( + ${TQT_LIBRARY_DIRS} +) + + +##### other data ################################ + +install( FILES + kopete-pluginloader.upd kopete-account-tdeconf_update.upd + kopete-pluginloader2.upd kopete-jabberproxytype-tdeconf_update.upd + kopete-jabberpriorityaddition-tdeconf_update.upd + kopete-nameTracking.upd + DESTINATION ${KCONF_UPDATE_INSTALL_DIR} ) + +install( PROGRAMS + kopete-pluginloader.pl kopete-jabberpriorityaddition-tdeconf_update.sh + kopete-pluginloader2.sh kopete-jabberproxytype-tdeconf_update.sh + kopete-account-0.10.pl kopete-account-tdeconf_update.sh + DESTINATION ${KCONF_UPDATE_INSTALL_DIR} ) + + +##### kopete_account_tdeconf_update (executable) ## + +tde_add_executable( "kopete-account-tdeconf_update" + SOURCES kopete-account-tdeconf_update.cpp + LINK ${TQT_LIBRARIES} + DESTINATION ${LIB_INSTALL_DIR}/tdeconf_update_bin +) + + +##### kopete_pluginloader2_tdeconf_update (executable) + +tde_add_executable( "kopete-pluginloader2-tdeconf_update" + SOURCES kopete-pluginloader2.cpp + LINK ${TQT_LIBRARIES} + DESTINATION ${LIB_INSTALL_DIR}/tdeconf_update_bin +) + + +##### kopete_nameTracking_tdeconf_update (executable) + +tde_add_executable( "kopete-nameTracking-tdeconf_update" + SOURCES kopete-nameTracking.cpp + LINK tdecore-shared + DESTINATION ${LIB_INSTALL_DIR}/tdeconf_update_bin +) diff --git a/kopete/kopete/tdeconf_update/Makefile.am b/kopete/kopete/tdeconf_update/Makefile.am new file mode 100644 index 00000000..8c4b949e --- /dev/null +++ b/kopete/kopete/tdeconf_update/Makefile.am @@ -0,0 +1,32 @@ +AM_CPPFLAGS = -DKDE_NO_COMPAT -DQT_NO_COMPAT $(all_includes) + +update_DATA = kopete-pluginloader.upd kopete-account-tdeconf_update.upd \ + kopete-pluginloader2.upd kopete-jabberproxytype-tdeconf_update.upd \ + kopete-jabberpriorityaddition-tdeconf_update.upd kopete-nameTracking.upd +update_SCRIPTS = kopete-pluginloader.pl kopete-account-tdeconf_update.sh \ + kopete-pluginloader2.sh kopete-jabberproxytype-tdeconf_update.sh \ + kopete-jabberpriorityaddition-tdeconf_update.sh kopete-account-0.10.pl +updatedir = $(kde_datadir)/tdeconf_update + +# The Qt app cannot go into kde_datadir, that is not portable. +# install to kde_bindir/tdeconf_update_bin instead. +# KDE 3.2 will allow tdeconf_update scripts to run directly from there, +# but for us that's too late. Use the .sh script as a workaround. +tdeconf_PROGRAMS = kopete-account-tdeconf_update kopete-pluginloader2-tdeconf_update \ + kopete-nameTracking-tdeconf_update +tdeconfdir = $(libdir)/tdeconf_update_bin + +kopete_account_tdeconf_update_SOURCES = kopete-account-tdeconf_update.cpp +kopete_account_tdeconf_update_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor +kopete_account_tdeconf_update_LDADD = $(LIB_QT) + +kopete_pluginloader2_tdeconf_update_SOURCES = kopete-pluginloader2.cpp +kopete_pluginloader2_tdeconf_update_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor +kopete_pluginloader2_tdeconf_update_LDADD = $(LIB_QT) + +kopete_nameTracking_tdeconf_update_SOURCES = kopete-nameTracking.cpp +kopete_nameTracking_tdeconf_update_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor +kopete_nameTracking_tdeconf_update_LDADD = $(LIB_QT) $(LIB_TDECORE) + +# vim: set noet: + diff --git a/kopete/kopete/tdeconf_update/kopete-account-0.10.pl b/kopete/kopete/tdeconf_update/kopete-account-0.10.pl new file mode 100755 index 00000000..3925a52f --- /dev/null +++ b/kopete/kopete/tdeconf_update/kopete-account-0.10.pl @@ -0,0 +1,26 @@ +#!/usr/bin/perl -w +# Olivier Goffart +# License: GPL + +use strict; + +# This script rename old plugin datas key. +# It remove the PlguinData_PLUGINID_ prefix from keys. + +# read the whole config file +my $currentGroup = ""; +my %configFile; +while ( <> ) { + chomp; # eat the trailing '\n' + next if ( /^$/ ); # skip empty lines + next if ( /^\#/ ); # skip comments + if ( /^\[/ ) { # group begin + $currentGroup = $_; + next; + } elsif ( $currentGroup =~ /^\[Account_/ and /^PluginData\_.+_(.+)=(.+)$/ ) + { + print "$currentGroup\n$1=$2\n"; + my ($key,$value) = split /=/; + print "# DELETE $currentGroup$key\n"; + } +} diff --git a/kopete/kopete/tdeconf_update/kopete-account-tdeconf_update.cpp b/kopete/kopete/tdeconf_update/kopete-account-tdeconf_update.cpp new file mode 100644 index 00000000..42ba47f1 --- /dev/null +++ b/kopete/kopete/tdeconf_update/kopete-account-tdeconf_update.cpp @@ -0,0 +1,247 @@ +/* + tdeconf_update app for migrating kopete 0.6.x accounts to 0.7. Code is + not up to my normal standards, but it does the job, and since it's + supposed to run exactly once on each system that's good enough for me :) + + Copyright (c) 2003 by Martijn Klingens + + Kopete (c) 2002-2003 by the Kopete developers + + ************************************************************************* + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Lesser General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + ************************************************************************* +*/ + +#include +#include +#include + +static TQTextStream qcin ( stdin, IO_ReadOnly ); +static TQTextStream qcout( stdout, IO_WriteOnly ); +static TQTextStream qcerr( stderr, IO_WriteOnly ); + +// Group cache. Yes, I know global vars are ugly :) +bool needFlush = false; +TQString accountId; +TQString password; +TQString autoConnect; +TQString protocol; +TQMap pluginData; + +// Global vars to hold separate IRC vars until we have read all of them +TQString ircNick; +TQString ircServer; +TQString ircPort; + +/* + * Function for (en/de)crypting strings for config file, taken from KMail + * Author: Stefan Taferner + */ +TQString cryptStr(const TQString &aStr) +{ + TQString result; + for (unsigned int i = 0; i < aStr.length(); i++) + result += (aStr[i].unicode() < 0x20) ? aStr[i] : + TQChar(0x1001F - aStr[i].unicode()); + return result; +} + +void parseGroup( const TQString &group, const TQString &rawLine ) +{ + // Groups that are converted can almost certainly be removed entirely + + if ( group == "MSN" || group == "ICQ" || group == "Oscar" || group == "Gadu" || group == "Jabber" || group == "IRC" ) + { + accountId = "EMPTY"; + autoConnect = "true"; + + if ( group == "Oscar" ) + protocol = "AIMProtocol"; + else + protocol = group + "Protocol"; + + password = TQString(); + pluginData.clear(); + + needFlush = true; + + qcout << "# DELETEGROUP [" << group << "]" << endl; + } + else + { + // Groups we don't convert. Output the raw line instead. + qcout << rawLine << endl; + } +} + +void parseKey( const TQString &group, const TQString &key, const TQString &value, const TQString &rawLine ) +{ + //qcerr << "*** group='" << group << "'" << endl; + if ( group == "MSN" ) + { + if ( key == "UserID" ) + accountId = value; + else if ( key == "Password" ) + password = value; + else if ( key == "AutoConnect" ) + autoConnect = value; + else if ( key == "Nick" ) + pluginData[ "displayName" ] = value; + + // All other keys are ignored for MSN, as these apply to stuff that's + // now in libkopete (and the main app) instead. + } + else if ( group == "ICQ" ) + { + if ( key == "UIN" ) + accountId = value; + else if ( key == "Password" ) + password = value; + else if ( key == "AutoConnect" ) + autoConnect = value; + else if ( key == "Nick" ) + pluginData[ "NickName" ] = value; + else if ( key == "Server" ) + pluginData[ key ] = value; + else if ( key == "Port" ) + pluginData[ key ] = value; + } + else if ( group == "Oscar" ) + { + if ( key == "ScreenName" ) + accountId = value; + else if ( key == "Password" ) + password = value; + else if ( key == "Server" ) + pluginData[ key ] = value; + else if ( key == "Port" ) + pluginData[ key ] = value; + } + else if ( group == "Jabber" ) + { + if ( key == "UserID" ) + accountId = value; + else if ( key == "Password" ) + password = value; + if ( key == "Server" || + key == "Port" || key == "UseSSL" || key == "Resource" ) + pluginData[ key ] = value; + } + else if ( group == "Gadu" ) + { + if ( key == "UIN" ) + accountId = value; + else if ( key == "Password" ) + password = value; + else if ( key == "Nick" ) + pluginData[ "displayName" ] = value; + } + else if ( group == "IRC" ) + { + if ( key == "Nickname" ) + ircNick = value; + if ( key == "Server" ) + ircServer = value; + if ( key == "Port" ) + ircPort = value; + if ( accountId == "EMPTY" && + !ircNick.isEmpty( ) && !ircServer.isEmpty() && + !ircPort.isEmpty() ) + { + accountId = TQString::fromLatin1( "%1@%2:%3" ).arg( ircNick, ircServer, ircPort ); + } + } + /* + fixme: insert all other plugins here - martijn + */ + else if ( key == "Modules" ) + { + TQString newValue = value; + newValue.replace ( ".plugin", ".desktop" ); + qcout << "Plugins=" << newValue; + } + else + { + // groups we don't convert. output the raw line instead. + qcout << rawLine << endl; + } +} + +void flushData( const TQString &group ) +{ + + qcout << "[Account_" << protocol << "_" << accountId << "]" << endl; + qcout << "Protocol=" << protocol << endl; + + if( group == "Jabber" ) + qcout << "AccountId=" << accountId << "@" << pluginData["Server"] << endl; + else + qcout << "AccountId=" << accountId << endl; + + qcout << "Password=" << cryptStr( password ) << endl; + qcout << "AutoConnect=" << autoConnect << endl; + + TQMap::ConstIterator it; + for ( it = pluginData.begin(); it != pluginData.end(); ++it ) + qcout << "PluginData_" << protocol << "_" << it.key() << "=" << it.data() << endl; + +} + +int main() +{ + qcin.setEncoding( TQTextStream::UnicodeUTF8 ); + qcout.setEncoding( TQTextStream::UnicodeUTF8 ); + + TQString curGroup; + + TQRegExp groupRegExp( "^\\[(.*)\\]" ); + TQRegExp keyRegExp( "^([a-zA-Z0-9:, _-]*)\\s*=\\s*(.*)\\s*" ); + TQRegExp commentRegExp( "^(#.*)?$" ); + + while ( !qcin.atEnd() ) + { + TQString line = qcin.readLine(); + + if ( commentRegExp.exactMatch( line ) ) + { + // We found a comment, leave unchanged + qcout << line << endl; + } + else if ( groupRegExp.exactMatch( line ) ) + { + // We found the start of a group, parse it + if ( needFlush ) + { + // ... but we were already working on a group, so finish what + // we were doing - flush existing group first + flushData ( curGroup ); + needFlush = false; + } + + curGroup = groupRegExp.capturedTexts()[ 1 ]; + parseGroup( curGroup, line ); + } + else if ( keyRegExp.exactMatch( line ) ) + { + // We found the a key line + parseKey( curGroup, keyRegExp.capturedTexts()[ 1 ], keyRegExp.capturedTexts()[ 2 ], line ); + } + else + { + qcerr << "** Unknown input line: " << line << endl; + } + } + + if ( needFlush ) + flushData ( curGroup ); + + return 0; +} + +// vim: set noet ts=4 sts=4 sw=4: + diff --git a/kopete/kopete/tdeconf_update/kopete-account-tdeconf_update.sh b/kopete/kopete/tdeconf_update/kopete-account-tdeconf_update.sh new file mode 100644 index 00000000..c9a1bcfc --- /dev/null +++ b/kopete/kopete/tdeconf_update/kopete-account-tdeconf_update.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +IFS=: +SUFF=tdeconf_update_bin/kopete-account-tdeconf_update +for path in `tde-config --path lib`; do + if test -x "$path/$SUFF"; then + exec "$path/$SUFF" + fi +done + diff --git a/kopete/kopete/tdeconf_update/kopete-account-tdeconf_update.upd b/kopete/kopete/tdeconf_update/kopete-account-tdeconf_update.upd new file mode 100644 index 00000000..d48aeed1 --- /dev/null +++ b/kopete/kopete/tdeconf_update/kopete-account-tdeconf_update.upd @@ -0,0 +1,9 @@ +Id=kopete0.7/r1 +File=kopeterc +Script=kopete-account-tdeconf_update.sh,sh + +#remove the PluginData_ProtocolID_ prefix from config keys +Id=kopete0.10/r1 +File=kopeterc +Script=kopete-account-0.10.pl,perl + diff --git a/kopete/kopete/tdeconf_update/kopete-jabberpriorityaddition-tdeconf_update.sh b/kopete/kopete/tdeconf_update/kopete-jabberpriorityaddition-tdeconf_update.sh new file mode 100644 index 00000000..2ba47416 --- /dev/null +++ b/kopete/kopete/tdeconf_update/kopete-jabberpriorityaddition-tdeconf_update.sh @@ -0,0 +1,2 @@ +#!/bin/sh +sed -e 's/^\(PluginData_JabberProtocol_Resource=.*\)$/\1\nPluginData_JabberProtocol_Priority=5/' diff --git a/kopete/kopete/tdeconf_update/kopete-jabberpriorityaddition-tdeconf_update.upd b/kopete/kopete/tdeconf_update/kopete-jabberpriorityaddition-tdeconf_update.upd new file mode 100644 index 00000000..7fd7d586 --- /dev/null +++ b/kopete/kopete/tdeconf_update/kopete-jabberpriorityaddition-tdeconf_update.upd @@ -0,0 +1,4 @@ +Id=kopete0.9/r1 +File=kopeterc +Script=kopete-jabberpriorityaddition-tdeconf_update.sh,sh + diff --git a/kopete/kopete/tdeconf_update/kopete-jabberproxytype-tdeconf_update.sh b/kopete/kopete/tdeconf_update/kopete-jabberproxytype-tdeconf_update.sh new file mode 100644 index 00000000..3cbf8a55 --- /dev/null +++ b/kopete/kopete/tdeconf_update/kopete-jabberproxytype-tdeconf_update.sh @@ -0,0 +1,2 @@ +#!/bin/sh +sed "s/PluginData_JabberProtocol_ProxyType=SOCKS4/PluginData_JabberProtocol_ProxyType=SOCKS/" | sed "s/PluginData_JabberProtocol_ProxyType=SOCKS5/PluginData_JabberProtocol_ProxyType=SOCKS/" diff --git a/kopete/kopete/tdeconf_update/kopete-jabberproxytype-tdeconf_update.upd b/kopete/kopete/tdeconf_update/kopete-jabberproxytype-tdeconf_update.upd new file mode 100644 index 00000000..efc15155 --- /dev/null +++ b/kopete/kopete/tdeconf_update/kopete-jabberproxytype-tdeconf_update.upd @@ -0,0 +1,4 @@ +Id=kopete0.9/r1 +File=kopeterc +Script=kopete-jabberproxytype-tdeconf_update.sh,sh + diff --git a/kopete/kopete/tdeconf_update/kopete-nameTracking.cpp b/kopete/kopete/tdeconf_update/kopete-nameTracking.cpp new file mode 100644 index 00000000..ee1f3f93 --- /dev/null +++ b/kopete/kopete/tdeconf_update/kopete-nameTracking.cpp @@ -0,0 +1,135 @@ +/* + tdeconf_update app for updating the contactlist format ( <= 0.9.0) for MetaContacts to + track the name of a subcontact. + + Kopete (c) 2002-2004 by the Kopete developers + + ************************************************************************* + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Lesser General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + ************************************************************************* +*/ + +#include +#include +#include + +#include + +static TQTextStream qcerr( stderr, IO_WriteOnly ); + +int main() +{ + TDEInstance* inst = new TDEInstance( "Update script" ); + TQString filename = locateLocal( "data", TQString::fromLatin1( "kopete/contactlist.xml" ) ); + + // Load contact list & save backup. + TQFile contactListFile( filename ); + contactListFile.open( IO_ReadOnly ); + TQDomDocument contactList; + contactList.setContent( &contactListFile ); + contactListFile.close(); + TQDir().rename( filename, filename + TQString::fromLatin1( ".bak" ) ); + + // parse the XML file + TQDomElement list = contactList.documentElement(); + TQDomElement mcElement = list.firstChild().toElement(); + + while( !mcElement.isNull() ) + { + + // update all the MetaContacts + if( mcElement.tagName() == TQString::fromLatin1("meta-contact") ) + { + TQDomElement displayName; + TQDomElement subcontact; + + TQDomElement elem = mcElement.firstChild().toElement(); + while( !elem.isNull() ) + { + if( elem.tagName() == TQString::fromLatin1( "display-name" ) ) + displayName = elem; + if( elem.tagName() == TQString::fromLatin1( "plugin-data" ) ) + { + // check if it's a contact by checking for "protocol" substring in the tag, + // and the presence of a contactId child element. + TQString pluginId = elem.attribute( TQString::fromLatin1( "plugin-id" ) ); + bool isProtocol = ( pluginId.contains( "protocol", false ) > 0 ); // case-insensitive search + bool hasContactId = false; + TQDomNode field = elem.firstChild(); + while( !field.isNull() ) + { + TQDomElement fieldElem = field.toElement(); + + if( !fieldElem.isNull() && + fieldElem.tagName() == TQString::fromLatin1( "plugin-data-field" ) && + fieldElem.attribute( TQString::fromLatin1( "key" ) ) == TQString::fromLatin1( "contactId" ) ) + { + hasContactId = true; + break; + } + field = field.nextSibling(); + } + + if( isProtocol && hasContactId ) + subcontact = elem; + } + + elem = elem.nextSibling().toElement(); + } // end while + + // check if we're even tracking the subcontact's name + // if displayName.isNull(), it simply won't find the attribute; no harm done + bool tracking = + ( displayName.attribute( TQString::fromLatin1( "trackChildNameChanges" ), + TQString::fromLatin1( "0" ) ) == TQString::fromLatin1( "1" ) ); + if( !displayName.isNull() && !subcontact.isNull() && tracking ) + { + // collect info + TQString nsCID; + TQString nsPID; + TQString nsAID; + + nsPID = subcontact.attribute( TQString::fromLatin1( "plugin-id" ) ); + TQDomNode field = subcontact.firstChild(); + while( !field.isNull() ) + { + TQDomElement fieldElem = field.toElement(); + + if( !fieldElem.isNull() && fieldElem.tagName() == TQString::fromLatin1( "plugin-data-field" ) ) + { + if( fieldElem.attribute( TQString::fromLatin1( "key" ) ) == TQString::fromLatin1( "contactId" ) ) + nsCID = fieldElem.text(); + if( fieldElem.attribute( TQString::fromLatin1( "key" ) ) == TQString::fromLatin1( "accountId" ) ) + nsAID = fieldElem.text(); + } + field = field.nextSibling(); + } + + // create the tracking info + displayName.setAttribute( TQString::fromLatin1( "nameSourceContactId" ), nsCID ); + displayName.setAttribute( TQString::fromLatin1( "nameSourcePluginId" ), nsPID ); + displayName.setAttribute( TQString::fromLatin1( "nameSourceAccountId" ), nsAID ); + } + } + + mcElement = mcElement.nextSibling().toElement(); + } + + // Save converted contactlist + contactListFile.open( IO_WriteOnly ); + TQTextStream stream( &contactListFile ); + stream.setEncoding( TQTextStream::UnicodeUTF8 ); + stream << contactList.toString( 4 ); + contactListFile.flush(); + contactListFile.close(); + + return 0; +} + +// vim: set noet ts=4 sts=4 sw=4: + diff --git a/kopete/kopete/tdeconf_update/kopete-nameTracking.upd b/kopete/kopete/tdeconf_update/kopete-nameTracking.upd new file mode 100644 index 00000000..62dd9538 --- /dev/null +++ b/kopete/kopete/tdeconf_update/kopete-nameTracking.upd @@ -0,0 +1,3 @@ +Id=kopete0.9/r1 +File=kopeterc +Script=kopete-nameTracking-tdeconf_update diff --git a/kopete/kopete/tdeconf_update/kopete-pluginloader.pl b/kopete/kopete/tdeconf_update/kopete-pluginloader.pl new file mode 100755 index 00000000..19709d3a --- /dev/null +++ b/kopete/kopete/tdeconf_update/kopete-pluginloader.pl @@ -0,0 +1,28 @@ +#!/usr/bin/perl +my $logging = "false"; +my $moduleLine; + +while( my $line = <> ) +{ + if( $line =~ /LogAll/ ) + { + $logging = "true"; + } + if( $line =~ /^Modules=/ ) + { + $moduleLine = $line; + } +} + +$moduleLine =~ s/^Modules/Plugins/; +$moduleLine =~ s/\.plugin/\.desktop/g; +$moduleLine =~ s/oscar/aim/; +if ( $logging == "true" ) +{ + chomp $moduleLine; + $moduleLine = $moduleLine . ",history.desktop\n"; +} +print $moduleLine; + +print "# DELETE Modules\n"; + diff --git a/kopete/kopete/tdeconf_update/kopete-pluginloader.upd b/kopete/kopete/tdeconf_update/kopete-pluginloader.upd new file mode 100644 index 00000000..cc739414 --- /dev/null +++ b/kopete/kopete/tdeconf_update/kopete-pluginloader.upd @@ -0,0 +1,4 @@ +Id=kopete0.7/r1 +File=kopeterc +Script=kopete-pluginloader.pl,perl + diff --git a/kopete/kopete/tdeconf_update/kopete-pluginloader2.cpp b/kopete/kopete/tdeconf_update/kopete-pluginloader2.cpp new file mode 100644 index 00000000..cf96144b --- /dev/null +++ b/kopete/kopete/tdeconf_update/kopete-pluginloader2.cpp @@ -0,0 +1,89 @@ +/* + tdeconf_update app for migrating the list of loaded plugins in + kopete 0.7.x to the new KPluginSelector format. + + Copyright (c) 2003 by Martijn Klingens + + Kopete (c) 2002-2003 by the Kopete developers + + ************************************************************************* + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Lesser General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + ************************************************************************* +*/ + +#include +#include + +static TQTextStream qcin ( stdin, IO_ReadOnly ); +static TQTextStream qcout( stdout, IO_WriteOnly ); +static TQTextStream qcerr( stderr, IO_WriteOnly ); + +void parseKey( const TQString &group, const TQString &key, const TQString &value, const TQString &rawLine ) +{ + //qcerr << "*** group='" << group << "'" << endl; + if ( group.isEmpty() && key == "Plugins" ) + { + TQStringList plugins = TQStringList::split( ',', value ); + if ( !plugins.isEmpty() ) + { + qcout << "[Plugins]" << endl; + for ( TQStringList::Iterator it = plugins.begin(); it != plugins.end(); ++it ) + qcout << "kopete_" << ( *it ).remove( ".desktop" ) << "Enabled=true" << endl; + } + qcout << "# DELETE []Plugins" << endl; + } + else + { + // groups we don't convert. output the raw line instead. + qcout << rawLine << endl; + } +} + +int main() +{ + qcin.setEncoding( TQTextStream::UnicodeUTF8 ); + qcout.setEncoding( TQTextStream::UnicodeUTF8 ); + + TQString curGroup; + + TQRegExp groupRegExp( "^\\[(.*)\\]" ); + TQRegExp keyRegExp( "^([a-zA-Z0-9:, _-]*)\\s*=\\s*(.*)\\s*" ); + TQRegExp commentRegExp( "^(#.*)?$" ); + + while ( !qcin.atEnd() ) + { + TQString line = qcin.readLine(); + + if ( commentRegExp.exactMatch( line ) ) + { + // We found a comment, leave unchanged + qcout << line << endl; + } + else if ( groupRegExp.exactMatch( line ) ) + { + // We found the start of a group, leave unchanged + qcout << line << endl; + + curGroup = groupRegExp.capturedTexts()[ 1 ]; + } + else if ( keyRegExp.exactMatch( line ) ) + { + // We found the a key line + parseKey( curGroup, keyRegExp.capturedTexts()[ 1 ], keyRegExp.capturedTexts()[ 2 ], line ); + } + else + { + qcerr << "** Unknown input line: " << line << endl; + } + } + + return 0; +} + +// vim: set noet ts=4 sts=4 sw=4: + diff --git a/kopete/kopete/tdeconf_update/kopete-pluginloader2.sh b/kopete/kopete/tdeconf_update/kopete-pluginloader2.sh new file mode 100644 index 00000000..f858a72e --- /dev/null +++ b/kopete/kopete/tdeconf_update/kopete-pluginloader2.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +IFS=: +SUFF=tdeconf_update_bin/kopete-pluginloader2-tdeconf_update +for path in `tde-config --path lib`; do + if test -x "$path/$SUFF"; then + exec "$path/$SUFF" + fi +done + diff --git a/kopete/kopete/tdeconf_update/kopete-pluginloader2.upd b/kopete/kopete/tdeconf_update/kopete-pluginloader2.upd new file mode 100644 index 00000000..3461c7a7 --- /dev/null +++ b/kopete/kopete/tdeconf_update/kopete-pluginloader2.upd @@ -0,0 +1,4 @@ +Id=kopete0.8/r1 +File=kopeterc +Script=kopete-pluginloader2.sh,sh + diff --git a/kopete/libkopete/avdevice/videodevicepool.h b/kopete/libkopete/avdevice/videodevicepool.h index 75ed9ed4..2a42f97f 100644 --- a/kopete/libkopete/avdevice/videodevicepool.h +++ b/kopete/libkopete/avdevice/videodevicepool.h @@ -32,7 +32,7 @@ #include "videodevice.h" #include "kopete_export.h" #include -#include +#include #include namespace Kopete { diff --git a/kopete/libkopete/kautoconfig.cpp b/kopete/libkopete/kautoconfig.cpp index 14c5efaf..e1fcf210 100644 --- a/kopete/libkopete/kautoconfig.cpp +++ b/kopete/libkopete/kautoconfig.cpp @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include @@ -101,8 +101,8 @@ public: } }; -KAutoConfig::KAutoConfig(TDEConfig *kconfig, TQObject *parent, - const char *name) : TQObject(parent, name), config(kconfig) { +KAutoConfig::KAutoConfig(TDEConfig *tdeconfig, TQObject *parent, + const char *name) : TQObject(parent, name), config(tdeconfig) { d = new KAutoConfigPrivate(); } diff --git a/kopete/libkopete/kautoconfig.h b/kopete/libkopete/kautoconfig.h index b582e85a..1779f174 100644 --- a/kopete/libkopete/kautoconfig.h +++ b/kopete/libkopete/kautoconfig.h @@ -119,12 +119,12 @@ signals: public: /** * Constructor. - * @param kconfig - TDEConfig to use when retrieving/saving the widgets + * @param tdeconfig - TDEConfig to use when retrieving/saving the widgets * that KAutoConfig knows about. * @param parent - Parent object. * @param name - Object name. */ - KAutoConfig( TDEConfig *kconfig, TQObject *parent=0, const char *name=0 ); + KAutoConfig( TDEConfig *tdeconfig, TQObject *parent=0, const char *name=0 ); /** * Constructor. diff --git a/kopete/libkopete/knotification.cpp b/kopete/libkopete/knotification.cpp index e8f69779..e0f49646 100644 --- a/kopete/libkopete/knotification.cpp +++ b/kopete/libkopete/knotification.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/kopete/libkopete/kopeteaccount.cpp b/kopete/libkopete/kopeteaccount.cpp index 69efb623..ccca93be 100644 --- a/kopete/libkopete/kopeteaccount.cpp +++ b/kopete/libkopete/kopeteaccount.cpp @@ -19,7 +19,7 @@ #include #include -#include +#include #include #include #include diff --git a/kopete/libkopete/kopeteaccountmanager.cpp b/kopete/libkopete/kopeteaccountmanager.cpp index 21f0d688..df844211 100644 --- a/kopete/libkopete/kopeteaccountmanager.cpp +++ b/kopete/libkopete/kopeteaccountmanager.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include #include diff --git a/kopete/libkopete/kopeteaway.cpp b/kopete/libkopete/kopeteaway.cpp index 94e07ddd..e0bf1553 100644 --- a/kopete/libkopete/kopeteaway.cpp +++ b/kopete/libkopete/kopeteaway.cpp @@ -29,7 +29,7 @@ #include "kopetecontact.h" #include "kopeteprefs.h" -#include +#include #include #include #include diff --git a/kopete/libkopete/kopeteblacklister.cpp b/kopete/libkopete/kopeteblacklister.cpp index e31a5d1a..e249d736 100644 --- a/kopete/libkopete/kopeteblacklister.cpp +++ b/kopete/libkopete/kopeteblacklister.cpp @@ -17,7 +17,7 @@ #include "kopetecontact.h" -#include +#include #include #include diff --git a/kopete/libkopete/kopetecontactlistelement.cpp b/kopete/libkopete/kopetecontactlistelement.cpp index 89e9ea29..86fc19c1 100644 --- a/kopete/libkopete/kopetecontactlistelement.cpp +++ b/kopete/libkopete/kopetecontactlistelement.cpp @@ -18,7 +18,7 @@ #include "kopetecontactlistelement.h" -#include +#include #include #include diff --git a/kopete/libkopete/kopeteglobal.cpp b/kopete/libkopete/kopeteglobal.cpp index 1c889fc5..4b77444d 100644 --- a/kopete/libkopete/kopeteglobal.cpp +++ b/kopete/libkopete/kopeteglobal.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/kopete/libkopete/kopetemimetypehandler.cpp b/kopete/libkopete/kopetemimetypehandler.cpp index b05b2f4e..90da909b 100644 --- a/kopete/libkopete/kopetemimetypehandler.cpp +++ b/kopete/libkopete/kopetemimetypehandler.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/kopete/libkopete/kopetepassword.cpp b/kopete/libkopete/kopetepassword.cpp index e56e0f5d..8ee74036 100644 --- a/kopete/libkopete/kopetepassword.cpp +++ b/kopete/libkopete/kopetepassword.cpp @@ -28,7 +28,7 @@ #include #include -#include +#include #include #include #include diff --git a/kopete/libkopete/kopetepluginmanager.cpp b/kopete/libkopete/kopetepluginmanager.cpp index a98b0fc3..5648e0cc 100644 --- a/kopete/libkopete/kopetepluginmanager.cpp +++ b/kopete/libkopete/kopetepluginmanager.cpp @@ -505,7 +505,7 @@ bool PluginManager::setPluginEnabled( const TQString &_pluginId, bool enabled /* TDEConfig *config = TDEGlobal::config(); config->setGroup( "Plugins" ); - // FIXME: What is this for? This sort of thing is kconf_update's job - Richard + // FIXME: What is this for? This sort of thing is tdeconf_update's job - Richard if ( !pluginId.startsWith( TQString::fromLatin1( "kopete_" ) ) ) pluginId.prepend( TQString::fromLatin1( "kopete_" ) ); diff --git a/kopete/libkopete/kopeteprefs.cpp b/kopete/libkopete/kopeteprefs.cpp index 353ea46d..77e8381a 100644 --- a/kopete/libkopete/kopeteprefs.cpp +++ b/kopete/libkopete/kopeteprefs.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include diff --git a/kopete/libkopete/kopetetransfermanager.cpp b/kopete/libkopete/kopetetransfermanager.cpp index 27952b9a..43e57573 100644 --- a/kopete/libkopete/kopetetransfermanager.cpp +++ b/kopete/libkopete/kopetetransfermanager.cpp @@ -18,10 +18,10 @@ #include #include -#include -#include +#include +#include #include -#include +#include #include "kopetemetacontact.h" #include "kopetecontact.h" diff --git a/kopete/libkopete/kopetetransfermanager.h b/kopete/libkopete/kopetetransfermanager.h index bd18c3f3..0333fc5a 100644 --- a/kopete/libkopete/kopetetransfermanager.h +++ b/kopete/libkopete/kopetetransfermanager.h @@ -24,7 +24,7 @@ #include #include "kopete_export.h" -#include +#include namespace Kopete { diff --git a/kopete/libkopete/kopeteutils.cpp b/kopete/libkopete/kopeteutils.cpp index 07e56734..0681b4c7 100644 --- a/kopete/libkopete/kopeteutils.cpp +++ b/kopete/libkopete/kopeteutils.cpp @@ -2,7 +2,7 @@ Kopete Utils. Copyright (c) 2005 Duncan Mac-Vicar Prett - isHostReachable function code derived from KDE's HTTP kioslave + isHostReachable function code derived from KDE's HTTP tdeioslave Copyright (c) 2005 Waldo Bastian Kopete (c) 2002-2003 by the Kopete developers diff --git a/kopete/libkopete/private/kopeteviewmanager.cpp b/kopete/libkopete/private/kopeteviewmanager.cpp index 37f04e02..9fbc19c7 100644 --- a/kopete/libkopete/private/kopeteviewmanager.cpp +++ b/kopete/libkopete/private/kopeteviewmanager.cpp @@ -16,7 +16,7 @@ #include -#include +#include #include #include #include diff --git a/kopete/libkopete/ui/addressbookselectorwidget.cpp b/kopete/libkopete/ui/addressbookselectorwidget.cpp index 7b6fc27f..5a75bbf9 100644 --- a/kopete/libkopete/ui/addressbookselectorwidget.cpp +++ b/kopete/libkopete/ui/addressbookselectorwidget.cpp @@ -27,7 +27,7 @@ #include #include -#include +#include #include #include diff --git a/kopete/libkopete/ui/kopetefileconfirmdialog.cpp b/kopete/libkopete/ui/kopetefileconfirmdialog.cpp index 7291feb9..524d6bed 100644 --- a/kopete/libkopete/ui/kopetefileconfirmdialog.cpp +++ b/kopete/libkopete/ui/kopetefileconfirmdialog.cpp @@ -18,9 +18,9 @@ #include #include -#include +#include #include -#include +#include #include #include diff --git a/kopete/libkopete/ui/kopetelistview.cpp b/kopete/libkopete/ui/kopetelistview.cpp index 7e783024..b0f7e787 100644 --- a/kopete/libkopete/ui/kopetelistview.cpp +++ b/kopete/libkopete/ui/kopetelistview.cpp @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include diff --git a/kopete/libkopete/ui/metacontactselectorwidget.cpp b/kopete/libkopete/ui/metacontactselectorwidget.cpp index 0fa64a4e..26b075a3 100644 --- a/kopete/libkopete/ui/metacontactselectorwidget.cpp +++ b/kopete/libkopete/ui/metacontactselectorwidget.cpp @@ -27,7 +27,7 @@ #include #include -#include +#include #include #include diff --git a/kopete/plugins/addbookmarks/CMakeLists.txt b/kopete/plugins/addbookmarks/CMakeLists.txt index 4d1df111..d7a3b1c8 100644 --- a/kopete/plugins/addbookmarks/CMakeLists.txt +++ b/kopete/plugins/addbookmarks/CMakeLists.txt @@ -25,7 +25,7 @@ link_directories( ##### other data ################################ install( FILES kopete_addbookmarks.desktop DESTINATION ${SERVICES_INSTALL_DIR} ) -install( FILES kopete_addbookmarks_config.desktop DESTINATION ${SERVICES_INSTALL_DIR}/kconfiguredialog ) +install( FILES kopete_addbookmarks_config.desktop DESTINATION ${SERVICES_INSTALL_DIR}/tdeconfiguredialog ) ##### kopete_addbookmarks (module) ############## diff --git a/kopete/plugins/addbookmarks/Makefile.am b/kopete/plugins/addbookmarks/Makefile.am index 1a6d19df..006ed524 100644 --- a/kopete/plugins/addbookmarks/Makefile.am +++ b/kopete/plugins/addbookmarks/Makefile.am @@ -19,4 +19,4 @@ service_DATA = kopete_addbookmarks.desktop servicedir = $(kde_servicesdir) kcm_DATA = kopete_addbookmarks_config.desktop -kcmdir = $(kde_servicesdir)/kconfiguredialog +kcmdir = $(kde_servicesdir)/tdeconfiguredialog diff --git a/kopete/plugins/addbookmarks/addbookmarksplugin.h b/kopete/plugins/addbookmarks/addbookmarksplugin.h index 32143ff9..4bf10668 100644 --- a/kopete/plugins/addbookmarks/addbookmarksplugin.h +++ b/kopete/plugins/addbookmarks/addbookmarksplugin.h @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include #include diff --git a/kopete/plugins/addbookmarks/addbookmarksprefssettings.cpp b/kopete/plugins/addbookmarks/addbookmarksprefssettings.cpp index 31f12978..8fe0fed1 100644 --- a/kopete/plugins/addbookmarks/addbookmarksprefssettings.cpp +++ b/kopete/plugins/addbookmarks/addbookmarksprefssettings.cpp @@ -10,7 +10,7 @@ // // #include -#include +#include #include #include "addbookmarksprefssettings.h" diff --git a/kopete/plugins/alias/CMakeLists.txt b/kopete/plugins/alias/CMakeLists.txt index d8ca2088..dfbc7c1b 100644 --- a/kopete/plugins/alias/CMakeLists.txt +++ b/kopete/plugins/alias/CMakeLists.txt @@ -26,7 +26,7 @@ link_directories( ##### other data ################################ install( FILES kopete_alias.desktop DESTINATION ${SERVICES_INSTALL_DIR} ) -install( FILES kopete_alias_config.desktop DESTINATION ${SERVICES_INSTALL_DIR}/kconfiguredialog ) +install( FILES kopete_alias_config.desktop DESTINATION ${SERVICES_INSTALL_DIR}/tdeconfiguredialog ) ##### kopete_alias (module) ##################### diff --git a/kopete/plugins/alias/Makefile.am b/kopete/plugins/alias/Makefile.am index 2172da71..ee84eb0c 100644 --- a/kopete/plugins/alias/Makefile.am +++ b/kopete/plugins/alias/Makefile.am @@ -15,5 +15,5 @@ service_DATA = kopete_alias.desktop servicedir = $(kde_servicesdir) kcm_DATA = kopete_alias_config.desktop -kcmdir = $(kde_servicesdir)/kconfiguredialog +kcmdir = $(kde_servicesdir)/tdeconfiguredialog diff --git a/kopete/plugins/alias/aliaspreferences.cpp b/kopete/plugins/alias/aliaspreferences.cpp index 4ffa9d27..f81da475 100644 --- a/kopete/plugins/alias/aliaspreferences.cpp +++ b/kopete/plugins/alias/aliaspreferences.cpp @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/kopete/plugins/autoreplace/CMakeLists.txt b/kopete/plugins/autoreplace/CMakeLists.txt index 9a39da64..671835b0 100644 --- a/kopete/plugins/autoreplace/CMakeLists.txt +++ b/kopete/plugins/autoreplace/CMakeLists.txt @@ -26,7 +26,7 @@ link_directories( ##### other data ################################ install( FILES kopete_autoreplace.desktop DESTINATION ${SERVICES_INSTALL_DIR} ) -install( FILES kopete_autoreplace_config.desktop DESTINATION ${SERVICES_INSTALL_DIR}/kconfiguredialog ) +install( FILES kopete_autoreplace_config.desktop DESTINATION ${SERVICES_INSTALL_DIR}/tdeconfiguredialog ) ##### kopete_autoreplace (module) ############### diff --git a/kopete/plugins/autoreplace/Makefile.am b/kopete/plugins/autoreplace/Makefile.am index e6363ae3..3a0d6440 100644 --- a/kopete/plugins/autoreplace/Makefile.am +++ b/kopete/plugins/autoreplace/Makefile.am @@ -17,5 +17,5 @@ service_DATA = kopete_autoreplace.desktop servicedir = $(kde_servicesdir) kcm_DATA = kopete_autoreplace_config.desktop -kcmdir = $(kde_servicesdir)/kconfiguredialog +kcmdir = $(kde_servicesdir)/tdeconfiguredialog diff --git a/kopete/plugins/autoreplace/autoreplaceconfig.cpp b/kopete/plugins/autoreplace/autoreplaceconfig.cpp index 0ce547cb..ce0ca264 100644 --- a/kopete/plugins/autoreplace/autoreplaceconfig.cpp +++ b/kopete/plugins/autoreplace/autoreplaceconfig.cpp @@ -18,7 +18,7 @@ #include "autoreplaceconfig.h" -#include +#include #include #include diff --git a/kopete/plugins/cryptography/CMakeLists.txt b/kopete/plugins/cryptography/CMakeLists.txt index 4952d8e2..27e36787 100644 --- a/kopete/plugins/cryptography/CMakeLists.txt +++ b/kopete/plugins/cryptography/CMakeLists.txt @@ -26,7 +26,7 @@ link_directories( ##### other data ################################ install( FILES kopete_cryptography.desktop DESTINATION ${SERVICES_INSTALL_DIR} ) -install( FILES kopete_cryptography_config.desktop DESTINATION ${SERVICES_INSTALL_DIR}/kconfiguredialog ) +install( FILES kopete_cryptography_config.desktop DESTINATION ${SERVICES_INSTALL_DIR}/tdeconfiguredialog ) install( FILES cryptographyui.rc cryptographychatui.rc DESTINATION ${DATA_INSTALL_DIR}/kopete_cryptography ) diff --git a/kopete/plugins/cryptography/Makefile.am b/kopete/plugins/cryptography/Makefile.am index 90c4c586..8e90bbfc 100644 --- a/kopete/plugins/cryptography/Makefile.am +++ b/kopete/plugins/cryptography/Makefile.am @@ -18,7 +18,7 @@ service_DATA = kopete_cryptography.desktop servicedir = $(kde_servicesdir) kcm_DATA = kopete_cryptography_config.desktop -kcmdir = $(kde_servicesdir)/kconfiguredialog +kcmdir = $(kde_servicesdir)/tdeconfiguredialog mydatadir = $(kde_datadir)/kopete_cryptography mydata_DATA = cryptographyui.rc cryptographychatui.rc diff --git a/kopete/plugins/cryptography/cryptographyguiclient.cpp b/kopete/plugins/cryptography/cryptographyguiclient.cpp index 898e7f1a..4892afb1 100644 --- a/kopete/plugins/cryptography/cryptographyguiclient.cpp +++ b/kopete/plugins/cryptography/cryptographyguiclient.cpp @@ -21,7 +21,7 @@ #include "kopetechatsession.h" #include -#include +#include #include #include diff --git a/kopete/plugins/cryptography/cryptographyplugin.cpp b/kopete/plugins/cryptography/cryptographyplugin.cpp index 7e7d7761..06412936 100644 --- a/kopete/plugins/cryptography/cryptographyplugin.cpp +++ b/kopete/plugins/cryptography/cryptographyplugin.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include #include #include #include diff --git a/kopete/plugins/cryptography/popuppublic.cpp b/kopete/plugins/cryptography/popuppublic.cpp index 65cfb3bc..e3d2e630 100644 --- a/kopete/plugins/cryptography/popuppublic.cpp +++ b/kopete/plugins/cryptography/popuppublic.cpp @@ -43,7 +43,7 @@ #include #include #include -#include +#include #include "popuppublic.h" diff --git a/kopete/plugins/highlight/CMakeLists.txt b/kopete/plugins/highlight/CMakeLists.txt index 78da77b7..0b92404a 100644 --- a/kopete/plugins/highlight/CMakeLists.txt +++ b/kopete/plugins/highlight/CMakeLists.txt @@ -28,7 +28,7 @@ link_directories( ##### other data ################################ install( FILES kopete_highlight.desktop DESTINATION ${SERVICES_INSTALL_DIR} ) -install( FILES kopete_highlight_config.desktop DESTINATION ${SERVICES_INSTALL_DIR}/kconfiguredialog ) +install( FILES kopete_highlight_config.desktop DESTINATION ${SERVICES_INSTALL_DIR}/tdeconfiguredialog ) ##### kopete_highlight (module) ################# diff --git a/kopete/plugins/highlight/Makefile.am b/kopete/plugins/highlight/Makefile.am index 489f911c..0340c2f5 100644 --- a/kopete/plugins/highlight/Makefile.am +++ b/kopete/plugins/highlight/Makefile.am @@ -18,4 +18,4 @@ service_DATA = kopete_highlight.desktop servicedir = $(kde_servicesdir) kcm_DATA = kopete_highlight_config.desktop -kcmdir = $(kde_servicesdir)/kconfiguredialog +kcmdir = $(kde_servicesdir)/tdeconfiguredialog diff --git a/kopete/plugins/history/CMakeLists.txt b/kopete/plugins/history/CMakeLists.txt index aed227fc..8f44c108 100644 --- a/kopete/plugins/history/CMakeLists.txt +++ b/kopete/plugins/history/CMakeLists.txt @@ -28,7 +28,7 @@ link_directories( install( FILES kopete_history.desktop DESTINATION ${SERVICES_INSTALL_DIR} ) install( FILES historyui.rc historychatui.rc DESTINATION ${DATA_INSTALL_DIR}/kopete_history ) -install( FILES kopete_history_config.desktop DESTINATION ${SERVICES_INSTALL_DIR}/kconfiguredialog ) +install( FILES kopete_history_config.desktop DESTINATION ${SERVICES_INSTALL_DIR}/tdeconfiguredialog ) install( FILES historyconfig.kcfg DESTINATION ${KCFG_INSTALL_DIR} ) diff --git a/kopete/plugins/history/Makefile.am b/kopete/plugins/history/Makefile.am index c5139402..b43b8ed4 100644 --- a/kopete/plugins/history/Makefile.am +++ b/kopete/plugins/history/Makefile.am @@ -21,6 +21,6 @@ mydatadir = $(kde_datadir)/kopete_history mydata_DATA = historyui.rc historychatui.rc kcm_DATA = kopete_history_config.desktop -kcmdir = $(kde_servicesdir)/kconfiguredialog +kcmdir = $(kde_servicesdir)/tdeconfiguredialog kde_kcfg_DATA = historyconfig.kcfg diff --git a/kopete/plugins/history/converter.cpp b/kopete/plugins/history/converter.cpp index 1c5c573d..34d2a426 100644 --- a/kopete/plugins/history/converter.cpp +++ b/kopete/plugins/history/converter.cpp @@ -20,7 +20,7 @@ #include "kopeteprotocol.h" #include "kopeteuiglobal.h" -#include +#include #include #include #include diff --git a/kopete/plugins/history/historyconfig.kcfgc b/kopete/plugins/history/historyconfig.kcfgc index 1e985622..8439dc23 100644 --- a/kopete/plugins/history/historyconfig.kcfgc +++ b/kopete/plugins/history/historyconfig.kcfgc @@ -1,4 +1,4 @@ -# Code generation options for kconfig_compiler +# Code generation options for tdeconfig_compiler File=historyconfig.kcfg ClassName=HistoryConfig Singleton=true diff --git a/kopete/plugins/history/historyplugin.cpp b/kopete/plugins/history/historyplugin.cpp index ce579ea8..c9dc5fd6 100644 --- a/kopete/plugins/history/historyplugin.cpp +++ b/kopete/plugins/history/historyplugin.cpp @@ -19,7 +19,7 @@ #include #include #include -//#include +//#include #include #include diff --git a/kopete/plugins/latex/CMakeLists.txt b/kopete/plugins/latex/CMakeLists.txt index d71dc85d..e8215b92 100644 --- a/kopete/plugins/latex/CMakeLists.txt +++ b/kopete/plugins/latex/CMakeLists.txt @@ -27,7 +27,7 @@ link_directories( ##### other data ################################ install( FILES kopete_latex.desktop DESTINATION ${SERVICES_INSTALL_DIR} ) -install( FILES kopete_latex_config.desktop DESTINATION ${SERVICES_INSTALL_DIR}/kconfiguredialog ) +install( FILES kopete_latex_config.desktop DESTINATION ${SERVICES_INSTALL_DIR}/tdeconfiguredialog ) install( PROGRAMS kopete_latexconvert.sh DESTINATION ${BIN_INSTALL_DIR} ) install( FILES latexconfig.kcfg DESTINATION ${KCFG_INSTALL_DIR} ) install( FILES latexchatui.rc DESTINATION ${DATA_INSTALL_DIR}/kopete_latex ) diff --git a/kopete/plugins/latex/Makefile.am b/kopete/plugins/latex/Makefile.am index 7d71f9f1..74b977df 100644 --- a/kopete/plugins/latex/Makefile.am +++ b/kopete/plugins/latex/Makefile.am @@ -18,7 +18,7 @@ service_DATA = kopete_latex.desktop servicedir = $(kde_servicesdir) kcm_DATA = kopete_latex_config.desktop -kcmdir = $(kde_servicesdir)/kconfiguredialog +kcmdir = $(kde_servicesdir)/tdeconfiguredialog bin_SCRIPTS = kopete_latexconvert.sh kde_kcfg_DATA = latexconfig.kcfg diff --git a/kopete/plugins/latex/latexconfig.kcfgc b/kopete/plugins/latex/latexconfig.kcfgc index 9e4e4fec..984349fd 100644 --- a/kopete/plugins/latex/latexconfig.kcfgc +++ b/kopete/plugins/latex/latexconfig.kcfgc @@ -1,4 +1,4 @@ -# Code generation options for kconfig_compiler +# Code generation options for tdeconfig_compiler File=latexconfig.kcfg ClassName=LatexConfig Singleton=true diff --git a/kopete/plugins/latex/latexguiclient.h b/kopete/plugins/latex/latexguiclient.h index 2534e9a5..b8e5efc5 100644 --- a/kopete/plugins/latex/latexguiclient.h +++ b/kopete/plugins/latex/latexguiclient.h @@ -23,7 +23,7 @@ #include #include -#include +#include #include "kopetemessage.h" #include "kopeteplugin.h" diff --git a/kopete/plugins/motionautoaway/CMakeLists.txt b/kopete/plugins/motionautoaway/CMakeLists.txt index 650766ef..a484ec5e 100644 --- a/kopete/plugins/motionautoaway/CMakeLists.txt +++ b/kopete/plugins/motionautoaway/CMakeLists.txt @@ -26,7 +26,7 @@ link_directories( ##### other data ################################ install( FILES kopete_motionaway.desktop DESTINATION ${SERVICES_INSTALL_DIR} ) -install( FILES kopete_motionaway_config.desktop DESTINATION ${SERVICES_INSTALL_DIR}/kconfiguredialog ) +install( FILES kopete_motionaway_config.desktop DESTINATION ${SERVICES_INSTALL_DIR}/tdeconfiguredialog ) install( FILES motionawayconfig.kcfg DESTINATION ${KCFG_INSTALL_DIR} ) diff --git a/kopete/plugins/motionautoaway/Makefile.am b/kopete/plugins/motionautoaway/Makefile.am index ff2c5bd8..8f8bbaa3 100644 --- a/kopete/plugins/motionautoaway/Makefile.am +++ b/kopete/plugins/motionautoaway/Makefile.am @@ -18,7 +18,7 @@ service_DATA = kopete_motionaway.desktop servicedir = $(kde_servicesdir) kcm_DATA = kopete_motionaway_config.desktop -kcmdir = $(kde_servicesdir)/kconfiguredialog +kcmdir = $(kde_servicesdir)/tdeconfiguredialog kde_kcfg_DATA = motionawayconfig.kcfg diff --git a/kopete/plugins/motionautoaway/motionawayplugin.cpp b/kopete/plugins/motionautoaway/motionawayplugin.cpp index ea4bf2bc..56aed0ff 100644 --- a/kopete/plugins/motionautoaway/motionawayplugin.cpp +++ b/kopete/plugins/motionautoaway/motionawayplugin.cpp @@ -38,7 +38,7 @@ #include -#include +#include #include #include @@ -159,12 +159,12 @@ MotionAwayPlugin::~MotionAwayPlugin() } void MotionAwayPlugin::loadSettings(){ - TDEConfig *kconfig = TDEGlobal::config(); - kconfig->setGroup("MotionAway Plugin"); + TDEConfig *tdeconfig = TDEGlobal::config(); + tdeconfig->setGroup("MotionAway Plugin"); - awayTimeout = kconfig->readNumEntry("AwayTimeout", 1); - becomeAvailableWithActivity = kconfig->readBoolEntry("BecomeAvailableWithActivity", true); - videoDevice = kconfig->readEntry("VideoDevice", "/dev/video0"); + awayTimeout = tdeconfig->readNumEntry("AwayTimeout", 1); + becomeAvailableWithActivity = tdeconfig->readBoolEntry("BecomeAvailableWithActivity", true); + videoDevice = tdeconfig->readEntry("VideoDevice", "/dev/video0"); m_awayTimer->changeInterval(awayTimeout * 60 * 1000); } diff --git a/kopete/plugins/netmeeting/CMakeLists.txt b/kopete/plugins/netmeeting/CMakeLists.txt index a53e1ff2..dfda84e3 100644 --- a/kopete/plugins/netmeeting/CMakeLists.txt +++ b/kopete/plugins/netmeeting/CMakeLists.txt @@ -31,7 +31,7 @@ link_directories( ##### other data ################################ install( FILES kopete_netmeeting.desktop DESTINATION ${SERVICES_INSTALL_DIR} ) -install( FILES kopete_netmeeting_config.desktop DESTINATION ${SERVICES_INSTALL_DIR}/kconfiguredialog ) +install( FILES kopete_netmeeting_config.desktop DESTINATION ${SERVICES_INSTALL_DIR}/tdeconfiguredialog ) install( FILES netmeetingchatui.rc DESTINATION ${DATA_INSTALL_DIR}/kopete_netmeeting ) diff --git a/kopete/plugins/netmeeting/Makefile.am b/kopete/plugins/netmeeting/Makefile.am index 1710f136..27c5b0cb 100644 --- a/kopete/plugins/netmeeting/Makefile.am +++ b/kopete/plugins/netmeeting/Makefile.am @@ -20,4 +20,4 @@ kcm_kopete_netmeeting_la_LIBADD = $(LIB_KOPETECOMPAT) $(LIB_KUTILS) kcm_DATA = kopete_netmeeting_config.desktop -kcmdir = $(kde_servicesdir)/kconfiguredialog +kcmdir = $(kde_servicesdir)/tdeconfiguredialog diff --git a/kopete/plugins/netmeeting/netmeetinginvitation.cpp b/kopete/plugins/netmeeting/netmeetinginvitation.cpp index 7581ac62..4373cb05 100644 --- a/kopete/plugins/netmeeting/netmeetinginvitation.cpp +++ b/kopete/plugins/netmeeting/netmeetinginvitation.cpp @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include diff --git a/kopete/plugins/netmeeting/netmeetingpreferences.cpp b/kopete/plugins/netmeeting/netmeetingpreferences.cpp index 9981351d..3c63bc7e 100644 --- a/kopete/plugins/netmeeting/netmeetingpreferences.cpp +++ b/kopete/plugins/netmeeting/netmeetingpreferences.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/kopete/plugins/nowlistening/CMakeLists.txt b/kopete/plugins/nowlistening/CMakeLists.txt index 55e1a5ca..29c1e03e 100644 --- a/kopete/plugins/nowlistening/CMakeLists.txt +++ b/kopete/plugins/nowlistening/CMakeLists.txt @@ -29,7 +29,7 @@ link_directories( ##### other data ################################ install( FILES kopete_nowlistening.desktop DESTINATION ${SERVICES_INSTALL_DIR} ) -install( FILES kopete_nowlistening_config.desktop DESTINATION ${SERVICES_INSTALL_DIR}/kconfiguredialog ) +install( FILES kopete_nowlistening_config.desktop DESTINATION ${SERVICES_INSTALL_DIR}/tdeconfiguredialog ) install( FILES nowlisteningconfig.kcfg DESTINATION ${KCFG_INSTALL_DIR} ) install( FILES nowlisteningui.rc nowlisteningchatui.rc DESTINATION ${DATA_INSTALL_DIR}/kopete ) diff --git a/kopete/plugins/nowlistening/Makefile.am b/kopete/plugins/nowlistening/Makefile.am index 8d991f3a..69dbb38e 100644 --- a/kopete/plugins/nowlistening/Makefile.am +++ b/kopete/plugins/nowlistening/Makefile.am @@ -16,7 +16,7 @@ service_DATA = kopete_nowlistening.desktop servicedir = $(kde_servicesdir) kcm_DATA = kopete_nowlistening_config.desktop -kcmdir = $(kde_servicesdir)/kconfiguredialog +kcmdir = $(kde_servicesdir)/tdeconfiguredialog kde_kcfg_DATA = nowlisteningconfig.kcfg diff --git a/kopete/plugins/nowlistening/nowlisteningconfig.kcfgc b/kopete/plugins/nowlistening/nowlisteningconfig.kcfgc index 87c53b77..d562e0cb 100644 --- a/kopete/plugins/nowlistening/nowlisteningconfig.kcfgc +++ b/kopete/plugins/nowlistening/nowlisteningconfig.kcfgc @@ -1,4 +1,4 @@ -# Code generation options for kconfig_compiler +# Code generation options for tdeconfig_compiler File=nowlisteningconfig.kcfg ClassName=NowListeningConfig Singleton=true diff --git a/kopete/plugins/smpppdcs/CMakeLists.txt b/kopete/plugins/smpppdcs/CMakeLists.txt index cac131f9..ac985dd2 100644 --- a/kopete/plugins/smpppdcs/CMakeLists.txt +++ b/kopete/plugins/smpppdcs/CMakeLists.txt @@ -31,7 +31,7 @@ link_directories( ##### other data ################################ install( FILES kopete_smpppdcs.desktop DESTINATION ${SERVICES_INSTALL_DIR} ) -install( FILES kopete_smpppdcs_config.desktop DESTINATION ${SERVICES_INSTALL_DIR}/kconfiguredialog ) +install( FILES kopete_smpppdcs_config.desktop DESTINATION ${SERVICES_INSTALL_DIR}/tdeconfiguredialog ) install( FILES smpppdcs.kcfg DESTINATION ${KCFG_INSTALL_DIR} ) diff --git a/kopete/plugins/smpppdcs/Makefile.am b/kopete/plugins/smpppdcs/Makefile.am index 11173ac6..fe8792fc 100644 --- a/kopete/plugins/smpppdcs/Makefile.am +++ b/kopete/plugins/smpppdcs/Makefile.am @@ -26,7 +26,7 @@ service_DATA = kopete_smpppdcs.desktop servicedir = $(kde_servicesdir) kcm_DATA = kopete_smpppdcs_config.desktop -kcmdir = $(kde_servicesdir)/kconfiguredialog +kcmdir = $(kde_servicesdir)/tdeconfiguredialog kde_kcfg_DATA = smpppdcs.kcfg diff --git a/kopete/plugins/smpppdcs/detectorsmpppd.cpp b/kopete/plugins/smpppdcs/detectorsmpppd.cpp index 772090d9..b6f6fc30 100644 --- a/kopete/plugins/smpppdcs/detectorsmpppd.cpp +++ b/kopete/plugins/smpppdcs/detectorsmpppd.cpp @@ -16,7 +16,7 @@ #include #include -#include +#include #include #include "iconnector.h" diff --git a/kopete/plugins/texteffect/CMakeLists.txt b/kopete/plugins/texteffect/CMakeLists.txt index e88a0e34..c56f73ad 100644 --- a/kopete/plugins/texteffect/CMakeLists.txt +++ b/kopete/plugins/texteffect/CMakeLists.txt @@ -28,7 +28,7 @@ link_directories( ##### other data ################################ install( FILES kopete_texteffect.desktop DESTINATION ${SERVICES_INSTALL_DIR} ) -install( FILES kopete_texteffect_config.desktop DESTINATION ${SERVICES_INSTALL_DIR}/kconfiguredialog ) +install( FILES kopete_texteffect_config.desktop DESTINATION ${SERVICES_INSTALL_DIR}/tdeconfiguredialog ) ##### kopete_texteffect (module) ################ diff --git a/kopete/plugins/texteffect/Makefile.am b/kopete/plugins/texteffect/Makefile.am index ee008e27..7f721dee 100644 --- a/kopete/plugins/texteffect/Makefile.am +++ b/kopete/plugins/texteffect/Makefile.am @@ -17,4 +17,4 @@ service_DATA = kopete_texteffect.desktop servicedir = $(kde_servicesdir) kcm_DATA = kopete_texteffect_config.desktop -kcmdir = $(kde_servicesdir)/kconfiguredialog +kcmdir = $(kde_servicesdir)/tdeconfiguredialog diff --git a/kopete/plugins/texteffect/texteffectconfig.cpp b/kopete/plugins/texteffect/texteffectconfig.cpp index b1e2417c..a411b363 100644 --- a/kopete/plugins/texteffect/texteffectconfig.cpp +++ b/kopete/plugins/texteffect/texteffectconfig.cpp @@ -19,7 +19,7 @@ #include #include -#include +#include #include "texteffectconfig.h" diff --git a/kopete/plugins/translator/CMakeLists.txt b/kopete/plugins/translator/CMakeLists.txt index 5dd274db..4c4e4756 100644 --- a/kopete/plugins/translator/CMakeLists.txt +++ b/kopete/plugins/translator/CMakeLists.txt @@ -25,7 +25,7 @@ link_directories( ##### other data ################################ install( FILES kopete_translator.desktop DESTINATION ${SERVICES_INSTALL_DIR} ) -install( FILES kopete_translator_config.desktop DESTINATION ${SERVICES_INSTALL_DIR}/kconfiguredialog ) +install( FILES kopete_translator_config.desktop DESTINATION ${SERVICES_INSTALL_DIR}/tdeconfiguredialog ) install( FILES translatorui.rc translatorchatui.rc DESTINATION ${DATA_INSTALL_DIR}/kopete_translator ) diff --git a/kopete/plugins/translator/Makefile.am b/kopete/plugins/translator/Makefile.am index 679c1ed8..fd58d26f 100644 --- a/kopete/plugins/translator/Makefile.am +++ b/kopete/plugins/translator/Makefile.am @@ -17,7 +17,7 @@ service_DATA = kopete_translator.desktop servicedir = $(kde_servicesdir) kcm_DATA = kopete_translator_config.desktop -kcmdir = $(kde_servicesdir)/kconfiguredialog +kcmdir = $(kde_servicesdir)/tdeconfiguredialog mydatadir = $(kde_datadir)/kopete_translator mydata_DATA = translatorui.rc translatorchatui.rc diff --git a/kopete/plugins/translator/translatorguiclient.h b/kopete/plugins/translator/translatorguiclient.h index 21675216..2f7a9f0f 100644 --- a/kopete/plugins/translator/translatorguiclient.h +++ b/kopete/plugins/translator/translatorguiclient.h @@ -23,7 +23,7 @@ #include #include -#include +#include #include "kopetemessage.h" #include "kopeteplugin.h" diff --git a/kopete/plugins/translator/translatorplugin.cpp b/kopete/plugins/translator/translatorplugin.cpp index a2614640..066f93a9 100644 --- a/kopete/plugins/translator/translatorplugin.cpp +++ b/kopete/plugins/translator/translatorplugin.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include diff --git a/kopete/plugins/translator/translatorplugin.h b/kopete/plugins/translator/translatorplugin.h index 762b6018..d7700d8e 100644 --- a/kopete/plugins/translator/translatorplugin.h +++ b/kopete/plugins/translator/translatorplugin.h @@ -27,7 +27,7 @@ #include -#include +#include #include "kopetemessage.h" #include "kopeteplugin.h" diff --git a/kopete/plugins/webpresence/CMakeLists.txt b/kopete/plugins/webpresence/CMakeLists.txt index bcba1176..a2b07be0 100644 --- a/kopete/plugins/webpresence/CMakeLists.txt +++ b/kopete/plugins/webpresence/CMakeLists.txt @@ -31,7 +31,7 @@ install( FILES install( FILES kopete_webpresence_config.desktop - DESTINATION ${SERVICES_INSTALL_DIR}/kconfiguredialog ) + DESTINATION ${SERVICES_INSTALL_DIR}/tdeconfiguredialog ) install( FILES webpresence_html.xsl webpresence_html_images.xsl diff --git a/kopete/plugins/webpresence/Makefile.am b/kopete/plugins/webpresence/Makefile.am index 6785efca..eb91a345 100644 --- a/kopete/plugins/webpresence/Makefile.am +++ b/kopete/plugins/webpresence/Makefile.am @@ -17,7 +17,7 @@ service_DATA = kopete_webpresence.desktop servicedir = $(kde_servicesdir) kcm_DATA = kopete_webpresence_config.desktop -kcmdir = $(kde_servicesdir)/kconfiguredialog +kcmdir = $(kde_servicesdir)/tdeconfiguredialog mydata_DATA = webpresence_html.xsl\ webpresence_html_images.xsl\ diff --git a/kopete/plugins/webpresence/webpresenceplugin.cpp b/kopete/plugins/webpresence/webpresenceplugin.cpp index 82525619..48271559 100644 --- a/kopete/plugins/webpresence/webpresenceplugin.cpp +++ b/kopete/plugins/webpresence/webpresenceplugin.cpp @@ -25,7 +25,7 @@ #include #include -#include +#include #include #include #include @@ -73,33 +73,33 @@ WebPresencePlugin::~WebPresencePlugin() void WebPresencePlugin::loadSettings() { - TDEConfig *kconfig = TDEGlobal::config(); - kconfig->setGroup( "Web Presence Plugin" ); + TDEConfig *tdeconfig = TDEGlobal::config(); + tdeconfig->setGroup( "Web Presence Plugin" ); - frequency = kconfig->readNumEntry("UploadFrequency", 15); - resultURL = kconfig->readPathEntry("uploadURL"); + frequency = tdeconfig->readNumEntry("UploadFrequency", 15); + resultURL = tdeconfig->readPathEntry("uploadURL"); resultFormatting = WEB_UNDEFINED; - if ( kconfig->readBoolEntry( "formatHTML", false ) ) { + if ( tdeconfig->readBoolEntry( "formatHTML", false ) ) { resultFormatting = WEB_HTML; - } else if ( kconfig->readBoolEntry( "formatXHTML", false ) ) { + } else if ( tdeconfig->readBoolEntry( "formatXHTML", false ) ) { resultFormatting = WEB_XHTML; - } else if ( kconfig->readBoolEntry( "formatXML", false ) ) { + } else if ( tdeconfig->readBoolEntry( "formatXML", false ) ) { resultFormatting = WEB_XML; - } else if ( kconfig->readBoolEntry( "formatStylesheet", false ) ) { + } else if ( tdeconfig->readBoolEntry( "formatStylesheet", false ) ) { resultFormatting = WEB_CUSTOM; - userStyleSheet = kconfig->readEntry("formatStylesheetURL"); + userStyleSheet = tdeconfig->readEntry("formatStylesheetURL"); } // Default to HTML if we dont get anything useful from config file. if ( resultFormatting == WEB_UNDEFINED ) resultFormatting = WEB_HTML; - useImagesInHTML = kconfig->readBoolEntry( "useImagesHTML", false ); - useImName = kconfig->readBoolEntry("showName", true); - userName = kconfig->readEntry("showThisName"); - showAddresses = kconfig->readBoolEntry("includeIMAddress", false); + useImagesInHTML = tdeconfig->readBoolEntry( "useImagesHTML", false ); + useImName = tdeconfig->readBoolEntry("showName", true); + userName = tdeconfig->readEntry("showThisName"); + showAddresses = tdeconfig->readBoolEntry("includeIMAddress", false); // Update file when settings are changed. slotWriteFile(); diff --git a/kopete/plugins/webpresence/webpresenceplugin.h b/kopete/plugins/webpresence/webpresenceplugin.h index d5324a40..c739d10e 100644 --- a/kopete/plugins/webpresence/webpresenceplugin.h +++ b/kopete/plugins/webpresence/webpresenceplugin.h @@ -22,7 +22,7 @@ #include -#include +#include #include "kopetecontact.h" #include "kopeteonlinestatus.h" diff --git a/kopete/protocols/gadu/gaduaccount.cpp b/kopete/protocols/gadu/gaduaccount.cpp index c60f4051..f9a725ee 100644 --- a/kopete/protocols/gadu/gaduaccount.cpp +++ b/kopete/protocols/gadu/gaduaccount.cpp @@ -37,14 +37,14 @@ #include "kopeteglobal.h" #include -#include +#include #include #include #include #include #include #include -#include +#include #include #include diff --git a/kopete/protocols/gadu/gaduaccount.h b/kopete/protocols/gadu/gaduaccount.h index 1ba9a5c2..dd3f6c68 100644 --- a/kopete/protocols/gadu/gaduaccount.h +++ b/kopete/protocols/gadu/gaduaccount.h @@ -37,7 +37,7 @@ #include #include #include -#include +#include class GaduAccountPrivate; diff --git a/kopete/protocols/gadu/gaducontact.cpp b/kopete/protocols/gadu/gaducontact.cpp index c9a68f25..9aea8fe5 100644 --- a/kopete/protocols/gadu/gaducontact.cpp +++ b/kopete/protocols/gadu/gaducontact.cpp @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include "gaduaccount.h" diff --git a/kopete/protocols/gadu/gaduprotocol.cpp b/kopete/protocols/gadu/gaduprotocol.cpp index 3ec773f0..4f77017a 100644 --- a/kopete/protocols/gadu/gaduprotocol.cpp +++ b/kopete/protocols/gadu/gaduprotocol.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include #include diff --git a/kopete/protocols/groupwise/gwaccount.cpp b/kopete/protocols/groupwise/gwaccount.cpp index 40d04a3e..51be07e1 100644 --- a/kopete/protocols/groupwise/gwaccount.cpp +++ b/kopete/protocols/groupwise/gwaccount.cpp @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include #include diff --git a/kopete/protocols/groupwise/ui/gweditaccountwidget.cpp b/kopete/protocols/groupwise/ui/gweditaccountwidget.cpp index de50ba19..910c99f4 100644 --- a/kopete/protocols/groupwise/ui/gweditaccountwidget.cpp +++ b/kopete/protocols/groupwise/ui/gweditaccountwidget.cpp @@ -26,7 +26,7 @@ #include #include -#include +#include #include #include #include diff --git a/kopete/protocols/groupwise/ui/gwreceiveinvitationdialog.cpp b/kopete/protocols/groupwise/ui/gwreceiveinvitationdialog.cpp index d4c65412..4c51487f 100644 --- a/kopete/protocols/groupwise/ui/gwreceiveinvitationdialog.cpp +++ b/kopete/protocols/groupwise/ui/gwreceiveinvitationdialog.cpp @@ -19,7 +19,7 @@ #include #include -#include +#include #include #include #include diff --git a/kopete/protocols/irc/ircaccount.cpp b/kopete/protocols/irc/ircaccount.cpp index 46e325ac..7daf2f8d 100644 --- a/kopete/protocols/irc/ircaccount.cpp +++ b/kopete/protocols/irc/ircaccount.cpp @@ -43,7 +43,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/kopete/protocols/irc/irccontactmanager.cpp b/kopete/protocols/irc/irccontactmanager.cpp index 84c88f39..10ae8a69 100644 --- a/kopete/protocols/irc/irccontactmanager.cpp +++ b/kopete/protocols/irc/irccontactmanager.cpp @@ -31,7 +31,7 @@ #include #include -#include +#include #include #include @@ -67,7 +67,7 @@ IRCContactManager::IRCContactManager(const TQString &nickName, IRCAccount *accou this, TQT_SLOT( slotContactAdded( Kopete::MetaContact* ))); socketTimeout = 15000; - TQString timeoutPath = locate( "config", "kioslaverc" ); + TQString timeoutPath = locate( "config", "tdeioslaverc" ); if( !timeoutPath.isEmpty() ) { TDEConfig config( timeoutPath ); diff --git a/kopete/protocols/irc/ircprotocol.cpp b/kopete/protocols/irc/ircprotocol.cpp index 96d905c0..e2d359dd 100644 --- a/kopete/protocols/irc/ircprotocol.cpp +++ b/kopete/protocols/irc/ircprotocol.cpp @@ -23,7 +23,7 @@ #include "ircchannelcontact.h" #include "irccontactmanager.h" -#include "networkconfig.h" +#include "networtdeconfig.h" #include "channellist.h" #include "ircguiclient.h" #include "ircusercontact.h" diff --git a/kopete/protocols/irc/ircusercontact.cpp b/kopete/protocols/irc/ircusercontact.cpp index 54c40132..fa2ae7b5 100644 --- a/kopete/protocols/irc/ircusercontact.cpp +++ b/kopete/protocols/irc/ircusercontact.cpp @@ -28,7 +28,7 @@ #include #include -#include +#include #include #include diff --git a/kopete/protocols/irc/libkirc/kircengine.cpp b/kopete/protocols/irc/libkirc/kircengine.cpp index 0fddaab7..79bc56df 100644 --- a/kopete/protocols/irc/libkirc/kircengine.cpp +++ b/kopete/protocols/irc/libkirc/kircengine.cpp @@ -24,7 +24,7 @@ #include "kircengine.h" #include "ksslsocket.h" -#include +#include #include #include #include diff --git a/kopete/protocols/irc/libkirc/ksslsocket.cpp b/kopete/protocols/irc/libkirc/ksslsocket.cpp index 5db30998..d3615fc5 100644 --- a/kopete/protocols/irc/libkirc/ksslsocket.cpp +++ b/kopete/protocols/irc/libkirc/ksslsocket.cpp @@ -184,16 +184,16 @@ void KSSLSocket::showInfoDialog() { if( socketStatus() == connected ) { - if (!d->dcc->isApplicationRegistered("kio_uiserver")) + if (!d->dcc->isApplicationRegistered("tdeio_uiserver")) { - TDEApplication::startServiceByDesktopPath("kio_uiserver.desktop",TQStringList()); + TDEApplication::startServiceByDesktopPath("tdeio_uiserver.desktop",TQStringList()); } TQByteArray data, ignore; TQCString ignoretype; TQDataStream arg(data, IO_WriteOnly); arg << "irc://" + peerAddress()->pretty() + ":" + port() << d->metaData; - d->dcc->call("kio_uiserver", "UIServer", + d->dcc->call("tdeio_uiserver", "UIServer", "showSSLInfoDialog(TQString,TDEIO::MetaData)", data, ignoretype, ignore); } } @@ -233,12 +233,12 @@ int KSSLSocket::messageBox( TDEIO::SlaveBase::MessageBoxType type, const TQStrin TQDataStream arg(data, IO_WriteOnly); arg << (int)1 << (int)type << text << caption << buttonYes << buttonNo; - if (!d->dcc->isApplicationRegistered("kio_uiserver")) + if (!d->dcc->isApplicationRegistered("tdeio_uiserver")) { - TDEApplication::startServiceByDesktopPath("kio_uiserver.desktop",TQStringList()); + TDEApplication::startServiceByDesktopPath("tdeio_uiserver.desktop",TQStringList()); } - d->dcc->call("kio_uiserver", "UIServer", + d->dcc->call("tdeio_uiserver", "UIServer", "messageBox(int,int,TQString,TQString,TQString,TQString)", data, returnType, result); if( returnType == "int" ) diff --git a/kopete/protocols/irc/libkirc/ksslsocket.h b/kopete/protocols/irc/libkirc/ksslsocket.h index a036a71d..f0b8e76c 100644 --- a/kopete/protocols/irc/libkirc/ksslsocket.h +++ b/kopete/protocols/irc/libkirc/ksslsocket.h @@ -22,7 +22,7 @@ #include #include -#include +#include class KSSLSocketPrivate; diff --git a/kopete/protocols/irc/ui/CMakeLists.txt b/kopete/protocols/irc/ui/CMakeLists.txt index 7d77d5b8..d90cdd65 100644 --- a/kopete/protocols/irc/ui/CMakeLists.txt +++ b/kopete/protocols/irc/ui/CMakeLists.txt @@ -26,5 +26,5 @@ include_directories( tde_add_library( kopeteircui STATIC_PIC AUTOMOC SOURCES ircadd.ui empty.cpp irceditaccountwidget.cpp irceditaccount.ui - channellist.cpp channellistdialog.cpp networkconfig.ui + channellist.cpp channellistdialog.cpp networtdeconfig.ui ) diff --git a/kopete/protocols/irc/ui/Makefile.am b/kopete/protocols/irc/ui/Makefile.am index 854a7398..b31b75ea 100644 --- a/kopete/protocols/irc/ui/Makefile.am +++ b/kopete/protocols/irc/ui/Makefile.am @@ -8,5 +8,5 @@ AM_CPPFLAGS = $(KOPETE_INCLUDES) \ libkopeteircui_la_SOURCES = ircadd.ui empty.cpp irceditaccountwidget.cpp \ - irceditaccount.ui channellist.cpp channellistdialog.cpp networkconfig.ui + irceditaccount.ui channellist.cpp channellistdialog.cpp networtdeconfig.ui EXTRA_DIST = ircadd.ui ircprefs.ui empty.cpp diff --git a/kopete/protocols/irc/ui/irceditaccountwidget.cpp b/kopete/protocols/irc/ui/irceditaccountwidget.cpp index f09ea21e..430282fb 100644 --- a/kopete/protocols/irc/ui/irceditaccountwidget.cpp +++ b/kopete/protocols/irc/ui/irceditaccountwidget.cpp @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include diff --git a/kopete/protocols/irc/ui/networkconfig.ui b/kopete/protocols/irc/ui/networkconfig.ui deleted file mode 100644 index 09121e54..00000000 --- a/kopete/protocols/irc/ui/networkconfig.ui +++ /dev/null @@ -1,382 +0,0 @@ - -NetworkConfig - - - NetworkConfig - - - - 0 - 0 - 670 - 468 - - - - Network Configuration - - - - unnamed - - - - description - - - - - textLabel10 - - - - 1 - 5 - 0 - 0 - - - - &Description: - - - description - - - - - groupBox2 - - - - 3 - 3 - 0 - 0 - - - - 4 - - - Host Con&figuration - - - - unnamed - - - - hostList - - - - 3 - 3 - 0 - 0 - - - - The IRC servers associated with this network - - - The IRC servers associated with this network. Use the up and down buttons to alter the order in which connections are attempted. - - - - - password - - - Password - - - Most IRC servers do not require a password - - - - - textLabel6 - - - Por&t: - - - port - - - - - port - - - 65536 - - - 1 - - - 6667 - - - - - textLabel4 - - - &Password: - - - password - - - - - textLabel5 - - - &Host: - - - host - - - - - host - - - true - - - - - - - - useSSL - - - Use SS&L - - - Check this to enable SSL for this connection - - - - - removeHost - - - - 1 - 0 - 0 - 0 - - - - &Remove - - - - - newHost - - - - 1 - 0 - 0 - 0 - - - - &New... - - - - - spacer3 - - - Horizontal - - - Expanding - - - - 210 - 20 - - - - - - downButton - - - false - - - Down - - - Move this server down - - - Move this server down in connection attempt priority - - - - - spacer4 - - - Vertical - - - Expanding - - - - 20 - 151 - - - - - - upButton - - - false - - - Up - - - Move this server up - - - Move this server up in connection attempt priority - - - - - - - cancelButton - - - &Cancel - - - - - saveButton - - - &Save - - - - - newNetwork - - - Ne&w - - - - - networkList - - - - 3 - 7 - 0 - 0 - - - - - - spacer5 - - - Horizontal - - - Expanding - - - - 260 - 20 - - - - - - renameNetwork - - - Rena&me... - - - - - removeNetwork - - - Remo&ve - - - - - - - cancelButton - clicked() - NetworkConfig - reject() - - - saveButton - clicked() - NetworkConfig - accept() - - - - networkList - newNetwork - renameNetwork - removeNetwork - description - hostList - upButton - downButton - host - port - password - useSSL - newHost - removeHost - saveButton - cancelButton - - - accepted() - rejected() - - - accept() - reject() - - - diff --git a/kopete/protocols/irc/ui/networkconfig.ui.h b/kopete/protocols/irc/ui/networkconfig.ui.h deleted file mode 100644 index 183ba57f..00000000 --- a/kopete/protocols/irc/ui/networkconfig.ui.h +++ /dev/null @@ -1,26 +0,0 @@ -/**************************************************************************** -** ui.h extension file, included from the uic-generated form implementation. -** -** If you wish to add, delete or rename functions or slots use -** TQt Designer which will update this file, preserving your code. Create an -** init() function in place of a constructor, and a destroy() function in -** place of a destructor. -*****************************************************************************/ - - - - - - -void NetworkConfig::accept() -{ - emit accepted(); - TQDialog::accept(); -} - - -void NetworkConfig::reject() -{ - emit rejected(); - TQDialog::reject(); -} diff --git a/kopete/protocols/irc/ui/networtdeconfig.ui b/kopete/protocols/irc/ui/networtdeconfig.ui new file mode 100644 index 00000000..09121e54 --- /dev/null +++ b/kopete/protocols/irc/ui/networtdeconfig.ui @@ -0,0 +1,382 @@ + +NetworkConfig + + + NetworkConfig + + + + 0 + 0 + 670 + 468 + + + + Network Configuration + + + + unnamed + + + + description + + + + + textLabel10 + + + + 1 + 5 + 0 + 0 + + + + &Description: + + + description + + + + + groupBox2 + + + + 3 + 3 + 0 + 0 + + + + 4 + + + Host Con&figuration + + + + unnamed + + + + hostList + + + + 3 + 3 + 0 + 0 + + + + The IRC servers associated with this network + + + The IRC servers associated with this network. Use the up and down buttons to alter the order in which connections are attempted. + + + + + password + + + Password + + + Most IRC servers do not require a password + + + + + textLabel6 + + + Por&t: + + + port + + + + + port + + + 65536 + + + 1 + + + 6667 + + + + + textLabel4 + + + &Password: + + + password + + + + + textLabel5 + + + &Host: + + + host + + + + + host + + + true + + + + + + + + useSSL + + + Use SS&L + + + Check this to enable SSL for this connection + + + + + removeHost + + + + 1 + 0 + 0 + 0 + + + + &Remove + + + + + newHost + + + + 1 + 0 + 0 + 0 + + + + &New... + + + + + spacer3 + + + Horizontal + + + Expanding + + + + 210 + 20 + + + + + + downButton + + + false + + + Down + + + Move this server down + + + Move this server down in connection attempt priority + + + + + spacer4 + + + Vertical + + + Expanding + + + + 20 + 151 + + + + + + upButton + + + false + + + Up + + + Move this server up + + + Move this server up in connection attempt priority + + + + + + + cancelButton + + + &Cancel + + + + + saveButton + + + &Save + + + + + newNetwork + + + Ne&w + + + + + networkList + + + + 3 + 7 + 0 + 0 + + + + + + spacer5 + + + Horizontal + + + Expanding + + + + 260 + 20 + + + + + + renameNetwork + + + Rena&me... + + + + + removeNetwork + + + Remo&ve + + + + + + + cancelButton + clicked() + NetworkConfig + reject() + + + saveButton + clicked() + NetworkConfig + accept() + + + + networkList + newNetwork + renameNetwork + removeNetwork + description + hostList + upButton + downButton + host + port + password + useSSL + newHost + removeHost + saveButton + cancelButton + + + accepted() + rejected() + + + accept() + reject() + + + diff --git a/kopete/protocols/irc/ui/networtdeconfig.ui.h b/kopete/protocols/irc/ui/networtdeconfig.ui.h new file mode 100644 index 00000000..183ba57f --- /dev/null +++ b/kopete/protocols/irc/ui/networtdeconfig.ui.h @@ -0,0 +1,26 @@ +/**************************************************************************** +** ui.h extension file, included from the uic-generated form implementation. +** +** If you wish to add, delete or rename functions or slots use +** TQt Designer which will update this file, preserving your code. Create an +** init() function in place of a constructor, and a destroy() function in +** place of a destructor. +*****************************************************************************/ + + + + + + +void NetworkConfig::accept() +{ + emit accepted(); + TQDialog::accept(); +} + + +void NetworkConfig::reject() +{ + emit rejected(); + TQDialog::reject(); +} diff --git a/kopete/protocols/jabber/CMakeLists.txt b/kopete/protocols/jabber/CMakeLists.txt index a5e53af2..61202e95 100644 --- a/kopete/protocols/jabber/CMakeLists.txt +++ b/kopete/protocols/jabber/CMakeLists.txt @@ -12,7 +12,7 @@ add_subdirectory( ui ) add_subdirectory( icons ) add_subdirectory( libiris ) -add_subdirectory( kioslave ) +add_subdirectory( tdeioslave ) if( WITH_JINGLE ) add_subdirectory( jingle ) diff --git a/kopete/protocols/jabber/Makefile.am b/kopete/protocols/jabber/Makefile.am index f1706949..34337e63 100644 --- a/kopete/protocols/jabber/Makefile.am +++ b/kopete/protocols/jabber/Makefile.am @@ -5,7 +5,7 @@ JINGLE_INCLUDES=-I$(srcdir)/jingle -I$(top_builddir)/kopete/protocols/jabber/jin endif METASOURCES = AUTO -SUBDIRS = ui icons libiris $(JINGLE) . kioslave +SUBDIRS = ui icons libiris $(JINGLE) . tdeioslave AM_CPPFLAGS = $(KOPETE_INCLUDES) \ -I$(srcdir)/libiris/iris/include \ -I$(srcdir)/libiris/iris/xmpp-im \ diff --git a/kopete/protocols/jabber/jabberaccount.cpp b/kopete/protocols/jabber/jabberaccount.cpp index 0a803927..23f947fc 100644 --- a/kopete/protocols/jabber/jabberaccount.cpp +++ b/kopete/protocols/jabber/jabberaccount.cpp @@ -37,7 +37,7 @@ #include #include -#include +#include #include #include #include diff --git a/kopete/protocols/jabber/jabberbasecontact.cpp b/kopete/protocols/jabber/jabberbasecontact.cpp index d994487f..ec4b869f 100644 --- a/kopete/protocols/jabber/jabberbasecontact.cpp +++ b/kopete/protocols/jabber/jabberbasecontact.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include diff --git a/kopete/protocols/jabber/jabberchatsession.cpp b/kopete/protocols/jabber/jabberchatsession.cpp index 75bcdd03..cbfc0eab 100644 --- a/kopete/protocols/jabber/jabberchatsession.cpp +++ b/kopete/protocols/jabber/jabberchatsession.cpp @@ -25,7 +25,7 @@ #include #include -#include +#include #include #include #include "kopetechatsessionmanager.h" @@ -38,7 +38,7 @@ #include "jabbercontact.h" #include "jabberresource.h" #include "jabberresourcepool.h" -#include "kioslave/jabberdisco.h" +#include "tdeioslave/jabberdisco.h" JabberChatSession::JabberChatSession ( JabberProtocol *protocol, const JabberBaseContact *user, diff --git a/kopete/protocols/jabber/jabbercontact.cpp b/kopete/protocols/jabber/jabbercontact.cpp index 58ca2409..1d7d2e3f 100644 --- a/kopete/protocols/jabber/jabbercontact.cpp +++ b/kopete/protocols/jabber/jabbercontact.cpp @@ -31,11 +31,11 @@ #include #include #include -#include +#include #include #include #include -#include +#include #include #include diff --git a/kopete/protocols/jabber/jabberfiletransfer.cpp b/kopete/protocols/jabber/jabberfiletransfer.cpp index 00ecd535..e60116e5 100644 --- a/kopete/protocols/jabber/jabberfiletransfer.cpp +++ b/kopete/protocols/jabber/jabberfiletransfer.cpp @@ -21,7 +21,7 @@ #include "jabberfiletransfer.h" #include #include -#include +#include #include "kopeteuiglobal.h" #include "kopetemetacontact.h" #include "kopetecontactlist.h" diff --git a/kopete/protocols/jabber/jabbergroupcontact.cpp b/kopete/protocols/jabber/jabbergroupcontact.cpp index 1fa6d884..96ab9bcd 100644 --- a/kopete/protocols/jabber/jabbergroupcontact.cpp +++ b/kopete/protocols/jabber/jabbergroupcontact.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include "jabberprotocol.h" #include "jabberaccount.h" diff --git a/kopete/protocols/jabber/jabbergroupmembercontact.cpp b/kopete/protocols/jabber/jabbergroupmembercontact.cpp index e9bae4c1..e1bbd04a 100644 --- a/kopete/protocols/jabber/jabbergroupmembercontact.cpp +++ b/kopete/protocols/jabber/jabbergroupmembercontact.cpp @@ -19,7 +19,7 @@ #include #include -#include +#include #include "jabberprotocol.h" #include "jabberaccount.h" #include "jabberfiletransfer.h" diff --git a/kopete/protocols/jabber/jabberprotocol.cpp b/kopete/protocols/jabber/jabberprotocol.cpp index a7cf3a78..9e9cdc9a 100644 --- a/kopete/protocols/jabber/jabberprotocol.cpp +++ b/kopete/protocols/jabber/jabberprotocol.cpp @@ -19,7 +19,7 @@ #include #include -#include +#include #include #include #include diff --git a/kopete/protocols/jabber/jabbertransport.cpp b/kopete/protocols/jabber/jabbertransport.cpp index 26d16b28..adc53b01 100644 --- a/kopete/protocols/jabber/jabbertransport.cpp +++ b/kopete/protocols/jabber/jabbertransport.cpp @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include "xmpp_tasks.h" diff --git a/kopete/protocols/jabber/kioslave/CMakeLists.txt b/kopete/protocols/jabber/kioslave/CMakeLists.txt deleted file mode 100644 index 24b4ce81..00000000 --- a/kopete/protocols/jabber/kioslave/CMakeLists.txt +++ /dev/null @@ -1,42 +0,0 @@ -################################################# -# -# (C) 2010-2011 Serghei Amelian -# serghei (DOT) amelian (AT) gmail.com -# -# Improvements and feedback are welcome -# -# This file is released under GPL >= 2 -# -################################################# - -include_directories( - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/.. - ${CMAKE_CURRENT_SOURCE_DIR}/../libiris/iris/include - ${CMAKE_CURRENT_SOURCE_DIR}/../libiris/iris/jabber - ${CMAKE_CURRENT_SOURCE_DIR}/../libiris/iris/xmpp-im - ${CMAKE_CURRENT_SOURCE_DIR}/../libiris/cutestuff/util - ${TDE_INCLUDE_DIR} - ${TQT_INCLUDE_DIRS} -) - -link_directories( - ${TQT_LIBRARY_DIRS} -) - - -##### other data ################################ - -install( FILES jabberdisco.protocol DESTINATION ${SERVICES_INSTALL_DIR} ) - - -##### kio_jabberdisco (module) ################## - -tde_add_kpart( kio_jabberdisco AUTOMOC - SOURCES jabberdisco.cpp - LINK - jabberclient-static - iris_xmpp_core-static iris_xmpp_im-static iris_jabber-static iris-static - qca-static cutestuff_network-static cutestuff_util-static kio-shared idn - DESTINATION ${PLUGIN_INSTALL_DIR} -) diff --git a/kopete/protocols/jabber/kioslave/Makefile.am b/kopete/protocols/jabber/kioslave/Makefile.am deleted file mode 100644 index be3b2112..00000000 --- a/kopete/protocols/jabber/kioslave/Makefile.am +++ /dev/null @@ -1,25 +0,0 @@ -METASOURCES = AUTO - -INCLUDES = \ - -I$(srcdir)/.. \ - -I$(srcdir)/../libiris/iris/include \ - -I$(srcdir)/../libiris/iris/xmpp-im \ - -I$(srcdir)/../libiris/iris/jabber \ - -I$(srcdir)/../libiris/qca/src \ - -I$(srcdir)/../libiris/cutestuff/util \ - -I$(srcdir)/../libiris/cutestuff/network \ - $(all_includes) - -kde_module_LTLIBRARIES = kio_jabberdisco.la - -kio_jabberdisco_la_SOURCES = jabberdisco.cpp -kio_jabberdisco_la_LIBADD = ../libjabberclient.la ../libiris/qca/src/libqca.la ../libiris/iris/include/libiris.la ../libiris/iris/xmpp-im/libiris_xmpp_im.la ../libiris/iris/xmpp-core/libiris_xmpp_core.la ../libiris/iris/jabber/libiris_jabber.la ../libiris/cutestuff/util/libcutestuff_util.la ../libiris/cutestuff/network/libcutestuff_network.la $(LIB_KIO) -kio_jabberdisco_la_LDFLAGS = -no-undefined -module $(KDE_PLUGIN) $(all_libraries) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor - -noinst_HEADERS = jabberdisco.h - -protocol_DATA = jabberdisco.protocol -protocoldir = $(kde_servicesdir) - -messages: rc.cpp - $(XGETTEXT) *.cpp -o $(podir)/kio_jabberdisco.pot diff --git a/kopete/protocols/jabber/kioslave/jabberdisco.cpp b/kopete/protocols/jabber/kioslave/jabberdisco.cpp deleted file mode 100644 index 311cfafd..00000000 --- a/kopete/protocols/jabber/kioslave/jabberdisco.cpp +++ /dev/null @@ -1,399 +0,0 @@ - -/*************************************************************************** - Jabber Service Discovery KIO Slave - ------------------- - begin : Wed June 1 2005 - copyright : (C) 2005 by Till Gerken - - Kopete (C) 2001-2005 Kopete developers - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#include - -#include "jabberdisco.h" - -#include -#include -#include -#include -#include -#include -#include - -#include -#include "jabberclient.h" - -JabberDiscoProtocol::JabberDiscoProtocol ( const TQCString &pool_socket, const TQCString &app_socket ) - : TDEIO::SlaveBase ( "kio_jabberdisco", pool_socket, app_socket ) -{ - kdDebug ( JABBER_DISCO_DEBUG ) << k_funcinfo << "Slave launched." << endl; - - m_jabberClient = 0l; - m_connected = false; - -} - - -JabberDiscoProtocol::~JabberDiscoProtocol () -{ - kdDebug ( JABBER_DISCO_DEBUG ) << k_funcinfo << "Slave is shutting down." << endl; - - delete m_jabberClient; - -} - -void JabberDiscoProtocol::setHost ( const TQString &host, int port, const TQString &user, const TQString &pass ) -{ - kdDebug ( JABBER_DISCO_DEBUG ) << k_funcinfo << " Host " << host << ", port " << port << ", user " << user << endl; - - m_host = host; - m_port = !port ? 5222 : port; - m_user = TQString(user).replace ( "%", "@" ); - m_password = pass; - -} - -void JabberDiscoProtocol::openConnection () -{ - kdDebug ( JABBER_DISCO_DEBUG ) << k_funcinfo << endl; - - if ( m_connected ) - { - return; - } - - // instantiate new client backend or clean up old one - if ( !m_jabberClient ) - { - m_jabberClient = new JabberClient; - - TQObject::connect ( m_jabberClient, TQT_SIGNAL ( csDisconnected () ), this, TQT_SLOT ( slotCSDisconnected () ) ); - TQObject::connect ( m_jabberClient, TQT_SIGNAL ( csError ( int ) ), this, TQT_SLOT ( slotCSError ( int ) ) ); - TQObject::connect ( m_jabberClient, TQT_SIGNAL ( tlsWarning ( int ) ), this, TQT_SLOT ( slotHandleTLSWarning ( int ) ) ); - TQObject::connect ( m_jabberClient, TQT_SIGNAL ( connected () ), this, TQT_SLOT ( slotConnected () ) ); - TQObject::connect ( m_jabberClient, TQT_SIGNAL ( error ( JabberClient::ErrorCode ) ), this, TQT_SLOT ( slotClientError ( JabberClient::ErrorCode ) ) ); - - TQObject::connect ( m_jabberClient, TQT_SIGNAL ( debugMessage ( const TQString & ) ), - this, TQT_SLOT ( slotClientDebugMessage ( const TQString & ) ) ); - } - else - { - m_jabberClient->disconnect (); - } - - // we need to use the old protocol for now - m_jabberClient->setUseXMPP09 ( true ); - - // set SSL flag (this should be converted to forceTLS when using the new protocol) - m_jabberClient->setUseSSL ( false ); - - // override server and port (this should be dropped when using the new protocol and no direct SSL) - m_jabberClient->setOverrideHost ( true, m_host, m_port ); - - // allow plaintext password authentication or not? - m_jabberClient->setAllowPlainTextPassword ( false ); - - switch ( m_jabberClient->connect ( XMPP::Jid ( m_user + TQString("/") + "JabberBrowser" ), m_password ) ) - { - case JabberClient::NoTLS: - // no SSL support, at the connecting stage this means the problem is client-side - error ( TDEIO::ERR_UPGRADE_REQUIRED, i18n ( "TLS" ) ); - break; - - case JabberClient::Ok: - default: - // everything alright! - kdDebug ( JABBER_DISCO_DEBUG ) << k_funcinfo << "Waiting for socket to open..." << endl; - break; - } - - connected (); - -} - -void JabberDiscoProtocol::closeConnection () -{ - kdDebug ( JABBER_DISCO_DEBUG ) << k_funcinfo << endl; - - if ( m_jabberClient ) - { - m_jabberClient->disconnect (); - } - -} - -void JabberDiscoProtocol::slave_status () -{ - kdDebug ( JABBER_DISCO_DEBUG ) << k_funcinfo << endl; - - slaveStatus ( m_host, m_connected ); - -} - -void JabberDiscoProtocol::get ( const KURL &url ) -{ - kdDebug ( JABBER_DISCO_DEBUG ) << k_funcinfo << endl; - - m_command = Get; - m_url = url; - - mimeType ( "inode/directory" ); - - finished (); - -} - -void JabberDiscoProtocol::listDir ( const KURL &url ) -{ - kdDebug ( JABBER_DISCO_DEBUG ) << k_funcinfo << endl; - - m_command = ListDir; - m_url = url; - - openConnection (); - -} - -void JabberDiscoProtocol::mimetype ( const KURL &/*url*/ ) -{ - kdDebug ( JABBER_DISCO_DEBUG ) << k_funcinfo << endl; - - mimeType("inode/directory"); - - finished (); - -} - -void JabberDiscoProtocol::slotClientDebugMessage ( const TQString &msg ) -{ - - kdDebug ( JABBER_DISCO_DEBUG ) << k_funcinfo << msg << endl; - -} - -void JabberDiscoProtocol::slotHandleTLSWarning ( int validityResult ) -{ - kdDebug ( JABBER_DISCO_DEBUG ) << k_funcinfo << "Handling TLS warning..." << endl; - - if ( messageBox ( TDEIO::SlaveBase::WarningContinueCancel, - i18n ( "The server certificate is invalid. Do you want to continue? " ), - i18n ( "Certificate Warning" ) ) == KMessageBox::Continue ) - { - // resume stream - m_jabberClient->continueAfterTLSWarning (); - } - else - { - // disconnect stream - closeConnection (); - } - -} - -void JabberDiscoProtocol::slotClientError ( JabberClient::ErrorCode errorCode ) -{ - kdDebug ( JABBER_DISCO_DEBUG ) << k_funcinfo << "Handling client error..." << endl; - - switch ( errorCode ) - { - case JabberClient::NoTLS: - default: - error ( TDEIO::ERR_UPGRADE_REQUIRED, i18n ( "TLS" ) ); - closeConnection (); - break; - } - -} - -void JabberDiscoProtocol::slotConnected () -{ - kdDebug ( JABBER_DISCO_DEBUG ) << k_funcinfo << "Connected to Jabber server." << endl; - - XMPP::JT_DiscoItems *discoTask; - - m_connected = true; - - // now execute command - switch ( m_command ) - { - case ListDir: // list a directory - kdDebug ( JABBER_DISCO_DEBUG ) << k_funcinfo << "Listing directory..." << endl; - discoTask = new XMPP::JT_DiscoItems ( m_jabberClient->rootTask () ); - connect ( discoTask, TQT_SIGNAL ( finished () ), this, TQT_SLOT ( slotQueryFinished () ) ); - discoTask->get ( m_host ); - discoTask->go ( true ); - break; - - case Get: // retrieve an item - kdDebug ( JABBER_DISCO_DEBUG ) << k_funcinfo << "Retrieving item..." << endl; - break; - - default: // do nothing by default - kdDebug ( JABBER_DISCO_DEBUG ) << k_funcinfo << "Unknown command " << m_command << endl; - break; - } - -} - -void JabberDiscoProtocol::slotQueryFinished () -{ - kdDebug ( JABBER_DISCO_DEBUG ) << "Query task finished" << endl; - - XMPP::JT_DiscoItems * task = (XMPP::JT_DiscoItems *) sender (); - - if (!task->success ()) - { - error ( TDEIO::ERR_COULD_NOT_READ, "" ); - return; - } - - XMPP::DiscoList::const_iterator itemsEnd = task->items().end (); - for (XMPP::DiscoList::const_iterator it = task->items().begin (); it != itemsEnd; ++it) - { - TDEIO::UDSAtom atom; - TDEIO::UDSEntry entry; - - atom.m_uds = TDEIO::UDS_NAME; - atom.m_str = (*it).jid().userHost (); - entry.prepend ( atom ); - - atom.m_uds = TDEIO::UDS_SIZE; - atom.m_long = 0; - entry.prepend ( atom ); - - atom.m_uds = TDEIO::UDS_LINK_DEST; - atom.m_str = (*it).name (); - entry.prepend ( atom ); - - atom.m_uds = TDEIO::UDS_MIME_TYPE; - atom.m_str = "inode/directory"; - entry.prepend ( atom ); - - atom.m_uds = TDEIO::UDS_SIZE; - atom.m_long = 0; - entry.prepend ( atom ); - - listEntry ( entry, false ); - - } - - listEntry ( TDEIO::UDSEntry(), true ); - - finished (); - -} - -void JabberDiscoProtocol::slotCSDisconnected () -{ - kdDebug ( JABBER_DISCO_DEBUG ) << k_funcinfo << "Disconnected from Jabber server." << endl; - - /* - * We should delete the JabberClient instance here, - * but timers etc prevent us from doing so. Iris does - * not like to be deleted from a slot. - */ - m_connected = false; - -} - -void JabberDiscoProtocol::slotCSError ( int errorCode ) -{ - kdDebug ( JABBER_DISCO_DEBUG ) << k_funcinfo << "Error in stream signalled." << endl; - - if ( ( errorCode == XMPP::ClientStream::ErrAuth ) - && ( m_jabberClient->clientStream()->errorCondition () == XMPP::ClientStream::NotAuthorized ) ) - { - kdDebug ( JABBER_DISCO_DEBUG ) << k_funcinfo << "Incorrect password, retrying." << endl; - - TDEIO::AuthInfo authInfo; - authInfo.username = m_user; - authInfo.password = m_password; - if ( openPassDlg ( authInfo, i18n ( "The login details are incorrect. Do you want to try again?" ) ) ) - { - m_user = authInfo.username; - m_password = authInfo.password; - closeConnection (); - openConnection (); - } - else - { - closeConnection (); - error ( TDEIO::ERR_COULD_NOT_AUTHENTICATE, "" ); - } - } - else - { - closeConnection (); - error ( TDEIO::ERR_CONNECTION_BROKEN, "" ); - } - -} - -bool breakEventLoop = false; - -class EventLoopThread : public TQThread -{ -public: - void run (); -}; - -void EventLoopThread::run () -{ - - while ( true ) - { - tqApp->processEvents (); - msleep ( 100 ); - - if ( breakEventLoop ) - break; - } - -} - -void JabberDiscoProtocol::dispatchLoop () -{ - - EventLoopThread eventLoopThread; - - eventLoopThread.start (); - SlaveBase::dispatchLoop (); - breakEventLoop = true; - eventLoopThread.wait (); - -} - -extern "C" -{ - KDE_EXPORT int kdemain(int argc, char **argv); -} - - -int kdemain ( int argc, char **argv ) -{ - TDEApplication app(argc, argv, "kio_jabberdisco", false, true); - - kdDebug(JABBER_DISCO_DEBUG) << k_funcinfo << endl; - - if ( argc != 4 ) - { - kdDebug(JABBER_DISCO_DEBUG) << "Usage: kio_jabberdisco protocol domain-socket1 domain-socket2" << endl; - exit(-1); - } - - JabberDiscoProtocol slave ( argv[2], argv[3] ); - slave.dispatchLoop (); - - return 0; -} - -#include "jabberdisco.moc" diff --git a/kopete/protocols/jabber/kioslave/jabberdisco.h b/kopete/protocols/jabber/kioslave/jabberdisco.h deleted file mode 100644 index 660ba269..00000000 --- a/kopete/protocols/jabber/kioslave/jabberdisco.h +++ /dev/null @@ -1,83 +0,0 @@ - -/*************************************************************************** - Jabber Service Discovery KIO Slave - ------------------- - begin : Wed June 1 2005 - copyright : (C) 2005 by Till Gerken - - Kopete (C) 2001-2005 Kopete developers - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef _JABBERDISCO_H_ -#define _JABBERDISCO_H_ - -#include -#include -#include - -#include -#include -#include -#include - -#define JABBER_DISCO_DEBUG 0 - -class JabberClient; - -class JabberDiscoProtocol : public TQObject, public TDEIO::SlaveBase -{ - -Q_OBJECT - - -public: - JabberDiscoProtocol ( const TQCString &pool_socket, const TQCString &app_socket ); - virtual ~JabberDiscoProtocol (); - - void setHost ( const TQString &host, int port, const TQString &user, const TQString &pass ); - - void openConnection (); - void closeConnection (); - - void slave_status (); - - void get ( const KURL &url ); - void listDir ( const KURL &url ); - void mimetype ( const KURL &url ); - - void dispatchLoop (); - -private slots: - void slotClientDebugMessage ( const TQString &msg ); - void slotHandleTLSWarning ( int validityResult ); - void slotClientError ( JabberClient::ErrorCode errorCode ); - void slotConnected (); - void slotCSDisconnected (); - void slotCSError ( int error ); - - void slotQueryFinished (); - -private: - enum CommandType { Get, ListDir }; - - TQString m_host, m_user, m_password; - int m_port; - KURL m_url; - bool m_connected; - - CommandType m_command; - - JabberClient *m_jabberClient; - -}; - -#endif diff --git a/kopete/protocols/jabber/kioslave/jabberdisco.protocol b/kopete/protocols/jabber/kioslave/jabberdisco.protocol deleted file mode 100644 index 01237e73..00000000 --- a/kopete/protocols/jabber/kioslave/jabberdisco.protocol +++ /dev/null @@ -1,53 +0,0 @@ -[Protocol] -exec=kio_jabberdisco -protocol=jabber -input=none -output=filesystem -reading=true -writing=false -makedir=false -linking=false -moving=false -Icon=remote -Description=A KIO slave for Jabber Service Discovery -Description[be]=Модуль kioslave для пошуку сервісаў Jabber -Description[bn]=Jabber সার্ভিস ডিসকভারির জন্য একটি কে-আই-ও স্লেভ -Description[bs]=KIO slave za otkrivanje Jabber servisa -Description[ca]=Un esclau KIO pel servei de de descoberta del Jabber -Description[cs]=Pomocný protokol pro zjišťování služeb Jabber -Description[da]=En kioslave til at opdage jabber service -Description[de]=Ein Ein-/Ausgabemodul zum Auffinden von Jabber-Diensten -Description[el]=Ένα kioslave για την ανίχνευση υπηρεσίας Jabber -Description[es]=Un «kioslave» para el servicio de descubrimiento jabber -Description[et]=Jabberi teenuste tuvastamise KIO-moodul -Description[eu]=Jabber aurkikuntza zerbitzureako KIO morroi bat -Description[fa]=یک پیرو KIO برای خدمت اکتشافی Jabber -Description[fr]=Un module d'entrée / sortie pour la recherche de service Jabber -Description[gl]=Un KIO slave para Jabber Service Discovery -Description[hu]=KDE-protokoll a Jabber szolgáltatáskereső használatához -Description[is]=kioslave fyrir Jabber þjónustu uppgötvun -Description[it]=Un KIO slave per il servizio di discovery per Jabber -Description[ja]=Jabber Service Discovery の KIO スレーブ -Description[ka]=KIO slave Jabber სერვისის დირექტორიისთვის -Description[kk]=Jabber қызметін байқау KIO slave қызметі -Description[km]=KIO slave មួយ​សម្រាប់​របក​គំហើញ​សេវា Jabber -Description[lt]=Priedas (kioslave) FISH protokolui -Description[nb]=En kioslave for Jabber tjenestesøk -Description[nds]=En In-/Utgaavmoduul för't Finnen vun Jabber-Deensten -Description[ne]=ज्याबर सेवा खोजीका लागि कियो स्लाभ -Description[nl]=Een kioslave voor Jabber Service Discovery -Description[nn]=Ein KIO-slave for Jabber-tenesteoppdaging -Description[pl]=Wtyczka protokołu KIO dla usługi odkrywania usług Jabbera (Jabber Service Discovery) -Description[pt]=Um 'kioslave' para a Descoberta de Serviços do Jabber -Description[pt_BR]=Um KIO-Slave para a descoberta de serviço do Jabber -Description[ru]=Обработчик KIO для обнаружения служб Jabber -Description[sk]=KIO otrok pre Jabber Service Discovery -Description[sl]=KIO slave za odkrivanje storitev za Jabber -Description[sr]=KIO слуга за Jabber Service Discovery -Description[sr@Latn]=KIO sluga za Jabber Service Discovery -Description[sv]=En I/O-slav för Jabber tjänstupptäckt -Description[tr]=Jabber Servis Bulucu için KIOSlave -Description[uk]=Підлеглий В/В для виявлення служби Jabber -Description[zh_CN]=Jabber 服务发现的 KIO slave -Description[zh_HK]=用於發現 Jabber 服務的 KIO slave -Description[zh_TW]=Jabber 服務的 kioslave diff --git a/kopete/protocols/jabber/tdeioslave/CMakeLists.txt b/kopete/protocols/jabber/tdeioslave/CMakeLists.txt new file mode 100644 index 00000000..aaf788bd --- /dev/null +++ b/kopete/protocols/jabber/tdeioslave/CMakeLists.txt @@ -0,0 +1,42 @@ +################################################# +# +# (C) 2010-2011 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +include_directories( + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/.. + ${CMAKE_CURRENT_SOURCE_DIR}/../libiris/iris/include + ${CMAKE_CURRENT_SOURCE_DIR}/../libiris/iris/jabber + ${CMAKE_CURRENT_SOURCE_DIR}/../libiris/iris/xmpp-im + ${CMAKE_CURRENT_SOURCE_DIR}/../libiris/cutestuff/util + ${TDE_INCLUDE_DIR} + ${TQT_INCLUDE_DIRS} +) + +link_directories( + ${TQT_LIBRARY_DIRS} +) + + +##### other data ################################ + +install( FILES jabberdisco.protocol DESTINATION ${SERVICES_INSTALL_DIR} ) + + +##### kio_jabberdisco (module) ################## + +tde_add_kpart( kio_jabberdisco AUTOMOC + SOURCES jabberdisco.cpp + LINK + jabberclient-static + iris_xmpp_core-static iris_xmpp_im-static iris_jabber-static iris-static + qca-static cutestuff_network-static cutestuff_util-static tdeio-shared idn + DESTINATION ${PLUGIN_INSTALL_DIR} +) diff --git a/kopete/protocols/jabber/tdeioslave/Makefile.am b/kopete/protocols/jabber/tdeioslave/Makefile.am new file mode 100644 index 00000000..f8b9c651 --- /dev/null +++ b/kopete/protocols/jabber/tdeioslave/Makefile.am @@ -0,0 +1,25 @@ +METASOURCES = AUTO + +INCLUDES = \ + -I$(srcdir)/.. \ + -I$(srcdir)/../libiris/iris/include \ + -I$(srcdir)/../libiris/iris/xmpp-im \ + -I$(srcdir)/../libiris/iris/jabber \ + -I$(srcdir)/../libiris/qca/src \ + -I$(srcdir)/../libiris/cutestuff/util \ + -I$(srcdir)/../libiris/cutestuff/network \ + $(all_includes) + +kde_module_LTLIBRARIES = kio_jabberdisco.la + +kio_jabberdisco_la_SOURCES = jabberdisco.cpp +kio_jabberdisco_la_LIBADD = ../libjabberclient.la ../libiris/qca/src/libqca.la ../libiris/iris/include/libiris.la ../libiris/iris/xmpp-im/libiris_xmpp_im.la ../libiris/iris/xmpp-core/libiris_xmpp_core.la ../libiris/iris/jabber/libiris_jabber.la ../libiris/cutestuff/util/libcutestuff_util.la ../libiris/cutestuff/network/libcutestuff_network.la $(LIB_KIO) +kio_jabberdisco_la_LDFLAGS = -no-undefined -module $(KDE_PLUGIN) $(all_libraries) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor + +noinst_HEADERS = jabberdisco.h + +protocol_DATA = jabberdisco.protocol +protocoldir = $(kde_servicesdir) + +messages: rc.cpp + $(XGETTEXT) *.cpp -o $(podir)/tdeio_jabberdisco.pot diff --git a/kopete/protocols/jabber/tdeioslave/jabberdisco.cpp b/kopete/protocols/jabber/tdeioslave/jabberdisco.cpp new file mode 100644 index 00000000..311cfafd --- /dev/null +++ b/kopete/protocols/jabber/tdeioslave/jabberdisco.cpp @@ -0,0 +1,399 @@ + +/*************************************************************************** + Jabber Service Discovery KIO Slave + ------------------- + begin : Wed June 1 2005 + copyright : (C) 2005 by Till Gerken + + Kopete (C) 2001-2005 Kopete developers + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include + +#include "jabberdisco.h" + +#include +#include +#include +#include +#include +#include +#include + +#include +#include "jabberclient.h" + +JabberDiscoProtocol::JabberDiscoProtocol ( const TQCString &pool_socket, const TQCString &app_socket ) + : TDEIO::SlaveBase ( "kio_jabberdisco", pool_socket, app_socket ) +{ + kdDebug ( JABBER_DISCO_DEBUG ) << k_funcinfo << "Slave launched." << endl; + + m_jabberClient = 0l; + m_connected = false; + +} + + +JabberDiscoProtocol::~JabberDiscoProtocol () +{ + kdDebug ( JABBER_DISCO_DEBUG ) << k_funcinfo << "Slave is shutting down." << endl; + + delete m_jabberClient; + +} + +void JabberDiscoProtocol::setHost ( const TQString &host, int port, const TQString &user, const TQString &pass ) +{ + kdDebug ( JABBER_DISCO_DEBUG ) << k_funcinfo << " Host " << host << ", port " << port << ", user " << user << endl; + + m_host = host; + m_port = !port ? 5222 : port; + m_user = TQString(user).replace ( "%", "@" ); + m_password = pass; + +} + +void JabberDiscoProtocol::openConnection () +{ + kdDebug ( JABBER_DISCO_DEBUG ) << k_funcinfo << endl; + + if ( m_connected ) + { + return; + } + + // instantiate new client backend or clean up old one + if ( !m_jabberClient ) + { + m_jabberClient = new JabberClient; + + TQObject::connect ( m_jabberClient, TQT_SIGNAL ( csDisconnected () ), this, TQT_SLOT ( slotCSDisconnected () ) ); + TQObject::connect ( m_jabberClient, TQT_SIGNAL ( csError ( int ) ), this, TQT_SLOT ( slotCSError ( int ) ) ); + TQObject::connect ( m_jabberClient, TQT_SIGNAL ( tlsWarning ( int ) ), this, TQT_SLOT ( slotHandleTLSWarning ( int ) ) ); + TQObject::connect ( m_jabberClient, TQT_SIGNAL ( connected () ), this, TQT_SLOT ( slotConnected () ) ); + TQObject::connect ( m_jabberClient, TQT_SIGNAL ( error ( JabberClient::ErrorCode ) ), this, TQT_SLOT ( slotClientError ( JabberClient::ErrorCode ) ) ); + + TQObject::connect ( m_jabberClient, TQT_SIGNAL ( debugMessage ( const TQString & ) ), + this, TQT_SLOT ( slotClientDebugMessage ( const TQString & ) ) ); + } + else + { + m_jabberClient->disconnect (); + } + + // we need to use the old protocol for now + m_jabberClient->setUseXMPP09 ( true ); + + // set SSL flag (this should be converted to forceTLS when using the new protocol) + m_jabberClient->setUseSSL ( false ); + + // override server and port (this should be dropped when using the new protocol and no direct SSL) + m_jabberClient->setOverrideHost ( true, m_host, m_port ); + + // allow plaintext password authentication or not? + m_jabberClient->setAllowPlainTextPassword ( false ); + + switch ( m_jabberClient->connect ( XMPP::Jid ( m_user + TQString("/") + "JabberBrowser" ), m_password ) ) + { + case JabberClient::NoTLS: + // no SSL support, at the connecting stage this means the problem is client-side + error ( TDEIO::ERR_UPGRADE_REQUIRED, i18n ( "TLS" ) ); + break; + + case JabberClient::Ok: + default: + // everything alright! + kdDebug ( JABBER_DISCO_DEBUG ) << k_funcinfo << "Waiting for socket to open..." << endl; + break; + } + + connected (); + +} + +void JabberDiscoProtocol::closeConnection () +{ + kdDebug ( JABBER_DISCO_DEBUG ) << k_funcinfo << endl; + + if ( m_jabberClient ) + { + m_jabberClient->disconnect (); + } + +} + +void JabberDiscoProtocol::slave_status () +{ + kdDebug ( JABBER_DISCO_DEBUG ) << k_funcinfo << endl; + + slaveStatus ( m_host, m_connected ); + +} + +void JabberDiscoProtocol::get ( const KURL &url ) +{ + kdDebug ( JABBER_DISCO_DEBUG ) << k_funcinfo << endl; + + m_command = Get; + m_url = url; + + mimeType ( "inode/directory" ); + + finished (); + +} + +void JabberDiscoProtocol::listDir ( const KURL &url ) +{ + kdDebug ( JABBER_DISCO_DEBUG ) << k_funcinfo << endl; + + m_command = ListDir; + m_url = url; + + openConnection (); + +} + +void JabberDiscoProtocol::mimetype ( const KURL &/*url*/ ) +{ + kdDebug ( JABBER_DISCO_DEBUG ) << k_funcinfo << endl; + + mimeType("inode/directory"); + + finished (); + +} + +void JabberDiscoProtocol::slotClientDebugMessage ( const TQString &msg ) +{ + + kdDebug ( JABBER_DISCO_DEBUG ) << k_funcinfo << msg << endl; + +} + +void JabberDiscoProtocol::slotHandleTLSWarning ( int validityResult ) +{ + kdDebug ( JABBER_DISCO_DEBUG ) << k_funcinfo << "Handling TLS warning..." << endl; + + if ( messageBox ( TDEIO::SlaveBase::WarningContinueCancel, + i18n ( "The server certificate is invalid. Do you want to continue? " ), + i18n ( "Certificate Warning" ) ) == KMessageBox::Continue ) + { + // resume stream + m_jabberClient->continueAfterTLSWarning (); + } + else + { + // disconnect stream + closeConnection (); + } + +} + +void JabberDiscoProtocol::slotClientError ( JabberClient::ErrorCode errorCode ) +{ + kdDebug ( JABBER_DISCO_DEBUG ) << k_funcinfo << "Handling client error..." << endl; + + switch ( errorCode ) + { + case JabberClient::NoTLS: + default: + error ( TDEIO::ERR_UPGRADE_REQUIRED, i18n ( "TLS" ) ); + closeConnection (); + break; + } + +} + +void JabberDiscoProtocol::slotConnected () +{ + kdDebug ( JABBER_DISCO_DEBUG ) << k_funcinfo << "Connected to Jabber server." << endl; + + XMPP::JT_DiscoItems *discoTask; + + m_connected = true; + + // now execute command + switch ( m_command ) + { + case ListDir: // list a directory + kdDebug ( JABBER_DISCO_DEBUG ) << k_funcinfo << "Listing directory..." << endl; + discoTask = new XMPP::JT_DiscoItems ( m_jabberClient->rootTask () ); + connect ( discoTask, TQT_SIGNAL ( finished () ), this, TQT_SLOT ( slotQueryFinished () ) ); + discoTask->get ( m_host ); + discoTask->go ( true ); + break; + + case Get: // retrieve an item + kdDebug ( JABBER_DISCO_DEBUG ) << k_funcinfo << "Retrieving item..." << endl; + break; + + default: // do nothing by default + kdDebug ( JABBER_DISCO_DEBUG ) << k_funcinfo << "Unknown command " << m_command << endl; + break; + } + +} + +void JabberDiscoProtocol::slotQueryFinished () +{ + kdDebug ( JABBER_DISCO_DEBUG ) << "Query task finished" << endl; + + XMPP::JT_DiscoItems * task = (XMPP::JT_DiscoItems *) sender (); + + if (!task->success ()) + { + error ( TDEIO::ERR_COULD_NOT_READ, "" ); + return; + } + + XMPP::DiscoList::const_iterator itemsEnd = task->items().end (); + for (XMPP::DiscoList::const_iterator it = task->items().begin (); it != itemsEnd; ++it) + { + TDEIO::UDSAtom atom; + TDEIO::UDSEntry entry; + + atom.m_uds = TDEIO::UDS_NAME; + atom.m_str = (*it).jid().userHost (); + entry.prepend ( atom ); + + atom.m_uds = TDEIO::UDS_SIZE; + atom.m_long = 0; + entry.prepend ( atom ); + + atom.m_uds = TDEIO::UDS_LINK_DEST; + atom.m_str = (*it).name (); + entry.prepend ( atom ); + + atom.m_uds = TDEIO::UDS_MIME_TYPE; + atom.m_str = "inode/directory"; + entry.prepend ( atom ); + + atom.m_uds = TDEIO::UDS_SIZE; + atom.m_long = 0; + entry.prepend ( atom ); + + listEntry ( entry, false ); + + } + + listEntry ( TDEIO::UDSEntry(), true ); + + finished (); + +} + +void JabberDiscoProtocol::slotCSDisconnected () +{ + kdDebug ( JABBER_DISCO_DEBUG ) << k_funcinfo << "Disconnected from Jabber server." << endl; + + /* + * We should delete the JabberClient instance here, + * but timers etc prevent us from doing so. Iris does + * not like to be deleted from a slot. + */ + m_connected = false; + +} + +void JabberDiscoProtocol::slotCSError ( int errorCode ) +{ + kdDebug ( JABBER_DISCO_DEBUG ) << k_funcinfo << "Error in stream signalled." << endl; + + if ( ( errorCode == XMPP::ClientStream::ErrAuth ) + && ( m_jabberClient->clientStream()->errorCondition () == XMPP::ClientStream::NotAuthorized ) ) + { + kdDebug ( JABBER_DISCO_DEBUG ) << k_funcinfo << "Incorrect password, retrying." << endl; + + TDEIO::AuthInfo authInfo; + authInfo.username = m_user; + authInfo.password = m_password; + if ( openPassDlg ( authInfo, i18n ( "The login details are incorrect. Do you want to try again?" ) ) ) + { + m_user = authInfo.username; + m_password = authInfo.password; + closeConnection (); + openConnection (); + } + else + { + closeConnection (); + error ( TDEIO::ERR_COULD_NOT_AUTHENTICATE, "" ); + } + } + else + { + closeConnection (); + error ( TDEIO::ERR_CONNECTION_BROKEN, "" ); + } + +} + +bool breakEventLoop = false; + +class EventLoopThread : public TQThread +{ +public: + void run (); +}; + +void EventLoopThread::run () +{ + + while ( true ) + { + tqApp->processEvents (); + msleep ( 100 ); + + if ( breakEventLoop ) + break; + } + +} + +void JabberDiscoProtocol::dispatchLoop () +{ + + EventLoopThread eventLoopThread; + + eventLoopThread.start (); + SlaveBase::dispatchLoop (); + breakEventLoop = true; + eventLoopThread.wait (); + +} + +extern "C" +{ + KDE_EXPORT int kdemain(int argc, char **argv); +} + + +int kdemain ( int argc, char **argv ) +{ + TDEApplication app(argc, argv, "kio_jabberdisco", false, true); + + kdDebug(JABBER_DISCO_DEBUG) << k_funcinfo << endl; + + if ( argc != 4 ) + { + kdDebug(JABBER_DISCO_DEBUG) << "Usage: kio_jabberdisco protocol domain-socket1 domain-socket2" << endl; + exit(-1); + } + + JabberDiscoProtocol slave ( argv[2], argv[3] ); + slave.dispatchLoop (); + + return 0; +} + +#include "jabberdisco.moc" diff --git a/kopete/protocols/jabber/tdeioslave/jabberdisco.h b/kopete/protocols/jabber/tdeioslave/jabberdisco.h new file mode 100644 index 00000000..a2bc92a4 --- /dev/null +++ b/kopete/protocols/jabber/tdeioslave/jabberdisco.h @@ -0,0 +1,83 @@ + +/*************************************************************************** + Jabber Service Discovery KIO Slave + ------------------- + begin : Wed June 1 2005 + copyright : (C) 2005 by Till Gerken + + Kopete (C) 2001-2005 Kopete developers + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef _JABBERDISCO_H_ +#define _JABBERDISCO_H_ + +#include +#include +#include + +#include +#include +#include +#include + +#define JABBER_DISCO_DEBUG 0 + +class JabberClient; + +class JabberDiscoProtocol : public TQObject, public TDEIO::SlaveBase +{ + +Q_OBJECT + + +public: + JabberDiscoProtocol ( const TQCString &pool_socket, const TQCString &app_socket ); + virtual ~JabberDiscoProtocol (); + + void setHost ( const TQString &host, int port, const TQString &user, const TQString &pass ); + + void openConnection (); + void closeConnection (); + + void slave_status (); + + void get ( const KURL &url ); + void listDir ( const KURL &url ); + void mimetype ( const KURL &url ); + + void dispatchLoop (); + +private slots: + void slotClientDebugMessage ( const TQString &msg ); + void slotHandleTLSWarning ( int validityResult ); + void slotClientError ( JabberClient::ErrorCode errorCode ); + void slotConnected (); + void slotCSDisconnected (); + void slotCSError ( int error ); + + void slotQueryFinished (); + +private: + enum CommandType { Get, ListDir }; + + TQString m_host, m_user, m_password; + int m_port; + KURL m_url; + bool m_connected; + + CommandType m_command; + + JabberClient *m_jabberClient; + +}; + +#endif diff --git a/kopete/protocols/jabber/tdeioslave/jabberdisco.protocol b/kopete/protocols/jabber/tdeioslave/jabberdisco.protocol new file mode 100644 index 00000000..fcc0161b --- /dev/null +++ b/kopete/protocols/jabber/tdeioslave/jabberdisco.protocol @@ -0,0 +1,53 @@ +[Protocol] +exec=kio_jabberdisco +protocol=jabber +input=none +output=filesystem +reading=true +writing=false +makedir=false +linking=false +moving=false +Icon=remote +Description=A KIO slave for Jabber Service Discovery +Description[be]=Модуль tdeioslave для пошуку сервісаў Jabber +Description[bn]=Jabber সার্ভিস ডিসকভারির জন্য একটি কে-আই-ও স্লেভ +Description[bs]=KIO slave za otkrivanje Jabber servisa +Description[ca]=Un esclau KIO pel servei de de descoberta del Jabber +Description[cs]=Pomocný protokol pro zjišťování služeb Jabber +Description[da]=En tdeioslave til at opdage jabber service +Description[de]=Ein Ein-/Ausgabemodul zum Auffinden von Jabber-Diensten +Description[el]=Ένα tdeioslave για την ανίχνευση υπηρεσίας Jabber +Description[es]=Un «tdeioslave» para el servicio de descubrimiento jabber +Description[et]=Jabberi teenuste tuvastamise KIO-moodul +Description[eu]=Jabber aurkikuntza zerbitzureako KIO morroi bat +Description[fa]=یک پیرو KIO برای خدمت اکتشافی Jabber +Description[fr]=Un module d'entrée / sortie pour la recherche de service Jabber +Description[gl]=Un KIO slave para Jabber Service Discovery +Description[hu]=KDE-protokoll a Jabber szolgáltatáskereső használatához +Description[is]=tdeioslave fyrir Jabber þjónustu uppgötvun +Description[it]=Un KIO slave per il servizio di discovery per Jabber +Description[ja]=Jabber Service Discovery の KIO スレーブ +Description[ka]=KIO slave Jabber სერვისის დირექტორიისთვის +Description[kk]=Jabber қызметін байқау KIO slave қызметі +Description[km]=KIO slave មួយ​សម្រាប់​របក​គំហើញ​សេវា Jabber +Description[lt]=Priedas (tdeioslave) FISH protokolui +Description[nb]=En tdeioslave for Jabber tjenestesøk +Description[nds]=En In-/Utgaavmoduul för't Finnen vun Jabber-Deensten +Description[ne]=ज्याबर सेवा खोजीका लागि कियो स्लाभ +Description[nl]=Een tdeioslave voor Jabber Service Discovery +Description[nn]=Ein KIO-slave for Jabber-tenesteoppdaging +Description[pl]=Wtyczka protokołu KIO dla usługi odkrywania usług Jabbera (Jabber Service Discovery) +Description[pt]=Um 'tdeioslave' para a Descoberta de Serviços do Jabber +Description[pt_BR]=Um KIO-Slave para a descoberta de serviço do Jabber +Description[ru]=Обработчик KIO для обнаружения служб Jabber +Description[sk]=KIO otrok pre Jabber Service Discovery +Description[sl]=KIO slave za odkrivanje storitev za Jabber +Description[sr]=KIO слуга за Jabber Service Discovery +Description[sr@Latn]=KIO sluga za Jabber Service Discovery +Description[sv]=En I/O-slav för Jabber tjänstupptäckt +Description[tr]=Jabber Servis Bulucu için KIOSlave +Description[uk]=Підлеглий В/В для виявлення служби Jabber +Description[zh_CN]=Jabber 服务发现的 KIO slave +Description[zh_HK]=用於發現 Jabber 服務的 KIO slave +Description[zh_TW]=Jabber 服務的 tdeioslave diff --git a/kopete/protocols/jabber/ui/dlgjabbervcard.cpp b/kopete/protocols/jabber/ui/dlgjabbervcard.cpp index 2da7740e..34a2eb35 100644 --- a/kopete/protocols/jabber/ui/dlgjabbervcard.cpp +++ b/kopete/protocols/jabber/ui/dlgjabbervcard.cpp @@ -36,8 +36,8 @@ #include #include #include -#include -#include +#include +#include #include #include diff --git a/kopete/protocols/jabber/ui/jabberchooseserver.cpp b/kopete/protocols/jabber/ui/jabberchooseserver.cpp index a9a00689..77356c55 100644 --- a/kopete/protocols/jabber/ui/jabberchooseserver.cpp +++ b/kopete/protocols/jabber/ui/jabberchooseserver.cpp @@ -21,9 +21,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include #include #include "jabberprotocol.h" diff --git a/kopete/protocols/jabber/ui/jabbereditaccountwidget.cpp b/kopete/protocols/jabber/ui/jabbereditaccountwidget.cpp index 71ad871f..a07c8f1d 100644 --- a/kopete/protocols/jabber/ui/jabbereditaccountwidget.cpp +++ b/kopete/protocols/jabber/ui/jabbereditaccountwidget.cpp @@ -25,7 +25,7 @@ #include #include -#include +#include #include #include #include diff --git a/kopete/protocols/meanwhile/meanwhileaccount.cpp b/kopete/protocols/meanwhile/meanwhileaccount.cpp index 03f8e008..dc66a0cf 100644 --- a/kopete/protocols/meanwhile/meanwhileaccount.cpp +++ b/kopete/protocols/meanwhile/meanwhileaccount.cpp @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include "kopeteaway.h" #include #include diff --git a/kopete/protocols/msn/config/CMakeLists.txt b/kopete/protocols/msn/config/CMakeLists.txt index 7e0d1337..d9fd401b 100644 --- a/kopete/protocols/msn/config/CMakeLists.txt +++ b/kopete/protocols/msn/config/CMakeLists.txt @@ -25,7 +25,7 @@ link_directories( install( FILES kopete_msn_config.desktop - DESTINATION ${SERVICES_INSTALL_DIR}/kconfiguredialog ) + DESTINATION ${SERVICES_INSTALL_DIR}/tdeconfiguredialog ) ##### kcm_kopete_msn (module) ################### diff --git a/kopete/protocols/msn/config/Makefile.am b/kopete/protocols/msn/config/Makefile.am index b5e2026a..f01cb0f1 100644 --- a/kopete/protocols/msn/config/Makefile.am +++ b/kopete/protocols/msn/config/Makefile.am @@ -8,5 +8,5 @@ kcm_kopete_msn_la_LDFLAGS = -no-undefined -module $(KDE_PLUGIN) $(all_libraries) kcm_kopete_msn_la_LIBADD = ../../../libkopete/libkopete.la $(LIB_KUTILS) service_DATA = kopete_msn_config.desktop -servicedir = $(kde_servicesdir)/kconfiguredialog +servicedir = $(kde_servicesdir)/tdeconfiguredialog diff --git a/kopete/protocols/msn/msnaccount.cpp b/kopete/protocols/msn/msnaccount.cpp index 58072441..39033752 100644 --- a/kopete/protocols/msn/msnaccount.cpp +++ b/kopete/protocols/msn/msnaccount.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include #include diff --git a/kopete/protocols/msn/msnchatsession.cpp b/kopete/protocols/msn/msnchatsession.cpp index df621d65..487f4aaa 100644 --- a/kopete/protocols/msn/msnchatsession.cpp +++ b/kopete/protocols/msn/msnchatsession.cpp @@ -24,7 +24,7 @@ #include -#include +#include #include #include #include diff --git a/kopete/protocols/msn/msncontact.cpp b/kopete/protocols/msn/msncontact.cpp index 84333bcf..c487f1df 100644 --- a/kopete/protocols/msn/msncontact.cpp +++ b/kopete/protocols/msn/msncontact.cpp @@ -26,17 +26,17 @@ #undef KDE_NO_COMPAT #include #include -#include +#include #include #include #include #include #include #include -#include +#include #include #include -#include +#include #include "kopetecontactlist.h" #include "kopetechatsessionmanager.h" diff --git a/kopete/protocols/msn/msnfiletransfersocket.cpp b/kopete/protocols/msn/msnfiletransfersocket.cpp index cfe74905..3c480092 100644 --- a/kopete/protocols/msn/msnfiletransfersocket.cpp +++ b/kopete/protocols/msn/msnfiletransfersocket.cpp @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include "kopetetransfermanager.h" diff --git a/kopete/protocols/msn/msnnotifysocket.cpp b/kopete/protocols/msn/msnnotifysocket.cpp index 1093370a..5f20d9ca 100644 --- a/kopete/protocols/msn/msnnotifysocket.cpp +++ b/kopete/protocols/msn/msnnotifysocket.cpp @@ -40,9 +40,9 @@ #include #include #include -#include +#include #include -#include +#include #include #include "kopeteuiglobal.h" diff --git a/kopete/protocols/msn/msnprotocol.cpp b/kopete/protocols/msn/msnprotocol.cpp index 9ef32e04..cab1407d 100644 --- a/kopete/protocols/msn/msnprotocol.cpp +++ b/kopete/protocols/msn/msnprotocol.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include diff --git a/kopete/protocols/msn/msnsecureloginhandler.cpp b/kopete/protocols/msn/msnsecureloginhandler.cpp index 58f4f66f..f8431f9f 100644 --- a/kopete/protocols/msn/msnsecureloginhandler.cpp +++ b/kopete/protocols/msn/msnsecureloginhandler.cpp @@ -20,7 +20,7 @@ #include // KDE includes -#include +#include #include #include diff --git a/kopete/protocols/msn/msnsocket.cpp b/kopete/protocols/msn/msnsocket.cpp index 2496006b..32b3d17a 100644 --- a/kopete/protocols/msn/msnsocket.cpp +++ b/kopete/protocols/msn/msnsocket.cpp @@ -27,7 +27,7 @@ #include #include -#include +#include #include #include #include diff --git a/kopete/protocols/msn/msnswitchboardsocket.cpp b/kopete/protocols/msn/msnswitchboardsocket.cpp index 7239e54f..9dc475ab 100644 --- a/kopete/protocols/msn/msnswitchboardsocket.cpp +++ b/kopete/protocols/msn/msnswitchboardsocket.cpp @@ -39,7 +39,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/kopete/protocols/msn/ui/msneditaccountwidget.cpp b/kopete/protocols/msn/ui/msneditaccountwidget.cpp index 57764d14..57022e6d 100644 --- a/kopete/protocols/msn/ui/msneditaccountwidget.cpp +++ b/kopete/protocols/msn/ui/msneditaccountwidget.cpp @@ -31,15 +31,15 @@ #include #include -#include +#include #include #include #include -#include +#include #include #include #include -#include +#include #include #include "kopeteuiglobal.h" diff --git a/kopete/protocols/msn/webcam.cpp b/kopete/protocols/msn/webcam.cpp index fde51060..b7f991cd 100644 --- a/kopete/protocols/msn/webcam.cpp +++ b/kopete/protocols/msn/webcam.cpp @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include "dispatcher.h" diff --git a/kopete/protocols/oscar/aim/aimaccount.cpp b/kopete/protocols/oscar/aim/aimaccount.cpp index ee9c0c4a..ba8d94b1 100644 --- a/kopete/protocols/oscar/aim/aimaccount.cpp +++ b/kopete/protocols/oscar/aim/aimaccount.cpp @@ -17,7 +17,7 @@ #include #include -#include +#include #include #include #include diff --git a/kopete/protocols/oscar/aim/ui/aimeditaccountwidget.cpp b/kopete/protocols/oscar/aim/ui/aimeditaccountwidget.cpp index 2e0100ab..e3c1f62b 100644 --- a/kopete/protocols/oscar/aim/ui/aimeditaccountwidget.cpp +++ b/kopete/protocols/oscar/aim/ui/aimeditaccountwidget.cpp @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include "kopetepassword.h" #include "kopetepasswordwidget.h" diff --git a/kopete/protocols/oscar/icq/icqaccount.cpp b/kopete/protocols/oscar/icq/icqaccount.cpp index f2a9bce9..9ca3baae 100644 --- a/kopete/protocols/oscar/icq/icqaccount.cpp +++ b/kopete/protocols/oscar/icq/icqaccount.cpp @@ -17,7 +17,7 @@ #include -#include +#include #include #include #include diff --git a/kopete/protocols/oscar/icq/ui/icqeditaccountwidget.cpp b/kopete/protocols/oscar/icq/ui/icqeditaccountwidget.cpp index 04a312a4..edcf03ce 100644 --- a/kopete/protocols/oscar/icq/ui/icqeditaccountwidget.cpp +++ b/kopete/protocols/oscar/icq/ui/icqeditaccountwidget.cpp @@ -25,7 +25,7 @@ #include #include -#include +#include #include #include #include diff --git a/kopete/protocols/oscar/oscaraccount.cpp b/kopete/protocols/oscar/oscaraccount.cpp index 719e9122..76c46be2 100644 --- a/kopete/protocols/oscar/oscaraccount.cpp +++ b/kopete/protocols/oscar/oscaraccount.cpp @@ -42,7 +42,7 @@ #include #include -#include +#include #include #include #include diff --git a/kopete/protocols/oscar/oscarversionupdater.cpp b/kopete/protocols/oscar/oscarversionupdater.cpp index bcaf454e..e7cb0a7a 100644 --- a/kopete/protocols/oscar/oscarversionupdater.cpp +++ b/kopete/protocols/oscar/oscarversionupdater.cpp @@ -20,8 +20,8 @@ #include #include -#include -#include +#include +#include #include diff --git a/kopete/protocols/sms/services/gsmlib.cpp b/kopete/protocols/sms/services/gsmlib.cpp index 45ade4c1..e8a83d69 100644 --- a/kopete/protocols/sms/services/gsmlib.cpp +++ b/kopete/protocols/sms/services/gsmlib.cpp @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include diff --git a/kopete/protocols/sms/services/smsclient.cpp b/kopete/protocols/sms/services/smsclient.cpp index 6b303104..c459bdd0 100644 --- a/kopete/protocols/sms/services/smsclient.cpp +++ b/kopete/protocols/sms/services/smsclient.cpp @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include "kopeteaccount.h" #include "kopeteuiglobal.h" diff --git a/kopete/protocols/sms/services/smssend.cpp b/kopete/protocols/sms/services/smssend.cpp index 0c7c6cad..93e7e033 100644 --- a/kopete/protocols/sms/services/smssend.cpp +++ b/kopete/protocols/sms/services/smssend.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include #include diff --git a/kopete/protocols/sms/services/smssendprovider.cpp b/kopete/protocols/sms/services/smssendprovider.cpp index e2095d25..40a60baa 100644 --- a/kopete/protocols/sms/services/smssendprovider.cpp +++ b/kopete/protocols/sms/services/smssendprovider.cpp @@ -18,7 +18,7 @@ #include #include -#include +#include #include #include #include diff --git a/kopete/protocols/sms/smsaccount.cpp b/kopete/protocols/sms/smsaccount.cpp index 10e09ae8..f3b8c35b 100644 --- a/kopete/protocols/sms/smsaccount.cpp +++ b/kopete/protocols/sms/smsaccount.cpp @@ -16,7 +16,7 @@ #undef KDE_NO_COMPAT -#include +#include #include #include #include diff --git a/kopete/protocols/sms/smscontact.cpp b/kopete/protocols/sms/smscontact.cpp index f47a0b46..d5980050 100644 --- a/kopete/protocols/sms/smscontact.cpp +++ b/kopete/protocols/sms/smscontact.cpp @@ -15,7 +15,7 @@ */ #undef KDE_NO_COMPAT -#include +#include #include #include #include diff --git a/kopete/protocols/sms/smseditaccountwidget.cpp b/kopete/protocols/sms/smseditaccountwidget.cpp index c2a1fb1e..f1872a21 100644 --- a/kopete/protocols/sms/smseditaccountwidget.cpp +++ b/kopete/protocols/sms/smseditaccountwidget.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include #include diff --git a/kopete/protocols/sms/smsprotocol.cpp b/kopete/protocols/sms/smsprotocol.cpp index cd32d959..f232edc3 100644 --- a/kopete/protocols/sms/smsprotocol.cpp +++ b/kopete/protocols/sms/smsprotocol.cpp @@ -16,7 +16,7 @@ #include #include -#include +#include #include #include "kopeteaccountmanager.h" diff --git a/kopete/protocols/winpopup/libwinpopup/libwinpopup.h b/kopete/protocols/winpopup/libwinpopup/libwinpopup.h index 1213b3cf..39a098eb 100644 --- a/kopete/protocols/winpopup/libwinpopup/libwinpopup.h +++ b/kopete/protocols/winpopup/libwinpopup/libwinpopup.h @@ -27,7 +27,7 @@ // KDE Includes #include -#include +#include const TQString WP_POPUP_DIR = TQString::fromLatin1("/var/lib/winpopup"); diff --git a/kopete/protocols/winpopup/wpaccount.cpp b/kopete/protocols/winpopup/wpaccount.cpp index d7439628..994735cc 100644 --- a/kopete/protocols/winpopup/wpaccount.cpp +++ b/kopete/protocols/winpopup/wpaccount.cpp @@ -25,7 +25,7 @@ #include #include #include -#include +#include // Kopete Includes diff --git a/kopete/protocols/winpopup/wpeditaccount.cpp b/kopete/protocols/winpopup/wpeditaccount.cpp index 0e0b6f43..414a1af6 100644 --- a/kopete/protocols/winpopup/wpeditaccount.cpp +++ b/kopete/protocols/winpopup/wpeditaccount.cpp @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include diff --git a/kopete/protocols/yahoo/libkyahoo/logintask.cpp b/kopete/protocols/yahoo/libkyahoo/logintask.cpp index b3c3f297..7e853fec 100644 --- a/kopete/protocols/yahoo/libkyahoo/logintask.cpp +++ b/kopete/protocols/yahoo/libkyahoo/logintask.cpp @@ -29,7 +29,7 @@ #include #include -#include +#include #include extern "C" diff --git a/kopete/protocols/yahoo/libkyahoo/modifyyabtask.cpp b/kopete/protocols/yahoo/libkyahoo/modifyyabtask.cpp index cd77498e..668e29c3 100644 --- a/kopete/protocols/yahoo/libkyahoo/modifyyabtask.cpp +++ b/kopete/protocols/yahoo/libkyahoo/modifyyabtask.cpp @@ -25,9 +25,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include using namespace KNetwork; diff --git a/kopete/protocols/yahoo/libkyahoo/receivefiletask.cpp b/kopete/protocols/yahoo/libkyahoo/receivefiletask.cpp index 4528612b..532e21bf 100644 --- a/kopete/protocols/yahoo/libkyahoo/receivefiletask.cpp +++ b/kopete/protocols/yahoo/libkyahoo/receivefiletask.cpp @@ -24,9 +24,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include ReceiveFileTask::ReceiveFileTask(Task* parent) : Task(parent) { diff --git a/kopete/protocols/yahoo/libkyahoo/sendfiletask.cpp b/kopete/protocols/yahoo/libkyahoo/sendfiletask.cpp index e435f568..9cfe6763 100644 --- a/kopete/protocols/yahoo/libkyahoo/sendfiletask.cpp +++ b/kopete/protocols/yahoo/libkyahoo/sendfiletask.cpp @@ -25,7 +25,7 @@ #include #include #include -#include +#include using namespace KNetwork; diff --git a/kopete/protocols/yahoo/libkyahoo/sendpicturetask.cpp b/kopete/protocols/yahoo/libkyahoo/sendpicturetask.cpp index a5f8f821..95193241 100644 --- a/kopete/protocols/yahoo/libkyahoo/sendpicturetask.cpp +++ b/kopete/protocols/yahoo/libkyahoo/sendpicturetask.cpp @@ -22,9 +22,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include #include #include diff --git a/kopete/protocols/yahoo/libkyahoo/yabtask.cpp b/kopete/protocols/yahoo/libkyahoo/yabtask.cpp index 4eb82cc4..98df4ef0 100644 --- a/kopete/protocols/yahoo/libkyahoo/yabtask.cpp +++ b/kopete/protocols/yahoo/libkyahoo/yabtask.cpp @@ -22,9 +22,9 @@ #include "client.h" #include #include -#include -#include -#include +#include +#include +#include #include YABTask::YABTask(Task* parent) : Task(parent) diff --git a/kopete/protocols/yahoo/libkyahoo/yahoobuddyiconloader.cpp b/kopete/protocols/yahoo/libkyahoo/yahoobuddyiconloader.cpp index b9a270f8..96f96389 100644 --- a/kopete/protocols/yahoo/libkyahoo/yahoobuddyiconloader.cpp +++ b/kopete/protocols/yahoo/libkyahoo/yahoobuddyiconloader.cpp @@ -21,9 +21,9 @@ // KDE Includes #include #include -#include -#include -#include +#include +#include +#include #include #include #include diff --git a/kopete/protocols/yahoo/libkyahoo/yahoochattask.cpp b/kopete/protocols/yahoo/libkyahoo/yahoochattask.cpp index 3f8650f5..96cc20c5 100644 --- a/kopete/protocols/yahoo/libkyahoo/yahoochattask.cpp +++ b/kopete/protocols/yahoo/libkyahoo/yahoochattask.cpp @@ -22,9 +22,9 @@ #include "client.h" #include #include -#include -#include -#include +#include +#include +#include #include YahooChatTask::YahooChatTask(Task* parent) : Task(parent) diff --git a/kopete/protocols/yahoo/yahooaccount.cpp b/kopete/protocols/yahoo/yahooaccount.cpp index 53f7c2b4..7e36d04e 100644 --- a/kopete/protocols/yahoo/yahooaccount.cpp +++ b/kopete/protocols/yahoo/yahooaccount.cpp @@ -33,7 +33,7 @@ // KDE #include -#include +#include #include #include #include diff --git a/kopete/protocols/yahoo/yahoochatsession.cpp b/kopete/protocols/yahoo/yahoochatsession.cpp index 5402919c..3bb8e717 100644 --- a/kopete/protocols/yahoo/yahoochatsession.cpp +++ b/kopete/protocols/yahoo/yahoochatsession.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include #include #include #include diff --git a/kopete/protocols/yahoo/yahooconferencemessagemanager.cpp b/kopete/protocols/yahoo/yahooconferencemessagemanager.cpp index 8d34689b..8e6132b6 100644 --- a/kopete/protocols/yahoo/yahooconferencemessagemanager.cpp +++ b/kopete/protocols/yahoo/yahooconferencemessagemanager.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include diff --git a/kopete/protocols/yahoo/yahoocontact.cpp b/kopete/protocols/yahoo/yahoocontact.cpp index 3bd55b85..f827bba3 100644 --- a/kopete/protocols/yahoo/yahoocontact.cpp +++ b/kopete/protocols/yahoo/yahoocontact.cpp @@ -52,13 +52,13 @@ #include #include #include -#include -#include +#include +#include #include -#include +#include #include #include -#include +#include YahooContact::YahooContact( YahooAccount *account, const TQString &userId, const TQString &fullName, Kopete::MetaContact *metaContact ) : Kopete::Contact( account, userId, metaContact ) diff --git a/kopete/protocols/yahoo/yahooeditaccount.cpp b/kopete/protocols/yahoo/yahooeditaccount.cpp index e047e849..8913eba3 100644 --- a/kopete/protocols/yahoo/yahooeditaccount.cpp +++ b/kopete/protocols/yahoo/yahooeditaccount.cpp @@ -32,9 +32,9 @@ #include #include #include -#include +#include #include -#include +#include #include #include diff --git a/kopete/protocols/yahoo/yahooverifyaccount.cpp b/kopete/protocols/yahoo/yahooverifyaccount.cpp index 14912167..62dde427 100644 --- a/kopete/protocols/yahoo/yahooverifyaccount.cpp +++ b/kopete/protocols/yahoo/yahooverifyaccount.cpp @@ -23,9 +23,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include // Kopete Includes diff --git a/kpf/src/Applet.cpp b/kpf/src/Applet.cpp index 217128a5..dfe0c165 100644 --- a/kpf/src/Applet.cpp +++ b/kpf/src/Applet.cpp @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/kpf/src/CMakeLists.txt b/kpf/src/CMakeLists.txt index 1de8db4c..09280dec 100644 --- a/kpf/src/CMakeLists.txt +++ b/kpf/src/CMakeLists.txt @@ -35,7 +35,7 @@ tde_add_kpart( kpf_panelapplet AUTOMOC ErrorMessageConfigDialog.cpp ActiveMonitor.cpp ActiveMonitorItem.cpp ActiveMonitorWindow.cpp BandwidthGraph.cpp ServerWizard.cpp AppletItem.cpp Applet.cpp Defaults.cpp Help.cpp - LINK tdednssd-shared kio-shared + LINK tdednssd-shared tdeio-shared DESTINATION ${PLUGIN_INSTALL_DIR} ) @@ -46,6 +46,6 @@ tde_add_kpart( kpfpropertiesdialog AUTOMOC SOURCES PropertiesDialogPlugin.cpp StartingKPFDialog.cpp WebServer.stub WebServerManager.stub Defaults.cpp Help.cpp - LINK tdednssd-shared kio-shared + LINK tdednssd-shared tdeio-shared DESTINATION ${PLUGIN_INSTALL_DIR} ) diff --git a/kpf/src/ConfigDialogPage.cpp b/kpf/src/ConfigDialogPage.cpp index 657e96f0..c0191441 100644 --- a/kpf/src/ConfigDialogPage.cpp +++ b/kpf/src/ConfigDialogPage.cpp @@ -30,7 +30,7 @@ #include #include -#include +#include #include "Defines.h" #include "ErrorMessageConfigDialog.h" diff --git a/kpf/src/ErrorMessageConfigDialog.cpp b/kpf/src/ErrorMessageConfigDialog.cpp index 05a082bb..20367f30 100644 --- a/kpf/src/ErrorMessageConfigDialog.cpp +++ b/kpf/src/ErrorMessageConfigDialog.cpp @@ -29,7 +29,7 @@ #include #include -#include +#include #include #include diff --git a/kpf/src/PropertiesDialogPlugin.cpp b/kpf/src/PropertiesDialogPlugin.cpp index 929bd2a9..5696e2c9 100644 --- a/kpf/src/PropertiesDialogPlugin.cpp +++ b/kpf/src/PropertiesDialogPlugin.cpp @@ -39,7 +39,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/kpf/src/Response.cpp b/kpf/src/Response.cpp index 7802df5f..bfacf03b 100644 --- a/kpf/src/Response.cpp +++ b/kpf/src/Response.cpp @@ -25,7 +25,7 @@ #include #include -#include +#include #include "Defines.h" #include "Utils.h" diff --git a/kpf/src/ServerWizard.cpp b/kpf/src/ServerWizard.cpp index 3c2e78f9..139d863b 100644 --- a/kpf/src/ServerWizard.cpp +++ b/kpf/src/ServerWizard.cpp @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include "Defines.h" #include "ServerWizard.h" diff --git a/kpf/src/WebServer.cpp b/kpf/src/WebServer.cpp index e12ebcd2..e114dd0e 100644 --- a/kpf/src/WebServer.cpp +++ b/kpf/src/WebServer.cpp @@ -33,7 +33,7 @@ // KDE includes #include "config.h" -#include +#include #include #include #include diff --git a/kpf/src/WebServerManager.cpp b/kpf/src/WebServerManager.cpp index 1fa58b63..fbb55439 100644 --- a/kpf/src/WebServerManager.cpp +++ b/kpf/src/WebServerManager.cpp @@ -22,7 +22,7 @@ */ // KDE includes -#include +#include #include #include diff --git a/kppp/CMakeLists.txt b/kppp/CMakeLists.txt index 556280e7..c2ea4e64 100644 --- a/kppp/CMakeLists.txt +++ b/kppp/CMakeLists.txt @@ -46,6 +46,6 @@ tde_add_executable( kppp SETUID AUTOMOC acctselect.cpp ruleset.cpp docking.cpp runtests.cpp loginterm.cpp ppplog.cpp newwidget.cpp requester.cpp opener.cpp modemdb.cpp utils.cpp providerdb.cpp modems.cpp KPPPIface.skel - LINK kio-shared + LINK tdeio-shared DESTINATION ${BIN_INSTALL_DIR} ) diff --git a/kppp/ChangeLog b/kppp/ChangeLog index 6c532c03..a956c949 100644 --- a/kppp/ChangeLog +++ b/kppp/ChangeLog @@ -1028,7 +1028,7 @@ * some KDE style guide conformant changes * some code cleanups - * removed -lkfile and -lkfm from Makefile.am + * removed -ltdefile and -lkfm from Makefile.am * added debug switch to pppd command line when debugging is turned on * Improved the response time for modem output. Modem output is diff --git a/kppp/kpppwidget.cpp b/kppp/kpppwidget.cpp index 9894cb9b..92789fdf 100644 --- a/kppp/kpppwidget.cpp +++ b/kppp/kpppwidget.cpp @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include #include // For BarIcon #include diff --git a/kppp/logview/CMakeLists.txt b/kppp/logview/CMakeLists.txt index a81b833f..204beeb5 100644 --- a/kppp/logview/CMakeLists.txt +++ b/kppp/logview/CMakeLists.txt @@ -33,6 +33,6 @@ install( FILES tde_add_executable( kppplogview AUTOMOC SOURCES main.cpp loginfo.cpp log.cpp monthly.cpp export.cpp - LINK kio-shared + LINK tdeio-shared DESTINATION ${BIN_INSTALL_DIR} ) diff --git a/kppp/logview/export.h b/kppp/logview/export.h index d3e37030..04ed0005 100644 --- a/kppp/logview/export.h +++ b/kppp/logview/export.h @@ -33,7 +33,7 @@ #include #include -#include +#include class Export; diff --git a/kppp/modemdb.cpp b/kppp/modemdb.cpp index 406a45c5..3213d00b 100644 --- a/kppp/modemdb.cpp +++ b/kppp/modemdb.cpp @@ -39,7 +39,7 @@ #include #include #include -#include +#include #include ModemSelector::ModemSelector(TQWidget *parent) : TQDialog(parent, 0, true) { diff --git a/kppp/pppdata.cpp b/kppp/pppdata.cpp index 1d681352..29ccb308 100644 --- a/kppp/pppdata.cpp +++ b/kppp/pppdata.cpp @@ -28,7 +28,7 @@ #include "runtests.h" #include "devices.h" #include -#include +#include #include #include #include diff --git a/krdc/hostpreferences.cpp b/krdc/hostpreferences.cpp index f0722880..cd573b57 100644 --- a/krdc/hostpreferences.cpp +++ b/krdc/hostpreferences.cpp @@ -21,7 +21,7 @@ #include "rdp/rdphostpref.h" #include -#include +#include #include #include diff --git a/krdc/krdc.cpp b/krdc/krdc.cpp index 75fe99a8..64aa80f2 100644 --- a/krdc/krdc.cpp +++ b/krdc/krdc.cpp @@ -21,7 +21,7 @@ #include "hostpreferences.h" #include -#include +#include #include #include #include diff --git a/krdc/main.cpp b/krdc/main.cpp index f0ee0ab4..bb46c7d6 100644 --- a/krdc/main.cpp +++ b/krdc/main.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/krdc/rdp/rdphostpref.cpp b/krdc/rdp/rdphostpref.cpp index d64960b5..42122549 100644 --- a/krdc/rdp/rdphostpref.cpp +++ b/krdc/rdp/rdphostpref.cpp @@ -18,7 +18,7 @@ */ #include "rdphostpref.h" -#include +#include #include const TQString RdpHostPref::RdpType = "RDP"; diff --git a/krdc/vnc/vnchostpref.cpp b/krdc/vnc/vnchostpref.cpp index c29f1877..4cff3768 100644 --- a/krdc/vnc/vnchostpref.cpp +++ b/krdc/vnc/vnchostpref.cpp @@ -16,7 +16,7 @@ ***************************************************************************/ #include "vnchostpref.h" -#include +#include #include const TQString VncHostPref::VncType = "VNC"; diff --git a/krfb/kcm_krfb/CMakeLists.txt b/krfb/kcm_krfb/CMakeLists.txt index 4f7e0b95..194e2ac5 100644 --- a/krfb/kcm_krfb/CMakeLists.txt +++ b/krfb/kcm_krfb/CMakeLists.txt @@ -30,6 +30,6 @@ install( FILES kcmkrfb.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} ) tde_add_kpart( kcm_krfb AUTOMOC SOURCES configurationwidget.ui kcm_krfb.cpp - LINK krfbconfig-static srvloc-static tdednssd-shared kio-shared + LINK krfbconfig-static srvloc-static tdednssd-shared tdeio-shared DESTINATION ${PLUGIN_INSTALL_DIR} ) diff --git a/krfb/kcm_krfb/kcm_krfb.cpp b/krfb/kcm_krfb/kcm_krfb.cpp index dfa8acf1..4279fb0f 100644 --- a/krfb/kcm_krfb/kcm_krfb.cpp +++ b/krfb/kcm_krfb/kcm_krfb.cpp @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/krfb/kcm_krfb/kcmkrfb.desktop b/krfb/kcm_krfb/kcmkrfb.desktop index 857c8962..c79fb2f2 100644 --- a/krfb/kcm_krfb/kcmkrfb.desktop +++ b/krfb/kcm_krfb/kcmkrfb.desktop @@ -1,7 +1,7 @@ [Desktop Entry] Icon=krfb Type=Application -Exec=kcmshell kcmkrfb +Exec=tdecmshell kcmkrfb DocPath=krfb/krfb-configuration.html X-TDE-ModuleType=Library diff --git a/krfb/kinetd/kinetd.cpp b/krfb/kinetd/kinetd.cpp index 369b1549..4a5abecd 100644 --- a/krfb/kinetd/kinetd.cpp +++ b/krfb/kinetd/kinetd.cpp @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/krfb/krfb/CMakeLists.txt b/krfb/krfb/CMakeLists.txt index 9f720945..799444d2 100644 --- a/krfb/krfb/CMakeLists.txt +++ b/krfb/krfb/CMakeLists.txt @@ -39,7 +39,7 @@ tde_add_executable( krfb AUTOMOC rfbcontroller.cc xupdatescanner.cc main.cpp connectionwidget.ui krfbifaceimpl.cc krfbiface.skel trayicon.cpp connectiondialog.cc LINK - krfbconfig-static vncserver-static srvloc-static tdeui-shared kio-shared jpeg Xext pthread ${XTST_LIBRARIES} + krfbconfig-static vncserver-static srvloc-static tdeui-shared tdeio-shared jpeg Xext pthread ${XTST_LIBRARIES} DESTINATION ${BIN_INSTALL_DIR} ) diff --git a/krfb/krfb/configuration.cc b/krfb/krfb/configuration.cc index 40812960..e34c1ec8 100644 --- a/krfb/krfb/configuration.cc +++ b/krfb/krfb/configuration.cc @@ -467,7 +467,7 @@ void Configuration::inviteEmail() { ////////////// invoke kcontrol module ////////////////////////// void Configuration::showConfigurationModule() { - KRun::run( "kcmshell kcmkrfb", KURL::List() ); + KRun::run( "tdecmshell kcmkrfb", KURL::List() ); } diff --git a/krfb/krfb/configuration.h b/krfb/krfb/configuration.h index f405ea11..dceceb9b 100644 --- a/krfb/krfb/configuration.h +++ b/krfb/krfb/configuration.h @@ -25,7 +25,7 @@ #include "invitedialog.h" #include -#include +#include #include #include #include diff --git a/krfb/krfb/invitation.h b/krfb/krfb/invitation.h index 2f7dbcd5..49b116ed 100644 --- a/krfb/krfb/invitation.h +++ b/krfb/krfb/invitation.h @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include #include diff --git a/ksirc/CMakeLists.txt b/ksirc/CMakeLists.txt index 6c6a1bf8..15dbf624 100644 --- a/ksirc/CMakeLists.txt +++ b/ksirc/CMakeLists.txt @@ -68,5 +68,5 @@ tde_add_tdeinit_executable( ksirc AUTOMOC dccNewbase.ui dccNew.cpp LINK ksprefs-static ksprogress-static ksopenksirc-static ksticker-static - kio-shared + tdeio-shared ) diff --git a/ksirc/FilterRuleEditor.cpp b/ksirc/FilterRuleEditor.cpp index 46819832..b4260829 100644 --- a/ksirc/FilterRuleEditor.cpp +++ b/ksirc/FilterRuleEditor.cpp @@ -15,7 +15,7 @@ #include #include -#include +#include #include #include #include diff --git a/ksirc/KSOpenkSirc/open_ksirc.cpp b/ksirc/KSOpenkSirc/open_ksirc.cpp index 41e13323..f562b2af 100644 --- a/ksirc/KSOpenkSirc/open_ksirc.cpp +++ b/ksirc/KSOpenkSirc/open_ksirc.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include diff --git a/ksirc/KSPrefs/page_autoconnect.cpp b/ksirc/KSPrefs/page_autoconnect.cpp index 2c868841..964a4acd 100644 --- a/ksirc/KSPrefs/page_autoconnect.cpp +++ b/ksirc/KSPrefs/page_autoconnect.cpp @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include diff --git a/ksirc/KSPrefs/page_colors.cpp b/ksirc/KSPrefs/page_colors.cpp index ae5c25fa..cf4f04d8 100644 --- a/ksirc/KSPrefs/page_colors.cpp +++ b/ksirc/KSPrefs/page_colors.cpp @@ -14,7 +14,7 @@ #include #include -#include +#include #include #include #include diff --git a/ksirc/KSPrefs/page_irccolors.cpp b/ksirc/KSPrefs/page_irccolors.cpp index 5ed96054..89de8231 100644 --- a/ksirc/KSPrefs/page_irccolors.cpp +++ b/ksirc/KSPrefs/page_irccolors.cpp @@ -11,7 +11,7 @@ #include #include -#include +#include #include PageIRCColors::PageIRCColors( TQWidget *parent, const char *name ) : PageIRCColorsBase( parent, name) diff --git a/ksirc/KSPrefs/page_looknfeel.cpp b/ksirc/KSPrefs/page_looknfeel.cpp index 29608e04..82244bb7 100644 --- a/ksirc/KSPrefs/page_looknfeel.cpp +++ b/ksirc/KSPrefs/page_looknfeel.cpp @@ -13,7 +13,7 @@ #include #include -#include +#include #include "page_looknfeel.h" PageLooknFeel::PageLooknFeel( TQWidget *parent, const char *name ) : PageLooknFeelBase( parent, name) diff --git a/ksirc/KSPrefs/page_servchan.cpp b/ksirc/KSPrefs/page_servchan.cpp index 24e36938..6be5ef5b 100644 --- a/ksirc/KSPrefs/page_servchan.cpp +++ b/ksirc/KSPrefs/page_servchan.cpp @@ -13,7 +13,7 @@ #include #include #include -#include +#include PageServChan::PageServChan( TQWidget *parent, const char *name ) : PageServChanBase( parent, name) { diff --git a/ksirc/KSPrefs/page_startup.cpp b/ksirc/KSPrefs/page_startup.cpp index e2ddfdc1..691b8cc2 100644 --- a/ksirc/KSPrefs/page_startup.cpp +++ b/ksirc/KSPrefs/page_startup.cpp @@ -12,7 +12,7 @@ #include #include -#include +#include #include #include diff --git a/ksirc/KSTicker/ksticker.cpp b/ksirc/KSTicker/ksticker.cpp index 5187489a..f2d77e39 100644 --- a/ksirc/KSTicker/ksticker.cpp +++ b/ksirc/KSTicker/ksticker.cpp @@ -17,7 +17,7 @@ #include "../ksopts.h" #include "../nickColourMaker.h" -#include +#include #include #include diff --git a/ksirc/KSTicker/ksttest.cpp b/ksirc/KSTicker/ksttest.cpp index ad8c3864..6c4bd80e 100644 --- a/ksirc/KSTicker/ksttest.cpp +++ b/ksirc/KSTicker/ksttest.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include #include #include diff --git a/ksirc/NewWindowDialog.cpp b/ksirc/NewWindowDialog.cpp index ce8309cc..9ec1136a 100644 --- a/ksirc/NewWindowDialog.cpp +++ b/ksirc/NewWindowDialog.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include #include #include diff --git a/ksirc/dccNew.cpp b/ksirc/dccNew.cpp index 5d345cc2..9174d4a7 100644 --- a/ksirc/dccNew.cpp +++ b/ksirc/dccNew.cpp @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/ksirc/iocontroller.cpp b/ksirc/iocontroller.cpp index 0545b189..db0615a4 100644 --- a/ksirc/iocontroller.cpp +++ b/ksirc/iocontroller.cpp @@ -84,7 +84,7 @@ #include #include #include -#include +#include int KSircIOController::counter = 0; diff --git a/ksirc/ksirc.cpp b/ksirc/ksirc.cpp index cd6018bb..ba9dbcda 100644 --- a/ksirc/ksirc.cpp +++ b/ksirc/ksirc.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include //#include "cdate.h" diff --git a/ksirc/ksircprocess.cpp b/ksirc/ksircprocess.cpp index 47e36c52..2aefe7d1 100644 --- a/ksirc/ksircprocess.cpp +++ b/ksirc/ksircprocess.cpp @@ -107,7 +107,7 @@ #include #include -#include +#include #include #include #include diff --git a/ksirc/ksopts.cpp b/ksirc/ksopts.cpp index 4b3517a4..d9035f19 100644 --- a/ksirc/ksopts.cpp +++ b/ksirc/ksopts.cpp @@ -1,6 +1,6 @@ #include -#include +#include #if KDE_IS_VERSION(3,1,92) #include diff --git a/ksirc/ksview.cpp b/ksirc/ksview.cpp index 81177b13..3d895513 100644 --- a/ksirc/ksview.cpp +++ b/ksirc/ksview.cpp @@ -32,8 +32,8 @@ #include #include #include -#include -#include +#include +#include #include #include "ksopts.h" diff --git a/ksirc/mditoplevel.cpp b/ksirc/mditoplevel.cpp index 510b40e8..c6047674 100644 --- a/ksirc/mditoplevel.cpp +++ b/ksirc/mditoplevel.cpp @@ -5,7 +5,7 @@ #include #include -#include +#include #include #include #include diff --git a/ksirc/puke/Makefile.am b/ksirc/puke/Makefile.am index de25d641..4fbf90d2 100644 --- a/ksirc/puke/Makefile.am +++ b/ksirc/puke/Makefile.am @@ -12,7 +12,7 @@ libpuke_la_SOURCES = pwidget.cpp pobject.cpp \ pprogress.cpp ptablevw.cpp plistbox.cpp \ plabel.cpp pmenudta.cpp ppopmenu.cpp \ palistbox.cpp ptabdialog.cpp \ - pkfiledialog.cpp pobjfinder.cpp + ptdefiledialog.cpp pobjfinder.cpp $(srcdir)/HOWTO-PUKE.txt: HOWTO-PUKE.pod pod2text $(srcdir)/HOWTO-PUKE.pod > HOWTO-PUKE.txt @@ -34,7 +34,7 @@ perl_DATA = commands-handler.pl commands-perl.pl convert_commands.pl \ puke.pl small.pl test.pl tester.pl \ dcc_progress.pm dcc_status.pm load_all.pm \ palistbox.pm pbase.pm pboxlayout.pm pbutton.pm pframe.pm \ - pkfiledialog.pm plabel.pm plined.pm plistbox.pm pmenudta.pm \ + ptdefiledialog.pm plabel.pm plined.pm plistbox.pm pmenudta.pm \ ppopmenu.pm pprogress.pm ppushbt.pm ptabdialog.pm ptablevw.pm \ pwidget.pm pobjfinder.pm diff --git a/ksirc/puke/controller.cpp b/ksirc/puke/controller.cpp index a7c95091..7d5e85e3 100644 --- a/ksirc/puke/controller.cpp +++ b/ksirc/puke/controller.cpp @@ -30,7 +30,7 @@ using namespace std; // iostream.h include cstring which puts strlen into #include "palistbox.h" #include "pbutton.h" #include "pframe.h" -#include "pkfiledialog.h" +#include "ptdefiledialog.h" #include "plabel.h" #include "ptqlayout.h" #include "plined.h" diff --git a/ksirc/puke/dcc_status.pm b/ksirc/puke/dcc_status.pm index 65bc1b07..149219d2 100644 --- a/ksirc/puke/dcc_status.pm +++ b/ksirc/puke/dcc_status.pm @@ -11,7 +11,7 @@ &docommand("/load pbutton.pm"); &docommand("/load ppushbt.pm"); &docommand("/load plined.pm"); -&docommand("/load pkfiledialog.pm"); +&docommand("/load ptdefiledialog.pm"); &docommand("/load ppopmenu.pm"); &docommand("/load dcc_progress.pm"); diff --git a/ksirc/puke/load_all.pm b/ksirc/puke/load_all.pm index 26594c0f..b54a7dc7 100644 --- a/ksirc/puke/load_all.pm +++ b/ksirc/puke/load_all.pm @@ -10,5 +10,5 @@ &docommand("/load plistbox.pm"); &docommand("/load ppopmenu.pm"); &docommand("/load ptabdialog.pm"); -&docommand("/load pkfiledialog.pm"); +&docommand("/load ptdefiledialog.pm"); &docommand("/load pobjfinder.pm"); diff --git a/ksirc/puke/pkfiledialog-cmd.h b/ksirc/puke/pkfiledialog-cmd.h deleted file mode 100644 index 6aebd59e..00000000 --- a/ksirc/puke/pkfiledialog-cmd.h +++ /dev/null @@ -1,56 +0,0 @@ -#ifndef PKFILEDIALOG_CMD_H -#define PKFILEDIALOG_CMD_H - -/* - * We get 2200 - */ - -// Desc: sets the current directory -// iWinId: widget -// iArg: not defined -// cArg: path -#define PUKE_KBFD_SET_PATH 2200 - -// Desc: ack for the set -// iWinId: widget -// iArg: not defined -// cArg: actual path -#define PUKE_BFD_SET_PATH_ACK -2200 - -// Desc: sets the current filter -// iWinId: widget -// iArg: not defined -// cArg: filter, as defined in KFileBaseDialog::setFilter -#define PUKE_KBFD_SET_FILTER 2201 - -// Desc: ack for the set -// iWinId: widget -// iArg: not defined -// cArg: not define -#define PUKE_KBFD_SET_FILTER_ACK -2201 - -// Desc: sets the current file -// iWinId: widget -// iArg: not defined -// cArg: filename (does it need the full path?) -#define PUKE_KBFD_SET_SELECTION 2202 - -// Desc: ack for the set -// iWinId: widget -// iArg: not defined -// cArg: not define -#define PUKE_KBFD_SET_SELECTION_ACK -2202 - -// Desc: ack for current file select -// iWinId: not defined -// iArg: not defined -// cArg: not defined -#define PUKE_KBFD_FILE_SELECTED 2203 - -// Desc: ack for current file select -// iWinId: widget -// iArg: not defined -// cArg: filename -#define PUKE_KBFD_FILE_SELECTED_ACK -2203 - -#endif diff --git a/ksirc/puke/pkfiledialog.cpp b/ksirc/puke/pkfiledialog.cpp deleted file mode 100644 index 53d37aa7..00000000 --- a/ksirc/puke/pkfiledialog.cpp +++ /dev/null @@ -1,123 +0,0 @@ -#include - - -#include - -#include "pkfiledialog.h" -#include "pkfiledialog-cmd.h" - -PObject * -PKFileDialog::createWidget(CreateArgs &ca) -{ - PKFileDialog *pw = new PKFileDialog(ca.parent); - KFileDialog *kfbd; - if(ca.fetchedObj != 0 && ca.fetchedObj->inherits("KFileDialog") == TRUE){ - kfbd = (KFileDialog *) ca.fetchedObj; - pw->setDeleteAble(FALSE); - } - else // Never takes a parent in Puke - kfbd = new KFileDialog("/", TQString(), 0L, "PukeKFileDialog", TRUE); - pw->setWidget(kfbd); - pw->setWidgetId(ca.pwI); - return pw; -} - - -PKFileDialog::PKFileDialog(PObject *parent) - : PWidget(parent) -{ - kfbd = 0; - setWidget(kfbd); -} - -PKFileDialog::~PKFileDialog() -{ - // kdDebug(5008) << "PLineEdit: in destructor" << endl; - /* - delete widget(); // Delete the frame - kfbd=0; // Set it to 0 - setWidget(kfbd); // Now set all widget() calls to 0. - */ -} - -void PKFileDialog::messageHandler(int fd, PukeMessage *pm) -{ - TQString selFile; - PukeMessage pmRet; - if(widget() == 0){ - kdDebug(5008) << "PKFileDialog: No Widget set" << endl; - return; - } - switch(pm->iCommand){ - case PUKE_KBFD_SET_PATH: - ((KFileDialog*)widget())->setURL(KURL(pm->cArg)); - - pmRet.iCommand = - pm->iCommand; - pmRet.iWinId = pm->iWinId; - pmRet.iArg = 0; - pmRet.iTextSize = widget()->baseURL().path().length(); -#warning check if the cast is okay - pmRet.cArg = (char*) widget()->baseURL().path().ascii(); - emit outputMessage(fd, &pmRet); - break; - case PUKE_KBFD_SET_FILTER: - widget()->setFilter(pm->cArg); - - pmRet.iCommand = - pm->iCommand; - pmRet.iWinId = pm->iWinId; - pmRet.iArg = 0; - pmRet.iTextSize = 0; - pmRet.cArg = 0; - emit outputMessage(fd, &pmRet); - break; - case PUKE_KBFD_SET_SELECTION: - widget()->setSelection(pm->cArg); - - pmRet.iCommand = - pm->iCommand; - pmRet.iWinId = pm->iWinId; - pmRet.iArg = 0; - selFile = widget()->selectedURL().path(); - pmRet.iTextSize = selFile.length(); -#warning check if the cast is okay - pmRet.cArg = (char*) selFile.ascii(); - emit outputMessage(fd, &pmRet); - break; - case PUKE_WIDGET_SHOW: - widget()->exec(); - pmRet.iCommand = PUKE_KBFD_FILE_SELECTED_ACK; - pmRet.iWinId = pm->iWinId; - pmRet.iArg = 0; - pmRet.cArg = new char[selFile.length()]; - selFile = widget()->selectedURL().path(); - // #### HPB: using strlen() 'cause we want the length of the .ascii() - // string. We should probably replace in the future. - memcpy(pmRet.cArg, selFile.ascii(), strlen(selFile.ascii())); - pmRet.iTextSize = selFile.length(); - emit outputMessage(widgetIden().fd, &pmRet); - delete pmRet.cArg; - break; - - default: - PWidget::messageHandler(fd, pm); - } -} - -void PKFileDialog::setWidget(TQObject *_kbfd) -{ - if(_kbfd != 0 && _kbfd->inherits("KFileBaseDialog") == FALSE) - { - errorInvalidSet(_kbfd); - return; - } - - kfbd = (KFileDialog *) _kbfd; - PWidget::setWidget(kfbd); -} - - -KFileDialog *PKFileDialog::widget() -{ - return kfbd; -} - -#include "pkfiledialog.moc" diff --git a/ksirc/puke/pkfiledialog.h b/ksirc/puke/pkfiledialog.h deleted file mode 100644 index 403f8493..00000000 --- a/ksirc/puke/pkfiledialog.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef PKFILEDIALOG_H -#define PKFILEDIALOG_H - -class PKFileDialog; - -#include -#include "pmessage.h" -#include "pwidget.h" -#include "controller.h" - -class PKFileDialog : public PWidget -{ - Q_OBJECT - -public: - static PObject *createWidget(CreateArgs &ca); - - PKFileDialog ( PObject * parent ); - virtual ~PKFileDialog (); - - virtual void messageHandler(int fd, PukeMessage *pm); - - virtual void setWidget(TQObject *_f = 0x0); - virtual KFileDialog *widget(); - -public slots: - -private: - KFileDialog *kfbd; -}; - -#endif diff --git a/ksirc/puke/pkfiledialog.pm b/ksirc/puke/pkfiledialog.pm deleted file mode 100644 index 6da8c229..00000000 --- a/ksirc/puke/pkfiledialog.pm +++ /dev/null @@ -1,76 +0,0 @@ - -&::PukeSendMessage($PUKE_WIDGET_LOAD, - $::PUKE_CONTROLLER, - $PWIDGET_KFILEDIALOG, - "pkfiledialog.so", - sub { my %ARG = %{shift()}; - if($ARG{'iArg'} == 1){ - print "*E* PKFileDialog Load failed!\n"; - } - } - ); - -use strict; - -package PKFileDialog; -use vars qw(@ISA); -@ISA = qw(PWidget); - -sub new { - my $class = shift; - my $self = $class->SUPER::new($class, @_); - - $self->{widgetType} = $::PWIDGET_KFILEDIALOG; - - if($class eq 'PKFileDialog'){ - $self->create(); - } - - $self->installHandler($::PUKE_KBFD_FILE_SELECTED_ACK, sub{$self->fileSelected(shift())}); - - return $self; - -} - -sub setDir { - my $self = shift; - - my $dir = shift; - - $self->sendMessage('iCommand' => $::PUKE_KBFD_SET_PATH, - 'cArg' => $dir, - 'CallBack' => sub{}); - -} - -sub setFilter { - my $self = shift; - - my $filter = shift; - - $self->sendMessage('iCommand' => $::PUKE_KBFD_SET_FILTER, - 'cArg' => $filter, - 'CallBack' => sub{}); - -} - -sub setSelected { - my $self = shift; - - my $sel = shift; - - $self->sendMessage('iCommand' => $::PUKE_KBFD_SET_SELECTION, - 'cArg' => $sel, - 'CallBack' => sub{}); - -} - -sub fileSelected { - my $self = shift; - my $rargs = shift; - - &::print("*I* File Selected: " . $rargs->{'cArg'}); - -} - -package main; diff --git a/ksirc/puke/ptdefiledialog-cmd.h b/ksirc/puke/ptdefiledialog-cmd.h new file mode 100644 index 00000000..6aebd59e --- /dev/null +++ b/ksirc/puke/ptdefiledialog-cmd.h @@ -0,0 +1,56 @@ +#ifndef PKFILEDIALOG_CMD_H +#define PKFILEDIALOG_CMD_H + +/* + * We get 2200 + */ + +// Desc: sets the current directory +// iWinId: widget +// iArg: not defined +// cArg: path +#define PUKE_KBFD_SET_PATH 2200 + +// Desc: ack for the set +// iWinId: widget +// iArg: not defined +// cArg: actual path +#define PUKE_BFD_SET_PATH_ACK -2200 + +// Desc: sets the current filter +// iWinId: widget +// iArg: not defined +// cArg: filter, as defined in KFileBaseDialog::setFilter +#define PUKE_KBFD_SET_FILTER 2201 + +// Desc: ack for the set +// iWinId: widget +// iArg: not defined +// cArg: not define +#define PUKE_KBFD_SET_FILTER_ACK -2201 + +// Desc: sets the current file +// iWinId: widget +// iArg: not defined +// cArg: filename (does it need the full path?) +#define PUKE_KBFD_SET_SELECTION 2202 + +// Desc: ack for the set +// iWinId: widget +// iArg: not defined +// cArg: not define +#define PUKE_KBFD_SET_SELECTION_ACK -2202 + +// Desc: ack for current file select +// iWinId: not defined +// iArg: not defined +// cArg: not defined +#define PUKE_KBFD_FILE_SELECTED 2203 + +// Desc: ack for current file select +// iWinId: widget +// iArg: not defined +// cArg: filename +#define PUKE_KBFD_FILE_SELECTED_ACK -2203 + +#endif diff --git a/ksirc/puke/ptdefiledialog.cpp b/ksirc/puke/ptdefiledialog.cpp new file mode 100644 index 00000000..d60b47d5 --- /dev/null +++ b/ksirc/puke/ptdefiledialog.cpp @@ -0,0 +1,123 @@ +#include + + +#include + +#include "ptdefiledialog.h" +#include "ptdefiledialog-cmd.h" + +PObject * +PKFileDialog::createWidget(CreateArgs &ca) +{ + PKFileDialog *pw = new PKFileDialog(ca.parent); + KFileDialog *kfbd; + if(ca.fetchedObj != 0 && ca.fetchedObj->inherits("KFileDialog") == TRUE){ + kfbd = (KFileDialog *) ca.fetchedObj; + pw->setDeleteAble(FALSE); + } + else // Never takes a parent in Puke + kfbd = new KFileDialog("/", TQString(), 0L, "PukeKFileDialog", TRUE); + pw->setWidget(kfbd); + pw->setWidgetId(ca.pwI); + return pw; +} + + +PKFileDialog::PKFileDialog(PObject *parent) + : PWidget(parent) +{ + kfbd = 0; + setWidget(kfbd); +} + +PKFileDialog::~PKFileDialog() +{ + // kdDebug(5008) << "PLineEdit: in destructor" << endl; + /* + delete widget(); // Delete the frame + kfbd=0; // Set it to 0 + setWidget(kfbd); // Now set all widget() calls to 0. + */ +} + +void PKFileDialog::messageHandler(int fd, PukeMessage *pm) +{ + TQString selFile; + PukeMessage pmRet; + if(widget() == 0){ + kdDebug(5008) << "PKFileDialog: No Widget set" << endl; + return; + } + switch(pm->iCommand){ + case PUKE_KBFD_SET_PATH: + ((KFileDialog*)widget())->setURL(KURL(pm->cArg)); + + pmRet.iCommand = - pm->iCommand; + pmRet.iWinId = pm->iWinId; + pmRet.iArg = 0; + pmRet.iTextSize = widget()->baseURL().path().length(); +#warning check if the cast is okay + pmRet.cArg = (char*) widget()->baseURL().path().ascii(); + emit outputMessage(fd, &pmRet); + break; + case PUKE_KBFD_SET_FILTER: + widget()->setFilter(pm->cArg); + + pmRet.iCommand = - pm->iCommand; + pmRet.iWinId = pm->iWinId; + pmRet.iArg = 0; + pmRet.iTextSize = 0; + pmRet.cArg = 0; + emit outputMessage(fd, &pmRet); + break; + case PUKE_KBFD_SET_SELECTION: + widget()->setSelection(pm->cArg); + + pmRet.iCommand = - pm->iCommand; + pmRet.iWinId = pm->iWinId; + pmRet.iArg = 0; + selFile = widget()->selectedURL().path(); + pmRet.iTextSize = selFile.length(); +#warning check if the cast is okay + pmRet.cArg = (char*) selFile.ascii(); + emit outputMessage(fd, &pmRet); + break; + case PUKE_WIDGET_SHOW: + widget()->exec(); + pmRet.iCommand = PUKE_KBFD_FILE_SELECTED_ACK; + pmRet.iWinId = pm->iWinId; + pmRet.iArg = 0; + pmRet.cArg = new char[selFile.length()]; + selFile = widget()->selectedURL().path(); + // #### HPB: using strlen() 'cause we want the length of the .ascii() + // string. We should probably replace in the future. + memcpy(pmRet.cArg, selFile.ascii(), strlen(selFile.ascii())); + pmRet.iTextSize = selFile.length(); + emit outputMessage(widgetIden().fd, &pmRet); + delete pmRet.cArg; + break; + + default: + PWidget::messageHandler(fd, pm); + } +} + +void PKFileDialog::setWidget(TQObject *_kbfd) +{ + if(_kbfd != 0 && _kbfd->inherits("KFileBaseDialog") == FALSE) + { + errorInvalidSet(_kbfd); + return; + } + + kfbd = (KFileDialog *) _kbfd; + PWidget::setWidget(kfbd); +} + + +KFileDialog *PKFileDialog::widget() +{ + return kfbd; +} + +#include "ptdefiledialog.moc" diff --git a/ksirc/puke/ptdefiledialog.h b/ksirc/puke/ptdefiledialog.h new file mode 100644 index 00000000..cdf940a8 --- /dev/null +++ b/ksirc/puke/ptdefiledialog.h @@ -0,0 +1,32 @@ +#ifndef PKFILEDIALOG_H +#define PKFILEDIALOG_H + +class PKFileDialog; + +#include +#include "pmessage.h" +#include "pwidget.h" +#include "controller.h" + +class PKFileDialog : public PWidget +{ + Q_OBJECT + +public: + static PObject *createWidget(CreateArgs &ca); + + PKFileDialog ( PObject * parent ); + virtual ~PKFileDialog (); + + virtual void messageHandler(int fd, PukeMessage *pm); + + virtual void setWidget(TQObject *_f = 0x0); + virtual KFileDialog *widget(); + +public slots: + +private: + KFileDialog *kfbd; +}; + +#endif diff --git a/ksirc/puke/ptdefiledialog.pm b/ksirc/puke/ptdefiledialog.pm new file mode 100644 index 00000000..d91fedca --- /dev/null +++ b/ksirc/puke/ptdefiledialog.pm @@ -0,0 +1,76 @@ + +&::PukeSendMessage($PUKE_WIDGET_LOAD, + $::PUKE_CONTROLLER, + $PWIDGET_KFILEDIALOG, + "ptdefiledialog.so", + sub { my %ARG = %{shift()}; + if($ARG{'iArg'} == 1){ + print "*E* PKFileDialog Load failed!\n"; + } + } + ); + +use strict; + +package PKFileDialog; +use vars qw(@ISA); +@ISA = qw(PWidget); + +sub new { + my $class = shift; + my $self = $class->SUPER::new($class, @_); + + $self->{widgetType} = $::PWIDGET_KFILEDIALOG; + + if($class eq 'PKFileDialog'){ + $self->create(); + } + + $self->installHandler($::PUKE_KBFD_FILE_SELECTED_ACK, sub{$self->fileSelected(shift())}); + + return $self; + +} + +sub setDir { + my $self = shift; + + my $dir = shift; + + $self->sendMessage('iCommand' => $::PUKE_KBFD_SET_PATH, + 'cArg' => $dir, + 'CallBack' => sub{}); + +} + +sub setFilter { + my $self = shift; + + my $filter = shift; + + $self->sendMessage('iCommand' => $::PUKE_KBFD_SET_FILTER, + 'cArg' => $filter, + 'CallBack' => sub{}); + +} + +sub setSelected { + my $self = shift; + + my $sel = shift; + + $self->sendMessage('iCommand' => $::PUKE_KBFD_SET_SELECTION, + 'cArg' => $sel, + 'CallBack' => sub{}); + +} + +sub fileSelected { + my $self = shift; + my $rargs = shift; + + &::print("*I* File Selected: " . $rargs->{'cArg'}); + +} + +package main; diff --git a/ksirc/servercontroller.cpp b/ksirc/servercontroller.cpp index 61495815..4eea7003 100644 --- a/ksirc/servercontroller.cpp +++ b/ksirc/servercontroller.cpp @@ -82,7 +82,7 @@ #include #include -#include +#include #include #include #include diff --git a/ksirc/topic.cpp b/ksirc/topic.cpp index e1623a3c..92066916 100644 --- a/ksirc/topic.cpp +++ b/ksirc/topic.cpp @@ -21,8 +21,8 @@ #include #include #include -#include -#include +#include +#include #include "ksopts.h" #include "ksparser.h" diff --git a/ksirc/toplevel.cpp b/ksirc/toplevel.cpp index de75ee5f..3d502a52 100644 --- a/ksirc/toplevel.cpp +++ b/ksirc/toplevel.cpp @@ -67,9 +67,9 @@ #include #include #include -#include +#include #include -#include +#include #include #include #include diff --git a/ksirc/usercontrolmenu.cpp b/ksirc/usercontrolmenu.cpp index 6fddff90..522a5ada 100644 --- a/ksirc/usercontrolmenu.cpp +++ b/ksirc/usercontrolmenu.cpp @@ -1,7 +1,7 @@ #include "usercontrolmenu.h" #include -#include +#include #include TQPtrList UserControlMenu::UserMenu; diff --git a/ktalkd/kcmktalkd/CMakeLists.txt b/ktalkd/kcmktalkd/CMakeLists.txt index f9f7a560..52c2681a 100644 --- a/ktalkd/kcmktalkd/CMakeLists.txt +++ b/ktalkd/kcmktalkd/CMakeLists.txt @@ -32,6 +32,6 @@ install( FILES kcmktalkd.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} ) tde_add_kpart( kcm_ktalkd AUTOMOC SOURCES main.cpp soundpage.cpp answmachpage.cpp forwmachpage.cpp - LINK kio-shared + LINK tdeio-shared DESTINATION ${PLUGIN_INSTALL_DIR} ) diff --git a/ktalkd/kcmktalkd/kcmktalkd.desktop b/ktalkd/kcmktalkd/kcmktalkd.desktop index 6ddbe1f7..c2ddc066 100644 --- a/ktalkd/kcmktalkd/kcmktalkd.desktop +++ b/ktalkd/kcmktalkd/kcmktalkd.desktop @@ -2,7 +2,7 @@ Icon=ktalkd Type=Application DocPath=kcontrol/kcmtalkd/index.html -Exec=kcmshell kcmktalkd +Exec=tdecmshell kcmktalkd X-TDE-ModuleType=Library X-TDE-Library=ktalkd diff --git a/ktalkd/ktalkd/readcfg++.cpp b/ktalkd/ktalkd/readcfg++.cpp index 1c0e9931..66eb1d79 100644 --- a/ktalkd/ktalkd/readcfg++.cpp +++ b/ktalkd/ktalkd/readcfg++.cpp @@ -50,7 +50,7 @@ #include /* KDE & TQt includes */ -#include +#include #include #include #include diff --git a/ktalkd/ktalkdlg/ktalkdlg.cpp b/ktalkd/ktalkdlg/ktalkdlg.cpp index 6ac67cca..b3a1b28e 100644 --- a/ktalkd/ktalkdlg/ktalkdlg.cpp +++ b/ktalkd/ktalkdlg/ktalkdlg.cpp @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include diff --git a/lanbrowsing/kcmlisa/kcmkiolan.desktop b/lanbrowsing/kcmlisa/kcmkiolan.desktop index 06fba0d7..78279de8 100644 --- a/lanbrowsing/kcmlisa/kcmkiolan.desktop +++ b/lanbrowsing/kcmlisa/kcmkiolan.desktop @@ -1,7 +1,7 @@ [Desktop Entry] Type=Application Icon=samba -Exec=kcmshell kcmkiolan +Exec=tdecmshell kcmkiolan X-TDE-ModuleType=Library X-TDE-Library=lanbrowser @@ -9,7 +9,7 @@ X-TDE-FactoryName=kiolan Name=LAN KIO Slave Name[ar]=الشبكة المحلية KIO Slave -Name[be]=Модуль kioslave для мясцовай сетцы +Name[be]=Модуль tdeioslave для мясцовай сетцы Name[bn]=ল্যান কে-আই-ও স্লেভ Name[br]=Sklav LAN evit KIO Name[bs]=LAN KIO slave diff --git a/lanbrowsing/kcmlisa/kcmkiolan.h b/lanbrowsing/kcmlisa/kcmkiolan.h index 53e88ed3..86dd0fa4 100644 --- a/lanbrowsing/kcmlisa/kcmkiolan.h +++ b/lanbrowsing/kcmlisa/kcmkiolan.h @@ -23,7 +23,7 @@ #include "portsettingsbar.h" #include -#include +#include class TQCheckBox; class TQLineEdit; diff --git a/lanbrowsing/kcmlisa/kcmlisa.desktop b/lanbrowsing/kcmlisa/kcmlisa.desktop index 161a8f9f..ffd92dd0 100644 --- a/lanbrowsing/kcmlisa/kcmlisa.desktop +++ b/lanbrowsing/kcmlisa/kcmlisa.desktop @@ -1,7 +1,7 @@ [Desktop Entry] Type=Application Icon=samba -Exec=kcmshell kcmlisa +Exec=tdecmshell kcmlisa X-TDE-ModuleType=Library X-TDE-Library=lanbrowser diff --git a/lanbrowsing/kcmlisa/kcmlisa.h b/lanbrowsing/kcmlisa/kcmlisa.h index 6e0370ee..1f83942e 100644 --- a/lanbrowsing/kcmlisa/kcmlisa.h +++ b/lanbrowsing/kcmlisa/kcmlisa.h @@ -21,7 +21,7 @@ #ifndef KCMLISA_H #define KCMLISA_H -#include +#include #include class TQPushButton; diff --git a/lanbrowsing/kcmlisa/kcmreslisa.desktop b/lanbrowsing/kcmlisa/kcmreslisa.desktop index f83db9f9..04098538 100644 --- a/lanbrowsing/kcmlisa/kcmreslisa.desktop +++ b/lanbrowsing/kcmlisa/kcmreslisa.desktop @@ -1,7 +1,7 @@ [Desktop Entry] Type=Application Icon=samba -Exec=kcmshell kcmreslisa +Exec=tdecmshell kcmreslisa X-TDE-ModuleType=Library X-TDE-Library=lanbrowser diff --git a/lanbrowsing/kcmlisa/kcmreslisa.h b/lanbrowsing/kcmlisa/kcmreslisa.h index 522b504e..69f226db 100644 --- a/lanbrowsing/kcmlisa/kcmreslisa.h +++ b/lanbrowsing/kcmlisa/kcmreslisa.h @@ -22,7 +22,7 @@ #define KCMRESLISA_H #include -#include +#include class TQSpinBox; diff --git a/lanbrowsing/kio_lan/CMakeLists.txt b/lanbrowsing/kio_lan/CMakeLists.txt index d3a117f3..d2fb242f 100644 --- a/lanbrowsing/kio_lan/CMakeLists.txt +++ b/lanbrowsing/kio_lan/CMakeLists.txt @@ -43,6 +43,6 @@ install( FILES tde_add_kpart( kio_lan SOURCES kio_lan.cpp - LINK kio-shared + LINK tdeio-shared DESTINATION ${PLUGIN_INSTALL_DIR} ) diff --git a/lanbrowsing/kio_lan/Makefile.am b/lanbrowsing/kio_lan/Makefile.am index c7a22ed6..90eaec15 100644 --- a/lanbrowsing/kio_lan/Makefile.am +++ b/lanbrowsing/kio_lan/Makefile.am @@ -1,4 +1,4 @@ -## Makefile.am of tdebase/kioslave/man +## Makefile.am of tdebase/tdeioslave/man INCLUDES= $(all_includes) @@ -27,5 +27,5 @@ konq_sidebartreedir = $(kde_datadir)/konqsidebartng/virtual_folders/services METASOURCES = AUTO messages: - $(XGETTEXT) *.cpp -o $(podir)/kio_lan.pot + $(XGETTEXT) *.cpp -o $(podir)/tdeio_lan.pot diff --git a/lanbrowsing/kio_lan/README b/lanbrowsing/kio_lan/README index 08b6278a..224cae5b 100644 --- a/lanbrowsing/kio_lan/README +++ b/lanbrowsing/kio_lan/README @@ -8,9 +8,9 @@ use the automake/configure stuff. On some systems (e.g. Solaris) you will have to add some libraries, like -lnsl, I think. -Copy this directory e.g. under tdebase/kioslave and enter it in -tdebase/kioslave/Makefile.am in the SUBDIR line. The rerun make in -tdebase/kioslave. +Copy this directory e.g. under tdebase/tdeioslave and enter it in +tdebase/tdeioslave/Makefile.am in the SUBDIR line. The rerun make in +tdebase/tdeioslave. Alexander Neundorf diff --git a/lanbrowsing/kio_lan/kio_lan.cpp b/lanbrowsing/kio_lan/kio_lan.cpp index 9490f7b4..4e7040ac 100644 --- a/lanbrowsing/kio_lan/kio_lan.cpp +++ b/lanbrowsing/kio_lan/kio_lan.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include diff --git a/lanbrowsing/kio_lan/kio_lan.h b/lanbrowsing/kio_lan/kio_lan.h index 40dd14ba..6b9887dc 100644 --- a/lanbrowsing/kio_lan/kio_lan.h +++ b/lanbrowsing/kio_lan/kio_lan.h @@ -20,9 +20,9 @@ #ifndef KIO_XLAN_H #define KIO_XLAN_H -#include -#include -#include +#include +#include +#include #include #include diff --git a/lanbrowsing/kio_lan/lan.protocol b/lanbrowsing/kio_lan/lan.protocol index ba72a216..59c72062 100644 --- a/lanbrowsing/kio_lan/lan.protocol +++ b/lanbrowsing/kio_lan/lan.protocol @@ -10,6 +10,6 @@ makedir=false deleting=false linking=false moving=false -DocPath=kioslave/lan.html +DocPath=tdeioslave/lan.html Icon=network_local Class=:local diff --git a/lanbrowsing/kio_lan/rlan.protocol b/lanbrowsing/kio_lan/rlan.protocol index de2c0ad4..79fe3c3c 100644 --- a/lanbrowsing/kio_lan/rlan.protocol +++ b/lanbrowsing/kio_lan/rlan.protocol @@ -10,6 +10,6 @@ makedir=false deleting=false linking=false moving=false -DocPath=kioslave/rlan.html +DocPath=tdeioslave/rlan.html Icon=network_local Class=:local diff --git a/librss/CMakeLists.txt b/librss/CMakeLists.txt index 2456b38d..4803ed69 100644 --- a/librss/CMakeLists.txt +++ b/librss/CMakeLists.txt @@ -36,7 +36,7 @@ tde_add_library( rss SHARED AUTOMOC article.cpp document.cpp image.cpp textinput.cpp tools_p.cpp loader.cpp VERSION 1.0.0 - LINK kio-shared + LINK tdeio-shared DESTINATION ${LIB_INSTALL_DIR} ) diff --git a/librss/image.cpp b/librss/image.cpp index aca4ba3b..73888f5b 100644 --- a/librss/image.cpp +++ b/librss/image.cpp @@ -11,7 +11,7 @@ #include "image.h" #include "tools_p.h" -#include +#include #include #include diff --git a/librss/loader.cpp b/librss/loader.cpp index 4eab3cc5..3346385a 100644 --- a/librss/loader.cpp +++ b/librss/loader.cpp @@ -11,7 +11,7 @@ #include "loader.h" #include "document.h" -#include +#include #include #include diff --git a/librss/loader.h b/librss/loader.h index 1f6ac05b..393e7ac6 100644 --- a/librss/loader.h +++ b/librss/loader.h @@ -113,7 +113,7 @@ namespace RSS /** * @return The error code for the last process of retrieving data. * The returned numbers correspond directly to the error codes - * as + * as * defined by KIO. */ virtual int errorCode() const; diff --git a/tdednssd/ioslave/CMakeLists.txt b/tdednssd/ioslave/CMakeLists.txt index 6a37a49a..6f15a6b0 100644 --- a/tdednssd/ioslave/CMakeLists.txt +++ b/tdednssd/ioslave/CMakeLists.txt @@ -39,6 +39,6 @@ install( FILES tde_add_kpart( kio_zeroconf AUTOMOC SOURCES dnssd.cpp - LINK tdednssd-shared kio-shared + LINK tdednssd-shared tdeio-shared DESTINATION ${PLUGIN_INSTALL_DIR} ) diff --git a/tdednssd/ioslave/CONFIG_FORMAT b/tdednssd/ioslave/CONFIG_FORMAT index 43e34001..35e25ea6 100644 --- a/tdednssd/ioslave/CONFIG_FORMAT +++ b/tdednssd/ioslave/CONFIG_FORMAT @@ -37,7 +37,7 @@ UserEntry=u PasswordEntry=p -Resolved URL will be ssh://user:password@machine:port/ . ssh is helper protocol so ktelnetservice will be launched for +Resolved URL will be ssh://user:password@machine:port/ . ssh is helper protocol so tdetelnetservice will be launched for this URL. diff --git a/tdednssd/ioslave/Makefile.am b/tdednssd/ioslave/Makefile.am index 3454d0f1..266dfeb4 100644 --- a/tdednssd/ioslave/Makefile.am +++ b/tdednssd/ioslave/Makefile.am @@ -16,6 +16,6 @@ remote_DATA = zeroconf.desktop remotedir = $(kde_datadir)/remoteview messages: rc.cpp - $(XGETTEXT) *.cpp -o $(podir)/kio_zeroconf.pot + $(XGETTEXT) *.cpp -o $(podir)/tdeio_zeroconf.pot METASOURCES = AUTO diff --git a/tdednssd/ioslave/dnssd.cpp b/tdednssd/ioslave/dnssd.cpp index ba510be0..c045d41c 100644 --- a/tdednssd/ioslave/dnssd.cpp +++ b/tdednssd/ioslave/dnssd.cpp @@ -31,7 +31,7 @@ #include #include -#include +#include #include #include #include diff --git a/tdednssd/ioslave/dnssd.h b/tdednssd/ioslave/dnssd.h index f06b0427..be9b95be 100644 --- a/tdednssd/ioslave/dnssd.h +++ b/tdednssd/ioslave/dnssd.h @@ -26,8 +26,8 @@ #include #include -#include -#include +#include +#include #include #include #include diff --git a/tdednssd/ioslave/zeroconf.protocol b/tdednssd/ioslave/zeroconf.protocol index 5343b282..2d4a9800 100644 --- a/tdednssd/ioslave/zeroconf.protocol +++ b/tdednssd/ioslave/zeroconf.protocol @@ -12,52 +12,52 @@ deleting=false linking=false moving=false Icon=network_local -Description=A kioslave for ZeroConf -Description[be]=Модуль kioslave для ZeroConf +Description=A tdeioslave for ZeroConf +Description[be]=Модуль tdeioslave для ZeroConf Description[bn]=জিরো-কন্ফ এর জন্য একটি কে-আই-ও স্লেভ Description[br]=Ur c'hioslave evit ZeroConf -Description[bs]=kioslave za ZeroConf -Description[ca]=Un kioslave per ZeroConf +Description[bs]=tdeioslave za ZeroConf +Description[ca]=Un tdeioslave per ZeroConf Description[cs]=Pomocný protokol pro Zeroconf -Description[da]=En kioslave for Zeroconf +Description[da]=En tdeioslave for Zeroconf Description[de]=Ein Ein-/Ausgabemodul für ZeroConf -Description[el]=Ένα kioslave για το ZeroConf -Description[es]=Un «kioslave» para ZeroConf +Description[el]=Ένα tdeioslave για το ZeroConf +Description[es]=Un «tdeioslave» para ZeroConf Description[et]=ZeroConfi I/O-moodul -Description[eu]= kioslave bat ZeroConf-erako -Description[fa]=یک kioslave برای ZeroConf +Description[eu]= tdeioslave bat ZeroConf-erako +Description[fa]=یک tdeioslave برای ZeroConf Description[fi]=Siirräntätyöskentelijä ZeroConfille Description[fr]=Un module d'entrée / sortie pour ZeroConf Description[gl]=Un kioslabe para ZeroConf -Description[he]=kioslave בשביל ZeroConf +Description[he]=tdeioslave בשביל ZeroConf Description[hu]=KDE-protokoll a Zeroconf használatához -Description[is]=kioslave fyrir ZeroConf -Description[it]=Un kioslave per Zeroconf -Description[ja]=ZeroConf の kioslave -Description[ka]= kioslave ZeroConfსთვის -Description[kk]=ZeroConf-тың kioslave-і -Description[km]=kioslave មួយ​សម្រាប់ ZeroConf +Description[is]=tdeioslave fyrir ZeroConf +Description[it]=Un tdeioslave per Zeroconf +Description[ja]=ZeroConf の tdeioslave +Description[ka]= tdeioslave ZeroConfსთვის +Description[kk]=ZeroConf-тың tdeioslave-і +Description[km]=tdeioslave មួយ​សម្រាប់ ZeroConf Description[lt]=Antrinė KDE programa skirta ZeroConf -Description[nb]=En kioslave for ZeroConf +Description[nb]=En tdeioslave for ZeroConf Description[nds]=In-/Utgaavmoduul för ZeroConf Description[ne]=जेरोकन्फका लागि कियोस्लाभ -Description[nl]=Een kioslave voor ZeroConf +Description[nl]=Een tdeioslave voor ZeroConf Description[nn]=Ein kio-slave for ZeroConf Description[pl]=Wtyczka protokołu ZeroConf -Description[pt]=Um 'kioslave' para o ZeroConf +Description[pt]=Um 'tdeioslave' para o ZeroConf Description[pt_BR]=Um IO-Slave para o ZeroConf Description[ro]=Un dispozitiv de I/E pentru ZeroConf Description[ru]=Kioslave для ZeroConf -Description[sk]=kioslave pre ZeroConf +Description[sk]=tdeioslave pre ZeroConf Description[sl]=Kioslave za ZeroConf -Description[sr]=kioslave за ZeroConf -Description[sr@Latn]=kioslave za ZeroConf +Description[sr]=tdeioslave за ZeroConf +Description[sr@Latn]=tdeioslave za ZeroConf Description[sv]=En I/O-slav för Zeroconf -Description[tr]=Zeroconf kioslave'i +Description[tr]=Zeroconf tdeioslave'i Description[uk]=Kioslave для ZeroConf -Description[zh_CN]=ZeroConf 的 kioslave -Description[zh_HK]=用於 ZeroConf 的 kioslave -Description[zh_TW]=ZeroConf 的 kioslave +Description[zh_CN]=ZeroConf 的 tdeioslave +Description[zh_HK]=用於 ZeroConf 的 tdeioslave +Description[zh_TW]=ZeroConf 的 tdeioslave maxInstances=4 Class=:local diff --git a/tdefile-plugins/CMakeLists.txt b/tdefile-plugins/CMakeLists.txt new file mode 100644 index 00000000..26723ebe --- /dev/null +++ b/tdefile-plugins/CMakeLists.txt @@ -0,0 +1,12 @@ +################################################# +# +# (C) 2010-2011 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +add_subdirectory( torrent ) diff --git a/tdefile-plugins/Makefile.am b/tdefile-plugins/Makefile.am new file mode 100644 index 00000000..d092f6a0 --- /dev/null +++ b/tdefile-plugins/Makefile.am @@ -0,0 +1 @@ +SUBDIRS=torrent diff --git a/tdefile-plugins/RETURNED_ITEMS b/tdefile-plugins/RETURNED_ITEMS new file mode 100644 index 00000000..13a579ca --- /dev/null +++ b/tdefile-plugins/RETURNED_ITEMS @@ -0,0 +1,15 @@ +If you make a new plugin, please add the list of returned items to this list. + +torrent plugin: +=========== + +type tag comment +============================================================================== +String name Default file/directory name. +Int length In Bytes, not the size of the .torrent. +String announce URL of the tracker server. +Date creation date Date the .torrent was generated. +Int NumFiles The number of files the .torrent will download. +Int piece length The block size used for this torrent. Each block + is downloaded and hashed separately. +String comment diff --git a/tdefile-plugins/torrent/CMakeLists.txt b/tdefile-plugins/torrent/CMakeLists.txt new file mode 100644 index 00000000..a14c3e23 --- /dev/null +++ b/tdefile-plugins/torrent/CMakeLists.txt @@ -0,0 +1,38 @@ +################################################# +# +# (C) 2010-2011 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +include_directories( + ${CMAKE_CURRENT_BINARY_DIR} + ${TDE_INCLUDE_DIR} + ${TQT_INCLUDE_DIRS} +) + +link_directories( + ${TQT_LIBRARY_DIRS} +) + + +##### other data ################################ + +install( FILES + tdefile_torrent.desktop + DESTINATION ${SERVICES_INSTALL_DIR} ) + + +##### tdefile_torrent (module) #################### + +tde_add_kpart( tdefile_torrent AUTOMOC + SOURCES + bytetape.cpp bint.cpp bstring.cpp blist.cpp + bdict.cpp tdefile_torrent.cpp + LINK tdeio-shared + DESTINATION ${PLUGIN_INSTALL_DIR} +) diff --git a/tdefile-plugins/torrent/Makefile.am b/tdefile-plugins/torrent/Makefile.am new file mode 100644 index 00000000..299dbe45 --- /dev/null +++ b/tdefile-plugins/torrent/Makefile.am @@ -0,0 +1,22 @@ +## Makefile.am for folder file meta info plugin + +INCLUDES = $(all_includes) + +# these are the headers for your project +noinst_HEADERS = tdefile_torrent.h bbase.h bdict.h bytetape.h \ + bstring.h bint.h blist.h + +kde_module_LTLIBRARIES = tdefile_torrent.la + +tdefile_torrent_la_SOURCES = bytetape.cpp bint.cpp bstring.cpp blist.cpp bdict.cpp tdefile_torrent.cpp +tdefile_torrent_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor +tdefile_torrent_la_LIBADD = $(LIB_KIO) + +# let automoc handle all of the meta source files (moc) +METASOURCES = AUTO + +services_DATA = tdefile_torrent.desktop +servicesdir = $(kde_servicesdir) + +messages: + $(XGETTEXT) *.cpp -o $(podir)/tdefile_torrent.pot diff --git a/tdefile-plugins/torrent/README b/tdefile-plugins/torrent/README new file mode 100644 index 00000000..ae85b049 --- /dev/null +++ b/tdefile-plugins/torrent/README @@ -0,0 +1,7 @@ +This is a meta information plugin for BitTorrent files (*.torrent). + +It doesn't depend on BitTorrent or any non-standard library being installed. + +The .torrent files used by BitTorrent are coded in what is called a b-encoding +by the BitTorrent author. Please see the actual tdefile plugin source code for +more information on the encoding. diff --git a/tdefile-plugins/torrent/bbase.h b/tdefile-plugins/torrent/bbase.h new file mode 100644 index 00000000..30da7528 --- /dev/null +++ b/tdefile-plugins/torrent/bbase.h @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2003, 2004 Michael Pyne + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this library; see the file COPYING. + * If not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +#ifndef _BBASE_H +#define _BBASE_H + +#include + +class TQIODevice; + +/** + * Abstract base class for the b-encoded types. Re-implemented + * by BInt, BList, BDict, and BString. Derive from this class in + * order to make a new type for the b-encoding suite. Classes + * derived from this one should not throw exceptions. Instead, + * they should implement isValid(), and allow calling modules to + * check error status that way. + * + * @author Michael Pyne + * @see BInt, BList, BDict, BString, KSharedPtr + */ + +// Derive from KShared to enable use of KSharedPtr. +class BBase : public KShared +{ + public: + + /** + * Identifies the particular class that has been instantiated. All + * subclasses of this class should have an identifier here. + */ + enum classID { + bBase, /**< This class is BBase. No subclass should return this. */ + bString, /**< This class is a BString. */ + bInt, /**< This class is a BInt. */ + bList, /**< This class is a BList. */ + bDict /**< This class is a BDict. (Dictionary/Map) */ + }; + + /** + * Returns the type identification of the object. It will + * be a value in the classID enum. A subclass of this class + * must implement this function. + * + * @return type identifier of the class + * @see classID + */ + virtual classID type_id() const = 0; + + /** + * Destructor for the class. This function must be reimplemented + * in subclasses. + */ + virtual ~BBase () { ; } + + /** + * Returns the validity status of the object. Newly constructed + * objects are invalid unless the initialization sequence completed + * successfully. + * + * @return the validity status of the object + */ + virtual bool isValid() const = 0; + + /** + * Outputs the b-encoded representation of the object to the given + * TQIODevice. + * @param device the TQIODevice to write to + * @return true on a successful write, false otherwise + */ + virtual bool writeToDevice (TQIODevice &device) = 0; +}; + +#endif /* _BBASE_H */ + +// vim: set et sw=4 ts=4: diff --git a/tdefile-plugins/torrent/bdict.cpp b/tdefile-plugins/torrent/bdict.cpp new file mode 100644 index 00000000..712fd526 --- /dev/null +++ b/tdefile-plugins/torrent/bdict.cpp @@ -0,0 +1,220 @@ +/* + * Copyright (c) 2003, 2004 Michael Pyne + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this library; see the file COPYING. + * If not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +#include +#include + +#include + +#include "bbase.h" +#include "bdict.h" +#include "bstring.h" +#include "bint.h" +#include "blist.h" + +BDict::BDict (TQByteArray &dict, int start) + : m_map(), m_valid(false) +{ + ByteTape tape(dict, start); + + init (tape); +} + +BDict::BDict (ByteTape &tape) + : m_map(), m_valid (false) +{ + init (tape); +} + +void BDict::init (ByteTape &tape) +{ + if (*tape != 'd') + { + kdDebug(7034) << "This isn't a dictionary!" << endl; + return; // This isn't a dictionary + } + + tape++; + + // We need to loop and read in a string, then read in some data + while (*tape != 'e') + { + BBase *temp_item = 0; + + // Read in string + KSharedPtr str (new BString (tape)); + + // Ensure str will be automatically deleted + if (!str || !str->isValid()) + { + kdDebug(7034) << (str ? "Invalid string" : "Unable to read String!") << endl; + return; + } + + // Read in data + switch (*tape) + { + case 'l': + temp_item = new BList (tape); + break; + + case 'i': + temp_item = new BInt (tape); + break; + + case 'd': + temp_item = new BDict (tape); + break; + + default: + // Hopefully this is a string + temp_item = new BString (tape); + } + + if (!temp_item || !temp_item->isValid()) + { + kdDebug(7034) << (temp_item ? "Invalid item!" + : "Unable to create keyed data!") << endl; + return; + } + + m_map.insert(str->get_string(), temp_item); + } + + // Move past the 'e' + tape++; + + // Let the map delete the items + m_map.setAutoDelete (true); + + // Oh yeah, we're valid now, too. :-) + m_valid = true; +} + +BDict::~BDict () +{ + // TQDict will take care of deleting each entry that + // it holds. +} + +BInt *BDict::findInt (const char *key) +{ + BBase *base = find(key); + + if (base && base->type_id() == bInt) + return dynamic_cast(base); + + return 0; +} + +BList *BDict::findList (const char *key) +{ + BBase *base = find(key); + + if (base && base->type_id() == bList) + return dynamic_cast(base); + + return 0; +} + +BDict *BDict::findDict (const char *key) +{ + BBase *base = find(key); + + if (base && base->type_id() == bDict) + return dynamic_cast(base); + + return 0; +} + +BString *BDict::findStr (const char *key) +{ + BBase *base = find(key); + + if (base && base->type_id() == bString) + return dynamic_cast(base); + + return 0; +} + +bool BDict::writeToDevice(TQIODevice &device) +{ + if (!isValid()) + return false; + + const char *d_str = "d"; + const char *e_str = "e"; + TQ_LONG written = 0, result = 0; + + written = device.writeBlock (d_str, 1); + while (written < 1) + { + if (written < 0 || result < 0) + return false; + + result = device.writeBlock (d_str, 1); + written += result; + } + + // Strings are supposed to be written in the dictionary such that + // the keys are in sorted order. TQDictIterator doesn't support an + // ordering, so we have to get a list of all the keys, sort it, and + // then go by the list. + + BBaseHashIterator iter (m_map); + TQStringList key_list; + + for ( ; iter.current(); ++iter) + key_list.append(iter.currentKey()); + + key_list.sort(); + + TQStringList::Iterator key_iter; + for (key_iter = key_list.begin(); key_iter != key_list.end(); ++key_iter) + { + TQCString utfString = (*key_iter).utf8(); + TQString str = TQString("%1:").arg(utfString.size() - 1); + + TQCString lenString = str.utf8(); + + // Write out length of key + device.writeBlock(lenString.data(), lenString.size() - 1); + + // Write out actual key + device.writeBlock(utfString.data(), utfString.size() - 1); + + // Write out the key's data + BBase *base = m_map.find(*key_iter); + if (!base->writeToDevice (device)) + return false; + } + + written = device.writeBlock (e_str, 1); + while ((uint) written < 1) + { + if (written < 0 || result < 0) + return false; + + result = device.writeBlock (e_str, 1); + written += result; + } + + return true; +} + +// vim: set et sw=4 ts=4: diff --git a/tdefile-plugins/torrent/bdict.h b/tdefile-plugins/torrent/bdict.h new file mode 100644 index 00000000..61be065b --- /dev/null +++ b/tdefile-plugins/torrent/bdict.h @@ -0,0 +1,203 @@ +/* + * Copyright (c) 2003, 2004 Michael Pyne + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this library; see the file COPYING. + * If not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +#ifndef _BDICT_H +#define _BDICT_H + +#include +#include // TQByteArray +#include "bytetape.h" +#include "bbase.h" + +// Some useful typedefs +typedef TQDict BBaseHash; +typedef TQDictIterator BBaseHashIterator; + +// Forward declarations +class BInt; +class BList; +class BString; + +/** + * Class to handle the BitTorrent b-encoded dictionary. It is keyed + * using const char *strings, and stores pointers to a class descended + * from BBase, such as BInt, BString, BList, or even more BDicts. + * + * @author Michael Pyne + * @see BBase, BInt, BString, BList + */ +class BDict : public BBase +{ + public: + + /** + * Construct a dictionary based on the b-encoded data contained in + * @p dict. You need to pass a value for @p start if the b-encoded + * dictionary doesn't start at the beginning of @p dict. + * + * @param dict the buffer containing the b-encoded dictionary + * @param start the position of the data within the buffer + */ + BDict (TQByteArray &dict, int start = 0); + + /** + * Construct a dictionary from a ByteTape. The data and current + * position of @p tape will be shared with all objects using it. + * @p tape should already be positioned to the b-encoded dictionary. + * After construction, @p tape will point to the byte after the + * dictionary if successful. If not successful, @p tape will have + * an undefined position. + * + * @param tape the ByteTape to read from + * @see ByteTape + */ + BDict (ByteTape &tape); + + /** + * Destroys the object and frees all memory allocated to it. + */ + virtual ~BDict(); + + /** + * Returns the type of this class. + * + * @return bDict. This value is only returned by this class. + */ + virtual classID type_id() const { return bDict; } + + /** + * Returns the number of keyed values contained within this + * dictionary. + * + * @return the number of items in this dictionary + */ + virtual int count() const { return m_map.count(); } + + /** + * This function should be called to determine whether the + * dictionary was successfully created, since no exceptions + * are thrown. + * + * @return true if this is a valid (possibly empty!) dictionary, + * false otherwise + */ + virtual bool isValid() const { return m_valid; } + + /** + * This function determines whether or not a value with a + * certain key exists in the dictionary. The key is case-sensitive. + * + * @param key the key to search for a value for + * @return true, if there is a value for the @p key in the + * dictionary, false otherwise + */ + virtual bool contains (const char *key) { return m_map.find(key) != 0; } + + /** + * Returns a pointer to the BBase descendant keyed by @p key. You + * can use the type_id() method to determine the type of the + * object returned. + * + * @param key the key to search the dictionary for + * @return a pointer to the matching object, or 0 if no object + * matches the key + * @see BBase + */ + virtual BBase *find (const char *key) { return m_map.find(key); } + + /** + * Convienience function to find and return a BInt keyed by @p key. + * + * @param key the key to find a value for + * @return 0 if the key doesn't match a value, or if the value isn't + * a BInt. Otherwise, a pointer to the matching BInt is + * returned. + * @see BInt + */ + BInt* findInt (const char *key); + + /** + * Convienience function to find and return a BList keyed by @p key. + * + * @param key the key to find a value for + * @return 0 if the key doesn't match a value, or if the value isn't + * a BList. Otherwise, a pointer to the matching BList is + * returned. + * @see BList + */ + BList* findList (const char *key); + + /** + * Convienience function to find and return a BDict keyed by @p key. + * + * @param key the key to find a value for + * @return 0 if the key doesn't match a value, or if the value isn't + * a BDict. Otherwise, a pointer to the matching BDict is + * returned. + * @see BDict + */ + BDict* findDict (const char *key); + + /** + * Convienience function to find and return a BString keyed by @p key. + * + * @param key the key to find a value for + * @return 0 if the key doesn't match a value, or if the value isn't + * a BString. Otherwise, a pointer to the matching BString is + * returned. + * @see BString + */ + BString* findStr (const char *key); + + /** + * Outputs the b-encoded representation of the object to the given + * TQIODevice. + * @param device the TQIODevice to write to + * @return true on a successful write, false otherwise + */ + virtual bool writeToDevice (TQIODevice &device); + + /** + * Returns a TQDictIterator that you can use to iterate through + * the items in the dictionary. + * + * @return TQDictIterator, which can be used to iterate through + * the items in the dictionary. + */ + BBaseHashIterator iterator() const + { + return BBaseHashIterator(m_map); + } + + private: + + /** + * This function handles the actual initialization of the object upon + * construction, and set the m_valid flag if successful. + * + * @param tape the ByteTape to read from + */ + void init (ByteTape &tape); + + BBaseHash m_map; /// The TQDict that actually store the data + bool m_valid; /// Store initialization status +}; + +#endif /* _BDICT_H */ + +// vim: set et sw=4 ts=4: diff --git a/tdefile-plugins/torrent/bint.cpp b/tdefile-plugins/torrent/bint.cpp new file mode 100644 index 00000000..db73aa72 --- /dev/null +++ b/tdefile-plugins/torrent/bint.cpp @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2003, 2004 Michael Pyne + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this library; see the file COPYING. + * If not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +#include +#include +#include + +#include "bytetape.h" +#include "bint.h" + +// A bencoded int is (approximately) as follows: +// i(\d)+e +BInt::BInt (TQByteArray &dict, int start) + : m_value (0), m_valid(false) +{ + ByteTape tape (dict, start); + init (tape); +} + +BInt::BInt (ByteTape &tape) + : m_value(0), m_valid(false) +{ + init(tape); +} + +void BInt::init (ByteTape &tape) +{ + if (*tape != 'i') + return; + + tape ++; // Move to start of digits + + TQByteArray &dict (tape.data()); + if (dict.find('e', tape.pos()) == -1) + return; + + // Copy the part from the start to the e. The values in-between + // should be digits, perhaps preceded by a negative sign. + int length = dict.find('e', tape.pos()) - tape.pos(); + char *ptr = dict.data(); // Get start of buffer + ptr += tape.pos(); // Advance to current position in tape + + // Allocate temporary data buffer + TQByteArray buffer(length + 1); + + tqmemmove (buffer.data(), ptr, length); + buffer[length] = 0; // Null-terminate + + TQString numberString (buffer); + bool a_isValid; // We want to make sure the string is a valid number + + m_value = numberString.toLongLong(&a_isValid); + + tape += length; // Move to 'e' + tape ++; // Move to next char + + m_valid = a_isValid; // Now we're good, if it was a number +} + +BInt::~BInt() +{ + /* Nothing yet */ +} + +bool BInt::writeToDevice (TQIODevice &device) +{ + if (!m_valid) + return false; + + /* Write out i234e, and such */ + TQString str = TQString("i%1e"). + arg (m_value); + + TQ_LONG written = 0, result = 0; + written = device.writeBlock (str.latin1(), str.length()); + while ((uint) written < str.length()) + { + if (written < 0 || result < 0) + return false; + + result = device.writeBlock(str.latin1() + written, + str.length() - written); + written += result; + } + + return true; +} + +// vim: set et ts=4 sw=4: diff --git a/tdefile-plugins/torrent/bint.h b/tdefile-plugins/torrent/bint.h new file mode 100644 index 00000000..e2ce2cc3 --- /dev/null +++ b/tdefile-plugins/torrent/bint.h @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2003, 2004 Michael Pyne + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this library; see the file COPYING. + * If not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +#ifndef _BINT_H +#define _BINT_H + +#include +#include "bbase.h" +#include "bytetape.h" + +/** + * Class to represent a b-encoded integer. + * + * @author Michael Pyne + * @see BBase + */ +class BInt : public BBase +{ + public: + + /** + * Constructs a BInt by reading a b-encoded integer from @p dict. + * You can start reading from a position other than the beginning + * by passing that position to the constructor. + * + * @param dict the buffer to read from + * @param start the position within the buffer of the beginning + * of the b-encoded integer. + */ + BInt (TQByteArray &dict, int start = 0); + + /** + * Constructs a BInt by reading a b-encoded integer from @p tape. + * + * @param tape the ByteTape to read from. It should already be + * positioned at the beginning of the b-encoded integer data. + * After construction, @p tape will point to the byte after + * the b-encoded integer on success. If construction was + * not successful, @p tape will have an undefined position. + */ + BInt (ByteTape &tape); + + /** + * Destructor for this class. No special action is taken. + */ + virtual ~BInt (); + + /** + * Returns the integer value of the data used to construct this + * object. + * + * @return this object's integer value + */ + TQ_LLONG get_value () const { return m_value; } + + /** + * Returns the type of this class. + * + * @return bInt. This value is only returned by this class. + */ + virtual classID type_id() const { return bInt; } + + /** + * This function should be called to determine whether the + * integer was successfully created, since no exceptions + * are thrown. + * + * @return true if this is a valid integer, false otherwise + */ + virtual bool isValid() const { return m_valid; } + + /** + * Outputs the b-encoded representation of the object to the given + * TQIODevice. + * @param device the TQIODevice to write to + * @return true on a successful write, false otherwise + */ + virtual bool writeToDevice (TQIODevice &device); + + private: + + /** + * Initialization function for the class, called to handle the + * actual work of reading the b-encoded data from @p tape. + * + * @param tape the ByteTape to read from + */ + void init(ByteTape &tape); + + TQ_LLONG m_value; + bool m_valid; +}; + +#endif /* _BINT_H */ + +// vim: set et ts=4 sw=4: diff --git a/tdefile-plugins/torrent/blist.cpp b/tdefile-plugins/torrent/blist.cpp new file mode 100644 index 00000000..4b510e76 --- /dev/null +++ b/tdefile-plugins/torrent/blist.cpp @@ -0,0 +1,178 @@ +/* + * Copyright (c) 2003, 2004 Michael Pyne + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this library; see the file COPYING. + * If not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +#include + +#include "bytetape.h" +#include "blist.h" +#include "bdict.h" +#include "bstring.h" +#include "bint.h" + +BList::BList (ByteTape &tape) + : m_valid(false), m_array() +{ + init (tape); +} + +BList::BList (TQByteArray &dict, unsigned int start) + : m_valid(false), m_array() +{ + ByteTape tape (dict, start); + + init (tape); +} + +void BList::init (ByteTape &tape) +{ + BBase *temp; + + if (*tape != 'l') + return; + + tape++; + + /* Repeat circling over the string until the list is over */ + while (*tape != 'e') + { + switch (*tape) + { + case 'd': + temp = new BDict (tape); + break; + + case 'l': /* This element is a list */ + temp = new BList (tape); + break; + + case 'i': /* This element is an int */ + temp = new BInt (tape); + break; + + default: /* Maybe a string? */ + temp = new BString (tape); + } + + if (!temp || !temp->isValid()) + return; // Invalid list element + + m_array.append (temp); + } + + m_valid = true; + + // Only way out is to detect 'e', so we need to increment tape past that. + tape++; +} + +BList::~BList() +{ + BBaseVectorIterator iter; + + for (iter = begin(); iter != end(); ++iter) + delete *iter; +} + +BBase* BList::index (unsigned int i) +{ + if (i >= count()) + return 0; + else + return m_array[i]; +} + +BList * BList::indexList (unsigned int i) +{ + BBase *base = index(i); + + if (base && base->type_id() == bList) + return dynamic_cast(base); + + return 0; +} + +BInt * BList::indexInt (unsigned int i) +{ + BBase *base = index(i); + + if (base && base->type_id() == bInt) + return dynamic_cast(base); + + return 0; +} + +BDict * BList::indexDict (unsigned int i) +{ + BBase *base = index(i); + + if (base && base->type_id() == bDict) + return dynamic_cast(base); + + return 0; +} + +BString * BList::indexStr (unsigned int i) +{ + BBase *base = index(i); + + if (base && base->type_id() == bString) + return dynamic_cast(base); + + return 0; +} + +bool BList::writeToDevice(TQIODevice &device) +{ + if (!m_valid) + return false; + + const char *l_str = "l"; + const char *e_str = "e"; + TQ_LONG written = 0, result = 0; + + written = device.writeBlock (l_str, 1); + while (written < 1) + { + if (written < 0 || result < 0) + return false; + + result = device.writeBlock (l_str, 1); + written += result; + } + + BBaseVectorIterator iter; + for (iter = begin(); iter != end(); ++iter) + { + if (!((*iter)->writeToDevice (device))) + return false; + } + + written = device.writeBlock (e_str, 1); + while (written < 1) + { + if (written < 0 || result < 0) + return false; + + result = device.writeBlock (e_str, 1); + written += result; + } + + return true; +} + +// vim: set et sw=4 ts=4: diff --git a/tdefile-plugins/torrent/blist.h b/tdefile-plugins/torrent/blist.h new file mode 100644 index 00000000..89721822 --- /dev/null +++ b/tdefile-plugins/torrent/blist.h @@ -0,0 +1,200 @@ +/* + * Copyright (c) 2003, 2004 Michael Pyne + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this library; see the file COPYING. + * If not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +#ifndef _BLIST_H +#define _BLIST_H + +#include +#include +#include "bbase.h" +#include "bytetape.h" + +typedef TQValueList BBaseVector; +typedef TQValueList::iterator BBaseVectorIterator; + +// Predeclare the following classes +class BDict; +class BString; +class BInt; + +/** + * Class to construct a list of BBase objects from a b-encoded + * list. + * + * @author Michael Pyne + * @see BBase + */ +class BList : public BBase +{ + public: + + /** + * Construct a BList from @p dict. + * + * @param dict the buffer to read from + * @param start the position in the buffer to start + * reading from + */ + BList (TQByteArray &dict, unsigned int start = 0); + + /** + * Construct a BList from @p tape. Any changes made to + * @p tape, such as its current position and data, will be + * shared with the object that called this constructor. @p tape + * should already be positioned at the position to read from. + * If construction was successful, @p tape will point to the + * byte after the list data. If construction was unsuccessful, + * the position of the tape is undefined. + * + * @param tape the ByteTape to read from. + */ + BList (ByteTape &tape); + + /** + * Destroys the list, and deletes all of the items that had + * been contained within. + */ + virtual ~BList (); + + /** + * Returns the type of this class. + * + * @return bList. This value is only returned by this class. + */ + virtual classID type_id() const { return bList; } + + /** + * Returns the number of items contained within the list. + * + * @return number of items in the list + */ + virtual unsigned int count() const { return m_array.count(); } + + /** + * This function should be called to determine whether the + * list was successfully created, since no exceptions + * are thrown. + * + * @return true if this is a valid list, false otherwise + */ + virtual bool isValid() const { return m_valid; } + + /** + * This function returns a pointer to the appropriate + * item in the list. + * + * @param i index of the item to return + * @return pointer to the appropriate BBase, or 0 if + * the index is out-of-bounds + */ + inline BBase * index (unsigned int i); + + /** + * Convience function to return a pointer to the appropriate + * item in the list, already casted. + * + * @param i index of the item to return + * @return pointer to the appropriate BBase, downcasted to + * BList. If the element is not a BList, 0 + * will be returned instead, even if it was a valid + * BBase. + */ + BList * indexList (unsigned int i); + + /** + * Convience function to return a pointer to the appropriate + * item in the list, already casted. + * + * @param i index of the item to return + * @return pointer to the appropriate BBase, downcasted to + * BInt. If the element is not a BInt, 0 + * will be returned instead, even if it was a valid + * BBase. + */ + BInt * indexInt (unsigned int i); + + /** + * Convience function to return a pointer to the appropriate + * item in the list, already casted. + * + * @param i index of the item to return + * @return pointer to the appropriate BBase, downcasted to + * BDict. If the element is not a BDict, 0 + * will be returned instead, even if it was a valid + * BBase. + */ + BDict * indexDict (unsigned int i); + + /** + * Convience function to return a pointer to the appropriate + * item in the list, already casted. + * + * @param i index of the item to return + * @return pointer to the appropriate BBase, downcasted to + * BString. If the element is not a BString, 0 + * will be returned instead, even if it was a valid + * BBase. + */ + BString * indexStr (unsigned int i); + + /** + * Returns an iterator to the first element in the list. + * There is no particular sorting associated with the list + * at this time. + * + * @return iterator pointing to the beginning of the list + * @see TQValueList + */ + BBaseVectorIterator begin(void) { return m_array.begin(); } + + /** + * Returns an iterator pointing one element past the end of + * the list. Although this element belongs to the list, + * you should never dereference this iterator. Instead, treat + * it as a boundary condition to avoid. + * + * @return iterator pointing one element past the end of the list + * @see TQValueList + */ + BBaseVectorIterator end(void) { return m_array.end(); } + + /** + * Outputs the b-encoded representation of the object to the given + * TQIODevice. + * @param device the TQIODevice to write to + * @return true on a successful write, false otherwise + */ + virtual bool writeToDevice (TQIODevice &device); + + private: + + /** + * This function handles the actual initialization of the object upon + * construction, and set the m_valid flag if successful. + * + * @param tape the ByteTape to read from + */ + void init(ByteTape &tape); + + bool m_valid; + BBaseVector m_array; +}; + +#endif /* _BLIST_H */ + +// vim: set et sw=4 ts=4: diff --git a/tdefile-plugins/torrent/bstring.cpp b/tdefile-plugins/torrent/bstring.cpp new file mode 100644 index 00000000..0b40b46a --- /dev/null +++ b/tdefile-plugins/torrent/bstring.cpp @@ -0,0 +1,128 @@ +/* + * Copyright (c) 2003, 2004 Michael Pyne + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this library; see the file COPYING. + * If not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +#include +#include + +#include + +#include "bstring.h" +#include "bytetape.h" + +BString::BString (TQByteArray &dict, int start) : + m_data(), m_valid(false) +{ + ByteTape tape (dict, start); + init (tape); +} + +BString::BString (ByteTape &tape) + : m_data(), m_valid(false) +{ + init (tape); +} + +// The reason we don't store stuff in a TQString is because BitTorrent +// b-encoded strings may contain zeroes within the string, which makes +// a BString more of a buffer than a true string. +void BString::init (ByteTape &tape) +{ + TQByteArray &dict(tape.data()); + + if (dict.find(':', tape.pos()) == -1) + { + kdDebug(7034) << "Can't find : for string!" << endl; + return; + } + + // Copy the part from start to :, as it will be a number + // That number is the number of characters to read + int length = dict.find(':', tape.pos()) - tape.pos(); + char *ptr = dict.data(); + + ptr += tape.pos(); + + TQByteArray buffer (length + 1); + tqmemmove (buffer.data(), ptr, length); + buffer[length] = 0; + + TQString numberString (buffer); + bool a_isValid; + ulong len = numberString.toULong (&a_isValid); + + if (!a_isValid) + { + kdDebug(7034) << "Invalid string length!" << endl; + return; + } + + // Now that we have the length, we need to advance the tape + // past the colon + tape += length; // Move to colon + if (*tape != ':') + { + // Sanity check + kdError(7034) << "SANITY CHECK FAILED. *tape != ':'!" << endl; + return; + } + + tape++; // Move past colon + + // Time to copy the data + char *textBuffer = tape.at(tape.pos()); + if (!m_data.resize(len + 1)) + return; + + tqmemmove (m_data.data(), textBuffer, len); + m_data[len] = 0; // Null terminate for convienience + + tape += len; + m_valid = true; +} + +BString::~BString () +{ +} + +bool BString::writeToDevice(TQIODevice &device) +{ + if (!m_valid) + return false; + + TQString str = TQString("%1:"). + arg(get_len()); + + TQCString utfString = str.utf8(); + + /* Don't write null terminator */ + device.writeBlock (utfString.data(), utfString.size() - 1); + + // Output the actual data + device.writeBlock (m_data.data(), m_data.size() - 1); + + // Done + return true; +} + +bool BString::setValue (const TQString &str) +{ + m_data = str.utf8(); + return true; +} + +// vim: set et ts=4 sw=4: diff --git a/tdefile-plugins/torrent/bstring.h b/tdefile-plugins/torrent/bstring.h new file mode 100644 index 00000000..c51311fc --- /dev/null +++ b/tdefile-plugins/torrent/bstring.h @@ -0,0 +1,138 @@ +/* + * Copyright (c) 2003, 2004 Michael Pyne + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this library; see the file COPYING. + * If not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +#ifndef _BSTRING_H +#define _BSTRING_H + +#include +#include + +#include "bytetape.h" +#include "bbase.h" + +/** + * A class to handle the b-encoded strings used by BitTorrent. + * It implements BBase, and although the class is referred to + * as a string, it can hold arbitrary data, since b-encoded strings + * are stored with a length, instead of using a terminator character. + * + * @author Michael Pyne + * @see BBase + */ +class BString : public BBase +{ + public: + + /** + * Construct a BString from @p dict. + * + * @param dict the buffer to read from + * @param start the position in the buffer to start + * reading from + */ + BString (TQByteArray &dict, int start = 0); + + /** + * Construct a BString from @p tape. Any changes made to + * @p tape, such as its current position and data, will be + * shared with the object that called this constructor. @p tape + * should already be positioned at the position to read from. + * If construction was successful, @p tape will point to the + * byte after the string data. If construction was unsuccessful, + * the position of the tape is undefined. + * + * @param tape the ByteTape to read from. + */ + BString (ByteTape &tape); + + /** + * Destroys the BString, and deallocates all memory that had + * been used. + */ + virtual ~BString (); + + /** + * Returns a TQString representation of the data in the + * BString. It is the responsibility of the caller to ensure + * that the data is convertible to a TQString. More specifically, + * the data should not contain any embedded NULLs. + * + * @return TQString containing the data from this BString. + */ + TQString get_string() const { return TQString::fromUtf8(m_data.data()); } + + /** + * Returns the amount of data held by the string. It would be + * perhaps more appropriate to call this size(), since this is + * a buffer, not a true text string. + * + * @return the size of the string, not including the NULL + * terminator. + */ + const int get_len() const { return m_data.size() - 1; } + + /** + * Returns the type of this class. + * + * @return bString. This value is only returned by this class. + */ + virtual classID type_id() const { return bString; } + + /** + * This function should be called to determine whether the + * string was successfully created, since no exceptions + * are thrown. + * + * @return true if this is a valid string, false otherwise + */ + virtual bool isValid() const { return m_valid; } + + /** + * Outputs the b-encoded representation of the object to the given + * TQIODevice. + * @param device the TQIODevice to write to + * @return true on a successful write, false otherwise + */ + virtual bool writeToDevice (TQIODevice &device); + + /** + * Changes the value of the string to the given TQString. + * + * @param str the TQString containing the new value + * @return true if the value was successfully changed, + * false otherwise. + */ + bool setValue (const TQString &str); + + private: + + /** + * This function handles the actual initialization of the object upon + * construction, and set the m_valid flag if successful. + * + * @param tape the ByteTape to read from + */ + void init (ByteTape &tape); + + TQByteArray m_data; + bool m_valid; +}; + +#endif /* _BSTRING_H */ + +// vim: set et ts=4 sw=4: diff --git a/tdefile-plugins/torrent/bytetape.cpp b/tdefile-plugins/torrent/bytetape.cpp new file mode 100644 index 00000000..5d6b8099 --- /dev/null +++ b/tdefile-plugins/torrent/bytetape.cpp @@ -0,0 +1,158 @@ +/* + * Copyright (c) 2003, 2004 Michael Pyne + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this library; see the file COPYING. + * If not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include + +#include "bytetape.h" + +ByteTape::ByteTape (TQByteArray &array, int pos) + : m_array(array), m_shared(new ByteTapeShared) +{ + m_shared->pos = pos; +} + +ByteTape::ByteTape (const ByteTape &tape) + : m_array(tape.m_array), m_shared(tape.m_shared) +{ +} + +ByteTape& ByteTape::operator += (const unsigned int i) +{ + m_shared->pos += i; + if (m_array.size() <= m_shared->pos) + { + kdDebug(7034) << "Whoops. Advanced too far." << endl; + m_shared->pos = m_array.size() - 1; + } + + return *this; +} + +ByteTape& ByteTape::operator -= (const unsigned int i) +{ + if (i > m_shared->pos) + { + kdDebug(7034) << "Whoops, tried to back up too far." << endl; + m_shared->pos = 0; + } + else + m_shared->pos -= i; + + return *this; +} + +char ByteTape::operator [] (const unsigned int i) +{ + if (i < m_array.size()) + return m_array[i]; + else + { + kdWarning() << "Can't dereference tape at " << i + << ", size is " << m_array.size() << endl; + return 0; + } +} + +char &ByteTape::operator * () +{ + return m_array[m_shared->pos]; +} + +// Postfix increment +ByteTape ByteTape::operator ++ (int) +{ + // Can't use copy ctor, as we'll be copying shared data, which defeats + // the semantics of the postfix operator. + ByteTape temp(m_array, m_shared->pos); + m_shared->pos ++; + + if (m_shared->pos >= m_array.size()) + { + m_shared->pos = m_array.size() - 1; + kdDebug(7034) << "Tape already at end!" << endl; + kdDebug(7034) << "Tape size is " << m_array.size() << endl; + } + + return temp; +} + +// Prefix increment +ByteTape & ByteTape::operator ++() +{ + m_shared->pos ++; + if (m_shared->pos >= m_array.size()) + { + m_shared->pos = m_array.size() - 1; + kdDebug(7034) << "Tape already at end!" << endl; + kdDebug(7034) << "Tape size is " << m_array.size() << endl; + } + + return *this; +} + +// Postfix decrement +ByteTape ByteTape::operator -- (int) +{ + // Can't use copy ctor, as we'll be copying shared data, which defeats + // the semantics of the postfix operator. + ByteTape temp(m_array, m_shared->pos); + + if (m_shared->pos != 0) + m_shared->pos --; + else + kdDebug(7034) << "Tape already at beginning!" << endl; + + return temp; +} + +// Prefix decrement +ByteTape & ByteTape::operator -- () +{ + if (m_shared->pos != 0) + m_shared->pos --; + else + kdDebug(7034) << "Tape already at beginning!" << endl; + + return *this; +} + +bool ByteTape::setPos (unsigned int pos) +{ + if (pos >= m_array.size()) + { + kdDebug(7034) << "Can't set tape to " << pos << endl; + return false; + } + + m_shared->pos = pos; + return true; +} + +char* ByteTape::at (const unsigned int i) +{ + if (i >= m_array.size()) + { + kdDebug(7034) << "Access to tape at " << i << " out-of-range." << endl; + return 0; + } + + return m_array.data() + i; +} + +// vim: set et ts=4 sw=4: diff --git a/tdefile-plugins/torrent/bytetape.h b/tdefile-plugins/torrent/bytetape.h new file mode 100644 index 00000000..f7309b11 --- /dev/null +++ b/tdefile-plugins/torrent/bytetape.h @@ -0,0 +1,194 @@ +/* + * Copyright (c) 2003, 2004 Michael Pyne + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this library; see the file COPYING. + * If not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +#ifndef _BYTETAPE_H +#define _BYTETAPE_H + +#include + +#include + +class ByteTapeShared : public KShared +{ + public: + + unsigned int pos; +}; + +/** + * Class to simulate a seekable byte stream. Very similar to TQByteArray, + * but the difference is that this class "knows" what a current position + * is. Also, the copy constructor will share the byte stream of the + * ByteTape being copied. This means that any copies made of an object of + * this class will share BOTH the data and the current position. This is + * by design. + * + * @author Michael Pyne + * @see TQByteArray + */ +class ByteTape +{ + public: + + /** + * Constructs a new ByteTape object from @p array. The + * current position will be set to @p pos. + * + * @param array a data buffer to use for reading and writing. + * The tape will be fixed to the size of this buffer. + * @param pos the initial position of the tape head. It must be + * a position within the buffer contained in @p array. + */ + ByteTape (TQByteArray &array, int pos = 0); + + /** + * Creates a ByteTape as a copy of @p tape. The newly created + * object will share both data and the current position with @p tape. + * This is done using reference counts. + * + * @param tape the ByteTape to copy + */ + ByteTape (const ByteTape &tape); + + /** + * Increments the current position by @p i. It is the responsibility + * of the function caller to ensure that the new position is in bounds. + * The position will be capped to remain in bounds regardless. + * + * @param i the amount to increment the current position by + * @return t reference to the object incremented + */ + ByteTape & operator += (const unsigned int i); + + /** + * Decrements the current position by @p i. It is the responsibility + * of the function caller to ensure that the new position is in bounds. + * Unlike a real Turing machine, attempting to decrement past the + * start will be capped to the beginning instead of crashing the + * computer. + * + * @param i the amount to decrement the current position by + * @return a reference to the object decremented + */ + ByteTape & operator -= (const unsigned int i); + + /** + * Increments the current position by 1. This is a postfix + * operator (i++). The current position will be capped to the end + * of the buffer. + * + * @return the object before the increment operation + */ + ByteTape operator ++ (int); + + /** + * Increments the current position by 1. This is a prefix + * operator (++i). The current position will be capped to the end + * of the buffer. + * + * @return a reference to the object incremented + */ + ByteTape & operator ++ (); + + /** + * Decrements the current position by 1. This is a postfix + * operator (i--). The current position will be capped to the start + * of the buffer. + * + * @return the object before the decrement operation + */ + ByteTape operator -- (int); + + /** + * Decrements the current position by 1. This is a prefix + * operator (--i). The current position will be capped to the start + * of the buffer. + * + * @return a reference to the object decremented + */ + ByteTape & operator -- (); + + /** + * Returns the byte within the array indexed by @p i. It is + * the responsibility of the caller to ensure that @p i is in bounds. + * Although out-of-range errors will be detected, no exceptions will + * be thrown. Since a reference is not returned, you won't be able + * to assign to the result. Example: tape[i] = 'a' will not work. + * + * The reason a reference isn't returned is because no exceptions are + * thrown by this class, and we can't return a reference to an out-of- + * bounds character. + * + * @param i the index of the byte to return + * @return the byte at the given index. 0 may be returned on error, + * but does not necessarily indicate an error. + */ + char operator [] (const unsigned int i); + + /** + * Returns the byte at the tape's current position. You can assign + * to the reference returned. + * + * @return a reference to the byte at the tape head's current position + */ + char &operator * (); + + /** + * Returns the position in memory of data at the given index, @p i. + * Unlike operator [], this function returns a pointer, so it can be + * used to access memory. + * + * @param i index of the byte to lookup. + * @return 0 if @p i is out of range, else the address of memory + * at that index + */ + char *at(const unsigned int i); + + /** + * Returns the current position of the tape head. + * + * @return the tape head's current position + */ + unsigned int pos() const { return m_shared->pos; } + + /** + * Sets the current position of the tape head to @p pos. If the + * position given is out-of-bounds, it will be capped to be within + * the array. + * + * @param pos the new position of the tape head + * @return whether the set operation was successful + */ + bool setPos(unsigned int pos); + + /** + * Returns a reference to the TQByteArray used to hold all the data. + * + * @return the TQByteArray used to hold the data + * @see TQByteArray + */ + TQByteArray &data() { return m_array; } + + private: + TQByteArray &m_array; + KSharedPtr m_shared; +}; + +#endif /* _BYTETAPE_H */ + +// vim: set et ts=4 sw=4: diff --git a/tdefile-plugins/torrent/tdefile_torrent.cpp b/tdefile-plugins/torrent/tdefile_torrent.cpp new file mode 100644 index 00000000..d1f2217a --- /dev/null +++ b/tdefile-plugins/torrent/tdefile_torrent.cpp @@ -0,0 +1,404 @@ +/* + * Copyright (c) 2003, 2004 2004 Michael Pyne + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this library; see the file COPYING. + * If not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +#include +#include +#include +#include +#include + +#include +#include + +#include "tdefile_torrent.h" +#include "bdict.h" +#include "blist.h" +#include "bint.h" +#include "bstring.h" + +typedef KGenericFactory TorrentFactory; +K_EXPORT_COMPONENT_FACTORY(tdefile_torrent, TorrentFactory("tdefile_torrent")) + +TQStringList filesList (BList *list); +TQ_ULLONG filesLength (BList *list); + +KTorrentPlugin::KTorrentPlugin (TQObject *parent, const char *name, + const TQStringList &args) + : KFilePlugin (parent, name, args), m_failed(true), m_dict(0) +{ + KFileMimeTypeInfo *info = addMimeTypeInfo ("application/x-bittorrent"); + if (!info) + { + kdError() << "Error creating application/x-bittorrent mime type info!\n"; + return; + } + + KFileMimeTypeInfo::GroupInfo* group = + addGroupInfo (info, "TorrentInfo", i18n("Torrent Information")); + if (!group) + { + kdError() << "Error creating TorrentInfo group!\n"; + return; + } + setAttributes (group, KFileMimeTypeInfo::Modifiable); + + KFileMimeTypeInfo::ItemInfo *item = 0; + + item = addItemInfo(group, "name", i18n("Name"), TQVariant::String); + if (!item) + { + kdError() << "Error adding Name to group!\n"; + return; + } + setHint (item, KFileMimeTypeInfo::Name); + setAttributes (item, KFileMimeTypeInfo::Modifiable); + + item = addItemInfo(group, "length", i18n("Torrent Length"), TQVariant::ULongLong); + if (!item) + { + kdError() << "Error adding Length to group!\n"; + return; + } + setHint (item, KFileMimeTypeInfo::Length); + setUnit (item, KFileMimeTypeInfo::Bytes); + + item = addItemInfo(group, "announce", i18n("Tracker URL"), TQVariant::String); + if (!item) + { + kdError() << "Error adding Announce to group!\n"; + return; + } + + item = addItemInfo(group, "creation date", i18n("Date Created"), TQVariant::DateTime); + if (!item) + { + kdError() << "Error adding DateCreated to group!\n"; + return; + } + + item = addItemInfo(group, "NumFiles", i18n("Number of Files"), TQVariant::Int); + if (!item) + { + kdError() << "Error adding NumFiles to group!\n"; + return; + } + + item = addItemInfo(group, "piece length", i18n("File Piece Length"), TQVariant::Int); + if (!item) + { + kdError() << "Error adding PieceLength to group!\n"; + return; + } + setUnit (item, KFileMimeTypeInfo::Bytes); + + item = addItemInfo(group, "comment", i18n("Comment"), TQVariant::String); + if (!item) + { + kdError() << "Error adding Comment to group!\n"; + return; + } + setAttributes (item, KFileMimeTypeInfo::MultiLine | KFileMimeTypeInfo::Modifiable); + + m_failed = false; +} + +bool KTorrentPlugin::readInfo (KFileMetaInfo &info, unsigned int) +{ + /* Since we don't throw during the ctor, check here whether we actually + * are valid are not. If not, die. + */ + if (m_failed) + { + kdError() << "Construction of KTorrentPlugin failed for " << info.path() << endl; + kdError() << "Aborting meta-info read.\n"; + return false; + } + + TQFile file (info.path()); + if (!file.open(IO_ReadOnly)) + { + kdError() << "Unable to open given file!\n"; + return false; + } + + // We need to read in the entire file to parse the dictionary structure. + TQByteArray buf = file.readAll(); + file.close(); + + if (buf.isEmpty()) + { + kdError() << "Empty file: " << info.path() << endl; + return false; + } + + m_dict = new BDict(buf); + + if (!m_dict) + { + kdError() << "Error creating dictionary from open file: " << info.path() << endl; + return false; + } + + if (!m_dict->isValid()) + { + kdDebug(7034) << "Invalid torrent file: " << info.path() << endl; + return false; + } + + KFileMetaInfoGroup group = appendGroup(info, "TorrentInfo"); + + // The remainder of this function will consist of a lot of redundancy checks. + // If a torrent has a key, but it is of the wrong type, then it isn't a valid + // torrent, and so we should just die. + + if (m_dict->contains("announce")) + { + BString *str = m_dict->findStr ("announce"); + if (!str) + return false; + appendItem (group, "announce", TQString(str->get_string())); + } + + if (m_dict->contains("creation date")) + { + BInt *the_data = m_dict->findInt ("creation date"); + TQDateTime my_date; + + if (!the_data) + return false; + + unsigned int the_time = the_data->get_value(); + + /* Hopefully the_time is UTC, because that's what TQDateTime does. */ + my_date.setTime_t (the_time); + appendItem (group, "creation date", my_date); + } + + // A valid torrent must have the info dict, no reason to check twice for + // it. + BDict *info_dict = m_dict->findDict("info"); + int num_files = 1; + TQ_ULLONG length = 0; + + if (!info_dict) + return false; + + if (!info_dict->contains("length")) + { + /* Has more than one file. The list of files is contained in a + * list called, appropriately enough, 'files' + */ + BList *info_list = info_dict->findList("files"); + if (!info_list) + return false; + + num_files = info_list->count(); + length = filesLength (info_list); + } + else + { + /* Only one file, let's put its length */ + BInt *blength = info_dict->findInt("length"); + if (!blength) + return false; + + length = blength->get_value(); + } + + appendItem (group, "NumFiles", num_files); + appendItem (group, "length", length); + + if (info_dict->contains("name")) + { + BString *str = info_dict->findStr("name"); + if (!str) + return false; + + TQString real_str (str->get_string()); + + if (num_files > 1 && !real_str.endsWith("/")) + real_str.append('/'); + + appendItem (group, "name", real_str); + } + + // piece length is required as well + BInt *piece_length = info_dict->findInt("piece length"); + if (!piece_length) + return false; + + appendItem (group, "piece length", piece_length->get_value()); + + if (m_dict->contains("comment")) + { + BString *comment = m_dict->findStr("comment"); + if (!comment) + return false; + + appendItem (group, "comment", comment->get_string()); + } + else + appendItem (group, "comment", TQString()); + + return true; +} + +/* Returns a TQStringList containing file names within the list. The list + * should be the one contained within the info dictionary of the torrent, + * keyed by 'files' + */ +TQStringList filesList (BList *list) +{ + TQStringList str_list, failList; + + for (unsigned int i = 0; i < list->count(); ++i) + { + /* Each item in this list is a dictionary, composed as follows: + * length -> BInt (size of file) + * path -> BList (list of strings) + * The list of strings is used to construct directory paths. The + * last element of the list is the file name. + */ + + BDict *list_dict = list->indexDict(i); + if (!list_dict) + return failList; + + BList *list_path = list_dict->findList("path"); + if (!list_path) + return failList; + + TQString str; + BString *temp_str; + + if (list_path->count() > 0) + { + temp_str = list_path->indexStr (0); + if (!temp_str) + return failList; + + str.append (temp_str->get_string()); + } + + /* Construct TQString consisting of path and file name */ + for (unsigned int j = 1; j < list_path->count(); ++j) + { + str.append (TQDir::separator()); + temp_str = list_path->indexStr (j); + if (!temp_str) + return failList; + + str.append (temp_str->get_string()); + } + + str_list += str; + } + + return str_list; +} + +/* This function determines the total length of a torrent stream. + * The list provided should be the same one provided for filesList. + */ +TQ_ULLONG filesLength (BList *list) +{ + TQ_ULLONG length = 0; + + for (unsigned int i = 0; i < list->count(); ++i) + { + /* Each item in this list is a dictionary, composed as follows: + * length -> BInt (size of file) + * path -> BList (list of strings) + */ + + BDict *list_dict = list->indexDict(i); + if (!list_dict) + return 0; + + BInt *bfile_len = list_dict->findInt("length"); + if (!bfile_len) + return 0; + + length += bfile_len->get_value(); + } + + return length; +} + +bool KTorrentPlugin::writeInfo(const KFileMetaInfo &info) const +{ + if (m_failed || !m_dict) + return false; + + // The m_dict is ready, all we have to do is open a file, and + // let 'er go. + TQStringList list = info.groups(); + TQStringList::Iterator it = list.begin(); + + for (; it != list.end(); ++it) + { + TQStringList list2 = info[*it].keys(); + TQStringList::Iterator it2 = list2.begin(); + + for (; it2 != list2.end(); ++it2) + { + TQString key = *it2; + + if (info[*it][key].isModified()) + { + // Re-enter the entry in the dictionary. + if (key == "comment") + { + BString *b_str = m_dict->findStr("comment"); + if (!b_str) + return false; + + b_str->setValue (info[*it][key].value().toString()); + } + else if (key == "name") + { + BDict *info_dict = m_dict->findDict ("info"); + if (!info_dict) + return false; + + BString *name_str = info_dict->findStr ("name"); + if (!name_str) + return false; + + TQString the_name = info[*it][key].value().toString(); + + // Remove trailing slashes + the_name.replace (TQRegExp("/*$"), ""); + + name_str->setValue (the_name); + } + } + } + } + + TQFile output (info.path()); + + if (!output.open(IO_WriteOnly | IO_Truncate)) + return false; + + return m_dict->writeToDevice(*TQT_TQIODEVICE(&output)); +} + +#include "tdefile_torrent.moc" + +// vim: set ts=4 sw=4 et: diff --git a/tdefile-plugins/torrent/tdefile_torrent.desktop b/tdefile-plugins/torrent/tdefile_torrent.desktop new file mode 100644 index 00000000..c04639e4 --- /dev/null +++ b/tdefile-plugins/torrent/tdefile_torrent.desktop @@ -0,0 +1,58 @@ +[Desktop Entry] +Type=Service +Name=Bit Torrent Info +Name[be]=Звесткі Bit Torrent +Name[bn]=বিট টোরেন্ট তথ্য +Name[br]=Titouriñ diwar-benn Bit Torrent +Name[bs]=Bit Torrent informacije +Name[ca]=Informació de Bit Torrent +Name[cs]=Bit Torrent informace +Name[da]=Info om bittorrent +Name[de]=Bit Torrent Informationen +Name[el]=Πληροφορίες Bit Torrent +Name[es]=Información Bit Torrent +Name[et]=Bit Torrenti info +Name[eu]=Bit-torrent informazioa +Name[fa]=اطلاعات جریان بیتی +Name[fi]=Bit Torrent +Name[fr]=Infos Bit Torrent +Name[gl]=Información de Bit Torrent +Name[he]=מידע ביטטורנט +Name[hu]=Bit Torrent-jellemzők +Name[is]=Bit Torrent upplýsingar +Name[it]=Informazioni Bittorrent +Name[ja]=Bit Torrent 情報 +Name[ka]=Bit Torrent ინფორმაცია +Name[kk]=Bit Torrent мәліметі +Name[km]=ព័ត៌មាន Bit Torrent +Name[lt]=Bit Torrent Informacija +Name[mk]=Информации за Bit Torrent +Name[nds]=BitTorrent-Info +Name[ne]=बिट टोरेन्ट सूचना +Name[nl]=Bittorent-informatie +Name[nn]=Bit Torrent-info +Name[pa]=Bit Torrent ਜਾਣਕਾਰੀ +Name[pl]=Informacja o Bit Torrent +Name[pt]=Informações Bit Torrent +Name[pt_BR]=Informações do Bit Torrent +Name[ro]=Informaţii Bit Torrent +Name[ru]=Сведения о BitTorrent +Name[sk]=Bit Torrent informácie +Name[sl]=Podatki o BitTorrentu +Name[sr]=Bit Torrent информације +Name[sr@Latn]=Bit Torrent informacije +Name[sv]=Information om Bit Torrent +Name[ta]=பிட் டோர்ரெண்ட் தகவல் +Name[tr]=Bit Torrent Bilgisi +Name[uk]=Інформація про Bit Torrent +Name[zh_CN]=BitTorrent 信息 +Name[zh_HK]=Bit Torrent 資訊 +Name[zh_TW]=Bit Torrent 資訊 +ServiceTypes=KFilePlugin +X-TDE-Library=tdefile_torrent +# change MimeType here! (example: inode/directory) +MimeType=application/x-bittorrent +# change PreferredGroups here! (example: FolderInfo) +PreferredGroups= +# change PreferredItems here! (example: Items;Size) +PreferredItems= diff --git a/tdefile-plugins/torrent/tdefile_torrent.h b/tdefile-plugins/torrent/tdefile_torrent.h new file mode 100644 index 00000000..c954a814 --- /dev/null +++ b/tdefile-plugins/torrent/tdefile_torrent.h @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2003, 2004 Michael Pyne + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this library; see the file COPYING. + * If not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +#ifndef _KFILE_TORRENT_H +#define _KFILE_TORRENT_H + +#include + +#include "bdict.h" + +class TQStringList; + +/** + * Class to provide meta info for BitTorrent files within Konqueror. + * Handles the mime type application/x-bittorrent, files typically + * have the extension .torrent + * + * @author Michael Pyne + * @todo Handle editing the meta info as well + * @bug The comment meta info should be Multi Line, but that only + * works when the comment can also be edited. + */ +class KTorrentPlugin : public KFilePlugin +{ + Q_OBJECT + + + public: + /** + * Constructs the class, and prepares for reading info on a torrent. + * + * @param parent the parent of this object + * @param name the name of this object (not user-readable) + * @param args unused by this class + */ + KTorrentPlugin (TQObject *parent, const char *name, const TQStringList &args); + + /** + * Destructor that closes the dictionary holding the torrent information. + */ + ~KTorrentPlugin () { delete m_dict; } + + /** + * Reads information on a torrent file given by @p info. + * + * @param info information on the file to decode + * @return true if the meta info was successfully detected and added, + * false otherwise. + */ + virtual bool readInfo (KFileMetaInfo& info, unsigned int); + + /** + * Writes information on a torrent file given by @p info. + * BitTorrent are practically nothing but meta information. + * Therefore, the entire file might be changed. + * + * @param info information on the file to encode + * @return true if the meta info was successfully updated, + * false otherwise + */ + virtual bool writeInfo (const KFileMetaInfo& info) const; + + private: + bool m_failed; + BDict *m_dict; +}; + +#endif /* _KFILE_TORRENT_H */ + +// vim: set et ts=4 sw=4: diff --git a/wifi/kcmwifi/CMakeLists.txt b/wifi/kcmwifi/CMakeLists.txt index d7d5e5c1..24930ab8 100644 --- a/wifi/kcmwifi/CMakeLists.txt +++ b/wifi/kcmwifi/CMakeLists.txt @@ -33,6 +33,6 @@ tde_add_kpart( kcm_wifi AUTOMOC wificonfig.cpp kcmwifi.cpp configcrypto.ui ifconfigpagebase.ui configpower.ui mainconfigbase.ui mainconfig.cpp ifconfigpage.cpp vendorconfig.cpp - LINK kio-shared + LINK tdeio-shared DESTINATION ${PLUGIN_INSTALL_DIR} ) diff --git a/wifi/kcmwifi/kcmwifi.desktop b/wifi/kcmwifi/kcmwifi.desktop index 5e5e0ecf..0ffef7e5 100644 --- a/wifi/kcmwifi/kcmwifi.desktop +++ b/wifi/kcmwifi/kcmwifi.desktop @@ -1,7 +1,7 @@ [Desktop Entry] Icon=kwifimanager Type=Application -Exec=kcmshell kcmwifi +Exec=tdecmshell kcmwifi DocPath= X-TDE-ModuleType=Library X-TDE-Library=wifi diff --git a/wifi/kwifimanager.cpp b/wifi/kwifimanager.cpp index ef3d5588..9c3472da 100644 --- a/wifi/kwifimanager.cpp +++ b/wifi/kwifimanager.cpp @@ -31,7 +31,7 @@ // include files for KDE #include -#include +#include #include #include #include @@ -558,7 +558,7 @@ void KWiFiManagerApp::slotStartConfigEditor () { TDEProcess startConf; - startConf << "tdesu" << locate("exe", "kcmshell") << "kcmwifi"; + startConf << "tdesu" << locate("exe", "tdecmshell") << "kcmwifi"; startConf.start (TDEProcess::DontCare); } @@ -612,7 +612,7 @@ TQStringList usedInterfacesList() client->registerAs( "kwifimanager" ); client->setDefaultObject( "dcop_interface" ); - // shamelessly stolen from tdelibs/kio/booksmarks/kbookmarkimporter_crash.cc + // shamelessly stolen from tdelibs/tdeio/booksmarks/kbookmarkimporter_crash.cc TQStringList ignoreInterfaces; QCStringList apps = client->registeredApplications(); for ( QCStringList::Iterator it = apps.begin(); it != apps.end(); ++it ) diff --git a/wifi/kwireless/kwireless.cpp b/wifi/kwireless/kwireless.cpp index 8e4944d6..f2eabb6a 100644 --- a/wifi/kwireless/kwireless.cpp +++ b/wifi/kwireless/kwireless.cpp @@ -9,7 +9,7 @@ #include #include -#include +#include #include #include diff --git a/wifi/kwireless/kwireless.h b/wifi/kwireless/kwireless.h index 68ce7401..0b0ae031 100644 --- a/wifi/kwireless/kwireless.h +++ b/wifi/kwireless/kwireless.h @@ -16,7 +16,7 @@ #include #include -#include +#include class KWireLessWidget; -- cgit v1.2.1