summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit2bda8f7717adf28da4af0d34fb82f63d2868c31d (patch)
tree8d927b7b47a90c4adb646482a52613f58acd6f8c
downloadtdeutils-2bda8f7717adf28da4af0d34fb82f63d2868c31d.tar.gz
tdeutils-2bda8f7717adf28da4af0d34fb82f63d2868c31d.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeutils@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
-rw-r--r--AUTHORS28
-rw-r--r--COPYING346
-rw-r--r--COPYING-DOCS397
-rw-r--r--INSTALL176
-rw-r--r--Mainpage.dox11
-rw-r--r--Makefile.am.in10
-rw-r--r--Makefile.cvs14
-rw-r--r--README51
-rw-r--r--ark/AUTHORS5
-rw-r--r--ark/ChangeLog277
-rw-r--r--ark/Makefile.am54
-rw-r--r--ark/README4
-rw-r--r--ark/TODO11
-rw-r--r--ark/ace.cpp181
-rw-r--r--ark/ace.h55
-rw-r--r--ark/addition.ui79
-rw-r--r--ark/ar.cpp263
-rw-r--r--ark/ar.h61
-rw-r--r--ark/arch.cpp403
-rw-r--r--ark/arch.h221
-rw-r--r--ark/archiveformatdlg.cpp71
-rw-r--r--ark/archiveformatdlg.h39
-rw-r--r--ark/archiveformatinfo.cpp278
-rw-r--r--ark/archiveformatinfo.h73
-rw-r--r--ark/ark.desktop87
-rw-r--r--ark/ark.kcfg90
-rw-r--r--ark/ark_part.cpp533
-rw-r--r--ark/ark_part.desktop135
-rw-r--r--ark/ark_part.h148
-rw-r--r--ark/ark_part.rc57
-rw-r--r--ark/ark_part_readonly.rc42
-rw-r--r--ark/arkapp.cpp294
-rw-r--r--ark/arkapp.h93
-rw-r--r--ark/arkfactory.cpp68
-rw-r--r--ark/arkfactory.h43
-rw-r--r--ark/arkui.rc22
-rw-r--r--ark/arkutils.cpp230
-rw-r--r--ark/arkutils.h56
-rw-r--r--ark/arkviewer.cpp103
-rw-r--r--ark/arkviewer.h47
-rw-r--r--ark/arkwidget.cpp2262
-rw-r--r--ark/arkwidget.h318
-rw-r--r--ark/common_texts.cpp35
-rw-r--r--ark/compressedfile.cpp376
-rw-r--r--ark/compressedfile.h86
-rw-r--r--ark/configure.in.in11
-rw-r--r--ark/extraction.ui79
-rw-r--r--ark/extractiondialog.cpp195
-rw-r--r--ark/extractiondialog.h97
-rw-r--r--ark/filelistview.cpp587
-rw-r--r--ark/filelistview.h163
-rw-r--r--ark/general.ui93
-rw-r--r--ark/hi128-app-ark.pngbin0 -> 11259 bytes
-rw-r--r--ark/hi16-app-ark.pngbin0 -> 1094 bytes
-rw-r--r--ark/hi22-app-ark.pngbin0 -> 1431 bytes
-rw-r--r--ark/hi32-app-ark.pngbin0 -> 2259 bytes
-rw-r--r--ark/hi48-app-ark.pngbin0 -> 3778 bytes
-rw-r--r--ark/hi64-app-ark.pngbin0 -> 5013 bytes
-rw-r--r--ark/hisc-app-ark.svgzbin0 -> 7499 bytes
-rw-r--r--ark/lha.cpp302
-rw-r--r--ark/lha.h61
-rw-r--r--ark/main.cpp128
-rw-r--r--ark/mainwindow.cpp481
-rw-r--r--ark/mainwindow.h112
-rw-r--r--ark/pics/Makefile.am2
-rw-r--r--ark/pics/cr22-action-ark_adddir.pngbin0 -> 1303 bytes
-rw-r--r--ark/pics/cr22-action-ark_addfile.pngbin0 -> 1287 bytes
-rw-r--r--ark/pics/cr22-action-ark_delete.pngbin0 -> 1346 bytes
-rw-r--r--ark/pics/cr22-action-ark_extract.pngbin0 -> 1227 bytes
-rw-r--r--ark/pics/cr22-action-ark_selectall.pngbin0 -> 989 bytes
-rw-r--r--ark/pics/cr22-action-ark_view.pngbin0 -> 833 bytes
-rw-r--r--ark/pics/cr32-action-ark_adddir.pngbin0 -> 2285 bytes
-rw-r--r--ark/pics/cr32-action-ark_addfile.pngbin0 -> 2126 bytes
-rw-r--r--ark/pics/cr32-action-ark_delete.pngbin0 -> 2284 bytes
-rw-r--r--ark/pics/cr32-action-ark_extract.pngbin0 -> 2084 bytes
-rw-r--r--ark/pics/cr32-action-ark_view.pngbin0 -> 1134 bytes
-rw-r--r--ark/rar.cpp306
-rw-r--r--ark/rar.h68
-rw-r--r--ark/searchbar.cpp49
-rw-r--r--ark/searchbar.h40
-rw-r--r--ark/settings.kcfgc5
-rw-r--r--ark/sevenzip.cpp367
-rw-r--r--ark/sevenzip.h54
-rw-r--r--ark/tar.cpp774
-rw-r--r--ark/tar.h135
-rw-r--r--ark/tarlistingthread.cpp161
-rw-r--r--ark/tarlistingthread.h63
-rw-r--r--ark/zip.cpp277
-rw-r--r--ark/zip.h58
-rw-r--r--ark/zoo.cpp317
-rw-r--r--ark/zoo.h59
-rw-r--r--charselectapplet/Makefile.am19
-rw-r--r--charselectapplet/charselectapplet.cpp366
-rw-r--r--charselectapplet/charselectapplet.h115
-rw-r--r--charselectapplet/kcharselectapplet.desktop100
-rw-r--r--configure.in.in12
-rw-r--r--doc/KRegExpEditor/Makefile.am5
-rw-r--r--doc/KRegExpEditor/altn.pngbin0 -> 310 bytes
-rw-r--r--doc/KRegExpEditor/altntool.pngbin0 -> 1282 bytes
-rw-r--r--doc/KRegExpEditor/anychar.pngbin0 -> 616 bytes
-rw-r--r--doc/KRegExpEditor/anychartool.pngbin0 -> 531 bytes
-rw-r--r--doc/KRegExpEditor/begline.pngbin0 -> 244 bytes
-rw-r--r--doc/KRegExpEditor/boundarytools.pngbin0 -> 861 bytes
-rw-r--r--doc/KRegExpEditor/characters.pngbin0 -> 240 bytes
-rw-r--r--doc/KRegExpEditor/charactertool.pngbin0 -> 983 bytes
-rw-r--r--doc/KRegExpEditor/compound.pngbin0 -> 285 bytes
-rw-r--r--doc/KRegExpEditor/compoundtool.pngbin0 -> 1432 bytes
-rw-r--r--doc/KRegExpEditor/endline.pngbin0 -> 245 bytes
-rw-r--r--doc/KRegExpEditor/index.docbook652
-rw-r--r--doc/KRegExpEditor/linestartendtool.pngbin0 -> 817 bytes
-rw-r--r--doc/KRegExpEditor/lookaheadtools.pngbin0 -> 774 bytes
-rw-r--r--doc/KRegExpEditor/neglookahead.pngbin0 -> 297 bytes
-rw-r--r--doc/KRegExpEditor/nonwordboundary.pngbin0 -> 225 bytes
-rw-r--r--doc/KRegExpEditor/poslookahead.pngbin0 -> 297 bytes
-rw-r--r--doc/KRegExpEditor/repeat.pngbin0 -> 632 bytes
-rw-r--r--doc/KRegExpEditor/repeattool.pngbin0 -> 1160 bytes
-rw-r--r--doc/KRegExpEditor/select.pngbin0 -> 742 bytes
-rw-r--r--doc/KRegExpEditor/text.pngbin0 -> 338 bytes
-rw-r--r--doc/KRegExpEditor/texttool.pngbin0 -> 396 bytes
-rw-r--r--doc/KRegExpEditor/theEditor.pngbin0 -> 10004 bytes
-rw-r--r--doc/KRegExpEditor/wordboundary.pngbin0 -> 210 bytes
-rw-r--r--doc/Makefile.am5
-rw-r--r--doc/ark/Makefile.am5
-rw-r--r--doc/ark/index.docbook793
-rw-r--r--doc/ark/man-ark.1.docbook174
-rw-r--r--doc/kcalc/Makefile.am4
-rw-r--r--doc/kcalc/commands.docbook254
-rw-r--r--doc/kcalc/index.docbook774
-rw-r--r--doc/kcalc/kcalc_on_Aix.txt123
-rw-r--r--doc/kcalc/kcalc_on_OSF.txt62
-rw-r--r--doc/kcharselect/Makefile.am4
-rw-r--r--doc/kcharselect/index.docbook66
-rw-r--r--doc/kcontrol/Makefile.am6
-rw-r--r--doc/kcontrol/kcmlowbatcrit/Makefile.am2
-rw-r--r--doc/kcontrol/kcmlowbatcrit/index.docbook47
-rw-r--r--doc/kcontrol/kcmlowbatwarn/Makefile.am2
-rw-r--r--doc/kcontrol/kcmlowbatwarn/index.docbook104
-rw-r--r--doc/kcontrol/laptop/Makefile.am2
-rw-r--r--doc/kcontrol/laptop/index.docbook111
-rw-r--r--doc/kcontrol/powerctrl/Makefile.am2
-rw-r--r--doc/kcontrol/powerctrl/index.docbook77
-rw-r--r--doc/kdelirc/Makefile.am5
-rw-r--r--doc/kdelirc/irkick/Makefile.am4
-rw-r--r--doc/kdelirc/irkick/index.docbook131
-rw-r--r--doc/kdelirc/kcmlirc/Makefile.am4
-rw-r--r--doc/kdelirc/kcmlirc/index.docbook165
-rw-r--r--doc/kdf/Makefile.am4
-rw-r--r--doc/kdf/index.docbook266
-rw-r--r--doc/kdf/kdf.pngbin0 -> 22869 bytes
-rw-r--r--doc/kdf/kdf_config.pngbin0 -> 32396 bytes
-rw-r--r--doc/kedit/Makefile.am4
-rw-r--r--doc/kedit/index.docbook1255
-rw-r--r--doc/kfloppy/Makefile.am4
-rw-r--r--doc/kfloppy/index.docbook614
-rw-r--r--doc/kgpg/Makefile.am4
-rw-r--r--doc/kgpg/editor.pngbin0 -> 15541 bytes
-rw-r--r--doc/kgpg/index.docbook354
-rw-r--r--doc/kgpg/keygen.pngbin0 -> 9522 bytes
-rw-r--r--doc/kgpg/keymanage.pngbin0 -> 23651 bytes
-rw-r--r--doc/kgpg/keys.pngbin0 -> 13790 bytes
-rw-r--r--doc/kgpg/kicker.pngbin0 -> 4582 bytes
-rw-r--r--doc/kgpg/options.pngbin0 -> 18367 bytes
-rw-r--r--doc/khexedit/Makefile.am4
-rw-r--r--doc/khexedit/index.docbook1063
-rw-r--r--doc/khexedit/khexedit1.pngbin0 -> 3266 bytes
-rw-r--r--doc/kinfocenter/Makefile.am6
-rw-r--r--doc/kinfocenter/blockdevices/Makefile.am3
-rw-r--r--doc/kinfocenter/blockdevices/index.docbook89
-rw-r--r--doc/kjots/Makefile.am4
-rw-r--r--doc/kjots/index.docbook552
-rw-r--r--doc/ksim/Makefile.am4
-rw-r--r--doc/ksim/index.docbook66
-rw-r--r--doc/ktimer/Makefile.am4
-rw-r--r--doc/ktimer/index.docbook66
-rw-r--r--doc/kwallet/Makefile.am4
-rw-r--r--doc/kwallet/cr22-action-wallet_closed.pngbin0 -> 997 bytes
-rw-r--r--doc/kwallet/cr22-action-wallet_open.pngbin0 -> 1098 bytes
-rw-r--r--doc/kwallet/edit1.pngbin0 -> 19314 bytes
-rw-r--r--doc/kwallet/edit2.pngbin0 -> 26113 bytes
-rw-r--r--doc/kwallet/edit3.pngbin0 -> 59244 bytes
-rw-r--r--doc/kwallet/index.docbook396
-rw-r--r--doc/kwallet/kwalletmanager.pngbin0 -> 11282 bytes
-rw-r--r--doc/kwallet/password1.pngbin0 -> 19088 bytes
-rw-r--r--doc/kwallet/password2.pngbin0 -> 21999 bytes
-rw-r--r--doc/superkaramba/Makefile.am4
-rw-r--r--doc/superkaramba/index.docbook261
-rw-r--r--kcalc/ChangeLog387
-rw-r--r--kcalc/Makefile.am40
-rw-r--r--kcalc/README8
-rw-r--r--kcalc/TODO15
-rw-r--r--kcalc/colors.ui278
-rw-r--r--kcalc/configure.in.bot12
-rw-r--r--kcalc/configure.in.in78
-rw-r--r--kcalc/confvalues.h48
-rw-r--r--kcalc/constants.ui491
-rw-r--r--kcalc/dlabel.cpp184
-rw-r--r--kcalc/dlabel.h64
-rw-r--r--kcalc/general.ui199
-rw-r--r--kcalc/hi16-app-kcalc.pngbin0 -> 983 bytes
-rw-r--r--kcalc/hi22-app-kcalc.pngbin0 -> 1421 bytes
-rw-r--r--kcalc/hi32-app-kcalc.pngbin0 -> 2701 bytes
-rw-r--r--kcalc/hi48-app-kcalc.pngbin0 -> 5023 bytes
-rw-r--r--kcalc/hi64-app-kcalc.pngbin0 -> 6760 bytes
-rw-r--r--kcalc/hisc-app-kcalc.svgzbin0 -> 5247 bytes
-rw-r--r--kcalc/kcalc.cpp2306
-rw-r--r--kcalc/kcalc.desktop88
-rw-r--r--kcalc/kcalc.h239
-rw-r--r--kcalc/kcalc.kcfg127
-rw-r--r--kcalc/kcalc_button.cpp168
-rw-r--r--kcalc/kcalc_button.h105
-rw-r--r--kcalc/kcalc_const_button.cpp109
-rw-r--r--kcalc/kcalc_const_button.h58
-rw-r--r--kcalc/kcalc_const_menu.cpp89
-rw-r--r--kcalc/kcalc_const_menu.h55
-rw-r--r--kcalc/kcalc_core.cpp1004
-rw-r--r--kcalc/kcalc_core.h181
-rw-r--r--kcalc/kcalc_settings.kcfgc8
-rw-r--r--kcalc/kcalcdisplay.cpp608
-rw-r--r--kcalc/kcalcdisplay.h152
-rw-r--r--kcalc/kcalcrc.upd4
-rw-r--r--kcalc/kcalctype.h135
-rw-r--r--kcalc/kcalcui.rc17
-rw-r--r--kcalc/knumber/Makefile.am16
-rw-r--r--kcalc/knumber/configure.in.in73
-rw-r--r--kcalc/knumber/knumber.cpp693
-rw-r--r--kcalc/knumber/knumber.h289
-rw-r--r--kcalc/knumber/knumber_priv.cpp1083
-rw-r--r--kcalc/knumber/knumber_priv.h313
-rw-r--r--kcalc/knumber/tests/Makefile.am32
-rw-r--r--kcalc/knumber/tests/knumbertest.cpp582
-rw-r--r--kcalc/knumber/tests/knumbertest.h9
-rw-r--r--kcalc/stats.cpp196
-rw-r--r--kcalc/stats.h60
-rw-r--r--kcalc/version.h1
-rw-r--r--kcharselect/KCharSelect.desktop98
-rw-r--r--kcharselect/Makefile.am21
-rw-r--r--kcharselect/TODO6
-rw-r--r--kcharselect/hi16-app-kcharselect.pngbin0 -> 325 bytes
-rw-r--r--kcharselect/hi32-app-kcharselect.pngbin0 -> 1666 bytes
-rw-r--r--kcharselect/hi48-app-kcharselect.pngbin0 -> 1353 bytes
-rw-r--r--kcharselect/kcharselect.upd5
-rw-r--r--kcharselect/kcharselectdia.cc289
-rw-r--r--kcharselect/kcharselectdia.h71
-rw-r--r--kcharselect/kcharselectui.rc16
-rw-r--r--kcharselect/main.cc49
-rw-r--r--kdelirc/AUTHORS3
-rw-r--r--kdelirc/COPYING340
-rw-r--r--kdelirc/ChangeLog0
-rw-r--r--kdelirc/Makefile.am3
-rw-r--r--kdelirc/README55
-rw-r--r--kdelirc/README.profile-creation145
-rw-r--r--kdelirc/README.remote-creation129
-rw-r--r--kdelirc/TODO6
-rw-r--r--kdelirc/icons/Makefile.am3
-rw-r--r--kdelirc/icons/hi16-action-ledblue.pngbin0 -> 709 bytes
-rw-r--r--kdelirc/icons/hi16-action-ledgreen.pngbin0 -> 641 bytes
-rw-r--r--kdelirc/icons/hi16-action-ledlightblue.pngbin0 -> 732 bytes
-rw-r--r--kdelirc/icons/hi16-action-ledlightgreen.pngbin0 -> 718 bytes
-rw-r--r--kdelirc/icons/hi16-action-ledorange.pngbin0 -> 698 bytes
-rw-r--r--kdelirc/icons/hi16-action-ledpurple.pngbin0 -> 702 bytes
-rw-r--r--kdelirc/icons/hi16-action-ledred.pngbin0 -> 659 bytes
-rw-r--r--kdelirc/icons/hi16-action-ledyellow.pngbin0 -> 672 bytes
-rw-r--r--kdelirc/icons/hi32-action-ledblue.pngbin0 -> 1384 bytes
-rw-r--r--kdelirc/icons/hi32-action-ledgreen.pngbin0 -> 1265 bytes
-rw-r--r--kdelirc/icons/hi32-action-ledlightblue.pngbin0 -> 1378 bytes
-rw-r--r--kdelirc/icons/hi32-action-ledlightgreen.pngbin0 -> 1464 bytes
-rw-r--r--kdelirc/icons/hi32-action-ledorange.pngbin0 -> 1378 bytes
-rw-r--r--kdelirc/icons/hi32-action-ledpurple.pngbin0 -> 1327 bytes
-rw-r--r--kdelirc/icons/hi32-action-ledred.pngbin0 -> 1207 bytes
-rw-r--r--kdelirc/icons/hi32-action-ledyellow.pngbin0 -> 1354 bytes
-rw-r--r--kdelirc/irkick/Makefile.am42
-rw-r--r--kdelirc/irkick/hi16-app-irkick.pngbin0 -> 954 bytes
-rw-r--r--kdelirc/irkick/hi22-app-irkick.pngbin0 -> 1457 bytes
-rw-r--r--kdelirc/irkick/hi32-app-irkick.pngbin0 -> 2421 bytes
-rw-r--r--kdelirc/irkick/icons/Makefile.am3
-rw-r--r--kdelirc/irkick/icons/hi16-action-irkick.pngbin0 -> 954 bytes
-rw-r--r--kdelirc/irkick/icons/hi16-action-irkickflash.pngbin0 -> 892 bytes
-rw-r--r--kdelirc/irkick/icons/hi16-action-irkickoff.pngbin0 -> 1016 bytes
-rw-r--r--kdelirc/irkick/irkick.cpp336
-rw-r--r--kdelirc/irkick/irkick.desktop116
-rw-r--r--kdelirc/irkick/irkick.h132
-rw-r--r--kdelirc/irkick/irkick.project12
-rw-r--r--kdelirc/irkick/kdedmodule_stub.h34
-rw-r--r--kdelirc/irkick/klircclient.cpp241
-rw-r--r--kdelirc/irkick/klircclient.h114
-rw-r--r--kdelirc/irkick/lo16-app-irkick.pngbin0 -> 381 bytes
-rw-r--r--kdelirc/irkick/lo32-app-irkick.pngbin0 -> 603 bytes
-rw-r--r--kdelirc/irkick/main.cpp39
-rw-r--r--kdelirc/kcmlirc/Makefile.am15
-rw-r--r--kdelirc/kcmlirc/addaction.cpp375
-rw-r--r--kdelirc/kcmlirc/addaction.h73
-rw-r--r--kdelirc/kcmlirc/addactionbase.ui1608
-rw-r--r--kdelirc/kcmlirc/editaction.cpp362
-rw-r--r--kdelirc/kcmlirc/editaction.h55
-rw-r--r--kdelirc/kcmlirc/editactionbase.ui1287
-rw-r--r--kdelirc/kcmlirc/editmode.cpp38
-rw-r--r--kdelirc/kcmlirc/editmode.h33
-rw-r--r--kdelirc/kcmlirc/editmodebase.ui303
-rw-r--r--kdelirc/kcmlirc/kcmlirc.cpp544
-rw-r--r--kdelirc/kcmlirc/kcmlirc.desktop119
-rw-r--r--kdelirc/kcmlirc/kcmlirc.h83
-rw-r--r--kdelirc/kcmlirc/kcmlircbase.ui506
-rw-r--r--kdelirc/kcmlirc/kcmlircbase.ui.h37
-rw-r--r--kdelirc/kcmlirc/modeslist.cpp33
-rw-r--r--kdelirc/kcmlirc/modeslist.h33
-rw-r--r--kdelirc/kcmlirc/newmode.ui158
-rw-r--r--kdelirc/kcmlirc/newmode.ui.h24
-rw-r--r--kdelirc/kcmlirc/selectprofile.ui128
-rw-r--r--kdelirc/kdelirc/Makefile.am45
-rw-r--r--kdelirc/kdelirc/arguments.cpp36
-rw-r--r--kdelirc/kdelirc/arguments.h32
-rw-r--r--kdelirc/kdelirc/iraction.cpp155
-rw-r--r--kdelirc/kdelirc/iraction.h88
-rw-r--r--kdelirc/kdelirc/iractions.cpp90
-rw-r--r--kdelirc/kdelirc/iractions.h52
-rw-r--r--kdelirc/kdelirc/mode.cpp51
-rw-r--r--kdelirc/kdelirc/mode.h50
-rw-r--r--kdelirc/kdelirc/modes.cpp128
-rw-r--r--kdelirc/kdelirc/modes.h62
-rw-r--r--kdelirc/kdelirc/profileserver.cpp159
-rw-r--r--kdelirc/kdelirc/profileserver.h142
-rw-r--r--kdelirc/kdelirc/prototype.cpp67
-rw-r--r--kdelirc/kdelirc/prototype.h54
-rw-r--r--kdelirc/kdelirc/remoteserver.cpp109
-rw-r--r--kdelirc/kdelirc/remoteserver.h89
-rw-r--r--kdelirc/profiles/Makefile.am5
-rw-r--r--kdelirc/profiles/klauncher.profile.xml18
-rw-r--r--kdelirc/profiles/konqueror.profile.xml17
-rw-r--r--kdelirc/profiles/noatun.profile.xml75
-rw-r--r--kdelirc/profiles/profile.dtd28
-rw-r--r--kdelirc/remotes/Makefile.am6
-rw-r--r--kdelirc/remotes/RM-0010.remote.xml49
-rw-r--r--kdelirc/remotes/cimr100.remote.xml31
-rw-r--r--kdelirc/remotes/hauppauge.remote.xml29
-rw-r--r--kdelirc/remotes/remote.dtd15
-rw-r--r--kdelirc/remotes/sherwood.remote.xml61
-rw-r--r--kdelirc/remotes/sonytv.remote.xml30
-rw-r--r--kdessh/LICENSE.readme124
-rw-r--r--kdessh/Makefile.am17
-rw-r--r--kdessh/README3
-rw-r--r--kdessh/kdessh.cpp201
-rw-r--r--kdessh/sshdlg.cpp80
-rw-r--r--kdessh/sshdlg.h32
-rw-r--r--kdeutils.lsm11
-rw-r--r--kdf/Makefile.am37
-rw-r--r--kdf/disklist.cpp506
-rw-r--r--kdf/disklist.h138
-rw-r--r--kdf/disks.cpp335
-rw-r--r--kdf/disks.h148
-rw-r--r--kdf/kcmdf.cpp66
-rw-r--r--kdf/kcmdf.desktop138
-rw-r--r--kdf/kcmdf.h49
-rw-r--r--kdf/kconftest.cpp80
-rw-r--r--kdf/kdf.cpp96
-rw-r--r--kdf/kdf.desktop88
-rw-r--r--kdf/kdf.h45
-rw-r--r--kdf/kdfconfig.cpp263
-rw-r--r--kdf/kdfconfig.h97
-rw-r--r--kdf/kdfui.rc11
-rw-r--r--kdf/kdfwidget.cpp652
-rw-r--r--kdf/kdfwidget.h153
-rw-r--r--kdf/kwikdisk.cpp346
-rw-r--r--kdf/kwikdisk.desktop78
-rw-r--r--kdf/kwikdisk.h78
-rw-r--r--kdf/listview.cpp113
-rw-r--r--kdf/listview.h53
-rw-r--r--kdf/mntconfig.cpp364
-rw-r--r--kdf/mntconfig.h102
-rw-r--r--kdf/optiondialog.cpp85
-rw-r--r--kdf/optiondialog.h50
-rw-r--r--kdf/pics/Makefile.am4
-rw-r--r--kdf/pics/cr16-app-kcmdf.pngbin0 -> 924 bytes
-rw-r--r--kdf/pics/cr22-app-kcmdf.pngbin0 -> 1152 bytes
-rw-r--r--kdf/pics/cr32-app-kcmdf.pngbin0 -> 1771 bytes
-rw-r--r--kdf/pics/delete.pngbin0 -> 963 bytes
-rw-r--r--kdf/pics/hi128-app-kdf.pngbin0 -> 10332 bytes
-rw-r--r--kdf/pics/hi128-app-kwikdisk.pngbin0 -> 11838 bytes
-rw-r--r--kdf/pics/hi16-app-kdf.pngbin0 -> 924 bytes
-rw-r--r--kdf/pics/hi16-app-kwikdisk.pngbin0 -> 818 bytes
-rw-r--r--kdf/pics/hi22-app-kdf.pngbin0 -> 1152 bytes
-rw-r--r--kdf/pics/hi22-app-kwikdisk.pngbin0 -> 1229 bytes
-rw-r--r--kdf/pics/hi32-app-kdf.pngbin0 -> 1771 bytes
-rw-r--r--kdf/pics/hi32-app-kwikdisk.pngbin0 -> 2079 bytes
-rw-r--r--kdf/pics/hi48-app-kdf.pngbin0 -> 2851 bytes
-rw-r--r--kdf/pics/hi48-app-kwikdisk.pngbin0 -> 3510 bytes
-rw-r--r--kdf/pics/hi64-app-kdf.pngbin0 -> 3801 bytes
-rw-r--r--kdf/pics/hi64-app-kwikdisk.pngbin0 -> 5185 bytes
-rw-r--r--kdf/pics/mini-root.pngbin0 -> 785 bytes
-rw-r--r--kdf/pics/tick.pngbin0 -> 661 bytes
-rw-r--r--kdf/stdoption.cpp148
-rw-r--r--kdf/stdoption.h72
-rw-r--r--kdf/unix_outputs/df-g.hpux392
-rw-r--r--kdf/unix_outputs/df-k.digital42
-rw-r--r--kdf/unix_outputs/df-k.hpux196
-rw-r--r--kdf/unix_outputs/df.man.hpux198
-rw-r--r--kdf/unix_outputs/etcfstab.digital43
-rw-r--r--kdf/unix_outputs/etcfstab.hpux75
-rw-r--r--kdf/unix_outputs/unix-defines.txt125
-rw-r--r--kedit/ChangeLog113
-rw-r--r--kedit/KEdit.desktop82
-rw-r--r--kedit/Makefile.am35
-rw-r--r--kedit/README192
-rw-r--r--kedit/TODO6
-rw-r--r--kedit/color.ui129
-rw-r--r--kedit/kedit.cpp1377
-rw-r--r--kedit/kedit.h229
-rw-r--r--kedit/kedit.kcfg45
-rw-r--r--kedit/keditui.rc10
-rw-r--r--kedit/ktextfiledlg.cpp212
-rw-r--r--kedit/ktextfiledlg.h74
-rw-r--r--kedit/misc.ui123
-rw-r--r--kedit/misc.ui.h14
-rw-r--r--kedit/pixmaps/Makefile.am2
-rw-r--r--kedit/pixmaps/hi16-app-kedit.pngbin0 -> 990 bytes
-rw-r--r--kedit/pixmaps/hi22-app-kedit.pngbin0 -> 1654 bytes
-rw-r--r--kedit/pixmaps/hi32-app-kedit.pngbin0 -> 2683 bytes
-rw-r--r--kedit/pixmaps/hi48-app-kedit.pngbin0 -> 4385 bytes
-rw-r--r--kedit/pixmaps/hi64-app-kedit.pngbin0 -> 8377 bytes
-rw-r--r--kedit/prefs.kcfgc7
-rw-r--r--kedit/version.h2
-rw-r--r--kfloppy/KFloppy.desktop96
-rw-r--r--kfloppy/Makefile.am23
-rw-r--r--kfloppy/README23
-rw-r--r--kfloppy/TODO47
-rw-r--r--kfloppy/debug.h65
-rw-r--r--kfloppy/floppy.cpp741
-rw-r--r--kfloppy/floppy.h128
-rw-r--r--kfloppy/floppy_format.desktop54
-rw-r--r--kfloppy/format.cpp996
-rw-r--r--kfloppy/format.h426
-rw-r--r--kfloppy/hi128-app-kfloppy.pngbin0 -> 12698 bytes
-rw-r--r--kfloppy/hi16-app-kfloppy.pngbin0 -> 1008 bytes
-rw-r--r--kfloppy/hi22-app-kfloppy.pngbin0 -> 1397 bytes
-rw-r--r--kfloppy/hi32-app-kfloppy.pngbin0 -> 2374 bytes
-rw-r--r--kfloppy/hi48-app-kfloppy.pngbin0 -> 3812 bytes
-rw-r--r--kfloppy/hi64-app-kfloppy.pngbin0 -> 5298 bytes
-rw-r--r--kfloppy/main.cpp79
-rw-r--r--kfloppy/zip.cpp305
-rw-r--r--kfloppy/zip.h106
-rw-r--r--kgpg/AUTHORS1
-rw-r--r--kgpg/ChangeLog310
-rw-r--r--kgpg/INSTALL160
-rw-r--r--kgpg/Makefile.am46
-rw-r--r--kgpg/adduid.ui64
-rw-r--r--kgpg/conf_decryption.ui69
-rw-r--r--kgpg/conf_encryption.ui321
-rw-r--r--kgpg/conf_encryption.ui.h22
-rw-r--r--kgpg/conf_gpg.ui219
-rw-r--r--kgpg/conf_misc.ui413
-rw-r--r--kgpg/conf_servers.ui118
-rw-r--r--kgpg/conf_ui2.ui178
-rw-r--r--kgpg/dcopiface.h35
-rw-r--r--kgpg/detailedconsole.cpp65
-rw-r--r--kgpg/detailedconsole.h43
-rw-r--r--kgpg/encryptfile.desktop62
-rw-r--r--kgpg/encryptfolder.desktop52
-rw-r--r--kgpg/groupedit.ui212
-rw-r--r--kgpg/hi16-app-kgpg.pngbin0 -> 1013 bytes
-rw-r--r--kgpg/hi22-app-kgpg.pngbin0 -> 1255 bytes
-rw-r--r--kgpg/hi32-app-kgpg.pngbin0 -> 2073 bytes
-rw-r--r--kgpg/hi48-app-kgpg.pngbin0 -> 3477 bytes
-rw-r--r--kgpg/icons/Makefile.am2
-rw-r--r--kgpg/icons/cr16-action-kgpg_key1.pngbin0 -> 267 bytes
-rw-r--r--kgpg/icons/cr16-action-kgpg_key2.pngbin0 -> 440 bytes
-rw-r--r--kgpg/icons/cr16-action-kgpg_key3.pngbin0 -> 671 bytes
-rw-r--r--kgpg/icons/cr16-action-kgpg_key4.pngbin0 -> 353 bytes
-rw-r--r--kgpg/icons/cr22-action-kgpg_edit.pngbin0 -> 3797 bytes
-rw-r--r--kgpg/icons/cr22-action-kgpg_export.pngbin0 -> 346 bytes
-rw-r--r--kgpg/icons/cr22-action-kgpg_gen.pngbin0 -> 585 bytes
-rw-r--r--kgpg/icons/cr22-action-kgpg_identity.pngbin0 -> 1358 bytes
-rw-r--r--kgpg/icons/cr22-action-kgpg_import.pngbin0 -> 371 bytes
-rw-r--r--kgpg/icons/cr22-action-kgpg_info.pngbin0 -> 408 bytes
-rw-r--r--kgpg/icons/cr22-action-kgpg_photo.pngbin0 -> 626 bytes
-rw-r--r--kgpg/icons/cr22-action-kgpg_show.pngbin0 -> 375 bytes
-rw-r--r--kgpg/icons/cr22-action-kgpg_sign.pngbin0 -> 437 bytes
-rw-r--r--kgpg/icons/cr22-action-kgpg_term.pngbin0 -> 544 bytes
-rw-r--r--kgpg/keyexport.ui142
-rw-r--r--kgpg/keyexport.ui.h21
-rw-r--r--kgpg/keygener.cpp176
-rw-r--r--kgpg/keygener.h50
-rw-r--r--kgpg/keyinfowidget.cpp465
-rw-r--r--kgpg/keyinfowidget.h84
-rw-r--r--kgpg/keyproperties.ui507
-rw-r--r--kgpg/keyserver.ui336
-rw-r--r--kgpg/keyservers.cpp574
-rw-r--r--kgpg/keyservers.h81
-rw-r--r--kgpg/kgpg.cpp1057
-rw-r--r--kgpg/kgpg.desktop123
-rw-r--r--kgpg/kgpg.h168
-rw-r--r--kgpg/kgpg.kcfg206
-rw-r--r--kgpg/kgpg.rc27
-rw-r--r--kgpg/kgpg_anim.gifbin0 -> 954 bytes
-rw-r--r--kgpg/kgpg_blank.pngbin0 -> 170 bytes
-rw-r--r--kgpg/kgpg_docked.gifbin0 -> 1602 bytes
-rw-r--r--kgpg/kgpg_docked.pngbin0 -> 1167 bytes
-rw-r--r--kgpg/kgpg_fill.pngbin0 -> 156 bytes
-rw-r--r--kgpg/kgpgeditor.cpp554
-rw-r--r--kgpg/kgpgeditor.h123
-rw-r--r--kgpg/kgpginterface.cpp2166
-rw-r--r--kgpg/kgpginterface.h404
-rw-r--r--kgpg/kgpglibrary.cpp245
-rw-r--r--kgpg/kgpglibrary.h81
-rw-r--r--kgpg/kgpgoptions.cpp601
-rw-r--r--kgpg/kgpgoptions.h106
-rw-r--r--kgpg/kgpgrevokewidget.ui152
-rw-r--r--kgpg/kgpgrevokewidget.ui.h21
-rw-r--r--kgpg/kgpgsettings.kcfgc9
-rw-r--r--kgpg/kgpgsettings_addons.h41
-rw-r--r--kgpg/kgpgview.cpp409
-rw-r--r--kgpg/kgpgview.h121
-rw-r--r--kgpg/kgpgwizard.ui405
-rw-r--r--kgpg/listkeys.cpp3149
-rw-r--r--kgpg/listkeys.h302
-rw-r--r--kgpg/listkeys.rc137
-rw-r--r--kgpg/main.cpp79
-rw-r--r--kgpg/newkey.ui196
-rw-r--r--kgpg/newkey.ui.h21
-rw-r--r--kgpg/popuppublic.cpp480
-rw-r--r--kgpg/popuppublic.h76
-rw-r--r--kgpg/searchres.ui124
-rw-r--r--kgpg/sourceselect.ui112
-rw-r--r--kgpg/tips44
-rw-r--r--khexedit/Makefile.am35
-rw-r--r--khexedit/README34
-rw-r--r--khexedit/bitswapwidget.cc323
-rw-r--r--khexedit/bitswapwidget.h101
-rw-r--r--khexedit/chartabledialog.cc212
-rw-r--r--khexedit/chartabledialog.h72
-rw-r--r--khexedit/configure.in.in8
-rw-r--r--khexedit/conversion.cc395
-rw-r--r--khexedit/conversion.h71
-rw-r--r--khexedit/converterdialog.cc163
-rw-r--r--khexedit/converterdialog.h83
-rw-r--r--khexedit/dialog.cc1433
-rw-r--r--khexedit/dialog.h350
-rw-r--r--khexedit/draglabel.cc149
-rw-r--r--khexedit/draglabel.h60
-rw-r--r--khexedit/exportdialog.cc696
-rw-r--r--khexedit/exportdialog.h138
-rw-r--r--khexedit/fileinfodialog.cc330
-rw-r--r--khexedit/fileinfodialog.h74
-rw-r--r--khexedit/hexbuffer.cc5099
-rw-r--r--khexedit/hexbuffer.h2040
-rw-r--r--khexedit/hexclipboard.cc254
-rw-r--r--khexedit/hexclipboard.h40
-rw-r--r--khexedit/hexdrag.cc130
-rw-r--r--khexedit/hexdrag.h54
-rw-r--r--khexedit/hexeditorwidget.cc2443
-rw-r--r--khexedit/hexeditorwidget.h301
-rw-r--r--khexedit/hexeditstate.h596
-rw-r--r--khexedit/hexerror.cc69
-rw-r--r--khexedit/hexerror.h57
-rw-r--r--khexedit/hexmanagerwidget.cc370
-rw-r--r--khexedit/hexmanagerwidget.h202
-rw-r--r--khexedit/hexprinter.cc168
-rw-r--r--khexedit/hexprinter.h108
-rw-r--r--khexedit/hextoolwidget.cc416
-rw-r--r--khexedit/hextoolwidget.h81
-rw-r--r--khexedit/hexvalidator.cc329
-rw-r--r--khexedit/hexvalidator.h63
-rw-r--r--khexedit/hexviewwidget.cc2286
-rw-r--r--khexedit/hexviewwidget.h584
-rw-r--r--khexedit/hi16-app-khexedit.pngbin0 -> 411 bytes
-rw-r--r--khexedit/hi32-app-khexedit.pngbin0 -> 1146 bytes
-rw-r--r--khexedit/hi48-app-khexedit.pngbin0 -> 1878 bytes
-rw-r--r--khexedit/khexedit.desktop86
-rw-r--r--khexedit/khexeditui.rc137
-rw-r--r--khexedit/lib/Makefile.am39
-rw-r--r--khexedit/lib/README36
-rw-r--r--khexedit/lib/codecs/Makefile.am15
-rw-r--r--khexedit/lib/codecs/README1
-rw-r--r--khexedit/lib/codecs/kbinarybytecodec.cpp80
-rw-r--r--khexedit/lib/codecs/kbinarybytecodec.h59
-rw-r--r--khexedit/lib/codecs/kbytecodec.cpp63
-rw-r--r--khexedit/lib/codecs/kcharcodec.cpp74
-rw-r--r--khexedit/lib/codecs/kdecimalbytecodec.cpp92
-rw-r--r--khexedit/lib/codecs/kdecimalbytecodec.h59
-rw-r--r--khexedit/lib/codecs/kebcdic1047charcodec.cpp124
-rw-r--r--khexedit/lib/codecs/kebcdic1047charcodec.h50
-rw-r--r--khexedit/lib/codecs/khexadecimalbytecodec.cpp113
-rw-r--r--khexedit/lib/codecs/khexadecimalbytecodec.h69
-rw-r--r--khexedit/lib/codecs/koctalbytecodec.cpp80
-rw-r--r--khexedit/lib/codecs/koctalbytecodec.h59
-rw-r--r--khexedit/lib/codecs/ktextcharcodec.cpp236
-rw-r--r--khexedit/lib/codecs/ktextcharcodec.h66
-rw-r--r--khexedit/lib/controller/Makefile.am12
-rw-r--r--khexedit/lib/controller/kchareditor.cpp58
-rw-r--r--khexedit/lib/controller/kchareditor.h43
-rw-r--r--khexedit/lib/controller/kcontroller.cpp34
-rw-r--r--khexedit/lib/controller/kcontroller.h44
-rw-r--r--khexedit/lib/controller/keditor.cpp197
-rw-r--r--khexedit/lib/controller/keditor.h52
-rw-r--r--khexedit/lib/controller/knavigator.cpp142
-rw-r--r--khexedit/lib/controller/knavigator.h46
-rw-r--r--khexedit/lib/controller/ktabcontroller.cpp70
-rw-r--r--khexedit/lib/controller/ktabcontroller.h52
-rw-r--r--khexedit/lib/controller/kvalueeditor.cpp226
-rw-r--r--khexedit/lib/controller/kvalueeditor.h75
-rw-r--r--khexedit/lib/helper.h31
-rw-r--r--khexedit/lib/kadds.h36
-rw-r--r--khexedit/lib/kbigbuffer.cpp216
-rw-r--r--khexedit/lib/kbigbuffer.h119
-rw-r--r--khexedit/lib/kbordercoltextexport.cpp47
-rw-r--r--khexedit/lib/kbordercoltextexport.h40
-rw-r--r--khexedit/lib/kbordercolumn.cpp82
-rw-r--r--khexedit/lib/kbordercolumn.h52
-rw-r--r--khexedit/lib/kbuffercoltextexport.cpp108
-rw-r--r--khexedit/lib/kbuffercoltextexport.h73
-rw-r--r--khexedit/lib/kbuffercolumn.cpp700
-rw-r--r--khexedit/lib/kbuffercolumn.h253
-rw-r--r--khexedit/lib/kbuffercoord.h293
-rw-r--r--khexedit/lib/kbuffercursor.cpp365
-rw-r--r--khexedit/lib/kbuffercursor.h172
-rw-r--r--khexedit/lib/kbufferdrag.cpp237
-rw-r--r--khexedit/lib/kbufferdrag.h76
-rw-r--r--khexedit/lib/kbufferlayout.cpp240
-rw-r--r--khexedit/lib/kbufferlayout.h196
-rw-r--r--khexedit/lib/kbufferranges.cpp307
-rw-r--r--khexedit/lib/kbufferranges.h130
-rw-r--r--khexedit/lib/kbytecodec.h73
-rw-r--r--khexedit/lib/kbytesedit.cpp162
-rw-r--r--khexedit/lib/kbytesedit.h163
-rw-r--r--khexedit/lib/kcharcodec.h55
-rw-r--r--khexedit/lib/kcharcoltextexport.cpp71
-rw-r--r--khexedit/lib/kcharcoltextexport.h50
-rw-r--r--khexedit/lib/kcharcolumn.cpp61
-rw-r--r--khexedit/lib/kcharcolumn.h116
-rw-r--r--khexedit/lib/kcoltextexport.h40
-rw-r--r--khexedit/lib/kcolumn.cpp60
-rw-r--r--khexedit/lib/kcolumn.h126
-rw-r--r--khexedit/lib/kcolumnsview.cpp236
-rw-r--r--khexedit/lib/kcolumnsview.h168
-rw-r--r--khexedit/lib/kcoordrange.h95
-rw-r--r--khexedit/lib/kcoordrangelist.cpp78
-rw-r--r--khexedit/lib/kcoordrangelist.h44
-rw-r--r--khexedit/lib/kcursor.cpp49
-rw-r--r--khexedit/lib/kcursor.h68
-rw-r--r--khexedit/lib/kdatabuffer.cpp51
-rw-r--r--khexedit/lib/kdatabuffer.h246
-rw-r--r--khexedit/lib/kfixedsizebuffer.cpp272
-rw-r--r--khexedit/lib/kfixedsizebuffer.h116
-rw-r--r--khexedit/lib/khe.h95
-rw-r--r--khexedit/lib/khechar.h44
-rw-r--r--khexedit/lib/khexedit.cpp2032
-rw-r--r--khexedit/lib/khexedit.h562
-rw-r--r--khexedit/lib/khexedit_export.h25
-rw-r--r--khexedit/lib/koffsetcoltextexport.cpp61
-rw-r--r--khexedit/lib/koffsetcoltextexport.h57
-rw-r--r--khexedit/lib/koffsetcolumn.cpp110
-rw-r--r--khexedit/lib/koffsetcolumn.h109
-rw-r--r--khexedit/lib/koffsetformat.cpp48
-rw-r--r--khexedit/lib/koffsetformat.h70
-rw-r--r--khexedit/lib/kplainbuffer.cpp344
-rw-r--r--khexedit/lib/kplainbuffer.h131
-rw-r--r--khexedit/lib/krange.h123
-rw-r--r--khexedit/lib/kreadonlybuffer.h45
-rw-r--r--khexedit/lib/ksection.h108
-rw-r--r--khexedit/lib/ksectionlist.cpp79
-rw-r--r--khexedit/lib/ksectionlist.h44
-rw-r--r--khexedit/lib/kselection.h178
-rw-r--r--khexedit/lib/kvaluecoltextexport.cpp69
-rw-r--r--khexedit/lib/kvaluecoltextexport.h47
-rw-r--r--khexedit/lib/kvaluecolumn.cpp134
-rw-r--r--khexedit/lib/kvaluecolumn.h92
-rw-r--r--khexedit/lib/kwordbufferservice.cpp209
-rw-r--r--khexedit/lib/kwordbufferservice.h137
-rw-r--r--khexedit/lib/kwrappingrobuffer.cpp61
-rw-r--r--khexedit/lib/kwrappingrobuffer.h85
-rw-r--r--khexedit/listview.cc54
-rw-r--r--khexedit/listview.h49
-rw-r--r--khexedit/main.cc130
-rw-r--r--khexedit/optiondialog.cc1224
-rw-r--r--khexedit/optiondialog.h269
-rw-r--r--khexedit/parts/Makefile.am1
-rw-r--r--khexedit/parts/README3
-rw-r--r--khexedit/parts/kbytesedit/Makefile.am15
-rw-r--r--khexedit/parts/kbytesedit/README23
-rw-r--r--khexedit/parts/kbytesedit/kbyteseditwidget.cpp319
-rw-r--r--khexedit/parts/kbytesedit/kbyteseditwidget.desktop52
-rw-r--r--khexedit/parts/kbytesedit/kbyteseditwidget.h185
-rw-r--r--khexedit/parts/kpart/Makefile.am21
-rw-r--r--khexedit/parts/kpart/khebrowserextension.cpp95
-rw-r--r--khexedit/parts/kpart/khebrowserextension.h58
-rw-r--r--khexedit/parts/kpart/khepart.cpp213
-rw-r--r--khexedit/parts/kpart/khepart.h95
-rw-r--r--khexedit/parts/kpart/khepartfactory.cpp90
-rw-r--r--khexedit/parts/kpart/khepartfactory.h47
-rw-r--r--khexedit/parts/kpart/khexedit2part.desktop101
-rw-r--r--khexedit/parts/kpart/khexedit2partui.rc42
-rw-r--r--khexedit/pics/Makefile.am3
-rw-r--r--khexedit/pics/hexdrag.pngbin0 -> 459 bytes
-rw-r--r--khexedit/pics/hexmask.pngbin0 -> 188 bytes
-rw-r--r--khexedit/pics/hexwrite.pngbin0 -> 381 bytes
-rw-r--r--khexedit/printdialogpage.cc386
-rw-r--r--khexedit/printdialogpage.h73
-rw-r--r--khexedit/progress.h130
-rw-r--r--khexedit/searchbar.cc188
-rw-r--r--khexedit/searchbar.h73
-rw-r--r--khexedit/statusbarprogress.cc374
-rw-r--r--khexedit/statusbarprogress.h159
-rw-r--r--khexedit/stringdialog.cc412
-rw-r--r--khexedit/stringdialog.h110
-rw-r--r--khexedit/toplevel.cc1366
-rw-r--r--khexedit/toplevel.h279
-rw-r--r--khexedit/version.h32
-rw-r--r--kjots/ANNOUNCE26
-rw-r--r--kjots/BUGS6
-rw-r--r--kjots/CHANGES75
-rw-r--r--kjots/KJotsMain.cpp1199
-rw-r--r--kjots/KJotsMain.h165
-rw-r--r--kjots/KJotsSettings.kcfgc8
-rw-r--r--kjots/Kjots.desktop80
-rw-r--r--kjots/Makefile.am28
-rw-r--r--kjots/README33
-rw-r--r--kjots/confpagefont.ui38
-rw-r--r--kjots/confpagemisc.ui152
-rw-r--r--kjots/icons/Makefile.am6
-rw-r--r--kjots/icons/README24
-rw-r--r--kjots/icons/filedel.pngbin0 -> 892 bytes
-rw-r--r--kjots/icons/hi16-app-kjots.pngbin0 -> 902 bytes
-rw-r--r--kjots/icons/hi22-app-kjots.pngbin0 -> 1318 bytes
-rw-r--r--kjots/icons/hi32-app-kjots.pngbin0 -> 2287 bytes
-rw-r--r--kjots/icons/hi48-app-kjots.pngbin0 -> 3755 bytes
-rw-r--r--kjots/icons/hi64-app-kjots.pngbin0 -> 5426 bytes
-rw-r--r--kjots/kjots.kcfg35
-rw-r--r--kjots/kjotsbookmarks.cpp51
-rw-r--r--kjots/kjotsbookmarks.h51
-rw-r--r--kjots/kjotsedit.cpp150
-rw-r--r--kjots/kjotsedit.h54
-rw-r--r--kjots/kjotsentry.cpp1234
-rw-r--r--kjots/kjotsentry.h179
-rw-r--r--kjots/kjotsui.rc41
-rw-r--r--kjots/main.cpp98
-rw-r--r--klaptopdaemon/Makefile.am49
-rw-r--r--klaptopdaemon/README8
-rw-r--r--klaptopdaemon/acpi.cpp281
-rw-r--r--klaptopdaemon/acpi.h72
-rw-r--r--klaptopdaemon/acpi_helper.cpp325
-rw-r--r--klaptopdaemon/apm.cpp285
-rw-r--r--klaptopdaemon/apm.h71
-rw-r--r--klaptopdaemon/applnk/.directory48
-rw-r--r--klaptopdaemon/applnk/Makefile.am4
-rw-r--r--klaptopdaemon/applnk/klaptopdaemon.desktop116
-rw-r--r--klaptopdaemon/applnk/laptop.desktop135
-rw-r--r--klaptopdaemon/applnk/pcmcia.desktop84
-rw-r--r--klaptopdaemon/battery.cpp390
-rw-r--r--klaptopdaemon/battery.h100
-rw-r--r--klaptopdaemon/buttons.cpp620
-rw-r--r--klaptopdaemon/buttons.h92
-rw-r--r--klaptopdaemon/checkcrc.h53
-rw-r--r--klaptopdaemon/configure.in.bot9
-rw-r--r--klaptopdaemon/configure.in.in49
-rw-r--r--klaptopdaemon/daemon_state.cpp282
-rw-r--r--klaptopdaemon/daemon_state.h141
-rw-r--r--klaptopdaemon/daemondock.cpp756
-rw-r--r--klaptopdaemon/daemondock.h108
-rw-r--r--klaptopdaemon/kpcmcia.cpp547
-rw-r--r--klaptopdaemon/kpcmcia.h214
-rw-r--r--klaptopdaemon/kpcmciainfo.cpp313
-rw-r--r--klaptopdaemon/kpcmciainfo.h116
-rw-r--r--klaptopdaemon/krichtextlabel.cpp112
-rw-r--r--klaptopdaemon/krichtextlabel.h65
-rw-r--r--klaptopdaemon/laptop_check.cpp53
-rw-r--r--klaptopdaemon/laptop_daemon.cpp1083
-rw-r--r--klaptopdaemon/laptop_daemon.h186
-rw-r--r--klaptopdaemon/linux/bulkmem.h184
-rw-r--r--klaptopdaemon/linux/ciscode.h96
-rw-r--r--klaptopdaemon/linux/cisreg.h105
-rw-r--r--klaptopdaemon/linux/cistpl.h543
-rw-r--r--klaptopdaemon/linux/cs.h455
-rw-r--r--klaptopdaemon/linux/cs_types.h50
-rw-r--r--klaptopdaemon/linux/driver_ops.h71
-rw-r--r--klaptopdaemon/linux/ds.h142
-rw-r--r--klaptopdaemon/linux/ftl.h62
-rw-r--r--klaptopdaemon/linux/k_compat.h246
-rw-r--r--klaptopdaemon/linux/mem_op.h120
-rw-r--r--klaptopdaemon/linux/memory.h30
-rw-r--r--klaptopdaemon/linux/ss.h113
-rw-r--r--klaptopdaemon/linux/version.h4
-rw-r--r--klaptopdaemon/main.cpp305
-rw-r--r--klaptopdaemon/main.h82
-rw-r--r--klaptopdaemon/makecrc.cpp38
-rw-r--r--klaptopdaemon/pcmcia.cpp122
-rw-r--r--klaptopdaemon/pcmcia.h70
-rw-r--r--klaptopdaemon/pics/Makefile.am6
-rw-r--r--klaptopdaemon/pics/README36
-rw-r--r--klaptopdaemon/pics/actions/Makefile.am3
-rw-r--r--klaptopdaemon/pics/actions/cr16-action-alt2_laptop_nobattery.pngbin0 -> 395 bytes
-rw-r--r--klaptopdaemon/pics/actions/cr16-action-alt2_laptop_nocharge.pngbin0 -> 280 bytes
-rw-r--r--klaptopdaemon/pics/actions/cr16-action-alt2_laptop_power.pngbin0 -> 317 bytes
-rw-r--r--klaptopdaemon/pics/actions/cr16-action-alt3_laptop_nocharge.pngbin0 -> 280 bytes
-rw-r--r--klaptopdaemon/pics/actions/cr16-action-alt3_laptop_power.pngbin0 -> 284 bytes
-rw-r--r--klaptopdaemon/pics/actions/cr16-action-alt_laptop_nocharge.pngbin0 -> 795 bytes
-rw-r--r--klaptopdaemon/pics/actions/cr16-action-alt_laptop_power.pngbin0 -> 775 bytes
-rw-r--r--klaptopdaemon/pics/actions/cr16-action-laptop_charge.pngbin0 -> 296 bytes
-rw-r--r--klaptopdaemon/pics/actions/cr16-action-laptop_nobattery.pngbin0 -> 352 bytes
-rw-r--r--klaptopdaemon/pics/actions/cr16-action-laptop_nocharge.pngbin0 -> 305 bytes
-rw-r--r--klaptopdaemon/pics/actions/cr16-action-power.pngbin0 -> 335 bytes
-rw-r--r--klaptopdaemon/pics/actions/cr22-action-laptop_charge.pngbin0 -> 966 bytes
-rw-r--r--klaptopdaemon/pics/actions/cr22-action-laptop_nobattery.pngbin0 -> 1022 bytes
-rw-r--r--klaptopdaemon/pics/actions/cr22-action-laptop_nocharge.pngbin0 -> 395 bytes
-rw-r--r--klaptopdaemon/pics/actions/cr22-action-laptop_power.pngbin0 -> 832 bytes
-rw-r--r--klaptopdaemon/pics/actions/cr32-action-power.pngbin0 -> 421 bytes
-rw-r--r--klaptopdaemon/pics/cr128-app-laptop_battery.pngbin0 -> 10017 bytes
-rw-r--r--klaptopdaemon/pics/cr16-app-laptop_battery.pngbin0 -> 912 bytes
-rw-r--r--klaptopdaemon/pics/cr16-app-laptop_pcmcia.pngbin0 -> 477 bytes
-rw-r--r--klaptopdaemon/pics/cr32-app-laptop_battery.pngbin0 -> 2374 bytes
-rw-r--r--klaptopdaemon/pics/cr32-app-laptop_pcmcia.pngbin0 -> 1375 bytes
-rw-r--r--klaptopdaemon/pics/cr48-app-laptop_battery.pngbin0 -> 3544 bytes
-rw-r--r--klaptopdaemon/pics/cr48-app-laptop_pcmcia.pngbin0 -> 1751 bytes
-rw-r--r--klaptopdaemon/pics/cr64-app-laptop_battery.pngbin0 -> 4730 bytes
-rw-r--r--klaptopdaemon/pics/crsc-app-laptop_battery.svgzbin0 -> 4371 bytes
-rw-r--r--klaptopdaemon/portable.cpp3087
-rw-r--r--klaptopdaemon/portable.h147
-rw-r--r--klaptopdaemon/power.cpp587
-rw-r--r--klaptopdaemon/power.h98
-rw-r--r--klaptopdaemon/profile.cpp424
-rw-r--r--klaptopdaemon/profile.h82
-rw-r--r--klaptopdaemon/smapi.h54
-rw-r--r--klaptopdaemon/smapibios.h93
-rw-r--r--klaptopdaemon/smapidev.c743
-rw-r--r--klaptopdaemon/smapidev.h273
-rw-r--r--klaptopdaemon/sony.cpp200
-rw-r--r--klaptopdaemon/sony.h71
-rw-r--r--klaptopdaemon/thinkpad_common.h127
-rw-r--r--klaptopdaemon/version.h19
-rw-r--r--klaptopdaemon/wake_laptop.cpp39
-rw-r--r--klaptopdaemon/warning.cpp602
-rw-r--r--klaptopdaemon/warning.h106
-rw-r--r--klaptopdaemon/xautolock.cc277
-rw-r--r--klaptopdaemon/xautolock.h77
-rw-r--r--klaptopdaemon/xautolock_c.h76
-rw-r--r--klaptopdaemon/xautolock_diy.c289
-rw-r--r--klaptopdaemon/xautolock_engine.c419
-rw-r--r--kmilo/Makefile.am18
-rw-r--r--kmilo/README17
-rw-r--r--kmilo/TODO7
-rw-r--r--kmilo/asus/Makefile.am37
-rw-r--r--kmilo/asus/README43
-rw-r--r--kmilo/asus/asus.cpp213
-rw-r--r--kmilo/asus/asus.h88
-rw-r--r--kmilo/asus/kmilo_asus.desktop97
-rw-r--r--kmilo/configure.in.in60
-rw-r--r--kmilo/delli8k/Makefile.am36
-rw-r--r--kmilo/delli8k/README98
-rw-r--r--kmilo/delli8k/delli8k.cpp256
-rw-r--r--kmilo/delli8k/delli8k.h89
-rw-r--r--kmilo/delli8k/i8k.h46
-rw-r--r--kmilo/delli8k/kmilo_delli8k.desktop96
-rw-r--r--kmilo/demo/Makefile.am32
-rw-r--r--kmilo/demo/demo.cpp56
-rw-r--r--kmilo/demo/demo.h39
-rw-r--r--kmilo/demo/kmilo_demo.desktop110
-rw-r--r--kmilo/generic/Makefile.am34
-rw-r--r--kmilo/generic/README38
-rw-r--r--kmilo/generic/generic_monitor.cpp324
-rw-r--r--kmilo/generic/generic_monitor.h94
-rw-r--r--kmilo/generic/kmilo_generic.desktop108
-rw-r--r--kmilo/kmilo_kvaio/Makefile.am39
-rw-r--r--kmilo/kmilo_kvaio/README.sonypi.h18
-rw-r--r--kmilo/kmilo_kvaio/kcmkvaio/Makefile.am15
-rw-r--r--kmilo/kmilo_kvaio/kcmkvaio/kcmkvaio_general.ui273
-rw-r--r--kmilo/kmilo_kvaio/kcmkvaio/kcmkvaio_general.ui.h15
-rw-r--r--kmilo/kmilo_kvaio/kcmkvaio/kvaio.desktop146
-rw-r--r--kmilo/kmilo_kvaio/kcmkvaio/main.cpp176
-rw-r--r--kmilo/kmilo_kvaio/kcmkvaio/main.h53
-rw-r--r--kmilo/kmilo_kvaio/kmilo_kvaio.cpp68
-rw-r--r--kmilo/kmilo_kvaio/kmilo_kvaio.desktop106
-rw-r--r--kmilo/kmilo_kvaio/kmilo_kvaio.h66
-rw-r--r--kmilo/kmilo_kvaio/kvaio.cpp606
-rw-r--r--kmilo/kmilo_kvaio/kvaio.h113
-rw-r--r--kmilo/kmilo_kvaio/kvaiodriverinterface.cpp221
-rw-r--r--kmilo/kmilo_kvaio/kvaiodriverinterface.h62
-rw-r--r--kmilo/kmilo_kvaio/sonypi.h158
-rw-r--r--kmilo/kmilod/Makefile.am43
-rw-r--r--kmilo/kmilod/defaultskin.cpp107
-rw-r--r--kmilo/kmilod/defaultskin.h56
-rw-r--r--kmilo/kmilod/defaultwidget.ui195
-rw-r--r--kmilo/kmilod/displayskin.cpp34
-rw-r--r--kmilo/kmilod/displayskin.h47
-rw-r--r--kmilo/kmilod/kmilod.cpp227
-rw-r--r--kmilo/kmilod/kmilod.desktop59
-rw-r--r--kmilo/kmilod/kmilod.h72
-rw-r--r--kmilo/kmilod/kmilointerface.cpp26
-rw-r--r--kmilo/kmilod/kmilointerface.h57
-rw-r--r--kmilo/kmilod/kmilopluginsvc.desktop9
-rw-r--r--kmilo/kmilod/monitor.cpp44
-rw-r--r--kmilo/kmilod/monitor.h98
-rw-r--r--kmilo/powerbook/Makefile.am34
-rw-r--r--kmilo/powerbook/kmilo_powerbook.desktop105
-rw-r--r--kmilo/powerbook/pb_monitor.cpp127
-rw-r--r--kmilo/powerbook/pb_monitor.h42
-rw-r--r--kmilo/powerbook2/Makefile.am34
-rw-r--r--kmilo/powerbook2/kmilo_powerbook.desktop106
-rw-r--r--kmilo/powerbook2/pb_monitor.cpp165
-rw-r--r--kmilo/powerbook2/pb_monitor.h55
-rw-r--r--kmilo/thinkpad/Makefile.am36
-rw-r--r--kmilo/thinkpad/README61
-rw-r--r--kmilo/thinkpad/kcmthinkpad/Makefile.am15
-rw-r--r--kmilo/thinkpad/kcmthinkpad/kcmthinkpad_general.ui307
-rw-r--r--kmilo/thinkpad/kcmthinkpad/kcmthinkpad_general.ui.h36
-rw-r--r--kmilo/thinkpad/kcmthinkpad/main.cpp189
-rw-r--r--kmilo/thinkpad/kcmthinkpad/main.h49
-rw-r--r--kmilo/thinkpad/kcmthinkpad/thinkpad.desktop145
-rw-r--r--kmilo/thinkpad/kmilo_thinkpad.desktop101
-rw-r--r--kmilo/thinkpad/thinkpad.cpp556
-rw-r--r--kmilo/thinkpad/thinkpad.h208
-rw-r--r--kregexpeditor/Comments4
-rw-r--r--kregexpeditor/KMultiFormListBox/Makefile.am15
-rw-r--r--kregexpeditor/KMultiFormListBox/TODO1
-rw-r--r--kregexpeditor/KMultiFormListBox/ccp.cpp83
-rw-r--r--kregexpeditor/KMultiFormListBox/ccp.h61
-rw-r--r--kregexpeditor/KMultiFormListBox/idx.xbm5
-rw-r--r--kregexpeditor/KMultiFormListBox/indexWindow.cpp97
-rw-r--r--kregexpeditor/KMultiFormListBox/indexWindow.h83
-rw-r--r--kregexpeditor/KMultiFormListBox/kmultiformlistbox-multivisible.cpp305
-rw-r--r--kregexpeditor/KMultiFormListBox/kmultiformlistbox-multivisible.h135
-rw-r--r--kregexpeditor/KMultiFormListBox/kmultiformlistbox-shower.h53
-rw-r--r--kregexpeditor/KMultiFormListBox/kmultiformlistbox-windowed.cpp213
-rw-r--r--kregexpeditor/KMultiFormListBox/kmultiformlistbox-windowed.h83
-rw-r--r--kregexpeditor/KMultiFormListBox/kmultiformlistbox.cpp104
-rw-r--r--kregexpeditor/KMultiFormListBox/kmultiformlistbox.h125
-rw-r--r--kregexpeditor/KMultiFormListBox/kmultiformlistboxentry.cpp44
-rw-r--r--kregexpeditor/KMultiFormListBox/kmultiformlistboxentry.h73
-rw-r--r--kregexpeditor/KMultiFormListBox/kmultiformlistboxfactory.cpp26
-rw-r--r--kregexpeditor/KMultiFormListBox/kmultiformlistboxfactory.h70
-rw-r--r--kregexpeditor/KMultiFormListBox/widgetwindow.cpp117
-rw-r--r--kregexpeditor/KMultiFormListBox/widgetwindow.h60
-rw-r--r--kregexpeditor/KMultiFormListBox/windowlistboxitem.cpp45
-rw-r--r--kregexpeditor/KMultiFormListBox/windowlistboxitem.h44
-rw-r--r--kregexpeditor/KWidgetStreamer/Makefile.am9
-rw-r--r--kregexpeditor/KWidgetStreamer/kwidgetstreamer.cpp177
-rw-r--r--kregexpeditor/KWidgetStreamer/kwidgetstreamer.h74
-rw-r--r--kregexpeditor/Makefile.am65
-rw-r--r--kregexpeditor/TODO49
-rw-r--r--kregexpeditor/altnregexp.cpp102
-rw-r--r--kregexpeditor/altnregexp.h47
-rw-r--r--kregexpeditor/altnwidget.cpp254
-rw-r--r--kregexpeditor/altnwidget.h65
-rw-r--r--kregexpeditor/auxbuttons.cpp121
-rw-r--r--kregexpeditor/auxbuttons.h60
-rw-r--r--kregexpeditor/characterswidget.cpp447
-rw-r--r--kregexpeditor/characterswidget.h144
-rw-r--r--kregexpeditor/charselector.cpp185
-rw-r--r--kregexpeditor/charselector.h52
-rw-r--r--kregexpeditor/compoundregexp.cpp115
-rw-r--r--kregexpeditor/compoundregexp.h54
-rw-r--r--kregexpeditor/compoundwidget.cpp324
-rw-r--r--kregexpeditor/compoundwidget.h104
-rw-r--r--kregexpeditor/concregexp.cpp157
-rw-r--r--kregexpeditor/concregexp.h49
-rw-r--r--kregexpeditor/concwidget.cpp400
-rw-r--r--kregexpeditor/concwidget.h69
-rw-r--r--kregexpeditor/dcbutton.cpp37
-rw-r--r--kregexpeditor/dcbutton.h42
-rw-r--r--kregexpeditor/dotregexp.cpp39
-rw-r--r--kregexpeditor/dotregexp.h41
-rw-r--r--kregexpeditor/drag.cpp77
-rw-r--r--kregexpeditor/drag.h45
-rw-r--r--kregexpeditor/dragaccepter.cpp139
-rw-r--r--kregexpeditor/dragaccepter.h53
-rw-r--r--kregexpeditor/editorwindow.cpp453
-rw-r--r--kregexpeditor/editorwindow.h269
-rw-r--r--kregexpeditor/emacsregexpconverter.cpp253
-rw-r--r--kregexpeditor/emacsregexpconverter.h43
-rw-r--r--kregexpeditor/errormap.cpp73
-rw-r--r--kregexpeditor/errormap.h36
-rwxr-xr-xkregexpeditor/extractrc-from-regexp85
-rw-r--r--kregexpeditor/gen_qregexplexer.cpp1980
-rw-r--r--kregexpeditor/gen_qregexpparser.cc1447
-rw-r--r--kregexpeditor/gen_qregexpparser.hh93
-rw-r--r--kregexpeditor/hi128-app-kregexpeditor.pngbin0 -> 6933 bytes
-rw-r--r--kregexpeditor/hi16-app-kregexpeditor.pngbin0 -> 801 bytes
-rw-r--r--kregexpeditor/hi22-app-kregexpeditor.pngbin0 -> 1235 bytes
-rw-r--r--kregexpeditor/hi32-app-kregexpeditor.pngbin0 -> 1391 bytes
-rw-r--r--kregexpeditor/hi48-app-kregexpeditor.pngbin0 -> 2090 bytes
-rw-r--r--kregexpeditor/hi64-app-kregexpeditor.pngbin0 -> 2895 bytes
-rw-r--r--kregexpeditor/infopage.cpp97
-rw-r--r--kregexpeditor/infopage.h37
-rw-r--r--kregexpeditor/kregexpeditor.desktop76
-rw-r--r--kregexpeditor/kregexpeditor.svgzbin0 -> 1098 bytes
-rw-r--r--kregexpeditor/kregexpeditorfactory.cpp25
-rw-r--r--kregexpeditor/kregexpeditorgui.cpp161
-rw-r--r--kregexpeditor/kregexpeditorgui.desktop62
-rw-r--r--kregexpeditor/kregexpeditorgui.h93
-rw-r--r--kregexpeditor/kregexpeditorprivate.cpp424
-rw-r--r--kregexpeditor/kregexpeditorprivate.h106
-rw-r--r--kregexpeditor/limitedcharlineedit.cpp75
-rw-r--r--kregexpeditor/limitedcharlineedit.h43
-rw-r--r--kregexpeditor/lookaheadregexp.cpp72
-rw-r--r--kregexpeditor/lookaheadregexp.h49
-rw-r--r--kregexpeditor/lookaheadwidget.cpp110
-rw-r--r--kregexpeditor/lookaheadwidget.h51
-rw-r--r--kregexpeditor/main.cpp68
-rw-r--r--kregexpeditor/multicontainerwidget.cpp265
-rw-r--r--kregexpeditor/multicontainerwidget.h50
-rw-r--r--kregexpeditor/myfontmetrics.cpp31
-rw-r--r--kregexpeditor/myfontmetrics.h27
-rw-r--r--kregexpeditor/pair.h37
-rw-r--r--kregexpeditor/picts/Makefile.am2
-rw-r--r--kregexpeditor/picts/altn.pngbin0 -> 310 bytes
-rw-r--r--kregexpeditor/picts/anychar.pngbin0 -> 616 bytes
-rw-r--r--kregexpeditor/picts/autoverify.pngbin0 -> 142 bytes
-rw-r--r--kregexpeditor/picts/begline.pngbin0 -> 244 bytes
-rw-r--r--kregexpeditor/picts/characters.pngbin0 -> 240 bytes
-rw-r--r--kregexpeditor/picts/compound.pngbin0 -> 285 bytes
-rw-r--r--kregexpeditor/picts/endline.pngbin0 -> 245 bytes
-rw-r--r--kregexpeditor/picts/error.pngbin0 -> 234 bytes
-rw-r--r--kregexpeditor/picts/neglookahead.pngbin0 -> 297 bytes
-rw-r--r--kregexpeditor/picts/nonwordboundary.pngbin0 -> 225 bytes
-rw-r--r--kregexpeditor/picts/poslookahead.pngbin0 -> 297 bytes
-rw-r--r--kregexpeditor/picts/repeat.pngbin0 -> 632 bytes
-rw-r--r--kregexpeditor/picts/select.pngbin0 -> 742 bytes
-rw-r--r--kregexpeditor/picts/text.pngbin0 -> 338 bytes
-rw-r--r--kregexpeditor/picts/verify.pngbin0 -> 141 bytes
-rw-r--r--kregexpeditor/picts/wordboundary.pngbin0 -> 210 bytes
-rw-r--r--kregexpeditor/positionregexp.cpp53
-rw-r--r--kregexpeditor/positionregexp.h46
-rw-r--r--kregexpeditor/predefined/General/Makefile.am5
-rw-r--r--kregexpeditor/predefined/General/anything.regexp11
-rw-r--r--kregexpeditor/predefined/General/spaces.regexp11
-rw-r--r--kregexpeditor/predefined/Makefile.am1
-rw-r--r--kregexpeditor/predefined/README2
-rw-r--r--kregexpeditor/qregexpparser.l319
-rw-r--r--kregexpeditor/qregexpparser.y203
-rwxr-xr-xkregexpeditor/qt-only/clean14
-rw-r--r--kregexpeditor/qt-only/compat.cpp115
-rw-r--r--kregexpeditor/qt-only/compat.h85
-rwxr-xr-xkregexpeditor/qt-only/compile28
-rw-r--r--kregexpeditor/qt-only/qt-only.pro137
-rw-r--r--kregexpeditor/qt-only/win-release.bat7
-rw-r--r--kregexpeditor/qtregexpconverter.cpp299
-rw-r--r--kregexpeditor/qtregexpconverter.h43
-rw-r--r--kregexpeditor/qtregexphighlighter.cpp71
-rw-r--r--kregexpeditor/qtregexphighlighter.h34
-rw-r--r--kregexpeditor/regexp.cpp95
-rw-r--r--kregexpeditor/regexp.h72
-rw-r--r--kregexpeditor/regexpbuttons.cpp217
-rw-r--r--kregexpeditor/regexpbuttons.h70
-rw-r--r--kregexpeditor/regexpconverter.cpp93
-rw-r--r--kregexpeditor/regexpconverter.h79
-rw-r--r--kregexpeditor/regexphighlighter.cpp44
-rw-r--r--kregexpeditor/regexphighlighter.h38
-rw-r--r--kregexpeditor/regexpwidget.cpp227
-rw-r--r--kregexpeditor/regexpwidget.h203
-rw-r--r--kregexpeditor/repeatregexp.cpp94
-rw-r--r--kregexpeditor/repeatregexp.h49
-rw-r--r--kregexpeditor/repeatwidget.cpp326
-rw-r--r--kregexpeditor/repeatwidget.h103
-rw-r--r--kregexpeditor/scrollededitorwindow.cpp144
-rw-r--r--kregexpeditor/scrollededitorwindow.h92
-rw-r--r--kregexpeditor/selectablelineedit.cpp73
-rw-r--r--kregexpeditor/selectablelineedit.h53
-rw-r--r--kregexpeditor/singlecontainerwidget.cpp132
-rw-r--r--kregexpeditor/singlecontainerwidget.h53
-rw-r--r--kregexpeditor/test-without-dl/Makefile.am8
-rw-r--r--kregexpeditor/test-without-dl/main.cpp66
-rw-r--r--kregexpeditor/textrangeregexp.cpp143
-rw-r--r--kregexpeditor/textrangeregexp.h75
-rw-r--r--kregexpeditor/textregexp.cpp81
-rw-r--r--kregexpeditor/textregexp.h50
-rw-r--r--kregexpeditor/textwidget.cpp157
-rw-r--r--kregexpeditor/textwidget.h63
-rw-r--r--kregexpeditor/triple.h40
-rw-r--r--kregexpeditor/userdefinedregexps.cpp266
-rw-r--r--kregexpeditor/userdefinedregexps.h75
-rw-r--r--kregexpeditor/util.cpp58
-rw-r--r--kregexpeditor/util.h34
-rw-r--r--kregexpeditor/verifier.cpp117
-rw-r--r--kregexpeditor/verifier.h61
-rw-r--r--kregexpeditor/verifybuttons.cpp214
-rw-r--r--kregexpeditor/verifybuttons.h79
-rw-r--r--kregexpeditor/widgetfactory.cpp209
-rw-r--r--kregexpeditor/widgetfactory.h60
-rw-r--r--kregexpeditor/zerowidgets.cpp145
-rw-r--r--kregexpeditor/zerowidgets.h125
-rw-r--r--ksim/AUTHORS2
-rw-r--r--ksim/BUGS3
-rw-r--r--ksim/COPYING340
-rw-r--r--ksim/ChangeLog363
-rw-r--r--ksim/Makefile.am34
-rw-r--r--ksim/README42
-rw-r--r--ksim/TODO5
-rw-r--r--ksim/baselist.h97
-rw-r--r--ksim/configure.in.in36
-rw-r--r--ksim/generalprefs.cpp574
-rw-r--r--ksim/generalprefs.h185
-rw-r--r--ksim/ksim.cpp129
-rw-r--r--ksim/ksim.desktop134
-rw-r--r--ksim/ksim.h67
-rw-r--r--ksim/ksim_panelextensionrc81
-rw-r--r--ksim/ksimframe.cpp94
-rw-r--r--ksim/ksimframe.h63
-rw-r--r--ksim/ksimpref.cpp260
-rw-r--r--ksim/ksimpref.h112
-rw-r--r--ksim/ksimsysinfo.cpp325
-rw-r--r--ksim/ksimsysinfo.h70
-rw-r--r--ksim/ksimview.cpp467
-rw-r--r--ksim/ksimview.h112
-rw-r--r--ksim/library/Makefile.am25
-rw-r--r--ksim/library/chart.cpp627
-rw-r--r--ksim/library/chart.h184
-rw-r--r--ksim/library/common.cpp102
-rw-r--r--ksim/library/common.h134
-rw-r--r--ksim/library/ksimconfig.cpp427
-rw-r--r--ksim/library/ksimconfig.h109
-rw-r--r--ksim/library/label.cpp301
-rw-r--r--ksim/library/label.h210
-rw-r--r--ksim/library/led.cpp349
-rw-r--r--ksim/library/led.h193
-rw-r--r--ksim/library/pluginglobal.cpp207
-rw-r--r--ksim/library/pluginglobal.h161
-rw-r--r--ksim/library/pluginloader.cpp326
-rw-r--r--ksim/library/pluginloader.h183
-rw-r--r--ksim/library/pluginmodule.cpp174
-rw-r--r--ksim/library/pluginmodule.h205
-rw-r--r--ksim/library/progress.cpp231
-rw-r--r--ksim/library/progress.h181
-rw-r--r--ksim/library/themeloader.cpp1266
-rw-r--r--ksim/library/themeloader.h511
-rw-r--r--ksim/library/themetypes.h81
-rw-r--r--ksim/monitorprefs.cpp98
-rw-r--r--ksim/monitorprefs.h45
-rw-r--r--ksim/monitors/Makefile.am9
-rw-r--r--ksim/monitors/cpu/Makefile.am16
-rw-r--r--ksim/monitors/cpu/cpu.desktop94
-rw-r--r--ksim/monitors/cpu/cr16-device-ksim_cpu.pngbin0 -> 249 bytes
-rw-r--r--ksim/monitors/cpu/ksimcpu.cpp514
-rw-r--r--ksim/monitors/cpu/ksimcpu.h228
-rw-r--r--ksim/monitors/disk/Makefile.am15
-rw-r--r--ksim/monitors/disk/configure.in.in13
-rw-r--r--ksim/monitors/disk/disk.desktop106
-rw-r--r--ksim/monitors/disk/ksimdisk.cpp570
-rw-r--r--ksim/monitors/disk/ksimdisk.h154
-rw-r--r--ksim/monitors/filesystem/DFree.desktop87
-rw-r--r--ksim/monitors/filesystem/Makefile.am16
-rw-r--r--ksim/monitors/filesystem/configure.in.in2
-rw-r--r--ksim/monitors/filesystem/filesystemstats.cpp224
-rw-r--r--ksim/monitors/filesystem/filesystemstats.h40
-rw-r--r--ksim/monitors/filesystem/filesystemwidget.cpp232
-rw-r--r--ksim/monitors/filesystem/filesystemwidget.h78
-rw-r--r--ksim/monitors/filesystem/fsystemconfig.cpp184
-rw-r--r--ksim/monitors/filesystem/fsystemconfig.h58
-rw-r--r--ksim/monitors/filesystem/fsystemiface.h32
-rw-r--r--ksim/monitors/filesystem/ksimfsystem.cpp202
-rw-r--r--ksim/monitors/filesystem/ksimfsystem.h76
-rw-r--r--ksim/monitors/i8k/Makefile.am15
-rw-r--r--ksim/monitors/i8k/i8k.desktop62
-rw-r--r--ksim/monitors/i8k/ksimi8k.cpp257
-rw-r--r--ksim/monitors/i8k/ksimi8k.h102
-rw-r--r--ksim/monitors/lm_sensors/Lm_sensors.desktop84
-rw-r--r--ksim/monitors/lm_sensors/Makefile.am26
-rw-r--r--ksim/monitors/lm_sensors/NVCtrl.c357
-rw-r--r--ksim/monitors/lm_sensors/NVCtrl.h807
-rw-r--r--ksim/monitors/lm_sensors/NVCtrlLib.h184
-rw-r--r--ksim/monitors/lm_sensors/ksimsensors.cpp189
-rw-r--r--ksim/monitors/lm_sensors/ksimsensors.h91
-rw-r--r--ksim/monitors/lm_sensors/ksimsensorsiface.h33
-rw-r--r--ksim/monitors/lm_sensors/nv_control.h205
-rw-r--r--ksim/monitors/lm_sensors/sensorbase.cpp254
-rw-r--r--ksim/monitors/lm_sensors/sensorbase.h175
-rw-r--r--ksim/monitors/lm_sensors/sensorsconfig.cpp241
-rw-r--r--ksim/monitors/lm_sensors/sensorsconfig.h69
-rw-r--r--ksim/monitors/mail/Makefile.am15
-rw-r--r--ksim/monitors/mail/ksimmail.cpp160
-rw-r--r--ksim/monitors/mail/ksimmail.h90
-rw-r--r--ksim/monitors/mail/mail.desktop119
-rw-r--r--ksim/monitors/net/Makefile.am14
-rw-r--r--ksim/monitors/net/Net.desktop112
-rw-r--r--ksim/monitors/net/ksimnet.cpp672
-rw-r--r--ksim/monitors/net/ksimnet.h90
-rw-r--r--ksim/monitors/net/netconfig.cpp296
-rw-r--r--ksim/monitors/net/netconfig.h67
-rw-r--r--ksim/monitors/net/netdevices.h218
-rw-r--r--ksim/monitors/net/netdialog.cpp328
-rw-r--r--ksim/monitors/net/netdialog.h85
-rw-r--r--ksim/monitors/snmp/Makefile.am16
-rw-r--r--ksim/monitors/snmp/Snmp.desktop70
-rw-r--r--ksim/monitors/snmp/browsedialog.cpp147
-rw-r--r--ksim/monitors/snmp/browsedialog.h71
-rw-r--r--ksim/monitors/snmp/browsedialogbase.ui262
-rw-r--r--ksim/monitors/snmp/chartmonitor.cpp83
-rw-r--r--ksim/monitors/snmp/chartmonitor.h54
-rw-r--r--ksim/monitors/snmp/configpage.cpp313
-rw-r--r--ksim/monitors/snmp/configpage.h120
-rw-r--r--ksim/monitors/snmp/configure.in.in40
-rw-r--r--ksim/monitors/snmp/configwidget.ui215
-rw-r--r--ksim/monitors/snmp/hostconfig.cpp152
-rw-r--r--ksim/monitors/snmp/hostconfig.h86
-rw-r--r--ksim/monitors/snmp/hostdialog.cpp193
-rw-r--r--ksim/monitors/snmp/hostdialog.h59
-rw-r--r--ksim/monitors/snmp/hostdialogbase.ui526
-rw-r--r--ksim/monitors/snmp/identifier.cpp129
-rw-r--r--ksim/monitors/snmp/identifier.h72
-rw-r--r--ksim/monitors/snmp/labelmonitor.cpp45
-rw-r--r--ksim/monitors/snmp/labelmonitor.h52
-rw-r--r--ksim/monitors/snmp/monitor.cpp96
-rw-r--r--ksim/monitors/snmp/monitor.h77
-rw-r--r--ksim/monitors/snmp/monitorconfig.cpp183
-rw-r--r--ksim/monitors/snmp/monitorconfig.h84
-rw-r--r--ksim/monitors/snmp/monitordialog.cpp178
-rw-r--r--ksim/monitors/snmp/monitordialog.h60
-rw-r--r--ksim/monitors/snmp/monitordialogbase.ui440
-rw-r--r--ksim/monitors/snmp/pdu.cpp98
-rw-r--r--ksim/monitors/snmp/pdu.h60
-rw-r--r--ksim/monitors/snmp/plugin.cpp52
-rw-r--r--ksim/monitors/snmp/plugin.h49
-rw-r--r--ksim/monitors/snmp/probedialog.cpp117
-rw-r--r--ksim/monitors/snmp/probedialog.h87
-rw-r--r--ksim/monitors/snmp/proberesultdialog.cpp55
-rw-r--r--ksim/monitors/snmp/proberesultdialog.h49
-rw-r--r--ksim/monitors/snmp/proberesultdialogbase.ui124
-rw-r--r--ksim/monitors/snmp/session.cpp283
-rw-r--r--ksim/monitors/snmp/session.h64
-rw-r--r--ksim/monitors/snmp/snmp.cpp320
-rw-r--r--ksim/monitors/snmp/snmp.h165
-rw-r--r--ksim/monitors/snmp/snmp_p.h59
-rw-r--r--ksim/monitors/snmp/snmplib.cpp151
-rw-r--r--ksim/monitors/snmp/snmplib.h143
-rw-r--r--ksim/monitors/snmp/value.cpp333
-rw-r--r--ksim/monitors/snmp/value.h106
-rw-r--r--ksim/monitors/snmp/value_p.h63
-rw-r--r--ksim/monitors/snmp/view.cpp80
-rw-r--r--ksim/monitors/snmp/view.h55
-rw-r--r--ksim/monitors/snmp/walker.cpp121
-rw-r--r--ksim/monitors/snmp/walker.h82
-rw-r--r--ksim/pics/Makefile.am2
-rw-r--r--ksim/pics/cr16-app-ksim.pngbin0 -> 1086 bytes
-rw-r--r--ksim/pics/cr32-app-ksim.pngbin0 -> 3314 bytes
-rw-r--r--ksim/pics/cr48-app-ksim.pngbin0 -> 6222 bytes
-rw-r--r--ksim/pics/misc/Makefile.am5
-rw-r--r--ksim/pics/misc/clock.pngbin0 -> 875 bytes
-rw-r--r--ksim/pics/misc/uptime.pngbin0 -> 654 bytes
-rw-r--r--ksim/systeminfo.cpp277
-rw-r--r--ksim/systeminfo.h137
-rw-r--r--ksim/themeprefs.cpp272
-rw-r--r--ksim/themeprefs.h115
-rw-r--r--ksim/themes/Makefile.am1
-rw-r--r--ksim/themes/ksim/Makefile.am24
-rw-r--r--ksim/themes/ksim/bg_chart.pngbin0 -> 263 bytes
-rw-r--r--ksim/themes/ksim/bg_grid.pngbin0 -> 172 bytes
-rw-r--r--ksim/themes/ksim/bg_meter.pngbin0 -> 246 bytes
-rw-r--r--ksim/themes/ksim/bg_panel.pngbin0 -> 245 bytes
-rw-r--r--ksim/themes/ksim/decal_net_leds.pngbin0 -> 285 bytes
-rw-r--r--ksim/themes/ksim/frame_bottom.pngbin0 -> 206 bytes
-rw-r--r--ksim/themes/ksim/frame_left.pngbin0 -> 153 bytes
-rw-r--r--ksim/themes/ksim/frame_right.pngbin0 -> 153 bytes
-rw-r--r--ksim/themes/ksim/frame_top.pngbin0 -> 211 bytes
-rw-r--r--ksim/themes/ksim/gkrellmrc47
-rw-r--r--ksim/themes/ksim/gkrellmrc_ksim47
-rw-r--r--ksim/themes/ksim/host/Makefile.am4
-rw-r--r--ksim/themes/ksim/host/bg_meter.pngbin0 -> 246 bytes
-rw-r--r--ksim/themes/ksim/krell_meter.pngbin0 -> 544 bytes
-rw-r--r--ksim/themes/ksim/krell_panel.pngbin0 -> 149 bytes
-rw-r--r--ksim/themes/ksim/krell_slider.pngbin0 -> 314 bytes
-rw-r--r--ksim/themes/ksim/mail/Makefile.am3
-rw-r--r--ksim/themes/ksim/mail/decal_mail.pngbin0 -> 3935 bytes
-rw-r--r--ksim/themes/ksim/mail/krell_mail.pngbin0 -> 3942 bytes
-rw-r--r--ksim/themes/ksim/mail/krell_mail_daemon.pngbin0 -> 126 bytes
-rw-r--r--ktimer/Makefile.am24
-rw-r--r--ktimer/hi128-app-ktimer.pngbin0 -> 17753 bytes
-rw-r--r--ktimer/hi16-app-ktimer.pngbin0 -> 875 bytes
-rw-r--r--ktimer/hi32-app-ktimer.pngbin0 -> 2458 bytes
-rw-r--r--ktimer/hi48-app-ktimer.pngbin0 -> 4736 bytes
-rw-r--r--ktimer/ktimer.cpp516
-rw-r--r--ktimer/ktimer.desktop63
-rw-r--r--ktimer/ktimer.h113
-rw-r--r--ktimer/main.cpp46
-rw-r--r--ktimer/prefwidget.ui278
-rw-r--r--kwallet/Makefile.am26
-rw-r--r--kwallet/TODO13
-rw-r--r--kwallet/allyourbase.cpp733
-rw-r--r--kwallet/allyourbase.h178
-rw-r--r--kwallet/hi128-app-kwalletmanager.pngbin0 -> 24094 bytes
-rw-r--r--kwallet/hi128-app-kwalletmanager2.pngbin0 -> 28434 bytes
-rw-r--r--kwallet/hi16-app-kwalletmanager.pngbin0 -> 1209 bytes
-rw-r--r--kwallet/hi16-app-kwalletmanager2.pngbin0 -> 1139 bytes
-rw-r--r--kwallet/hi22-app-kwalletmanager.pngbin0 -> 1601 bytes
-rw-r--r--kwallet/hi32-app-kwalletmanager.pngbin0 -> 3273 bytes
-rw-r--r--kwallet/hi32-app-kwalletmanager2.pngbin0 -> 3225 bytes
-rw-r--r--kwallet/hi48-app-kwalletmanager.pngbin0 -> 6355 bytes
-rw-r--r--kwallet/hi48-app-kwalletmanager2.pngbin0 -> 6332 bytes
-rw-r--r--kwallet/hi64-app-kwalletmanager.pngbin0 -> 9728 bytes
-rw-r--r--kwallet/hi64-app-kwalletmanager2.pngbin0 -> 9702 bytes
-rw-r--r--kwallet/icons/Makefile.am5
-rw-r--r--kwallet/icons/cr22-action-folder_closed.pngbin0 -> 1149 bytes
-rw-r--r--kwallet/icons/cr22-action-folder_open.pngbin0 -> 1349 bytes
-rw-r--r--kwallet/icons/cr22-action-wallet_closed.pngbin0 -> 997 bytes
-rw-r--r--kwallet/icons/cr22-action-wallet_open.pngbin0 -> 1098 bytes
-rw-r--r--kwallet/kbetterthankdialogbase.ui154
-rw-r--r--kwallet/kbetterthankdialogbase.ui.h50
-rw-r--r--kwallet/konfigurator/Makefile.am15
-rw-r--r--kwallet/konfigurator/konfigurator.cpp323
-rw-r--r--kwallet/konfigurator/konfigurator.h57
-rw-r--r--kwallet/konfigurator/kwallet_config.desktop47
-rw-r--r--kwallet/konfigurator/kwalletconfig.desktop152
-rw-r--r--kwallet/konfigurator/kwalletmanager_show.desktop60
-rw-r--r--kwallet/konfigurator/walletconfigwidget.ui499
-rw-r--r--kwallet/kwalleteditor.cpp1143
-rw-r--r--kwallet/kwalleteditor.h110
-rw-r--r--kwallet/kwalleteditor.rc17
-rw-r--r--kwallet/kwalletmanager-kwalletd.desktop60
-rw-r--r--kwallet/kwalletmanager.cpp423
-rw-r--r--kwallet/kwalletmanager.desktop63
-rw-r--r--kwallet/kwalletmanager.h84
-rw-r--r--kwallet/kwalletmanager.rc14
-rw-r--r--kwallet/kwalletpopup.cpp110
-rw-r--r--kwallet/kwalletpopup.h54
-rw-r--r--kwallet/kwmapeditor.cpp187
-rw-r--r--kwallet/kwmapeditor.h61
-rw-r--r--kwallet/main.cpp100
-rw-r--r--kwallet/walletwidget.ui416
-rw-r--r--superkaramba/AUTHORS49
-rw-r--r--superkaramba/COPYING280
-rw-r--r--superkaramba/ChangeLog710
-rw-r--r--superkaramba/Doxyfile0
-rw-r--r--superkaramba/INSTALL167
-rw-r--r--superkaramba/Makefile.am4
-rw-r--r--superkaramba/NEWS0
-rw-r--r--superkaramba/README42
-rw-r--r--superkaramba/TODO1
-rw-r--r--superkaramba/configure.in.bot7
-rw-r--r--superkaramba/configure.in.in77
-rw-r--r--superkaramba/doc/Makefile.am6
-rw-r--r--superkaramba/doc/faq/faq.css36
-rw-r--r--superkaramba/doc/faq/faq.dat75
-rw-r--r--superkaramba/doc/faq/faq.html111
-rw-r--r--superkaramba/doc/faq/faq.txt159
-rw-r--r--superkaramba/doc/faq/faqfooter.html9
-rw-r--r--superkaramba/doc/faq/faqfooter.txt9
-rw-r--r--superkaramba/doc/faq/faqheader.html12
-rw-r--r--superkaramba/doc/faq/faqheader.txt4
-rw-r--r--superkaramba/doc/python_api/api.css40
-rw-r--r--superkaramba/doc/python_api/api_html.rc36
-rwxr-xr-xsuperkaramba/doc/python_api/make_api_doc.sh42
-rw-r--r--superkaramba/examples/API6
-rw-r--r--superkaramba/examples/README62
-rw-r--r--superkaramba/examples/api.html4016
-rw-r--r--superkaramba/examples/autoHide/main.py62
-rw-r--r--superkaramba/examples/autoHide/main.theme42
-rw-r--r--superkaramba/examples/autoHide/pics/MSN-64x64.pngbin0 -> 6178 bytes
-rw-r--r--superkaramba/examples/autoHide/pics/MSN-96x96.pngbin0 -> 11529 bytes
-rw-r--r--superkaramba/examples/autoHide/pics/Tux_House-64x64.pngbin0 -> 4485 bytes
-rw-r--r--superkaramba/examples/autoHide/pics/Tux_House-96x96.pngbin0 -> 7462 bytes
-rw-r--r--superkaramba/examples/autoHide/pics/Tux_Mail-64x64.pngbin0 -> 8572 bytes
-rw-r--r--superkaramba/examples/autoHide/pics/Tux_Mail-96x96.pngbin0 -> 15942 bytes
-rw-r--r--superkaramba/examples/autoHide/pics/Tux_Mozilla-64x64.pngbin0 -> 7373 bytes
-rw-r--r--superkaramba/examples/autoHide/pics/Tux_Mozilla-96x96.pngbin0 -> 13570 bytes
-rw-r--r--superkaramba/examples/autoHide/pics/Tux_Sherlock-64x64.pngbin0 -> 5635 bytes
-rw-r--r--superkaramba/examples/autoHide/pics/Tux_Sherlock-96x96.pngbin0 -> 10369 bytes
-rw-r--r--superkaramba/examples/autoHide/pics/Tux_Terminal-64x64.pngbin0 -> 3489 bytes
-rw-r--r--superkaramba/examples/autoHide/pics/Tux_Terminal-96x96.pngbin0 -> 5985 bytes
-rw-r--r--superkaramba/examples/autoHide/pics/Tux_iPhoto-64x64.pngbin0 -> 8036 bytes
-rw-r--r--superkaramba/examples/autoHide/pics/Tux_iPhoto-96x96.pngbin0 -> 14876 bytes
-rw-r--r--superkaramba/examples/autoHide/pics/bar3.pngbin0 -> 393 bytes
-rw-r--r--superkaramba/examples/autoHide/pics/bar4.pngbin0 -> 310 bytes
-rw-r--r--superkaramba/examples/autoHide/pics/calendar.pngbin0 -> 1950 bytes
-rw-r--r--superkaramba/examples/autoHide/pics/ctrl center-64x64.pngbin0 -> 5582 bytes
-rw-r--r--superkaramba/examples/autoHide/pics/ctrl center-96x96.pngbin0 -> 9770 bytes
-rw-r--r--superkaramba/examples/autoHide/pics/iconbarback.pngbin0 -> 2475 bytes
-rw-r--r--superkaramba/examples/autoHide/pics/label3.pngbin0 -> 300 bytes
-rw-r--r--superkaramba/examples/autoHide/pics/label4.pngbin0 -> 256 bytes
-rw-r--r--superkaramba/examples/autoHide/pics/osxbarback.pngbin0 -> 6463 bytes
-rw-r--r--superkaramba/examples/autoHide/pics/osxbarbackBig.pngbin0 -> 6473 bytes
-rw-r--r--superkaramba/examples/autoHide/pics/pointer.pngbin0 -> 309 bytes
-rw-r--r--superkaramba/examples/bar/bar.py93
-rw-r--r--superkaramba/examples/bar/bar.theme26
-rw-r--r--superkaramba/examples/bar/hor.pngbin0 -> 300 bytes
-rw-r--r--superkaramba/examples/bar/ver.pngbin0 -> 321 bytes
-rw-r--r--superkaramba/examples/change_interval/interval.py60
-rw-r--r--superkaramba/examples/change_interval/interval.theme2
-rw-r--r--superkaramba/examples/control_management/mgmt.py49
-rw-r--r--superkaramba/examples/control_management/mgmt.theme1
-rw-r--r--superkaramba/examples/disableRightClickMenu/disable_menu.py176
-rw-r--r--superkaramba/examples/disableRightClickMenu/disable_menu.theme1
-rw-r--r--superkaramba/examples/globalMouse/README29
-rw-r--r--superkaramba/examples/globalMouse/extension/setup.py12
-rw-r--r--superkaramba/examples/globalMouse/extension/xcursor.c104
-rw-r--r--superkaramba/examples/globalMouse/eyes.py192
-rw-r--r--superkaramba/examples/globalMouse/eyes.theme3
-rw-r--r--superkaramba/examples/globalMouse/pics/eyes.pngbin0 -> 2819 bytes
-rw-r--r--superkaramba/examples/globalMouse/pics/eyes.xcfbin0 -> 18677 bytes
-rw-r--r--superkaramba/examples/globalMouse/pics/mask.pngbin0 -> 495 bytes
-rw-r--r--superkaramba/examples/globalMouse/pics/pupille.pngbin0 -> 256 bytes
-rwxr-xr-xsuperkaramba/examples/globalMouse/xcursor.sobin0 -> 7465 bytes
-rw-r--r--superkaramba/examples/graph/graph.py89
-rw-r--r--superkaramba/examples/graph/graph.theme26
-rw-r--r--superkaramba/examples/image/flag.pngbin0 -> 1072 bytes
-rw-r--r--superkaramba/examples/image/flag2.pngbin0 -> 2130 bytes
-rw-r--r--superkaramba/examples/image/image.py121
-rw-r--r--superkaramba/examples/image/image.theme34
-rwxr-xr-xsuperkaramba/examples/image/test1.sh2
-rwxr-xr-xsuperkaramba/examples/image/test2.sh2
-rw-r--r--superkaramba/examples/input_api/input_api.py185
-rw-r--r--superkaramba/examples/input_api/input_api.theme5
-rw-r--r--superkaramba/examples/input_example/input_example.py169
-rw-r--r--superkaramba/examples/input_example/input_example.theme5
-rw-r--r--superkaramba/examples/mouseDrag/karmix/images/bar.pngbin0 -> 207 bytes
-rw-r--r--superkaramba/examples/mouseDrag/karmix/images/bg.pngbin0 -> 4719 bytes
-rw-r--r--superkaramba/examples/mouseDrag/karmix/karmix.py190
-rw-r--r--superkaramba/examples/mouseDrag/karmix/karmix.theme17
-rw-r--r--superkaramba/examples/mouseDrop/mousedrop.py138
-rw-r--r--superkaramba/examples/mouseDrop/mousedrop.theme5
-rw-r--r--superkaramba/examples/openCloseTheme/1.py22
-rw-r--r--superkaramba/examples/openCloseTheme/1.theme2
-rw-r--r--superkaramba/examples/openCloseTheme/2.theme2
-rw-r--r--superkaramba/examples/popupMenu/calendar.pngbin0 -> 1950 bytes
-rw-r--r--superkaramba/examples/popupMenu/popupMenu.pngbin0 -> 6221 bytes
-rw-r--r--superkaramba/examples/popupMenu/popupMenu.py117
-rw-r--r--superkaramba/examples/popupMenu/popupMenu.theme4
-rw-r--r--superkaramba/examples/richtext/info.pngbin0 -> 641 bytes
-rw-r--r--superkaramba/examples/richtext/penguin_executive.pngbin0 -> 5159 bytes
-rw-r--r--superkaramba/examples/richtext/richtext.py136
-rw-r--r--superkaramba/examples/richtext/richtext.theme1
-rw-r--r--superkaramba/examples/richtext/rtext.py99
-rw-r--r--superkaramba/examples/richtext/rtext.theme26
-rw-r--r--superkaramba/examples/service_group/service_group.py143
-rw-r--r--superkaramba/examples/service_group/service_group.theme4
-rw-r--r--superkaramba/examples/setIncomingData/1.py27
-rw-r--r--superkaramba/examples/setIncomingData/1.theme2
-rw-r--r--superkaramba/examples/setIncomingData/2.py78
-rw-r--r--superkaramba/examples/setIncomingData/2.theme2
-rw-r--r--superkaramba/examples/taskBar/cleanbar/README25
-rw-r--r--superkaramba/examples/taskBar/cleanbar/cleanbar.py267
-rw-r--r--superkaramba/examples/taskBar/cleanbar/cleanbar.theme14
-rw-r--r--superkaramba/examples/taskBar/cleanbar/pics/bar2.pngbin0 -> 7508 bytes
-rw-r--r--superkaramba/examples/taskBar/cleanbar/pics/rightend.pngbin0 -> 434 bytes
-rw-r--r--superkaramba/examples/taskBar/cleanbar/pics/rightend_new.pngbin0 -> 5267 bytes
-rw-r--r--superkaramba/examples/taskBar/cleanbar/pics/slickbar.pngbin0 -> 3130 bytes
-rw-r--r--superkaramba/examples/taskBar/cleanbar/pics/startup.pngbin0 -> 2584 bytes
-rw-r--r--superkaramba/examples/taskBar/cleanbar/pics/task.pngbin0 -> 429 bytes
-rw-r--r--superkaramba/examples/taskBar/cleanbar/pics/task_new.pngbin0 -> 2470 bytes
-rw-r--r--superkaramba/examples/template.py160
-rwxr-xr-xsuperkaramba/examples/test_all.sh27
-rw-r--r--superkaramba/examples/text/text.py110
-rw-r--r--superkaramba/examples/text/text.theme35
-rw-r--r--superkaramba/examples/unicode/unicode.py116
-rw-r--r--superkaramba/examples/unicode/unicode.theme1
-rw-r--r--superkaramba/icons/Makefile.am1
-rw-r--r--superkaramba/icons/cr128-app-superkaramba.pngbin0 -> 10111 bytes
-rw-r--r--superkaramba/icons/cr128-mime-superkaramba_theme.pngbin0 -> 9438 bytes
-rw-r--r--superkaramba/icons/cr16-app-superkaramba.pngbin0 -> 697 bytes
-rw-r--r--superkaramba/icons/cr16-mime-superkaramba_theme.pngbin0 -> 694 bytes
-rw-r--r--superkaramba/icons/cr22-app-superkaramba.pngbin0 -> 1030 bytes
-rw-r--r--superkaramba/icons/cr22-mime-superkaramba_theme.pngbin0 -> 1008 bytes
-rw-r--r--superkaramba/icons/cr32-app-superkaramba.pngbin0 -> 1657 bytes
-rw-r--r--superkaramba/icons/cr32-mime-superkaramba_theme.pngbin0 -> 1642 bytes
-rw-r--r--superkaramba/icons/cr48-app-superkaramba.pngbin0 -> 2757 bytes
-rw-r--r--superkaramba/icons/cr48-mime-superkaramba_theme.pngbin0 -> 2746 bytes
-rw-r--r--superkaramba/icons/cr64-app-superkaramba.pngbin0 -> 4039 bytes
-rw-r--r--superkaramba/icons/cr64-mime-superkaramba_theme.pngbin0 -> 3901 bytes
-rw-r--r--superkaramba/icons/crsc-app-superkaramba.svgzbin0 -> 4263 bytes
-rw-r--r--superkaramba/icons/crsc-mime-superkaramba_theme.svgzbin0 -> 10765 bytes
-rw-r--r--superkaramba/karamba.kdevelop257
-rw-r--r--superkaramba/karamba.kdevses29
-rw-r--r--superkaramba/mimetypes/Makefile.am2
-rw-r--r--superkaramba/mimetypes/x-superkaramba.desktop52
-rw-r--r--superkaramba/src/Makefile.am54
-rw-r--r--superkaramba/src/bar.cpp134
-rw-r--r--superkaramba/src/bar.h55
-rw-r--r--superkaramba/src/bar_python.cpp168
-rw-r--r--superkaramba/src/bar_python.h316
-rw-r--r--superkaramba/src/clickable.cpp37
-rw-r--r--superkaramba/src/clickable.h46
-rw-r--r--superkaramba/src/clickarea.cpp107
-rw-r--r--superkaramba/src/clickarea.h69
-rw-r--r--superkaramba/src/clickmap.cpp96
-rw-r--r--superkaramba/src/clickmap.h43
-rw-r--r--superkaramba/src/config_python.cpp182
-rw-r--r--superkaramba/src/config_python.h138
-rw-r--r--superkaramba/src/cpusensor.cpp167
-rw-r--r--superkaramba/src/cpusensor.h44
-rw-r--r--superkaramba/src/datesensor.cpp129
-rw-r--r--superkaramba/src/datesensor.h47
-rw-r--r--superkaramba/src/dcopinterface.h37
-rw-r--r--superkaramba/src/disksensor.cpp175
-rw-r--r--superkaramba/src/disksensor.h51
-rw-r--r--superkaramba/src/graph.cpp74
-rw-r--r--superkaramba/src/graph.h39
-rw-r--r--superkaramba/src/graph_python.cpp137
-rw-r--r--superkaramba/src/graph_python.h289
-rw-r--r--superkaramba/src/imagelabel.cpp632
-rw-r--r--superkaramba/src/imagelabel.h191
-rw-r--r--superkaramba/src/imagelabel_python.cpp331
-rw-r--r--superkaramba/src/imagelabel_python.h449
-rw-r--r--superkaramba/src/input.cpp196
-rw-r--r--superkaramba/src/input.h84
-rw-r--r--superkaramba/src/input_python.cpp355
-rw-r--r--superkaramba/src/input_python.h475
-rw-r--r--superkaramba/src/karamba.cpp2098
-rw-r--r--superkaramba/src/karamba.h363
-rw-r--r--superkaramba/src/karamba_python.cpp635
-rw-r--r--superkaramba/src/karamba_python.h85
-rw-r--r--superkaramba/src/karambaapp.cpp427
-rw-r--r--superkaramba/src/karambaapp.h95
-rw-r--r--superkaramba/src/karambainterface.cpp153
-rw-r--r--superkaramba/src/karambainterface.h42
-rw-r--r--superkaramba/src/karambalistboxitem.cpp25
-rw-r--r--superkaramba/src/karambalistboxitem.h31
-rw-r--r--superkaramba/src/karambarootpixmap.cpp36
-rw-r--r--superkaramba/src/karambarootpixmap.h39
-rw-r--r--superkaramba/src/karambasessionmanaged.cpp63
-rw-r--r--superkaramba/src/karambasessionmanaged.h30
-rw-r--r--superkaramba/src/kwidgetlistbox.cpp200
-rw-r--r--superkaramba/src/kwidgetlistbox.h68
-rw-r--r--superkaramba/src/lineparser.cpp96
-rw-r--r--superkaramba/src/lineparser.h53
-rw-r--r--superkaramba/src/main.cpp156
-rw-r--r--superkaramba/src/memsensor.cpp359
-rw-r--r--superkaramba/src/memsensor.h67
-rw-r--r--superkaramba/src/menu_python.cpp200
-rw-r--r--superkaramba/src/menu_python.h124
-rw-r--r--superkaramba/src/meter.cpp111
-rw-r--r--superkaramba/src/meter.h99
-rw-r--r--superkaramba/src/meter_python.cpp373
-rw-r--r--superkaramba/src/meter_python.h44
-rw-r--r--superkaramba/src/misc_python.cpp852
-rw-r--r--superkaramba/src/misc_python.h606
-rw-r--r--superkaramba/src/networksensor.cpp164
-rw-r--r--superkaramba/src/networksensor.h47
-rw-r--r--superkaramba/src/noatunsensor.cpp234
-rw-r--r--superkaramba/src/noatunsensor.h48
-rw-r--r--superkaramba/src/programsensor.cpp93
-rw-r--r--superkaramba/src/programsensor.h38
-rw-r--r--superkaramba/src/richtextlabel.cpp212
-rw-r--r--superkaramba/src/richtextlabel.h64
-rw-r--r--superkaramba/src/richtextlabel_python.cpp182
-rw-r--r--superkaramba/src/richtextlabel_python.h338
-rw-r--r--superkaramba/src/rsssensor.cpp136
-rw-r--r--superkaramba/src/rsssensor.h39
-rw-r--r--superkaramba/src/sensor.cpp64
-rw-r--r--superkaramba/src/sensor.h47
-rw-r--r--superkaramba/src/sensorparams.cpp34
-rw-r--r--superkaramba/src/sensorparams.h48
-rw-r--r--superkaramba/src/sensorsensor.cpp115
-rw-r--r--superkaramba/src/sensorsensor.h49
-rw-r--r--superkaramba/src/showdesktop.cpp123
-rw-r--r--superkaramba/src/showdesktop.h58
-rw-r--r--superkaramba/src/sklineedit.cpp82
-rw-r--r--superkaramba/src/sklineedit.h57
-rw-r--r--superkaramba/src/sknewstuff.cpp140
-rw-r--r--superkaramba/src/sknewstuff.h53
-rw-r--r--superkaramba/src/superkaramba.desktop99
-rw-r--r--superkaramba/src/superkaramba.kcfg16
-rw-r--r--superkaramba/src/superkaramba.lsm16
-rw-r--r--superkaramba/src/superkarambasettings.kcfgc4
-rw-r--r--superkaramba/src/superkarambaui.rc8
-rw-r--r--superkaramba/src/svcgrp_python.cpp156
-rw-r--r--superkaramba/src/svcgrp_python.h44
-rw-r--r--superkaramba/src/systemtray.cpp231
-rw-r--r--superkaramba/src/systemtray.h69
-rw-r--r--superkaramba/src/systray_python.cpp199
-rw-r--r--superkaramba/src/systray_python.h117
-rw-r--r--superkaramba/src/task_python.cpp375
-rw-r--r--superkaramba/src/task_python.h153
-rw-r--r--superkaramba/src/taskbartest.cpp183
-rw-r--r--superkaramba/src/taskbartest.h23
-rw-r--r--superkaramba/src/taskmanager.cpp829
-rw-r--r--superkaramba/src/taskmanager.h550
-rw-r--r--superkaramba/src/textfield.cpp159
-rw-r--r--superkaramba/src/textfield.h59
-rw-r--r--superkaramba/src/textfilesensor.cpp109
-rw-r--r--superkaramba/src/textfilesensor.h53
-rw-r--r--superkaramba/src/textlabel.cpp379
-rw-r--r--superkaramba/src/textlabel.h87
-rw-r--r--superkaramba/src/textlabel_python.cpp235
-rw-r--r--superkaramba/src/textlabel_python.h397
-rw-r--r--superkaramba/src/themefile.cpp414
-rw-r--r--superkaramba/src/themefile.h107
-rw-r--r--superkaramba/src/themelocale.cpp438
-rw-r--r--superkaramba/src/themelocale.h61
-rw-r--r--superkaramba/src/themes_layout.ui241
-rw-r--r--superkaramba/src/themesdlg.cpp543
-rw-r--r--superkaramba/src/themesdlg.h80
-rw-r--r--superkaramba/src/themewidget.cpp113
-rw-r--r--superkaramba/src/themewidget.h57
-rw-r--r--superkaramba/src/themewidget_layout.ui182
-rw-r--r--superkaramba/src/uptimesensor.cpp119
-rw-r--r--superkaramba/src/uptimesensor.h30
-rw-r--r--superkaramba/src/widget_python.cpp214
-rw-r--r--superkaramba/src/widget_python.h131
-rw-r--r--superkaramba/src/xmmssensor.cpp149
-rw-r--r--superkaramba/src/xmmssensor.h38
1583 files changed, 223413 insertions, 0 deletions
diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 0000000..4c064a3
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1,28 @@
+Program Person held responsible
+=======================================
+ark Emily Ezust <emilye@corel.com>
+kab (discontinued) Mirko Boehm <mirko@kde.org>
+karm Sirtaj Singh Kang <taj@kde.org>
+kcalc Bernd Johannes Wuebben <wuebben@kde.org>
+kcharselect Reginald Stadlbauer <reggie@kde.org>
+kdepasswd Geert Jansen <jansen@kde.org>
+kdessh Geert Jansen <jansen@kde.org>
+kdf Michael Kropfberger <michael.kropfberger@gmx.net>
+kedit Bernd Johannes Wuebben <wuebben@kde.org>
+kfind Carsten Pfeiffer <pfeiffer@kde.org>
+kfloppy Bernd Johannes Wuebben <wuebben@kde.org>
+kfontmanager Hans Petter Bieker <bieker@kde.org>
+kgpg Jean-Baptiste Mardelle <bj@alter.org>
+khexedit Espen Sand <espensa@online.no>
+kjots Christoph Neerfeld <chris@kde.org>
+klaptopdaemon Paul Campbell <paul@taniwha.com>
+klipper Carsten Pfeiffer <pfeiffer@kde.org>
+kljettool Bernd Johannes Wuebben <wuebben@kde.org>
+klpq Bernd Johannes Wuebben <wuebben@kde.org>
+kpm Mario Weilguni <mweilguni@kde.org>
+ktimemon Dirk A. Mueller <dmuell@gmx.net>
+ktop Chris Schlaeger <cs@kde.org>
+kwrite Jochen Wilhelmy <digisnap@cs.tu-berlin.de>
+
+Look in the subdirs to get more info about the authors.
+The package is maintained by Matthias Elter <elter@kde.org>
diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..5185fd3
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,346 @@
+NOTE! The GPL below is copyrighted by the Free Software Foundation, but
+the instance of code that it refers to (the kde programs) are copyrighted
+by the authors who actually wrote it.
+
+---------------------------------------------------------------------------
+
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) 19yy <name of author>
+
+ 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.
+
+ This program 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 program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) 19yy name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/COPYING-DOCS b/COPYING-DOCS
new file mode 100644
index 0000000..4a0fe1c
--- /dev/null
+++ b/COPYING-DOCS
@@ -0,0 +1,397 @@
+ GNU Free Documentation License
+ Version 1.2, November 2002
+
+
+ Copyright (C) 2000,2001,2002 Free Software Foundation, Inc.
+ 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+
+0. PREAMBLE
+
+The purpose of this License is to make a manual, textbook, or other
+functional and useful document "free" in the sense of freedom: to
+assure everyone the effective freedom to copy and redistribute it,
+with or without modifying it, either commercially or noncommercially.
+Secondarily, this License preserves for the author and publisher a way
+to get credit for their work, while not being considered responsible
+for modifications made by others.
+
+This License is a kind of "copyleft", which means that derivative
+works of the document must themselves be free in the same sense. It
+complements the GNU General Public License, which is a copyleft
+license designed for free software.
+
+We have designed this License in order to use it for manuals for free
+software, because free software needs free documentation: a free
+program should come with manuals providing the same freedoms that the
+software does. But this License is not limited to software manuals;
+it can be used for any textual work, regardless of subject matter or
+whether it is published as a printed book. We recommend this License
+principally for works whose purpose is instruction or reference.
+
+
+1. APPLICABILITY AND DEFINITIONS
+
+This License applies to any manual or other work, in any medium, that
+contains a notice placed by the copyright holder saying it can be
+distributed under the terms of this License. Such a notice grants a
+world-wide, royalty-free license, unlimited in duration, to use that
+work under the conditions stated herein. The "Document", below,
+refers to any such manual or work. Any member of the public is a
+licensee, and is addressed as "you". You accept the license if you
+copy, modify or distribute the work in a way requiring permission
+under copyright law.
+
+A "Modified Version" of the Document means any work containing the
+Document or a portion of it, either copied verbatim, or with
+modifications and/or translated into another language.
+
+A "Secondary Section" is a named appendix or a front-matter section of
+the Document that deals exclusively with the relationship of the
+publishers or authors of the Document to the Document's overall subject
+(or to related matters) and contains nothing that could fall directly
+within that overall subject. (Thus, if the Document is in part a
+textbook of mathematics, a Secondary Section may not explain any
+mathematics.) The relationship could be a matter of historical
+connection with the subject or with related matters, or of legal,
+commercial, philosophical, ethical or political position regarding
+them.
+
+The "Invariant Sections" are certain Secondary Sections whose titles
+are designated, as being those of Invariant Sections, in the notice
+that says that the Document is released under this License. If a
+section does not fit the above definition of Secondary then it is not
+allowed to be designated as Invariant. The Document may contain zero
+Invariant Sections. If the Document does not identify any Invariant
+Sections then there are none.
+
+The "Cover Texts" are certain short passages of text that are listed,
+as Front-Cover Texts or Back-Cover Texts, in the notice that says that
+the Document is released under this License. A Front-Cover Text may
+be at most 5 words, and a Back-Cover Text may be at most 25 words.
+
+A "Transparent" copy of the Document means a machine-readable copy,
+represented in a format whose specification is available to the
+general public, that is suitable for revising the document
+straightforwardly with generic text editors or (for images composed of
+pixels) generic paint programs or (for drawings) some widely available
+drawing editor, and that is suitable for input to text formatters or
+for automatic translation to a variety of formats suitable for input
+to text formatters. A copy made in an otherwise Transparent file
+format whose markup, or absence of markup, has been arranged to thwart
+or discourage subsequent modification by readers is not Transparent.
+An image format is not Transparent if used for any substantial amount
+of text. A copy that is not "Transparent" is called "Opaque".
+
+Examples of suitable formats for Transparent copies include plain
+ASCII without markup, Texinfo input format, LaTeX input format, SGML
+or XML using a publicly available DTD, and standard-conforming simple
+HTML, PostScript or PDF designed for human modification. Examples of
+transparent image formats include PNG, XCF and JPG. Opaque formats
+include proprietary formats that can be read and edited only by
+proprietary word processors, SGML or XML for which the DTD and/or
+processing tools are not generally available, and the
+machine-generated HTML, PostScript or PDF produced by some word
+processors for output purposes only.
+
+The "Title Page" means, for a printed book, the title page itself,
+plus such following pages as are needed to hold, legibly, the material
+this License requires to appear in the title page. For works in
+formats which do not have any title page as such, "Title Page" means
+the text near the most prominent appearance of the work's title,
+preceding the beginning of the body of the text.
+
+A section "Entitled XYZ" means a named subunit of the Document whose
+title either is precisely XYZ or contains XYZ in parentheses following
+text that translates XYZ in another language. (Here XYZ stands for a
+specific section name mentioned below, such as "Acknowledgements",
+"Dedications", "Endorsements", or "History".) To "Preserve the Title"
+of such a section when you modify the Document means that it remains a
+section "Entitled XYZ" according to this definition.
+
+The Document may include Warranty Disclaimers next to the notice which
+states that this License applies to the Document. These Warranty
+Disclaimers are considered to be included by reference in this
+License, but only as regards disclaiming warranties: any other
+implication that these Warranty Disclaimers may have is void and has
+no effect on the meaning of this License.
+
+
+2. VERBATIM COPYING
+
+You may copy and distribute the Document in any medium, either
+commercially or noncommercially, provided that this License, the
+copyright notices, and the license notice saying this License applies
+to the Document are reproduced in all copies, and that you add no other
+conditions whatsoever to those of this License. You may not use
+technical measures to obstruct or control the reading or further
+copying of the copies you make or distribute. However, you may accept
+compensation in exchange for copies. If you distribute a large enough
+number of copies you must also follow the conditions in section 3.
+
+You may also lend copies, under the same conditions stated above, and
+you may publicly display copies.
+
+
+3. COPYING IN QUANTITY
+
+If you publish printed copies (or copies in media that commonly have
+printed covers) of the Document, numbering more than 100, and the
+Document's license notice requires Cover Texts, you must enclose the
+copies in covers that carry, clearly and legibly, all these Cover
+Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
+the back cover. Both covers must also clearly and legibly identify
+you as the publisher of these copies. The front cover must present
+the full title with all words of the title equally prominent and
+visible. You may add other material on the covers in addition.
+Copying with changes limited to the covers, as long as they preserve
+the title of the Document and satisfy these conditions, can be treated
+as verbatim copying in other respects.
+
+If the required texts for either cover are too voluminous to fit
+legibly, you should put the first ones listed (as many as fit
+reasonably) on the actual cover, and continue the rest onto adjacent
+pages.
+
+If you publish or distribute Opaque copies of the Document numbering
+more than 100, you must either include a machine-readable Transparent
+copy along with each Opaque copy, or state in or with each Opaque copy
+a computer-network location from which the general network-using
+public has access to download using public-standard network protocols
+a complete Transparent copy of the Document, free of added material.
+If you use the latter option, you must take reasonably prudent steps,
+when you begin distribution of Opaque copies in quantity, to ensure
+that this Transparent copy will remain thus accessible at the stated
+location until at least one year after the last time you distribute an
+Opaque copy (directly or through your agents or retailers) of that
+edition to the public.
+
+It is requested, but not required, that you contact the authors of the
+Document well before redistributing any large number of copies, to give
+them a chance to provide you with an updated version of the Document.
+
+
+4. MODIFICATIONS
+
+You may copy and distribute a Modified Version of the Document under
+the conditions of sections 2 and 3 above, provided that you release
+the Modified Version under precisely this License, with the Modified
+Version filling the role of the Document, thus licensing distribution
+and modification of the Modified Version to whoever possesses a copy
+of it. In addition, you must do these things in the Modified Version:
+
+A. Use in the Title Page (and on the covers, if any) a title distinct
+ from that of the Document, and from those of previous versions
+ (which should, if there were any, be listed in the History section
+ of the Document). You may use the same title as a previous version
+ if the original publisher of that version gives permission.
+B. List on the Title Page, as authors, one or more persons or entities
+ responsible for authorship of the modifications in the Modified
+ Version, together with at least five of the principal authors of the
+ Document (all of its principal authors, if it has fewer than five),
+ unless they release you from this requirement.
+C. State on the Title page the name of the publisher of the
+ Modified Version, as the publisher.
+D. Preserve all the copyright notices of the Document.
+E. Add an appropriate copyright notice for your modifications
+ adjacent to the other copyright notices.
+F. Include, immediately after the copyright notices, a license notice
+ giving the public permission to use the Modified Version under the
+ terms of this License, in the form shown in the Addendum below.
+G. Preserve in that license notice the full lists of Invariant Sections
+ and required Cover Texts given in the Document's license notice.
+H. Include an unaltered copy of this License.
+I. Preserve the section Entitled "History", Preserve its Title, and add
+ to it an item stating at least the title, year, new authors, and
+ publisher of the Modified Version as given on the Title Page. If
+ there is no section Entitled "History" in the Document, create one
+ stating the title, year, authors, and publisher of the Document as
+ given on its Title Page, then add an item describing the Modified
+ Version as stated in the previous sentence.
+J. Preserve the network location, if any, given in the Document for
+ public access to a Transparent copy of the Document, and likewise
+ the network locations given in the Document for previous versions
+ it was based on. These may be placed in the "History" section.
+ You may omit a network location for a work that was published at
+ least four years before the Document itself, or if the original
+ publisher of the version it refers to gives permission.
+K. For any section Entitled "Acknowledgements" or "Dedications",
+ Preserve the Title of the section, and preserve in the section all
+ the substance and tone of each of the contributor acknowledgements
+ and/or dedications given therein.
+L. Preserve all the Invariant Sections of the Document,
+ unaltered in their text and in their titles. Section numbers
+ or the equivalent are not considered part of the section titles.
+M. Delete any section Entitled "Endorsements". Such a section
+ may not be included in the Modified Version.
+N. Do not retitle any existing section to be Entitled "Endorsements"
+ or to conflict in title with any Invariant Section.
+O. Preserve any Warranty Disclaimers.
+
+If the Modified Version includes new front-matter sections or
+appendices that qualify as Secondary Sections and contain no material
+copied from the Document, you may at your option designate some or all
+of these sections as invariant. To do this, add their titles to the
+list of Invariant Sections in the Modified Version's license notice.
+These titles must be distinct from any other section titles.
+
+You may add a section Entitled "Endorsements", provided it contains
+nothing but endorsements of your Modified Version by various
+parties--for example, statements of peer review or that the text has
+been approved by an organization as the authoritative definition of a
+standard.
+
+You may add a passage of up to five words as a Front-Cover Text, and a
+passage of up to 25 words as a Back-Cover Text, to the end of the list
+of Cover Texts in the Modified Version. Only one passage of
+Front-Cover Text and one of Back-Cover Text may be added by (or
+through arrangements made by) any one entity. If the Document already
+includes a cover text for the same cover, previously added by you or
+by arrangement made by the same entity you are acting on behalf of,
+you may not add another; but you may replace the old one, on explicit
+permission from the previous publisher that added the old one.
+
+The author(s) and publisher(s) of the Document do not by this License
+give permission to use their names for publicity for or to assert or
+imply endorsement of any Modified Version.
+
+
+5. COMBINING DOCUMENTS
+
+You may combine the Document with other documents released under this
+License, under the terms defined in section 4 above for modified
+versions, provided that you include in the combination all of the
+Invariant Sections of all of the original documents, unmodified, and
+list them all as Invariant Sections of your combined work in its
+license notice, and that you preserve all their Warranty Disclaimers.
+
+The combined work need only contain one copy of this License, and
+multiple identical Invariant Sections may be replaced with a single
+copy. If there are multiple Invariant Sections with the same name but
+different contents, make the title of each such section unique by
+adding at the end of it, in parentheses, the name of the original
+author or publisher of that section if known, or else a unique number.
+Make the same adjustment to the section titles in the list of
+Invariant Sections in the license notice of the combined work.
+
+In the combination, you must combine any sections Entitled "History"
+in the various original documents, forming one section Entitled
+"History"; likewise combine any sections Entitled "Acknowledgements",
+and any sections Entitled "Dedications". You must delete all sections
+Entitled "Endorsements".
+
+
+6. COLLECTIONS OF DOCUMENTS
+
+You may make a collection consisting of the Document and other documents
+released under this License, and replace the individual copies of this
+License in the various documents with a single copy that is included in
+the collection, provided that you follow the rules of this License for
+verbatim copying of each of the documents in all other respects.
+
+You may extract a single document from such a collection, and distribute
+it individually under this License, provided you insert a copy of this
+License into the extracted document, and follow this License in all
+other respects regarding verbatim copying of that document.
+
+
+7. AGGREGATION WITH INDEPENDENT WORKS
+
+A compilation of the Document or its derivatives with other separate
+and independent documents or works, in or on a volume of a storage or
+distribution medium, is called an "aggregate" if the copyright
+resulting from the compilation is not used to limit the legal rights
+of the compilation's users beyond what the individual works permit.
+When the Document is included in an aggregate, this License does not
+apply to the other works in the aggregate which are not themselves
+derivative works of the Document.
+
+If the Cover Text requirement of section 3 is applicable to these
+copies of the Document, then if the Document is less than one half of
+the entire aggregate, the Document's Cover Texts may be placed on
+covers that bracket the Document within the aggregate, or the
+electronic equivalent of covers if the Document is in electronic form.
+Otherwise they must appear on printed covers that bracket the whole
+aggregate.
+
+
+8. TRANSLATION
+
+Translation is considered a kind of modification, so you may
+distribute translations of the Document under the terms of section 4.
+Replacing Invariant Sections with translations requires special
+permission from their copyright holders, but you may include
+translations of some or all Invariant Sections in addition to the
+original versions of these Invariant Sections. You may include a
+translation of this License, and all the license notices in the
+Document, and any Warranty Disclaimers, provided that you also include
+the original English version of this License and the original versions
+of those notices and disclaimers. In case of a disagreement between
+the translation and the original version of this License or a notice
+or disclaimer, the original version will prevail.
+
+If a section in the Document is Entitled "Acknowledgements",
+"Dedications", or "History", the requirement (section 4) to Preserve
+its Title (section 1) will typically require changing the actual
+title.
+
+
+9. TERMINATION
+
+You may not copy, modify, sublicense, or distribute the Document except
+as expressly provided for under this License. Any other attempt to
+copy, modify, sublicense or distribute the Document is void, and will
+automatically terminate your rights under this License. However,
+parties who have received copies, or rights, from you under this
+License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+
+10. FUTURE REVISIONS OF THIS LICENSE
+
+The Free Software Foundation may publish new, revised versions
+of the GNU Free Documentation License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns. See
+http://www.gnu.org/copyleft/.
+
+Each version of the License is given a distinguishing version number.
+If the Document specifies that a particular numbered version of this
+License "or any later version" applies to it, you have the option of
+following the terms and conditions either of that specified version or
+of any later version that has been published (not as a draft) by the
+Free Software Foundation. If the Document does not specify a version
+number of this License, you may choose any version ever published (not
+as a draft) by the Free Software Foundation.
+
+
+ADDENDUM: How to use this License for your documents
+
+To use this License in a document you have written, include a copy of
+the License in the document and put the following copyright and
+license notices just after the title page:
+
+ Copyright (c) YEAR YOUR NAME.
+ Permission is granted to copy, distribute and/or modify this document
+ under the terms of the GNU Free Documentation License, Version 1.2
+ or any later version published by the Free Software Foundation;
+ with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
+ A copy of the license is included in the section entitled "GNU
+ Free Documentation License".
+
+If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
+replace the "with...Texts." line with this:
+
+ with the Invariant Sections being LIST THEIR TITLES, with the
+ Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
+
+If you have Invariant Sections without Cover Texts, or some other
+combination of the three, merge those two alternatives to suit the
+situation.
+
+If your document contains nontrivial examples of program code, we
+recommend releasing these examples in parallel under your choice of
+free software license, such as the GNU General Public License,
+to permit their use in free software.
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 0000000..f8bad0c
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,176 @@
+Basic Installation
+==================
+
+ These are generic installation instructions.
+
+ The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation. It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions. Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, a file
+`config.cache' that saves the results of its tests to speed up
+reconfiguring, and a file `config.log' containing compiler output
+(useful mainly for debugging `configure').
+
+ If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release. If at some point `config.cache'
+contains results you don't want to keep, you may remove or edit it.
+
+ The file `configure.in' is used to create `configure' by a program
+called `autoconf'. You only need `configure.in' if you want to change
+it or regenerate `configure' using a newer version of `autoconf'.
+
+The simplest way to compile this package is:
+
+ 1. `cd' to the directory containing the package's source code and type
+ `./configure' to configure the package for your system. If you're
+ using `csh' on an old version of System V, you might need to type
+ `sh ./configure' instead to prevent `csh' from trying to execute
+ `configure' itself.
+
+ Running `configure' takes a while. While running, it prints some
+ messages telling which features it is checking for.
+
+ 2. Type `make' to compile the package.
+
+ 3. Optionally, type `make check' to run any self-tests that come with
+ the package.
+
+ 4. Type `make install' to install the programs and any data files and
+ documentation.
+
+ 5. You can remove the program binaries and object files from the
+ source code directory by typing `make clean'. To also remove the
+ files that `configure' created (so you can compile the package for
+ a different kind of computer), type `make distclean'. There is
+ also a `make maintainer-clean' target, but that is intended mainly
+ for the package's developers. If you use it, you may have to get
+ all sorts of other programs in order to regenerate files that came
+ with the distribution.
+
+Compilers and Options
+=====================
+
+ Some systems require unusual options for compilation or linking that
+the `configure' script does not know about. You can give `configure'
+initial values for variables by setting them in the environment. Using
+a Bourne-compatible shell, you can do that on the command line like
+this:
+ CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
+
+Or on systems that have the `env' program, you can do it like this:
+ env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
+
+Compiling For Multiple Architectures
+====================================
+
+ You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory. To do this, you must use a version of `make' that
+supports the `VPATH' variable, such as GNU `make'. `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script. `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'.
+
+ If you have to use a `make' that does not supports the `VPATH'
+variable, you have to compile the package for one architecture at a time
+in the source code directory. After you have installed the package for
+one architecture, use `make distclean' before reconfiguring for another
+architecture.
+
+Installation Names
+==================
+
+ By default, `make install' will install the package's files in
+`/usr/local/kde/bin', `/usr/local/kde/lib', etc. You can specify an
+installation prefix other than `/usr/local/kde' by giving `configure'
+the option `--prefix=PATH'.
+
+ You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files. If you
+give `configure' the option `--exec-prefix=PATH', the package will use
+PATH as the prefix for installing programs and libraries.
+Documentation and other data files will still use the regular prefix.
+
+ If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+Optional Features
+=================
+
+ Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System). The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+ For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+Specifying the System Type
+==========================
+
+ There may be some features `configure' can not figure out
+automatically, but needs to determine by the type of host the package
+will run on. Usually `configure' can figure that out, but if it prints
+a message saying it can not guess the host type, give it the
+`--host=TYPE' option. TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name with three fields:
+ CPU-COMPANY-SYSTEM
+
+See the file `config.sub' for the possible values of each field. If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the host type.
+
+ If you are building compiler tools for cross-compiling, you can also
+use the `--target=TYPE' option to select the type of system they will
+produce code for and the `--build=TYPE' option to select the type of
+system on which you are compiling the package.
+
+Sharing Defaults
+================
+
+ If you want to set default values for `configure' scripts to share,
+you can create a site shell script called `config.site' that gives
+default values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists. Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Operation Controls
+==================
+
+ `configure' recognizes the following options to control how it
+operates.
+
+`--cache-file=FILE'
+ Use and save the results of the tests in FILE instead of
+ `./config.cache'. Set FILE to `/dev/null' to disable caching, for
+ debugging `configure'.
+
+`--help'
+ Print a summary of the options to `configure', and exit.
+
+`--quiet'
+`--silent'
+`-q'
+ Do not print messages saying which checks are being made.
+
+`--srcdir=DIR'
+ Look for the package's source code in directory DIR. Usually
+ `configure' can determine that directory automatically.
+
+`--version'
+ Print the version of Autoconf used to generate the `configure'
+ script, and exit.
+
+`configure' also accepts some other, not widely useful, options.
+
diff --git a/Mainpage.dox b/Mainpage.dox
new file mode 100644
index 0000000..3334ae2
--- /dev/null
+++ b/Mainpage.dox
@@ -0,0 +1,11 @@
+/** @mainpage KDE Utilities
+*
+* The KDE Utilities SVN module collects together an enormous amount
+* of small shoddy utilities of dubious value that fall under the
+* 'desk utilities' category and that you would normally get for
+* free in a box of cereal. These include:
+*
+* - kfloppy, a floppy disk formatter
+* - superkaramba, a form of eyecandy
+*
+*/
diff --git a/Makefile.am.in b/Makefile.am.in
new file mode 100644
index 0000000..f5a67f1
--- /dev/null
+++ b/Makefile.am.in
@@ -0,0 +1,10 @@
+## kdebase/Makefile.am
+## (C) 1997 Stephan Kulow
+
+AUTOMAKE_OPTIONS = foreign 1.6.1
+DISTCLEANFILES = inst-apps
+
+MAINTAINERCLEANFILES = subdirs configure.in acinclude.m4 SUBDIRS
+include admin/deps.am
+include admin/Doxyfile.am
+
diff --git a/Makefile.cvs b/Makefile.cvs
new file mode 100644
index 0000000..be59a86
--- /dev/null
+++ b/Makefile.cvs
@@ -0,0 +1,14 @@
+all:
+ @echo "This Makefile is only for the CVS repository"
+ @echo "This will be deleted before making the distribution"
+ @echo ""
+ @if test ! -d admin; then \
+ echo "Please recheckout this module!" ;\
+ echo "for cvs: use checkout once and after that update again" ;\
+ echo "for cvsup: checkout kde-common from cvsup and" ;\
+ echo " link kde-common/admin to ./admin" ;\
+ exit 1 ;\
+ fi
+ $(MAKE) -f admin/Makefile.common cvs
+
+.SILENT:
diff --git a/README b/README
new file mode 100644
index 0000000..9e3708e
--- /dev/null
+++ b/README
@@ -0,0 +1,51 @@
+In this file:
+
+* What it is
+* Common Mistakes
+* Debugging
+* More Info
+
+What it is
+----------
+
+* ark: manager for compressed files and archives
+* kcalc: scientific calculator
+* kcharselect: select special characters from any fonts and put them into
+ the clipboard
+* charselectapplet: dito, but as a Kicker applet
+* kdepasswd: like 'passwd', a graphical password changer
+* kdessh: front end to ssh
+* kdf: like 'df', a graphical free disk space viewer
+* kedit: a simple text editor, without formatting like bold, italics etc
+* kfloppy: format a floppy disks with this app
+* khexedit: binary file editor
+* kjots: manages several "books" with a subject and notes
+* klaptopdaemon: battery and power management, including KControl plugins
+* kregexpeditor: graphical regular expression editor
+* ktimer: execute programs after some time
+
+Common Mistakes
+---------------
+
+If configure claims Qt cannot be found, have a look at http://www.trolltech.com
+to get latest copy of Qt 3.3.x version. If you have peeked there already,
+grab the CVS module qt-copy from anoncvs.kde.org, or a snapshot thereof.
+
+Debugging
+---------
+
+You can use --enable-debug with the configure script, if you want to have
+debug code in your KDE apps and libs. I recommend to do this, since this
+is alpha software and this makes debugging things a whole lot easier.
+
+More Info
+---------
+
+Have a look at the individual subdirectories, if you want to know, what
+versions of apps are included.
+
+Please direct any bug reports to our bug list by visiting
+http://bugs.kde.org.
+
+General KDE discussions should go to the KDE mailing list (kde@kde.org).
+
diff --git a/ark/AUTHORS b/ark/AUTHORS
new file mode 100644
index 0000000..0de587e
--- /dev/null
+++ b/ark/AUTHORS
@@ -0,0 +1,5 @@
+Rob Palmbos palm9744@kettering.edu
+Francois-Xavier Duranceau duranceau@kde.org
+Emily Ezust emilye@corel.com
+Roberto Selbach Teixeira maragato@kde.org
+Helio Chissini de Castro helio@kde.org
diff --git a/ark/ChangeLog b/ark/ChangeLog
new file mode 100644
index 0000000..cd5b4de
--- /dev/null
+++ b/ark/ChangeLog
@@ -0,0 +1,277 @@
+ $Id$
+
+2001-10-24: Roberto Selbach Teixeira <maragato@kde.org>
+ * Renamed all .cc files to .cpp to make things more logic.
+
+2001-06-23: Roberto Selbach Teixeira <maragato@kde.org>
+ * Fixed a bug in tar addition with non-compressed tar archives
+
+2001-06-10: Roberto Selbach Teixeira <maragato@conectiva.com>
+ * Made extraction use KURL instead of QString.
+ * Made extractDlg use a KHistoryCombo.
+
+2001-05-31 Roberto Selbach Teixeira <maragato@conectiva.com>
+ * Fixed a bug that made the file list freeze.
+ * Fixed extractDlg size to use QLayout
+
+2001-05-30 Roberto Selbach Teixeira <maragato@conectiva.com>
+ * Began using KMimeMagic to figure file types
+ * Began cleaning up Ark's code a bit.
+
+2001-05-29 Roberto Selbach Teixeira <maragato@conectiva.com>
+
+ * compressedfile.cc (unarchFile): move to fromLocal8Bit() to allow
+ non-Latin1 characters in filenames.
+
+ * ar.cc (unarchFile): .latin1() to .local8Bit()
+
+ * zip.cc (unarchFile): .latin1() to .local8Bit()
+
+2000-07-10: Emily Ezust <emilye@corel.com>
+ * Added checks for available disk space
+
+2000-07-05: Emily Ezust <emilye@corel.com>
+ * Added some more mimetype magic.
+
+2000-06-28: Emily Ezust <emilye@corel.com>
+ * Made Extract dialog prettier
+
+2000-06-27: Emily Ezust <emilye@corel.com>
+ * Added code to let users load rar, lha, ar and tar archives that
+ do not have the standard extensions. You can also "Save As" into
+ a file with no extension provided the original is rar, lha or ar.
+ Zip and zoo don't like having no extension. Tar doesn't mind but
+ I haven't explored that tangle yet. It's complicated with all the
+ compressors!
+ * Made shell output dialog a tiny bit prettier.
+
+2000-06-22: Emily Ezust <emilye@corel.com>
+ * Overhaul of Directories Preferences dialog
+ * For Save As, ark will add proper extension if user does not have one.
+
+2000-06-13: Emily Ezust <emilye@corel.com>
+ * Fixed "Save As" code so that it prevents the user from saving a
+ zip as a tar
+ * Fixed bug preventing you from opening a network file after having
+ opened one before in the same session.
+ * Added a check for utilities (it will notify you e.g. that
+ "The utility zip is not in your PATH. Please
+ install it or contact your system administrator.").
+ * Added support for drag/adding files or drag/opening network archives
+ from konqy.
+
+2000-06-12: Emily Ezust <emilye@corel.com>
+ * Began adding network transparency
+ * Added a Save As option so that people can rename arks that are
+ temporary files
+
+2000-05-23: Emily Ezust <emilye@corel.com>
+ * Odds and ends: fixed problem with selecting multiple files in Add
+ File; added some better option enabling in the extract dialog.
+
+2000-05-16: Emily Ezust <emilye@corel.com>
+ * Fixed a bug in ArArch - wasn't reading TOCs properly
+
+2000-05-12: Emily Ezust <emilye@corel.com>
+ * Added some code to notify the user about file(s) that were not
+ extracted. This happens when the user disallows overwrites and
+ then extracts file(s) that already exist in the destination
+ directory. The notification happens before the extract, so that
+ the user can decide whether to continue or not.
+ * Fixed a possible memory corruption having to do with the lists passed
+ via the stack to unarchFile which cease to exist because unarchFile
+ returns before the job is done.
+
+2000-05-04: Emily Ezust <emilye@corel.com>
+ * Added control/shift LMB selection rules
+ * Added code to allow drag/extract but it doesn't work yet. Commented
+ it out. Not too sure about when to start the drag anyhow... have to
+ extract first!
+ * Added an "Edit With" option to let you edit files in the archive.
+ It would be too complicated to let the user edit more than one
+ file at a time, so like view, this freezes the app until the user
+ quits the editor.
+
+ It even works with files that have paths! (I think - haven't
+ tested thoroughly)
+
+2000-04-27: Emily Ezust <emilye@corel.com>
+ * Got rid of a segfault that occured whenever you closed an archive
+ (I was deleting something that the statusbar needed (but had not
+ needed before KStatusBar was adopted by QStatusBar!))
+ * Added code to let users drag files to extract them. Not working
+ yet: when I drag to konqy, it requests a filename for
+ clipboard content.
+
+2000-04-18: Emily Ezust <emilye@corel.com>
+ * Added some code to prevent tar from adding duplicate filenames
+ (having duplicates really screws up deletion and particular extracts)
+ * More archive-specific options (for all types: update only with
+ newer files; tar: keep absolute paths; zip, rar: store file as
+ symlinks (although my version of rar doesn't seem to know how
+ to extract a symlink??)
+
+2000-04-06: Emily Ezust <emilye@corel.com>
+ * Switched to KListView
+ * Some work on settings and archive-specific actions
+ * Couldn't load LHA archives with files that were symlinks; fixed
+ * Added more entries to the Settings and RMB menu. Toggle menu bar will
+ display help in the titlebar for getting the menubar back (just as
+ konsole does)
+ * Seems I need a KFileOpenWithHandler for OpenWith now...
+ * Moved archive column header strings from archive classes to the base
+ class header file on Francois-Xavier Duranceau's suggestion.
+
+2000-04-03: Emily Ezust <emilye@corel.com>
+ * Struggling with the Recent Files popup (fixed next day with help of
+ Kurt Granroth)
+ * Ar had a problem with some of my files; fixed
+ * ArkWidget destructor was never being called; fixed
+
+2000-03-29: Emily Ezust <emilye@corel.com>
+ * Extra GUI tweaks
+ * Fixed faulty drop/add into compressed file (if you chose to create a
+ real archive, it didn't actually add the files, just the compressed
+ file).
+
+2000-03-23: Emily Ezust <emilye@corel.com>
+ * Began migration to the XML-GUI framework. RMB menus disabled for
+ the moment...
+
+2000-03-20: Emily Ezust <emilye@corel.com>
+ * Fixed up Ar format.
+
+2000-03-20: Emily Ezust <emilye@corel.com>
+ * Added Rar format. Added disabling of buttons and menu entries during
+ operations
+
+2000-03-16: Emily Ezust <emilye@corel.com>
+ * Added Zoo format
+
+2000-03-15: Emily Ezust <emilye@corel.com>
+ * Added the class CompressedFile to the hierarchy. This
+ allows ark to be used to view, create, and extract compressed files.
+ The user will be asked if he/she wants to create a real archive if
+ she/he tries to add a file to the thing when there's already
+ a file in there.
+ * Added an Open With option (RMB and Action menu)
+ * Made use of statusbar improvements
+ * Made the time and date stamp in LHA sortable
+
+2000-03-09: Emily Ezust <emilye@corel.com>
+ * Fixed TarArch so that it warns the user before deleting the
+ contents of a directory. (Delete a directory entry in tar and
+ tar deletes everything in it, unlike zip & lha!!)
+ * Finished TarArch so that extract and view work.
+ * Added LHA format
+ * Simplified the Arch API a little (got rid of useless return values)
+
+2000-03-06: Emily Ezust <emilye@corel.com>
+ * Fixed TarArch so that the other compressors work
+ * Dealt with readonly archives (if the user views an archive from
+ within an archive, it is extracted to the /tmp directory, so all
+ changes will be lost.)
+
+2000-03-06: Emily Ezust <emilye@corel.com>
+ * Got rid of KProcess data member in Arch - no need for it with the
+ new way that KProcess does its work: we are always passing it
+ around to the functions that need it. This way we won't get
+ confused when there are more than one processes happening.
+ * Made tar more asynchronous, redid the temp file creation & updating.
+
+2000-03-03: Emily Ezust <emilye@corel.com>
+ * Made zip fully asynchronous.
+
+2000-03-02: Emily Ezust <emilye@corel.com>
+ * add and delete now work for tar files, although I'll probably
+ change how temp files are created from compressed tars and
+ how they are used to update the original archive...
+ Note: ark uses KTar for display and shell process for everything
+ else.
+ * Reduced the number of calls of slotSelectionChanged
+ * OK, _now_ I'm done with the enable/disable stuff - I swear!
+ * Other miscellaneous abstractions with zip->arch code
+
+2000-02-24: Emily Ezust <emilye@corel.com>
+ * Got showFile interface working (see zip)
+ * Started using KTar in tar. Seems to display OK.
+ No other functionality yet for tar.
+
+2000-02-22: Emily Ezust <emilye@corel.com>
+ * More work on the abstract base class for archives - moved lots of
+ slots dealing with the KProcess from zip.cpp to arch.cpp
+ * Some work on tar. Doesn't work yet.
+
+2000-02-16: Emily Ezust <emilye@corel.com>
+ * More consistent disabling/enabling of menu items and toolbar buttons.
+ * Added "add directory" - might need some more tweaking in zip so it
+ doesn't flatten the files out.
+
+2000-02-15: Emily Ezust <emilye@corel.com>
+ * Added drop support. Doesn't seem to work with directories though.
+ * Toolbar icons stopped working briefly - renamed them to ensure no
+ ambiguity.
+
+2000-02-14: Emily Ezust <emilye@corel.com>
+ * Separated GUI and backend in zip, which will be the model
+ for the other formats once it's just-right. Next I'll make sure
+ drag and drop works.
+
+2000-02-09: Emily Ezust <emilye@corel.com>
+ * Finally have Add and Extract working for zip
+
+2000-02-07: Emily Ezust <emilye@corel.com>
+ * new locking scheme to prevent users from opening the same archive
+ in two different windows. Handles symlinks. But I can't figure out
+ why raise() alone doesn't do it - I hide and show the window
+ instead - blech!
+ * made classes more const correct
+ * add dialog still doesn't work. Problem with KFileView?
+
+2000-01-18: Emily Ezust <emilye@corel.com>
+ * KUniqueApplication stuff was enabled by waba, with KCmdLineArgs
+ code. Modified it to work according to Cooperating-SDI model.
+ * Moved windowList to ArkApplication (accessed through a static
+ function). ArkApplication is now modelled on the singleton pattern.
+
+2000-01-10: Emily Ezust <emilye@corel.com>
+ * Finished renaming ArkData to ArkSettings.
+ * Tried using KDialogBase for Add dialog - not working too well.
+
+2000-01-6: Emily Ezust <emilye@corel.com>
+ * Disabled KUniqueApplication stuff for now... was interfering with
+ development with crashes. Will add later.
+ * Asks "Are you sure?" when you try to "New" over an existing zip
+ * Began work on new extract dialog - old one doesn't work any longer
+ due to kdelibs changes. Doesn't do anything yet - just trying out
+ for look&feel with error-checking.
+ Idea of extract: highlight the ones to be extracted and then
+ let the right archiver grab all the highlighted files (or current).
+
+
+1999-12-16 Emily Ezust <emilye@corel.com>
+ * created ArkApplication : public KUniqueApplication
+ * Code now to follow the Co-operating SDI model.
+ * Some problems with dcop still... exiting the last window doesn't
+ get you back the prompt!
+
+1999-12-13 Emily Ezust <emilye@corel.com>
+ * fixed up icons, continued with merge: enabling toolbar buttons
+ and menu items. Close enables don't work yet...
+ * Fixed status bar totals for selection, number and size.
+
+1999-12-09 Emily Ezust <emilye@corel.com>
+ * started merge with Corel Linux code.
+ * added toolbar icons (with two more on the way), lock files,
+ and fixed the sorting for numeric column data.
+ * added preliminary code to count number of files and total sizes
+ in the status bar, but it does nothing so far.
+ * created a new problem: action_add in zip now segfaults.
+
+1999-07-05 Francois-Xavier Duranceau <duranceau@kde.org>
+ * added selection with regular expressions
+
+1999-04-11 Francois-Xavier Duranceau <duranceau@kde.org>
+
+ * created this file
+
diff --git a/ark/Makefile.am b/ark/Makefile.am
new file mode 100644
index 0000000..b97b034
--- /dev/null
+++ b/ark/Makefile.am
@@ -0,0 +1,54 @@
+# set the include path for X, qt and KDE
+AM_CPPFLAGS = -D_LARGEFILE64_SOURCE $(all_includes)
+
+SUBDIRS = pics
+
+# The binary name. Changed from kzip to ark
+bin_PROGRAMS =
+kdeinit_LTLIBRARIES = ark.la
+lib_LTLIBRARIES =
+
+ark_la_SOURCES = main.cpp arkapp.cpp mainwindow.cpp
+ark_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN)
+ark_la_LIBADD = libark_common.la $(LIB_KPARTS)
+ark_la_COMPILE_FIRST = settings.h
+
+noinst_LTLIBRARIES = libark_common.la
+
+libark_common_la_SOURCES = settings.kcfgc archiveformatinfo.cpp
+libark_common_la_LDFLAGS = $(all_libraries) -no-undefined
+libark_common_la_LIBADD = $(LIB_KFILE)
+
+kde_module_LTLIBRARIES = libarkpart.la
+libarkpart_la_LDFLAGS = $(KDE_PLUGIN) $(all_libraries)
+libarkpart_la_LIBADD = libark_common.la $(LIB_KPARTS)
+libarkpart_la_COMPILE_FIRST = settings.h
+
+libarkpart_la_SOURCES = ark_part.cpp arkfactory.cpp zip.cpp tar.cpp \
+ filelistview.cpp arch.cpp lha.cpp \
+ compressedfile.cpp zoo.cpp rar.cpp \
+ ar.cpp arkutils.cpp archiveformatdlg.cpp \
+ arkwidget.cpp searchbar.cpp \
+ addition.ui extraction.ui general.ui \
+ arkviewer.cpp sevenzip.cpp extractiondialog.cpp \
+ ace.cpp tarlistingthread.cpp
+
+METASOURCES = AUTO
+
+rcdir = $(kde_datadir)/ark
+rc_DATA = arkui.rc ark_part.rc ark_part_readonly.rc
+
+messages: rc.cpp
+ $(XGETTEXT) *.cpp -o $(podir)/ark.pot
+
+KDE_ICON = ark
+
+xdg_apps_DATA = ark.desktop
+kde_kcfg_DATA = ark.kcfg
+
+parts_DATA = ark_part.desktop
+partsdir = $(kde_servicesdir)
+
+#konqservice_DATA = arkservicemenu.desktop ark_directory_service.desktop
+#konqservicedir = $(kde_datadir)/konqueror/servicemenus
+
diff --git a/ark/README b/ark/README
new file mode 100644
index 0000000..156c2bb
--- /dev/null
+++ b/ark/README
@@ -0,0 +1,4 @@
+This is Ark version 2.3.x.
+
+Ark is KDE archive handling tool, part of the kdeutils package.
+
diff --git a/ark/TODO b/ark/TODO
new file mode 100644
index 0000000..cc3d455
--- /dev/null
+++ b/ark/TODO
@@ -0,0 +1,11 @@
+TODO
+-----
+
+Feature-wise:
+- Rename option
+- Behavior-compatibility with the Konqueror filemanager
+
+For KDE 4.0:
+- Use KArchive to handle archives
+- Add support for split files
+- Add support for more archive formats (ace, iso, rpm)
diff --git a/ark/ace.cpp b/ark/ace.cpp
new file mode 100644
index 0000000..d9cce52
--- /dev/null
+++ b/ark/ace.cpp
@@ -0,0 +1,181 @@
+/*
+
+ ark -- archiver for the KDE project
+
+ Copyright (C)
+
+ 2005: Henrique Pinto <henrique.pinto@kdemail.net>
+
+ 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.
+
+ This program 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 program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+*/
+
+#include <qdir.h>
+
+#include <kglobal.h>
+#include <klocale.h>
+#include <kdebug.h>
+#include <kurl.h>
+#include <kmessagebox.h>
+#include <kprocess.h>
+#include <kstandarddirs.h>
+
+#include "ace.h"
+#include "arkwidget.h"
+#include "settings.h"
+
+AceArch::AceArch( ArkWidget *gui, const QString &filename )
+ : Arch( gui, filename )
+{
+ //m_archiver_program = m_unarchiver_program = "/usr/local/bin/unace";
+ m_archiver_program = m_unarchiver_program = "/home/henrique/ArkTest/teste.sh";
+ verifyCompressUtilityIsAvailable( m_archiver_program );
+
+ m_headerString = "Date Time Packed Size RatioFile";
+
+ m_repairYear = 5; m_fixMonth = 6; m_fixDay = 7; m_fixTime = 8;
+ m_dateCol = 3;
+ m_numCols = 5;
+
+ m_archCols.append( new ArchColumns( 7, QRegExp( "[0-3][0-9]" ), 2 ) ); // Day
+ m_archCols.append( new ArchColumns( 6, QRegExp( "[01][0-9]" ), 2 ) ); // Month
+ m_archCols.append( new ArchColumns( 5, QRegExp( "[0-9][0-9]" ), 4 ) ); // Year
+ m_archCols.append( new ArchColumns( 8, QRegExp( "[0-9:]+" ), 8 ) ); // Time
+ m_archCols.append( new ArchColumns( 2, QRegExp( "[0-9]+" ) ) ); // Compressed Size
+ m_archCols.append( new ArchColumns( 1, QRegExp( "[0-9]+" ) ) ); // Size
+ m_archCols.append( new ArchColumns( 9, QRegExp( "[0-9][0-9]%" ) ) ); // Ratio
+ m_archCols.append( new ArchColumns( 0, QRegExp( "[^\\n]+" ), 4096 ) ); // Name
+}
+
+AceArch::~AceArch()
+{
+}
+
+void AceArch::setHeaders()
+{
+ ColumnList list;
+ list.append( FILENAME_COLUMN );
+ list.append( SIZE_COLUMN );
+ list.append( PACKED_COLUMN );
+ list.append( TIMESTAMP_COLUMN );
+
+ emit headers( list );
+}
+
+void AceArch::open()
+{
+ kdDebug(1601) << "+AceArch::open()" << endl;
+ setHeaders();
+
+ m_buffer = "";
+ m_header_removed = false;
+ m_finished = false;
+
+ KProcess *kp = m_currentProcess = new KProcess;
+ *kp << m_archiver_program << "v" << m_filename;
+ //kp->setUseShell( true );
+
+ kdDebug() << "AceArch::open(): kp->args(): " << kp->args() << endl;
+
+ connect( kp, SIGNAL( receivedStdout(KProcess*, char*, int) ),
+ SLOT( slotReceivedTOC(KProcess*, char*, int) ) );
+ connect( kp, SIGNAL( receivedStderr(KProcess*, char*, int) ),
+ SLOT( slotReceivedOutput(KProcess*, char*, int) ) );
+ connect( kp, SIGNAL( processExited(KProcess*) ),
+ SLOT( slotOpenExited(KProcess*) ) );
+
+ connect( kp, SIGNAL( receivedStdout(KProcess*, char*, int) ),
+ this, SLOT( catchMeIfYouCan(KProcess*, char*, int) ) );
+
+ if ( !kp->start( KProcess::NotifyOnExit, KProcess::AllOutput ) )
+ {
+ KMessageBox::error( 0, i18n( "Could not start a subprocess." ) );
+ emit sigOpen( this, false, QString::null, 0 );
+ }
+}
+
+void AceArch::create()
+{
+ emit sigCreate( this, true, m_filename,
+ Arch::Extract | Arch::View );
+}
+
+void AceArch::addFile( const QStringList & urls )
+{
+}
+
+void AceArch::addDir( const QString & dirName )
+{
+}
+
+void AceArch::remove( QStringList *list )
+{
+}
+
+void AceArch::unarchFileInternal( )
+{
+ if ( m_destDir.isEmpty() || m_destDir.isNull() )
+ {
+ kdError( 1601 ) << "There was no extract directory given." << endl;
+ return;
+ }
+
+ KProcess *kp = m_currentProcess = new KProcess;
+ kp->clearArguments();
+
+ // extract (and maybe overwrite)
+ *kp << m_unarchiver_program << "x" << "-y";
+
+ if ( ArkSettings::extractOverwrite() )
+ {
+ *kp << "-o";
+ }
+
+ *kp << m_filename;
+
+ *kp << m_destDir ;
+
+ // if the file list is empty, no filenames go on the command line,
+ // and we then extract everything in the archive.
+ if ( m_fileList )
+ {
+ QStringList::Iterator it;
+ for ( it = m_fileList->begin(); it != m_fileList->end(); ++it )
+ {
+ *kp << (*it);
+ }
+ }
+
+ connect( kp, SIGNAL( receivedStdout(KProcess*, char*, int) ),
+ SLOT( slotReceivedOutput(KProcess*, char*, int) ) );
+ connect( kp, SIGNAL( receivedStderr(KProcess*, char*, int) ),
+ SLOT( slotReceivedOutput(KProcess*, char*, int) ) );
+ connect( kp, SIGNAL( processExited(KProcess*) ),
+ SLOT( slotExtractExited(KProcess*) ) );
+
+ if ( !kp->start( KProcess::NotifyOnExit, KProcess::AllOutput ) )
+ {
+ KMessageBox::error( 0, i18n( "Could not start a subprocess." ) );
+ emit sigExtract( false );
+ }
+}
+
+void AceArch::catchMeIfYouCan( KProcess*, char *buffer, int buflen )
+{
+ QString myBuf = QString::fromLatin1( buffer, buflen );
+ kdDebug(1601) << " Wololo!: " << myBuf << endl;
+}
+
+#include "ace.moc"
diff --git a/ark/ace.h b/ark/ace.h
new file mode 100644
index 0000000..7aed56c
--- /dev/null
+++ b/ark/ace.h
@@ -0,0 +1,55 @@
+/*
+
+ ark -- archiver for the KDE project
+
+ Copyright (C)
+
+ 2005: Henrique Pinto <henrique.pinto@kdemail.net>
+
+ 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.
+
+ This program 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 program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+*/
+
+#ifndef ARK_ACE_H
+#define ARK_ACE_H
+
+#include "arch.h"
+
+class KProcess; // TODO: Remove me!
+
+class AceArch : public Arch
+{
+ Q_OBJECT
+ public:
+ AceArch( ArkWidget *, const QString & );
+ virtual ~AceArch();
+
+ virtual void open();
+ virtual void create();
+
+ virtual void addFile( const QStringList & );
+ virtual void addDir( const QString & );
+
+ virtual void remove( QStringList * );
+ virtual void unarchFileInternal( );
+
+ private slots:
+ void catchMeIfYouCan( KProcess*, char*, int );
+
+ private:
+ void setHeaders();
+};
+
+#endif // ARK_ACE_H
diff --git a/ark/addition.ui b/ark/addition.ui
new file mode 100644
index 0000000..a8f51d8
--- /dev/null
+++ b/ark/addition.ui
@@ -0,0 +1,79 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>Addition</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>Addition</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>365</width>
+ <height>268</height>
+ </rect>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>kcfg_replaceOnlyWithNewer</cstring>
+ </property>
+ <property name="text">
+ <string>Replace old files only &amp;with newer files</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>kcfg_forceMSDOS</cstring>
+ </property>
+ <property name="text">
+ <string>Force &amp;MS-DOS short filenames (Zip)</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>kcfg_convertLF2CRLF</cstring>
+ </property>
+ <property name="text">
+ <string>Translate &amp;LF to DOS CRLF (Zip)</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>kcfg_rarStoreSymlinks</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Store symlinks as links (Zip, Rar)</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>kcfg_rarRecurseSubdirs</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Recursively add subfolders (Zip, Rar)</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>51</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/ark/ar.cpp b/ark/ar.cpp
new file mode 100644
index 0000000..71f44e0
--- /dev/null
+++ b/ark/ar.cpp
@@ -0,0 +1,263 @@
+/*
+
+ ark -- archiver for the KDE project
+
+ Copyright (C)
+
+ 1997-1999: Rob Palmbos palm9744@kettering.edu
+ 2000: Corel Corporation (author: Emily Ezust, emilye@corel.com)
+ 2001: Corel Corporation (author: Michael Jarrett, michaelj@corel.com)
+
+ 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.
+
+ This program 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 program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+*/
+
+// C includes
+#include <stdio.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <string.h>
+
+// QT includes
+#include <qdir.h>
+
+// KDE includes
+#include <kdebug.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+#include <kprocess.h>
+
+// ark includes
+#include "arkwidget.h"
+#include "settings.h"
+#include "ar.h"
+
+ArArch::ArArch( ArkWidget *_gui, const QString & _fileName )
+ : Arch(_gui, _fileName )
+{
+ m_archiver_program = m_unarchiver_program = "ar";
+ verifyCompressUtilityIsAvailable( m_archiver_program );
+ verifyUncompressUtilityIsAvailable( m_unarchiver_program );
+
+ // Do not set headerString - there is none for Ar
+ m_numCols = 5;
+ m_dateCol = 4; m_fixYear = 8; m_repairMonth = 5; m_fixDay = 6; m_fixTime = 7;
+
+ m_archCols.append(new ArchColumns(1, QRegExp("[a-zA-Z-]+"), 12)); // Perms
+ m_archCols.append(new ArchColumns(2, QRegExp("[^\\s]+"), 128)); //User/grp
+ m_archCols.append(new ArchColumns(3, QRegExp("[0-9]+"))); // Size
+ m_archCols.append(new ArchColumns(5, QRegExp("[a-zA-Z]+"), 4)); // Month
+ m_archCols.append(new ArchColumns(6, QRegExp("[0-9]+"), 2)); // Day
+ m_archCols.append(new ArchColumns(7, QRegExp("[0-9:]+"), 6)); // Time
+ m_archCols.append(new ArchColumns(8, QRegExp("[0-9]+"), 5)); // Year
+ m_archCols.append(new ArchColumns(0, QRegExp("[^\\s][^\\n]+"), 4096));// File
+
+ kdDebug(1601) << "ArArch constructor" << endl;
+}
+
+void ArArch::setHeaders()
+{
+ ColumnList list;
+ list.append( FILENAME_COLUMN );
+ list.append( PERMISSION_COLUMN );
+ list.append( OWNER_GROUP_COLUMN );
+ list.append( SIZE_COLUMN );
+ list.append( TIMESTAMP_COLUMN );
+
+ emit headers( list );
+}
+
+void ArArch::open()
+{
+ kdDebug(1601) << "+ArArch::open" << endl;
+ setHeaders();
+
+ m_buffer = "";
+
+ KProcess *kp = m_currentProcess = new KProcess;
+ *kp << m_archiver_program << "vt" << m_filename;
+ connect( kp, SIGNAL(receivedStdout(KProcess*, char*, int)),
+ this, SLOT(slotReceivedTOC(KProcess*, char*, int)));
+ connect( kp, SIGNAL(receivedStderr(KProcess*, char*, int)),
+ this, SLOT(slotReceivedOutput(KProcess*, char*, int)));
+
+ connect( kp, SIGNAL(processExited(KProcess*)), this,
+ SLOT(slotOpenExited(KProcess*)));
+
+ if (kp->start(KProcess::NotifyOnExit, KProcess::AllOutput) == false)
+ {
+ KMessageBox::error( 0, i18n("Could not start a subprocess.") );
+ emit sigOpen(this, false, QString::null, 0 );
+ }
+ kdDebug(1601) << "-ArArch::open" << endl;
+}
+
+void ArArch::create()
+{
+ KProcess *kp = m_currentProcess = new KProcess;
+ kp->clearArguments();
+ *kp << m_archiver_program << "c" << m_filename;
+
+ connect( kp, SIGNAL(receivedStdout(KProcess*, char*, int)),
+ this, SLOT(slotReceivedOutput(KProcess*, char*, int)));
+ connect( kp, SIGNAL(receivedStderr(KProcess*, char*, int)),
+ this, SLOT(slotReceivedOutput(KProcess*, char*, int)));
+
+ if (kp->start(KProcess::Block) == false)
+ {
+ KMessageBox::error( 0, i18n("Could not start a subprocess.") );
+ emit sigCreate(this, false, m_filename,
+ Arch::Extract | Arch::Delete | Arch::Add
+ | Arch::View);
+ }
+ else
+ emit sigCreate(this, true, m_filename,
+ Arch::Extract | Arch::Delete | Arch::Add
+ | Arch::View);
+}
+
+void ArArch::addFile( const QStringList &urls )
+{
+ kdDebug(1601) << "+ArArch::addFile" << endl;
+ KProcess *kp = m_currentProcess = new KProcess;
+ kp->clearArguments();
+ *kp << m_archiver_program;
+
+ if (ArkSettings::replaceOnlyWithNewer())
+ *kp << "ru";
+ else
+ *kp << "r";
+
+ *kp << m_filename;
+
+ QStringList::ConstIterator iter;
+ KURL url( urls.first() );
+ QDir::setCurrent( url.directory() );
+ for (iter = urls.begin(); iter != urls.end(); ++iter )
+ {
+ KURL fileURL( *iter );
+ *kp << fileURL.fileName();
+ }
+
+ connect( kp, SIGNAL(receivedStdout(KProcess*, char*, int)),
+ this, SLOT(slotReceivedOutput(KProcess*, char*, int)));
+ connect( kp, SIGNAL(receivedStderr(KProcess*, char*, int)),
+ this, SLOT(slotReceivedOutput(KProcess*, char*, int)));
+
+ connect( kp, SIGNAL(processExited(KProcess*)), this,
+ SLOT(slotAddExited(KProcess*)));
+
+ if (kp->start(KProcess::NotifyOnExit, KProcess::AllOutput) == false)
+ {
+ KMessageBox::error( 0, i18n("Could not start a subprocess.") );
+ emit sigAdd(false);
+ }
+
+ kdDebug(1601) << "-ArArch::addFile" << endl;
+}
+
+void ArArch::unarchFileInternal()
+{
+ // if m_fileList is empty, we extract all.
+ // if m_destDir is empty, abort with error.
+
+ kdDebug(1601) << "+ArArch::unarchFile" << endl;
+ QString dest;
+
+ if (m_destDir.isEmpty() || m_destDir.isNull())
+ {
+ kdError(1601) << "There was no extract directory given." << endl;
+ return;
+ }
+ else dest = m_destDir;
+
+ // ar has no option to specify the destination directory
+ // so I have to change to it.
+
+ bool ret = QDir::setCurrent(dest);
+ // I already checked the validity of the dir before coming here
+ Q_ASSERT(ret);
+
+ KProcess *kp = m_currentProcess = new KProcess;
+ kp->clearArguments();
+
+ *kp << m_archiver_program;
+ *kp << "vx";
+ *kp << m_filename;
+
+ // if the list is empty, no filenames go on the command line,
+ // and we then extract everything in the archive.
+ if (m_fileList)
+ {
+ for ( QStringList::Iterator it = m_fileList->begin();
+ it != m_fileList->end(); ++it )
+ {
+ *kp << (*it);
+ }
+ }
+
+ connect( kp, SIGNAL(receivedStdout(KProcess*, char*, int)),
+ this, SLOT(slotReceivedOutput(KProcess*, char*, int)));
+ connect( kp, SIGNAL(receivedStderr(KProcess*, char*, int)),
+ this, SLOT(slotReceivedOutput(KProcess*, char*, int)));
+
+ connect( kp, SIGNAL(processExited(KProcess*)), this,
+ SLOT(slotExtractExited(KProcess*)));
+
+ if (kp->start(KProcess::NotifyOnExit, KProcess::AllOutput) == false)
+ {
+ KMessageBox::error( 0, i18n("Could not start a subprocess.") );
+ emit sigExtract(false);
+ }
+}
+
+void ArArch::remove(QStringList *list)
+{
+ kdDebug(1601) << "+ArArch::remove" << endl;
+
+ if (!list)
+ return;
+
+ KProcess *kp = m_currentProcess = new KProcess;
+ kp->clearArguments();
+
+ *kp << m_archiver_program << "d" << m_filename;
+ for ( QStringList::Iterator it = list->begin();
+ it != list->end(); ++it )
+ {
+ QString str = *it;
+ *kp << str;
+ }
+
+ connect( kp, SIGNAL(receivedStdout(KProcess*, char*, int)),
+ this, SLOT(slotReceivedOutput(KProcess*, char*, int)));
+ connect( kp, SIGNAL(receivedStderr(KProcess*, char*, int)),
+ this, SLOT(slotReceivedOutput(KProcess*, char*, int)));
+
+ connect( kp, SIGNAL(processExited(KProcess*)), this,
+ SLOT(slotDeleteExited(KProcess*)));
+
+ if (kp->start(KProcess::NotifyOnExit, KProcess::AllOutput) == false)
+ {
+ KMessageBox::error( 0, i18n("Could not start a subprocess.") );
+ emit sigDelete(false);
+ }
+
+ kdDebug(1601) << "-ArArch::remove" << endl;
+}
+
+
+#include "ar.moc"
diff --git a/ark/ar.h b/ark/ar.h
new file mode 100644
index 0000000..1a5f00f
--- /dev/null
+++ b/ark/ar.h
@@ -0,0 +1,61 @@
+// -*-C++-*- emacs magic for .h files
+/*
+
+ $Id$
+
+ ark -- archiver for the KDE project
+
+ Copyright (C)
+
+ 1997-1999: Rob Palmbos palm9744@kettering.edu
+ 1999-2000: Corel Corporation (author: Emily Ezust, emilye@corel.com)
+ 2001: Corel Corporation (author: Michael Jarrett, michaelj@corel.com)
+
+ 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.
+
+ This program 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 program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+*/
+
+#ifndef ARARCH_H
+#define ARARCH_H
+
+class QString;
+class QCString;
+class QStringList;
+
+class Arch;
+class ArkWidget;
+
+class ArArch : public Arch
+{
+ Q_OBJECT
+public:
+ ArArch( ArkWidget *_gui,
+ const QString & _fileName );
+ virtual ~ArArch() {}
+
+ virtual void open();
+ virtual void create();
+
+ virtual void addFile( const QStringList & );
+ virtual void addDir(const QString &) {} // never gets called
+
+ virtual void remove(QStringList *);
+ virtual void unarchFileInternal();
+
+private:
+ void setHeaders();
+};
+
+#endif /* ARARCH_H */
diff --git a/ark/arch.cpp b/ark/arch.cpp
new file mode 100644
index 0000000..8ff6a2b
--- /dev/null
+++ b/ark/arch.cpp
@@ -0,0 +1,403 @@
+/*
+
+ ark -- archiver for the KDE project
+
+ Copyright (C)
+
+ 2002: Helio Chissini de Castro <helio@conectiva.com.br>
+ 2001: Corel Corporation (author: Michael Jarrett, michaelj@corel.com)
+ 1999-2000: Corel Corporation (author: Emily Ezust, emilye@corel.com)
+ 1999: Francois-Xavier Duranceau duranceau@kde.org
+ 1997-1999: Rob Palmbos palm9744@kettering.edu
+
+ 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.
+
+ This program 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 program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+*/
+
+// C includes
+#include <stdlib.h>
+#include <time.h>
+
+// QT includes
+#include <qapplication.h>
+#include <qfile.h>
+
+// KDE includes
+#include <kdebug.h>
+#include <kmessagebox.h>
+#include <kmimetype.h>
+#include <klocale.h>
+#include <kpassdlg.h>
+#include <kprocess.h>
+#include <kstandarddirs.h>
+
+// ark includes
+#include "arch.h"
+#include "arkwidget.h"
+#include "arkutils.h"
+#include "filelistview.h"
+
+// the archive types
+#include "tar.h"
+#include "zip.h"
+#include "lha.h"
+#include "compressedfile.h"
+#include "zoo.h"
+#include "rar.h"
+#include "ar.h"
+#include "sevenzip.h"
+#include "ace.h"
+
+Arch::ArchColumns::ArchColumns( int col, QRegExp reg, int length, bool opt )
+ : colRef( col ), pattern( reg ), maxLength( length ), optional( opt )
+{
+}
+
+Arch::Arch( ArkWidget *gui, const QString &filename )
+ : m_filename( filename ), m_buffer( "" ), m_gui( gui ),
+ m_bReadOnly( false ), m_bNotifyWhenDeleteFails( true ),
+ m_header_removed( false ), m_finished( false ),
+ m_numCols( 0 ), m_dateCol( -1 ), m_fixYear( -1 ), m_fixMonth( -1 ),
+ m_fixDay( -1 ), m_fixTime( -1 ), m_repairYear( -1 ), m_repairMonth( -1 ),
+ m_repairTime( -1 ), m_currentProcess( 0 )
+{
+ m_archCols.setAutoDelete( true ); // To check: it still leaky here???
+}
+
+Arch::~Arch()
+{
+ if ( m_currentProcess )
+ m_currentProcess->kill();
+}
+
+//Check if a compress utility exists
+void Arch::verifyCompressUtilityIsAvailable( const QString &utility )
+{
+ // see if the utility is in the PATH of the user.
+ QString cmd = KGlobal::dirs()->findExe( utility );
+ m_bArchUtilityIsAvailable = !cmd.isEmpty();
+}
+
+//Check if a utility can uncompress files
+void Arch::verifyUncompressUtilityIsAvailable( const QString &utility )
+{
+ // see if the utility is in the PATH of the user.
+ QString cmd = KGlobal::dirs()->findExe( utility );
+ m_bUnarchUtilityIsAvailable = !cmd.isEmpty();
+}
+
+void Arch::slotOpenExited( KProcess* _kp )
+{
+ int exitStatus = 100; // arbitrary bad exit status
+
+ if ( _kp->normalExit() )
+ exitStatus = _kp->exitStatus();
+
+ if ( exitStatus == 1 )
+ {
+ exitStatus = 0; // because 1 means empty archive - not an error.
+ // Is this a safe assumption?
+ }
+
+ if ( !exitStatus )
+ emit sigOpen( this, true, m_filename,
+ Arch::Extract | Arch::Delete | Arch::Add | Arch::View );
+ else
+ emit sigOpen( this, false, QString::null, 0 );
+
+ delete _kp;
+ _kp = m_currentProcess = 0;
+}
+
+void Arch::slotDeleteExited( KProcess *_kp )
+{
+ bool success = ( _kp->normalExit() && ( _kp->exitStatus() == 0 ) );
+
+ if ( !success )
+ {
+ QApplication::restoreOverrideCursor();
+
+ QString msg = i18n( "The deletion operation failed." );
+
+ if ( !getLastShellOutput().isNull() )
+ {
+ QStringList list = QStringList::split( "\n", getLastShellOutput() );
+ KMessageBox::errorList( m_gui, msg, list );
+ clearShellOutput();
+ }
+ else
+ {
+ KMessageBox::error( m_gui, msg );
+ }
+ }
+
+ emit sigDelete( success );
+ delete _kp;
+ _kp = m_currentProcess = 0;
+}
+
+void Arch::slotExtractExited( KProcess *_kp )
+{
+ bool success = ( _kp->normalExit() && ( _kp->exitStatus() == 0 ) );
+
+ if( !success )
+ {
+ if ( passwordRequired() )
+ {
+ QString msg;
+ if ( !m_password.isEmpty() )
+ msg = i18n("The password was incorrect. ");
+ if (KPasswordDialog::getPassword( m_password, msg+i18n("You must enter a password to extract the file:") ) == KPasswordDialog::Accepted )
+ {
+ delete _kp;
+ _kp = m_currentProcess = 0;
+ clearShellOutput();
+ unarchFileInternal(); // try to extract the file again with a password
+ return;
+ }
+ m_password = "";
+ emit sigExtract( false );
+ delete _kp;
+ _kp = m_currentProcess = 0;
+ return;
+ }
+ else if ( m_password.isEmpty() || _kp->exitStatus() > 1 )
+ {
+ QApplication::restoreOverrideCursor();
+
+ QString msg = i18n( "The extraction operation failed." );
+
+ if ( !getLastShellOutput().isNull() )
+ {
+ //getLastShellOutput() is a QString. errorList is expecting QStringLists to show in multiple lines
+ QStringList list = QStringList::split( "\n", getLastShellOutput() );
+ KMessageBox::errorList( m_gui, msg, list );
+ clearShellOutput();
+ }
+ else
+ {
+ KMessageBox::error( m_gui, msg );
+ }
+ }
+ }
+ m_password = "";
+ delete _kp;
+ _kp = m_currentProcess = 0;
+ emit sigExtract( success );
+}
+
+void Arch::unarchFile( QStringList *fileList, const QString & destDir,
+ bool viewFriendly )
+{
+ m_fileList = fileList;
+ m_destDir = destDir;
+ m_viewFriendly = viewFriendly;
+ unarchFileInternal();
+}
+
+void Arch::slotAddExited( KProcess *_kp )
+{
+ bool success = ( _kp->normalExit() && ( _kp->exitStatus() == 0 ) );
+
+ if( !success )
+ {
+ QApplication::restoreOverrideCursor();
+
+ QString msg = i18n( "The addition operation failed." );
+
+ if ( !getLastShellOutput().isNull() )
+ {
+ QStringList list = QStringList::split( "\n", getLastShellOutput() );
+ KMessageBox::errorList( m_gui, msg, list );
+ clearShellOutput();
+ }
+ else
+ {
+ KMessageBox::error( m_gui, msg );
+ }
+ }
+
+ emit sigAdd( success );
+ delete _kp;
+ _kp = m_currentProcess = 0;
+}
+
+void Arch::slotReceivedOutput( KProcess*, char* data, int length )
+{
+ char c = data[ length ];
+ data[ length ] = '\0';
+
+ appendShellOutputData( data );
+ data[ length ] = c;
+}
+
+
+void Arch::slotReceivedTOC( KProcess*, char* data, int length )
+{
+ char c = data[ length ];
+ data[ length ] = '\0';
+
+ appendShellOutputData( data );
+
+ int lfChar, startChar = 0;
+
+ while ( !m_finished )
+ {
+ for ( lfChar = startChar; data[ lfChar ] != '\n' && lfChar < length;
+ lfChar++ );
+
+ if ( data[ lfChar ] != '\n')
+ break; // We are done all the complete lines
+
+ data[ lfChar ] = '\0';
+ m_buffer.append( data + startChar );
+ data[ lfChar ] = '\n';
+ startChar = lfChar + 1;
+
+ if ( m_headerString.isEmpty() )
+ {
+ processLine( m_buffer );
+ }
+ else if ( m_buffer.find( m_headerString ) == -1 )
+ {
+ if ( m_header_removed && !m_finished )
+ {
+ if ( !processLine( m_buffer ) )
+ {
+ // Have faith - maybe it wasn't a header?
+ m_header_removed = false;
+ m_error = true;
+ }
+ }
+ }
+ else if ( !m_header_removed )
+ {
+ m_header_removed = true;
+ }
+ else
+ {
+ m_finished = true;
+ }
+
+ m_buffer = "";
+ }
+
+ if ( !m_finished )
+ m_buffer.append( data + startChar); // Append what's left of the buffer
+
+ data[ length ] = c;
+}
+
+bool Arch::processLine( const QCString &line )
+{
+ QString columns[ 11 ];
+ unsigned int pos = 0;
+ int strpos, len;
+
+ // Go through our columns, try to pick out data, return silently on failure
+ for ( QPtrListIterator <ArchColumns>col( m_archCols ); col.current(); ++col )
+ {
+ ArchColumns *curCol = *col;
+
+ strpos = curCol->pattern.search( line, pos );
+ len = curCol->pattern.matchedLength();
+
+ if ( ( strpos == -1 ) || ( len > curCol->maxLength ) )
+ {
+ if ( curCol->optional )
+ continue; // More?
+ else
+ {
+ kdDebug(1601) << "processLine failed to match critical column" << endl;
+ return false;
+ }
+ }
+
+ pos = strpos + len;
+
+ columns[curCol->colRef] = QString::fromLocal8Bit( line.mid(strpos, len) );
+ }
+
+
+ if ( m_dateCol >= 0 )
+ {
+ QString year = ( m_repairYear >= 0 ) ?
+ ArkUtils::fixYear( columns[ m_repairYear ].ascii())
+ : columns[ m_fixYear ];
+ QString month = ( m_repairMonth >= 0 ) ?
+ QString( "%1" )
+ .arg( ArkUtils::getMonth( columns[ m_repairMonth ].ascii() ) )
+ : columns[ m_fixMonth ];
+ QString timestamp = QString::fromLatin1( "%1-%2-%3 %4" )
+ .arg( year )
+ .arg( month )
+ .arg( columns[ m_fixDay ] )
+ .arg( columns[ m_fixTime ] );
+
+ columns[ m_dateCol ] = timestamp;
+ }
+
+ QStringList list;
+
+ for ( int i = 0; i < m_numCols; ++i )
+ {
+ list.append( columns[ i ] );
+ }
+
+ m_gui->fileList()->addItem( list ); // send the entry to the GUI
+
+ return true;
+}
+
+
+Arch *Arch::archFactory( ArchType aType,
+ ArkWidget *parent, const QString &filename,
+ const QString &openAsMimeType )
+{
+ switch( aType )
+ {
+ case TAR_FORMAT:
+ return new TarArch( parent, filename, openAsMimeType );
+
+ case ZIP_FORMAT:
+ return new ZipArch( parent, filename );
+
+ case LHA_FORMAT:
+ return new LhaArch( parent, filename );
+
+ case COMPRESSED_FORMAT:
+ return new CompressedFile( parent, filename, openAsMimeType );
+
+ case ZOO_FORMAT:
+ return new ZooArch( parent, filename );
+
+ case RAR_FORMAT:
+ return new RarArch( parent, filename );
+
+ case AA_FORMAT:
+ return new ArArch( parent, filename );
+
+ case SEVENZIP_FORMAT:
+ return new SevenZipArch( parent, filename );
+
+ case ACE_FORMAT:
+ return new AceArch( parent, filename );
+
+ case UNKNOWN_FORMAT:
+ default:
+ return 0;
+ }
+}
+#include "arch.moc"
diff --git a/ark/arch.h b/ark/arch.h
new file mode 100644
index 0000000..1a38a2c
--- /dev/null
+++ b/ark/arch.h
@@ -0,0 +1,221 @@
+/*
+
+ ark -- archiver for the KDE project
+
+ Copyright (C)
+
+ 1997-1999: Rob Palmbos palm9744@kettering.edu
+ 1999: Francois-Xavier Duranceau duranceau@kde.org
+ 1999-2000: Corel Corporation (author: Emily Ezust, emilye@corel.com)
+ 2001: Corel Corporation (author: Michael Jarrett, michaelj@corel.com)
+
+ 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.
+
+ This program 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 program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+*/
+
+/* The following class is the base class for all of the archive types.
+ * In order for it to work properly with the KProcess, you have to
+ * connect the ProcessExited signal appropriately before spawning
+ * the core operations. Then the signal that the process exited can
+ * be intercepted by the viewer (in ark, ArkWidget) and dealt with
+ * appropriately. See LhaArch or ZipArch for a good model. Don't use
+ * TarArch or CompressedFile as models - they're too complicated!
+ *
+ * Don't forget to set m_archiver_program and m_unarchiver_program
+ * and add a call to
+ * verifyUtilityIsAvailable(m_archiver_program, m_unarchiver_program);
+ * in the constructor of your class. It's OK to leave out the second argument.
+ *
+ * To add a new archive type:
+ * 1. Create a new header file and a source code module
+ * 2. Add an entry to the ArchType enum in arch.h.
+ * 3. Add appropriate types to buildFormatInfo() in archiveformatinfo.cpp
+ * and archFactory() in arch.cpp
+ */
+
+
+#ifndef ARCH_H
+#define ARCH_H
+
+#include <qobject.h>
+#include <qptrlist.h> // Some very annoying hackery in arkwidgetpart
+#include <qregexp.h>
+#include <qstring.h>
+#include <kurl.h>
+#include <qpair.h>
+
+class QCString;
+class QStringList;
+class KProcess;
+
+class FileListView;
+class ArkWidget;
+
+enum ArchType { UNKNOWN_FORMAT, ZIP_FORMAT, TAR_FORMAT, AA_FORMAT,
+ LHA_FORMAT, RAR_FORMAT, ZOO_FORMAT, COMPRESSED_FORMAT,
+ SEVENZIP_FORMAT, ACE_FORMAT };
+
+typedef QValueList< QPair< QString, Qt::AlignmentFlags > > ColumnList;
+
+/**
+ * Pure virtual base class for archives - provides a framework as well as
+ * useful common functionality.
+ */
+class Arch : public QObject
+{
+ Q_OBJECT
+
+ protected:
+ /**
+ * A struct representing column data. This makes it possible to abstract
+ * archive output, and save writing the same function for every archive
+ * type. It is also much more robust than sscanf (which was breaking).
+ */
+ struct ArchColumns
+ {
+ int colRef; // Which column to load to in processLine
+ QRegExp pattern;
+ int maxLength;
+ bool optional;
+
+ ArchColumns( int col, QRegExp reg, int length = 64, bool opt = false );
+ };
+
+ public:
+ Arch( ArkWidget *_viewer, const QString & _fileName );
+ virtual ~Arch();
+
+ virtual void open() = 0;
+ virtual void create() = 0;
+ virtual void remove( QStringList * ) = 0;
+
+ virtual void addFile( const QStringList & ) = 0;
+ virtual void addDir( const QString & ) = 0;
+
+ // unarch the files in m_fileList or all files if m_fileList is empty.
+ // if m_destDir is empty, abort with error.
+ // m_viewFriendly forces certain options like directory junking required by view/edit
+ virtual void unarchFileInternal() = 0;
+ // returns true if a password is required
+ virtual bool passwordRequired() { return false; }
+
+ void unarchFile( QStringList *, const QString & _destDir,
+ bool viewFriendly = false );
+
+ QString fileName() const { return m_filename; }
+
+ enum EditProperties{ Add = 1, Delete = 2, Extract = 4,
+ View = 8, Integrity = 16 };
+
+ // is the archive readonly?
+ bool isReadOnly() { return m_bReadOnly; }
+ void setReadOnly( bool bVal ) { m_bReadOnly = bVal; }
+
+ bool isError() { return m_error; }
+ void resetError() { m_error = false; }
+
+ // check to see if the utility exists in the PATH of the user
+ void verifyUtilityIsAvailable( const QString &,
+ const QString & = QString::null );
+
+ void verifyCompressUtilityIsAvailable( const QString &utility );
+
+ void verifyUncompressUtilityIsAvailable( const QString &utility );
+
+ bool archUtilityIsAvailable() { return m_bArchUtilityIsAvailable; }
+
+ bool unarchUtilityIsAvailable() { return m_bUnarchUtilityIsAvailable; }
+
+ QString getArchUtility() { return m_archiver_program; }
+
+ QString getUnarchUtility() { return m_unarchiver_program; }
+
+ void appendShellOutputData( const char * data ) { m_lastShellOutput.append( QString::fromLocal8Bit( data ) ); }
+ void clearShellOutput() { m_lastShellOutput.truncate( 0 ); }
+ const QString& getLastShellOutput() const { return m_lastShellOutput; }
+
+ static Arch *archFactory( ArchType aType, ArkWidget *parent,
+ const QString &filename,
+ const QString &openAsMimeType = QString::null );
+
+ protected slots:
+ void slotOpenExited( KProcess* );
+ void slotExtractExited( KProcess* );
+ void slotDeleteExited( KProcess* );
+ void slotAddExited( KProcess* );
+
+ void slotReceivedOutput( KProcess *, char*, int );
+
+ virtual bool processLine( const QCString &line );
+ virtual void slotReceivedTOC( KProcess *, char *, int );
+
+ signals:
+ void sigOpen( Arch * archive, bool success, const QString &filename, int );
+ void sigCreate( Arch *, bool, const QString &, int );
+ void sigDelete( bool );
+ void sigExtract( bool );
+ void sigAdd( bool );
+ void headers( const ColumnList& columns );
+
+ protected: // data
+ QString m_filename;
+ QString m_lastShellOutput;
+ QCString m_buffer;
+ ArkWidget *m_gui;
+ bool m_bReadOnly; // for readonly archives
+ bool m_error;
+
+ // lets tar delete unsuccessfully before adding without confusing the user
+ bool m_bNotifyWhenDeleteFails;
+
+ // set to whether if the compressing utility is in the user's PATH
+ bool m_bArchUtilityIsAvailable;
+
+ // set to whether if the uncompressing utility is in the user's PATH
+ bool m_bUnarchUtilityIsAvailable;
+
+ QString m_archiver_program;
+ QString m_unarchiver_program;
+
+ // Archive parsing information
+ QCString m_headerString;
+ bool m_header_removed, m_finished;
+ QPtrList<ArchColumns> m_archCols;
+ int m_numCols, m_dateCol, m_fixYear, m_fixMonth, m_fixDay, m_fixTime;
+ int m_repairYear, m_repairMonth, m_repairTime;
+ KProcess *m_currentProcess;
+ QStringList *m_fileList;
+ QString m_destDir;
+ bool m_viewFriendly;
+ QCString m_password;
+};
+
+// Columns
+// don't forget to change common_texts.cpp if you change something here
+#define FILENAME_COLUMN qMakePair( i18n(" Filename "), Qt::AlignLeft )
+#define PERMISSION_COLUMN qMakePair( i18n(" Permissions "), Qt::AlignLeft )
+#define OWNER_GROUP_COLUMN qMakePair( i18n(" Owner/Group "), Qt::AlignLeft )
+#define SIZE_COLUMN qMakePair( i18n(" Size "), Qt::AlignRight )
+#define TIMESTAMP_COLUMN qMakePair( i18n(" Timestamp "), Qt::AlignRight )
+#define LINK_COLUMN qMakePair( i18n(" Link "), Qt::AlignLeft )
+#define PACKED_COLUMN qMakePair( i18n(" Size Now "), Qt::AlignRight )
+#define RATIO_COLUMN qMakePair( i18n(" Ratio "), Qt::AlignRight )
+#define CRC_COLUMN qMakePair( i18n("Cyclic Redundancy Check"," CRC "), Qt::AlignLeft )
+#define METHOD_COLUMN qMakePair( i18n(" Method "), Qt::AlignLeft )
+#define VERSION_COLUMN qMakePair( i18n(" Version "), Qt::AlignLeft )
+#define OWNER_COLUMN qMakePair( i18n(" Owner "), Qt::AlignLeft )
+#define GROUP_COLUMN qMakePair( i18n(" Group "), Qt::AlignLeft )
+
+#endif /* ARCH_H */
diff --git a/ark/archiveformatdlg.cpp b/ark/archiveformatdlg.cpp
new file mode 100644
index 0000000..be046fb
--- /dev/null
+++ b/ark/archiveformatdlg.cpp
@@ -0,0 +1,71 @@
+/*
+ ark -- archiver for the KDE project
+
+ Copyright (C) 2003: Georg Robbers <Georg.Robbers@urz.uni-hd.de>
+
+ 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.
+
+ This program 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 program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+*/
+
+#include "archiveformatdlg.h"
+#include "archiveformatinfo.h"
+#include "arch.h"
+
+#include <klocale.h>
+
+#include <qlabel.h>
+#include <qvbox.h>
+
+ArchiveFormatDlg::ArchiveFormatDlg( QWidget * parent, const QString & defaultType )
+ :KDialogBase( parent, "archiveformatdialog", true,
+ i18n( "Choose Archive Format" ),
+ KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok),
+ m_combo( 0 )
+{
+ QString defaultDescription = ArchiveFormatInfo::self()->descriptionForMimeType( defaultType );
+ QString text;
+ if ( defaultDescription.isNull() )
+ text = i18n( "This file appears to be of type %1,\n"
+ "which is not a supported archive format.\n"
+ "In order to proceed, please choose the format\n"
+ "of the file." ).arg( defaultType );
+ else
+ text = i18n( "You are about to open a file that has a non-standard extension.\n"
+ "Ark has detected the format: %1\n"
+ "If this is not correct, please choose "
+ "the appropriate format." ).arg( defaultDescription );
+
+ QVBox * page = makeVBoxMainWidget();
+
+ QLabel * label;
+ label = new QLabel( text, page );
+
+ m_combo = new KComboBox( page );
+ QStringList list = ArchiveFormatInfo::self()->allDescriptions();
+ list.sort();
+ m_combo->insertStringList( list );
+ m_combo->setCurrentItem( list.findIndex( defaultDescription ) );
+}
+
+QString ArchiveFormatDlg::mimeType()
+{
+ if (m_combo && !m_combo->currentText().isEmpty())
+ return ArchiveFormatInfo::self()->mimeTypeForDescription( m_combo->currentText() );
+ else
+ return QString();
+}
+
+#include "archiveformatdlg.moc"
+
diff --git a/ark/archiveformatdlg.h b/ark/archiveformatdlg.h
new file mode 100644
index 0000000..c8a2e46
--- /dev/null
+++ b/ark/archiveformatdlg.h
@@ -0,0 +1,39 @@
+/*
+
+ ark -- archiver for the KDE project
+
+ Copyright (C) 2003: Georg Robbers <Georg.Robbers@urz.uni-hd.de>
+
+ 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.
+
+ This program 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 program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+*/
+#ifndef ARCHIVEFORMATDLG_H
+#define ARCHIVEFORMATDLG_H
+
+#include <kdialogbase.h>
+#include <kcombobox.h>
+
+class ArchiveFormatDlg: public KDialogBase
+{
+ Q_OBJECT
+public:
+ ArchiveFormatDlg( QWidget * parent, const QString & defaultType );
+ QString mimeType();
+
+private:
+ KComboBox * m_combo;
+};
+#endif // ARCHIVEFORMATDLG_H
+
diff --git a/ark/archiveformatinfo.cpp b/ark/archiveformatinfo.cpp
new file mode 100644
index 0000000..f2ac14d
--- /dev/null
+++ b/ark/archiveformatinfo.cpp
@@ -0,0 +1,278 @@
+/*
+
+ ark -- archiver for the KDE project
+
+ Copyright (C) 2003 Georg Robbers <Georg.Robbers@urz.uni-hd.de>
+
+ 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.
+
+ This program 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 program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+*/
+
+#include "arch.h"
+#include "archiveformatinfo.h"
+#include "settings.h"
+
+#include <klocale.h>
+#include <kdebug.h>
+#include <kdesktopfile.h>
+#include <kfilterdev.h>
+
+#include <qfile.h>
+
+ArchiveFormatInfo * ArchiveFormatInfo::m_pSelf = 0;
+
+ArchiveFormatInfo::ArchiveFormatInfo()
+ :m_lastExtensionUnknown( false )
+{
+ buildFormatInfos();
+}
+
+ArchiveFormatInfo * ArchiveFormatInfo::self()
+{
+ if ( !m_pSelf )
+ m_pSelf = new ArchiveFormatInfo();
+ return m_pSelf;
+}
+
+void ArchiveFormatInfo::buildFormatInfos()
+{
+ addFormatInfo( TAR_FORMAT, "application/x-tgz", ".tar.gz" );
+ addFormatInfo( TAR_FORMAT, "application/x-tzo", ".tar.lzo" );
+ addFormatInfo( TAR_FORMAT, "application/x-tarz", ".tar.z" );
+ addFormatInfo( TAR_FORMAT, "application/x-tbz", ".tar.bz2" );
+ addFormatInfo( TAR_FORMAT, "application/x-tbz2", ".tar.bz2" );
+ // x-tar as the last one to get its comment for all the others, too
+ addFormatInfo( TAR_FORMAT, "application/x-tar", ".tar" );
+
+ addFormatInfo( LHA_FORMAT, "application/x-lha", ".lha" );
+
+ addFormatInfo( ZIP_FORMAT, "application/x-jar", ".jar" );
+ addFormatInfo( ZIP_FORMAT, "application/x-zip", ".zip" );
+ addFormatInfo( ZIP_FORMAT, "application/x-zip-compressed", ".zip" );
+
+ addFormatInfo( COMPRESSED_FORMAT, "application/x-gzip", ".gz" );
+ addFormatInfo( COMPRESSED_FORMAT, "application/x-bzip", ".bz" );
+ addFormatInfo( COMPRESSED_FORMAT, "application/x-bzip2", ".bz2" );
+ addFormatInfo( COMPRESSED_FORMAT, "application/x-lzop", ".lzo" );
+ addFormatInfo( COMPRESSED_FORMAT, "application/x-compress", ".Z" );
+ find( COMPRESSED_FORMAT ).description = i18n( "Compressed File" );
+
+ addFormatInfo( ZOO_FORMAT, "application/x-zoo", ".zoo" );
+
+ addFormatInfo( RAR_FORMAT, "application/x-rar", ".rar" );
+ addFormatInfo( RAR_FORMAT, "application/x-rar-compressed", ".rar" );
+
+ addFormatInfo( AA_FORMAT, "application/x-deb", ".deb" );
+ addFormatInfo( AA_FORMAT, "application/x-archive",".a" );
+
+ addFormatInfo( SEVENZIP_FORMAT, "application/x-7z", ".7z" );
+
+ if ( ArkSettings::aceSupport() )
+ addFormatInfo( ACE_FORMAT, "application/x-ace", ".ace" );
+}
+
+void ArchiveFormatInfo::addFormatInfo( ArchType type, QString mime, QString stdExt )
+{
+ FormatInfo & info = find( type );
+
+ KDesktopFile * desktopFile = new KDesktopFile( mime + ".desktop", true, "mime" );
+ if( !desktopFile )
+ kdWarning( 1601 ) << "MimeType " << mime << " seems to be missing." << endl;
+ KMimeType mimeType( desktopFile );
+ info.mimeTypes.append( mimeType.name() );
+ info.extensions += mimeType.patterns();
+ info.defaultExtensions += stdExt;
+ info.allDescriptions.append( mimeType.comment() );
+ info.description = mimeType.comment();
+
+ delete desktopFile;
+}
+
+
+QString ArchiveFormatInfo::filter()
+{
+ QStringList allExtensions;
+ QString filter;
+ InfoList::Iterator it;
+ for ( it = m_formatInfos.begin(); it != m_formatInfos.end(); ++it )
+ {
+ allExtensions += (*it).extensions;
+ filter += "\n" + (*it).extensions.join( " " ) + '|' + (*it).description;
+ }
+ return allExtensions.join( " " ) + '|' + i18n( "All Valid Archives\n" )
+ + "*|" + i18n( "All Files" )
+ + filter;
+}
+
+const QStringList ArchiveFormatInfo::supportedMimeTypes( bool includeCompressed )
+{
+ QStringList list;
+
+ InfoList::Iterator end = m_formatInfos.end();
+ for ( InfoList::Iterator it = m_formatInfos.begin(); it != end; ++it )
+ {
+ if ( includeCompressed || ( *it ).type != COMPRESSED_FORMAT )
+ {
+ list += ( *it ).mimeTypes;
+ }
+ }
+
+ return list;
+}
+
+QStringList ArchiveFormatInfo::allDescriptions()
+{
+ QStringList descriptions;
+ InfoList::Iterator it;
+ for ( it = m_formatInfos.begin(); it != m_formatInfos.end(); ++it )
+ descriptions += (*it).allDescriptions;
+ return descriptions;
+}
+
+ArchiveFormatInfo::FormatInfo & ArchiveFormatInfo::find( ArchType type )
+{
+ InfoList::Iterator it = m_formatInfos.begin();
+ for( ; it != m_formatInfos.end(); ++it )
+ if( (*it).type == type )
+ return (*it);
+
+ FormatInfo info;
+ info.type = type;
+ return ( *m_formatInfos.append( info ) );
+}
+
+ArchType ArchiveFormatInfo::archTypeByExtension( const QString & archname )
+{
+ InfoList::Iterator it = m_formatInfos.begin();
+ QStringList::Iterator ext;
+ for( ; it != m_formatInfos.end(); ++it )
+ {
+ ext = (*it).extensions.begin();
+ for( ; ext != (*it).extensions.end(); ++ext )
+ if( archname.endsWith( (*ext).remove( '*' ) ) )
+ return (*it).type;
+ }
+ return UNKNOWN_FORMAT;
+}
+
+ArchType ArchiveFormatInfo::archTypeForMimeType( const QString & mimeType )
+{
+ InfoList::Iterator it = m_formatInfos.begin();
+ for( ; it != m_formatInfos.end(); ++it )
+ {
+ int index = (*it).mimeTypes.findIndex( mimeType );
+ if( index != -1 )
+ return (*it).type;
+ }
+ return UNKNOWN_FORMAT;
+}
+
+ArchType ArchiveFormatInfo::archTypeForURL( const KURL & url )
+{
+ m_lastExtensionUnknown = false;
+
+ if( url.isEmpty() )
+ return UNKNOWN_FORMAT;
+
+ if( !QFile::exists( url.path() ) )
+ return archTypeByExtension( url.path() );
+
+ QString mimeType = KMimeType::findByURL( url, 0, true, true )->name();
+ kdDebug( 1601 ) << "find by url: " << mimeType << endl;
+ if( mimeType == KMimeType::defaultMimeType() )
+ {
+ m_lastExtensionUnknown = true;
+ mimeType = KMimeType::findByFileContent( url.path() )->name();
+ }
+
+ ArchType archType = archTypeForMimeType( mimeType );
+ if ( archType == UNKNOWN_FORMAT )
+ m_lastExtensionUnknown = true;
+
+ return archType;
+}
+
+
+QString ArchiveFormatInfo::findMimeType( const KURL & url )
+{
+ QString mimeType = KMimeType::findByURL( url )->name();
+ if ( mimeType != "application/x-bzip2" && mimeType != "application/x-gzip" )
+ return mimeType;
+
+ QIODevice * dev = KFilterDev::deviceForFile( url.path(), mimeType );
+ if ( !dev )
+ return mimeType;
+
+ char buffer[ 0x200 ];
+
+ dev->open( IO_ReadOnly );
+ Q_LONG n = dev->readBlock( buffer, 0x200 );
+ delete dev;
+
+ if ( n == 0x200 && buffer[0] != 0 && !strncmp(buffer + 257, "ustar", 5) )
+ {
+ if (mimeType == "application/x-bzip2")
+ return "application/x-tbz";
+ else
+ return "application/x-tgz";
+ }
+
+ return mimeType;
+}
+
+QString ArchiveFormatInfo::mimeTypeForDescription( const QString & description )
+{
+ InfoList::Iterator it = m_formatInfos.begin();
+ int index;
+ for( ; it != m_formatInfos.end(); ++it )
+ {
+ index = (*it).allDescriptions.findIndex( description );
+ if ( index != -1 )
+ return (* (*it).mimeTypes.at( index ) );
+ }
+ return QString::null;
+}
+
+QString ArchiveFormatInfo::descriptionForMimeType( const QString & mimeType )
+{
+ InfoList::Iterator it = m_formatInfos.begin();
+ int index;
+ for( ; it != m_formatInfos.end(); ++it )
+ {
+ index = (*it).mimeTypes.findIndex( mimeType );
+ if ( index != -1 )
+ return (* (*it).allDescriptions.at( index ) );
+ }
+ return QString::null;
+}
+
+QString ArchiveFormatInfo::defaultExtension( const QString & mimeType )
+{
+ InfoList::Iterator it = m_formatInfos.begin();
+ int index;
+ for( ; it != m_formatInfos.end(); ++it )
+ {
+ index = (*it).mimeTypes.findIndex( mimeType );
+ if ( index != -1 )
+ return (* (*it).defaultExtensions.at( index ) );
+ }
+ return QString::null;
+}
+
+bool ArchiveFormatInfo::wasUnknownExtension()
+{
+ return m_lastExtensionUnknown;
+}
+
diff --git a/ark/archiveformatinfo.h b/ark/archiveformatinfo.h
new file mode 100644
index 0000000..5682a11
--- /dev/null
+++ b/ark/archiveformatinfo.h
@@ -0,0 +1,73 @@
+/*
+
+ ark -- archiver for the KDE project
+
+ Copyright (C) 2003 Georg Robbers <Georg.Robbers@urz.uni-hd.de>
+
+ 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.
+
+ This program 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 program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+*/
+
+#ifndef ARCHIVEFORMATINFO_H
+#define ARCHIVEFORMATINFO_H
+
+#include "arch.h"
+#include <kmimetype.h>
+
+class ArchiveFormatInfo
+{
+private:
+ ArchiveFormatInfo();
+
+public:
+ static ArchiveFormatInfo * self();
+ QString filter();
+ const QStringList supportedMimeTypes( bool includeCompressed = true );
+ QStringList allDescriptions();
+ ArchType archTypeForMimeType( const QString & mimeType );
+ ArchType archTypeByExtension( const QString & archname );
+ ArchType archTypeForURL( const KURL & url );
+ QString mimeTypeForDescription( const QString & description );
+ QString findMimeType( const KURL & url );
+ QString descriptionForMimeType( const QString & mimeType );
+ QString defaultExtension( const QString & mimeType );
+ bool wasUnknownExtension();
+
+private:
+ void buildFormatInfos();
+ void addFormatInfo( ArchType type, QString mime, QString stdExt );
+
+ struct FormatInfo
+ {
+ QStringList extensions;
+ QStringList mimeTypes;
+ QStringList allDescriptions;
+ QStringList defaultExtensions;
+ QString description;
+ enum ArchType type;
+ };
+
+ FormatInfo & find ( ArchType type );
+
+ typedef QValueList<FormatInfo> InfoList;
+ InfoList m_formatInfos;
+
+ bool m_lastExtensionUnknown;
+
+ static ArchiveFormatInfo * m_pSelf;
+};
+
+#endif // ARCHIVEFORMATINFO_H
+
diff --git a/ark/ark.desktop b/ark/ark.desktop
new file mode 100644
index 0000000..d3615fe
--- /dev/null
+++ b/ark/ark.desktop
@@ -0,0 +1,87 @@
+[Desktop Entry]
+MimeType=application/x-gzip;application/x-lha;application/x-tar;application/x-tgz;application/x-tbz;application/x-tbz2;application/x-zip;application/zip;application/x-bzip;application/x-tzo;application/x-lzop;application/x-rar;application/x-zoo;application/x-tarz;application/x-archive;application/x-bzip2;application/x-jar;application/x-deb;application/x-ace;application/x-7z;application/x-arc;application/x-arj;application/x-compress;application/x-cpio;application/x-pak;application/x-zip-compressed
+GenericName=Archiving Tool
+GenericName[af]=Argiveer Program
+GenericName[ar]=أداة أرشفة
+GenericName[bg]=Работа с архиви
+GenericName[br]=Ostilh merañ an Dielloù
+GenericName[bs]=Alat za arhiviranje
+GenericName[ca]=Eina d'arxivament
+GenericName[cs]=Archivační nástroj
+GenericName[cy]=Erfyn Archifo
+GenericName[da]=Arkiveringsværktøj
+GenericName[de]=Archivprogramm
+GenericName[el]=Εργαλείο αρχειοθέτησης
+GenericName[eo]=Arĥivilo
+GenericName[es]=Archivador
+GenericName[et]=Arhiivide haldamise rakendus
+GenericName[eu]=Artxibaketa Tresna
+GenericName[fa]=ابزار بایگانی
+GenericName[fi]=Pakettienhallintatyökalu
+GenericName[fr]=Outil de manipulation d'archives
+GenericName[ga]=Uirlis Chartlannaithe
+GenericName[he]=כלי לניהול ארכיונים
+GenericName[hi]=अभिलेख औज़ार
+GenericName[hr]=Uslužni program za arhiviranje
+GenericName[hu]=Fájltömörítő
+GenericName[is]=Vinna með safnskrár
+GenericName[it]=Strumento di archiviazione
+GenericName[ja]=アーカイバツール
+GenericName[ka]=არქივებთან სამუშაო უტილიტა
+GenericName[kk]=Архивтеу құралы
+GenericName[km]=ឧបករណ៍​ប័ណ្ណសារ
+GenericName[lt]=Archyvavimo priemonė
+GenericName[lv]=Arhivēšanas Rīks
+GenericName[mk]=Алатка за архивирање
+GenericName[ms]=Alatan Pengarkiban
+GenericName[mt]=Għodda tal-arkivji
+GenericName[nb]=Arkiveringsverktøy
+GenericName[nds]=Archivwarktüüch
+GenericName[ne]=उपकरण सङ्ग्रह गर्दै
+GenericName[nl]=Archiefgereedschap
+GenericName[nn]=Arkiveringsverktøy
+GenericName[pa]=ਪੁਰਾਲੇਖ ਸੰਦ
+GenericName[pl]=Narzędzie do archiwizacji
+GenericName[pt]=Ferramenta de Armazenamento
+GenericName[pt_BR]=Ferramenta de Arquivamento
+GenericName[ro]=Utilitar de arhivare
+GenericName[ru]=Архиватор
+GenericName[sk]=Archivačný nástroj
+GenericName[sl]=Orodje za ravnanje z arhivi
+GenericName[sr]=Алат за архивирање
+GenericName[sr@Latn]=Alat za arhiviranje
+GenericName[sv]=Arkiveringsverktyg
+GenericName[ta]=காப்பக கருவி
+GenericName[tg]=Асбобҳои Бойгонӣ
+GenericName[th]=เครื่องมือจัดการแฟ้มบีบอัด
+GenericName[tr]=Arşivleme Aracı
+GenericName[uk]=Засіб роботи з архівами
+GenericName[uz]=Arxivlash vositasi
+GenericName[uz@cyrillic]=Архивлаш воситаси
+GenericName[ven]=Tshishumiswa tsha fhethu huno vhulungelwa hone zwithu zwa kale
+GenericName[vi]=Công cụ nén
+GenericName[wa]=Usteye d' årtchivaedje
+GenericName[xh]=Isixhobo Sokuphatha i Archive
+GenericName[zh_CN]=文件压缩归档工具
+GenericName[zh_TW]=壓縮工具
+GenericName[zu]=Ithuluzi Lomqulu
+Name=Ark
+Name[ar]=أرك
+Name[eo]=Arĥivilo
+Name[hi]=आर्क
+Name[ne]=आर्क
+Name[nso]=Areka
+Name[pa]=ਆਕ
+Name[ta]=ஆர்க்
+Name[th]=อาร์ค
+Exec=ark -caption "%c" %i %m %U
+Icon=ark
+Path=
+DocPath=ark/index.html
+Type=Application
+Terminal=false
+SwallowExec=
+SwallowTitle=
+X-DCOP-ServiceType=Unique
+X-KDE-HasTempFileOption=true
+Categories=Qt;KDE;Utility;X-KDE-Utilities-File;
diff --git a/ark/ark.kcfg b/ark/ark.kcfg
new file mode 100644
index 0000000..1c134a4
--- /dev/null
+++ b/ark/ark.kcfg
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
+ http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
+ <kcfgfile name="arkrc"/>
+ <group name="generic">
+ <entry name="extractionHistory" type="PathList">
+ <label>Last folders used for extraction</label>
+ </entry>
+ <entry name="replaceOnlyWithNewer" type="Bool">
+ <label>Replace old files only with newer files</label>
+ <whatsthis>If this option is enabled and you add filenames that already exist in an archive, only replace the old files if the added files are newer than them</whatsthis>
+ <default>false</default>
+ </entry>
+ <entry name="extractOverwrite" type="Bool">
+ <label>Overwrite files (Zip, Tar, Zoo, Rar)</label>
+ <whatsthis>Overwrite any files that have matching names on disk with the one from the archive</whatsthis>
+ <default>false</default>
+ </entry>
+ </group>
+ <group name="Tar">
+ <entry name="preservePerms" type="Bool">
+ <label>Preserve permissions</label>
+ <whatsthis>Save the user, group, and permission settings on files. Use with care, as this may result in files being extracted that do not belong to any valid user on your computer</whatsthis>
+ <default>false</default>
+ </entry>
+ </group>
+ <group name="Zip">
+ <entry name="forceMSDOS" type="Bool">
+ <label>Force MS-DOS short filenames (Zip)</label>
+ <whatsthis>Force names of files in Zip archives to the DOS 8.3 format</whatsthis>
+ <default>false</default>
+ </entry>
+ <entry name="convertLF2CRLF" type="Bool">
+ <label>Translate LF to DOS CRLF</label>
+ <default>false</default>
+ </entry>
+ <entry name="extractJunkPaths" type="Bool">
+ <label>Ignore folder names (Zip)</label>
+ <whatsthis>Extract all the files into the extraction folder, ignoring any folder structure in the archive.</whatsthis>
+ <default>false</default>
+ </entry>
+ </group>
+ <group name="Rar">
+ <entry name="rarStoreSymlinks" type="Bool">
+ <label>Store symlinks as links (Zip, Rar)</label>
+ <default>true</default>
+ </entry>
+ <entry name="rarRecurseSubdirs" type="Bool">
+ <label>Recursively add subfolders (Zip, Rar)</label>
+ <default>true</default>
+ </entry>
+ <entry name="rarToLower" type="Bool">
+ <label>Convert filenames to lowercase (Zip, Rar)</label>
+ <default>false</default>
+ </entry>
+ <entry name="rarToUpper" type="Bool">
+ <label>Convert filenames to uppercase</label>
+ <default>false</default>
+ </entry>
+ </group>
+ <group name="ark">
+ <entry name="showSearchBar" type="Bool">
+ <label>Show search bar</label>
+ <default>true</default>
+ </entry>
+ <entry name="KonquerorIntegration" type="Bool">
+ <label>Enable Konqueror integration</label>
+ <whatsthis>Enables integration with Konqueror's context menus, letting you easily archive or unarchive files. This option will only work if you have the kdeaddons package installed.</whatsthis>
+ <default>true</default>
+ </entry>
+ <entry name="UseIntegratedViewer" type="Bool">
+ <label>Use integrated viewer</label>
+ <default>true</default>
+ </entry>
+ <entry name="TarExe" type="String">
+ <label>Tar Command</label>
+ <default>tar</default>
+ </entry>
+ <entry name="OpenDestinationFolder" type="Bool">
+ <label>Open destination folder after extraction</label>
+ <default>false</default>
+ </entry>
+ <entry name="aceSupport" type="Bool">
+ <label>Enable experimental support for loading ACE files</label>
+ <default>false</default>
+ </entry>
+ </group>
+</kcfg>
diff --git a/ark/ark_part.cpp b/ark/ark_part.cpp
new file mode 100644
index 0000000..a574217
--- /dev/null
+++ b/ark/ark_part.cpp
@@ -0,0 +1,533 @@
+/*
+ Copyright (C)
+
+ 2001: Macadamian Technologies Inc (author: Jian Huang, jian@macadamian.com)
+ 2003: Georg Robbers <Georg.Robbers@urz.uni-hd.de>
+ 2005: Henrique Pinto <henrique.pinto@kdemail.net>
+
+ 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.
+
+ This program 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 program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+*/
+
+#include "ark_part.h"
+#include "arkfactory.h"
+#include "arkwidget.h"
+#include "settings.h"
+#include "filelistview.h"
+#include "searchbar.h"
+
+#include <kdebug.h>
+#include <kpopupmenu.h>
+#include <kmessagebox.h>
+#include <kaboutdata.h>
+#include <kxmlguifactory.h>
+#include <kstatusbar.h>
+#include <kiconloader.h>
+#include <kio/netaccess.h>
+#include <kpushbutton.h>
+#include <ksqueezedtextlabel.h>
+
+#include <qfile.h>
+#include <qtimer.h>
+
+KAboutData *ArkPart::createAboutData()
+{
+ KAboutData *about = new KAboutData("ark", I18N_NOOP("ark"),
+ "1.0",
+ I18N_NOOP("Ark KParts Component"),
+ KAboutData::License_GPL,
+ I18N_NOOP( "(c) 1997-2003, The Various Ark Developers" ));
+ about->addAuthor("Robert Palmbos",0, "palm9744@kettering.edu");
+ about->addAuthor("Francois-Xavier Duranceau",0, "duranceau@kde.org");
+ about->addAuthor("Corel Corporation (author: Emily Ezust)",0,
+ "emilye@corel.com");
+ about->addAuthor("Corel Corporation (author: Michael Jarrett)", 0,
+ "michaelj@corel.com");
+ about->addAuthor("Jian Huang");
+ about->addAuthor( "Roberto Teixeira", 0, "maragato@kde.org" );
+
+ return about;
+}
+
+
+
+ArkPart::ArkPart( QWidget *parentWidget, const char * /*widgetName*/, QObject *parent,
+ const char *name, const QStringList &, bool readWrite )
+ : KParts::ReadWritePart(parent, name)
+{
+ kdDebug(1601)<<"ArkPart::ArkPart"<<endl;
+ setInstance(ArkFactory::instance());
+ awidget = new ArkWidget( parentWidget, "ArkWidget" );
+
+ setWidget(awidget);
+ connect( awidget, SIGNAL( fixActions() ), this, SLOT( fixEnables() ) );
+ connect( awidget, SIGNAL( disableAllActions() ), this, SLOT( disableActions() ) );
+ connect( awidget, SIGNAL( signalFilePopup( const QPoint& ) ), this, SLOT( slotFilePopup( const QPoint& ) ) );
+ connect( awidget, SIGNAL( setWindowCaption( const QString & ) ), this, SIGNAL( setWindowCaption( const QString & ) ) );
+ connect( awidget, SIGNAL( removeRecentURL( const KURL & ) ), this, SIGNAL( removeRecentURL( const KURL & ) ) );
+ connect( awidget, SIGNAL( addRecentURL( const KURL & ) ), this, SIGNAL( addRecentURL( const KURL & ) ) );
+
+ if( readWrite )
+ setXMLFile( "ark_part.rc" );
+ else
+ {
+ setXMLFile( "ark_part_readonly.rc" );
+ }
+ setReadWrite( readWrite );
+
+ setupActions();
+
+ m_ext = new ArkBrowserExtension( this, "ArkBrowserExtension" );
+ connect( awidget, SIGNAL( openURLRequest( const KURL & ) ),
+ m_ext, SLOT( slotOpenURLRequested( const KURL & ) ) );
+
+ m_bar = new ArkStatusBarExtension( this );
+ connect( awidget, SIGNAL( setStatusBarText( const QString & ) ), m_bar,
+ SLOT( slotSetStatusBarText( const QString & ) ) );
+ connect( awidget, SIGNAL( setStatusBarSelectedFiles( const QString & ) ), m_bar,
+ SLOT( slotSetStatusBarSelectedFiles( const QString & ) ) );
+ connect( awidget, SIGNAL( setBusy( const QString & ) ), m_bar,
+ SLOT( slotSetBusy( const QString & ) ) );
+ connect( awidget, SIGNAL( setReady() ), m_bar,
+ SLOT( slotSetReady() ) );
+ connect( this, SIGNAL( started(KIO::Job*) ), SLOT( transferStarted(KIO::Job*) ) );
+ connect( this, SIGNAL( completed() ), SLOT( transferCompleted() ) );
+ connect( this, SIGNAL( canceled(const QString&) ),
+ SLOT( transferCanceled(const QString&) ) );
+
+ setProgressInfoEnabled( false );
+}
+
+ArkPart::~ArkPart()
+{}
+
+void
+ArkPart::setupActions()
+{
+ addFileAction = new KAction(i18n("Add &File..."), "ark_addfile", 0, awidget,
+ SLOT(action_add()), actionCollection(), "addfile");
+
+ addDirAction = new KAction(i18n("Add Folde&r..."), "ark_adddir", 0, awidget,
+ SLOT(action_add_dir()), actionCollection(), "adddir");
+
+ extractAction = new KAction(i18n("E&xtract..."), "ark_extract", 0, awidget,
+ SLOT(action_extract()), actionCollection(), "extract");
+
+ deleteAction = new KAction(i18n("De&lete"), "ark_delete", KShortcut(Qt::Key_Delete), awidget,
+ SLOT(action_delete()), actionCollection(), "delete");
+
+ viewAction = new KAction(i18n("to view something","&View"), "ark_view", 0, awidget,
+ SLOT(action_view()), actionCollection(), "view");
+
+
+ openWithAction = new KAction(i18n("&Open With..."), 0, awidget,
+ SLOT(slotOpenWith()), actionCollection(), "open_with");
+
+
+ editAction = new KAction(i18n("Edit &With..."), 0, awidget,
+ SLOT(action_edit()), actionCollection(), "edit");
+
+ selectAllAction = KStdAction::selectAll(awidget->fileList(), SLOT(selectAll()), actionCollection(), "select_all");
+
+ deselectAllAction = new KAction(i18n("&Unselect All"), 0, awidget->fileList(), SLOT(unselectAll()), actionCollection(), "deselect_all");
+
+ invertSelectionAction = new KAction(i18n("&Invert Selection"), 0, awidget->fileList(), SLOT(invertSelection()), actionCollection(), "invert_selection");
+
+ saveAsAction = KStdAction::saveAs(this, SLOT(file_save_as()), actionCollection());
+
+ //KStdAction::preferences(awidget, SLOT(showSettings()), actionCollection());
+
+ ( void ) new KAction( i18n( "Configure &Ark..." ), "configure" , 0, awidget,
+ SLOT( showSettings() ), actionCollection(), "options_configure_ark" );
+
+
+ showSearchBar = new KToggleAction( i18n( "Show Search Bar" ), KShortcut(), actionCollection(), "options_show_search_bar" );
+ showSearchBar->setCheckedState(i18n("Hide Search Bar"));
+
+ showSearchBar->setChecked( ArkSettings::showSearchBar() );
+
+ connect( showSearchBar, SIGNAL( toggled( bool ) ), awidget, SLOT( slotShowSearchBarToggled( bool ) ) );
+
+ initialEnables();
+}
+
+
+void ArkPart::fixEnables()
+{
+ bool bHaveFiles = ( awidget->getNumFilesInArchive() > 0 );
+ bool bReadOnly = false;
+ bool bAddDirSupported = true;
+ QString extension;
+ if ( awidget->archiveType() == ZOO_FORMAT || awidget->archiveType() == AA_FORMAT
+ || awidget->archiveType() == COMPRESSED_FORMAT)
+ bAddDirSupported = false;
+
+ if (awidget->archive())
+ bReadOnly = awidget->archive()->isReadOnly();
+
+ saveAsAction->setEnabled(bHaveFiles);
+ selectAllAction->setEnabled(bHaveFiles);
+ deselectAllAction->setEnabled(bHaveFiles);
+ invertSelectionAction->setEnabled(bHaveFiles);
+
+ deleteAction->setEnabled(bHaveFiles && awidget->numSelectedFiles() > 0
+ && awidget->archive() && !bReadOnly);
+ addFileAction->setEnabled(awidget->isArchiveOpen() &&
+ !bReadOnly);
+ addDirAction->setEnabled(awidget->isArchiveOpen() &&
+ !bReadOnly && bAddDirSupported);
+ extractAction->setEnabled(bHaveFiles);
+ awidget->searchBar()->setEnabled(bHaveFiles);
+
+ bool b = ( bHaveFiles
+ && (awidget->numSelectedFiles() == 1)
+ && (awidget->fileList()->currentItem()->childCount() == 0)
+ );
+ viewAction->setEnabled( b );
+ openWithAction->setEnabled( b );
+ editAction->setEnabled( b && !bReadOnly ); // You can't edit files in read-only archives
+ emit fixActionState( bHaveFiles );
+}
+
+void ArkPart::initialEnables()
+{
+ saveAsAction->setEnabled( false );
+ selectAllAction->setEnabled(false);
+ deselectAllAction->setEnabled(false);
+ invertSelectionAction->setEnabled(false);
+
+ viewAction->setEnabled(false);
+
+ deleteAction->setEnabled(false);
+ extractAction->setEnabled(false);
+ addFileAction->setEnabled(false);
+ addDirAction->setEnabled(false);
+ openWithAction->setEnabled(false);
+ editAction->setEnabled(false);
+
+ awidget->searchBar()->setEnabled(false);
+}
+
+void ArkPart::disableActions()
+{
+ saveAsAction->setEnabled(false);
+ selectAllAction->setEnabled(false);
+ deselectAllAction->setEnabled(false);
+ invertSelectionAction->setEnabled(false);
+
+ viewAction->setEnabled(false);
+ deleteAction->setEnabled(false);
+ extractAction->setEnabled(false);
+ addFileAction->setEnabled(false);
+ addDirAction->setEnabled(false);
+ openWithAction->setEnabled(false);
+ editAction->setEnabled(false);
+ awidget->searchBar()->setEnabled(false);
+}
+
+bool ArkPart::openURL( const KURL & url )
+{
+ awidget->setRealURL( url );
+ return KParts::ReadWritePart::openURL( KIO::NetAccess::mostLocalURL( url, awidget ) );
+}
+
+bool ArkPart::openFile()
+{
+ KURL url;
+ url.setPath( m_file );
+ if( !QFile::exists( m_file ) )
+ {
+ emit setWindowCaption( QString::null );
+ emit removeRecentURL( awidget->realURL() );
+ return false;
+ }
+ emit addRecentURL( awidget->realURL() );
+ awidget->setModified( false );
+ awidget->file_open( url );
+ return true;
+}
+
+void ArkPart::file_save_as()
+{
+ KURL u = awidget->getSaveAsFileName();
+ if ( u.isEmpty() ) // user canceled
+ return;
+
+ if ( !awidget->allowedArchiveName( u ) )
+ awidget->convertTo( u );
+ else if ( awidget->file_save_as( u ) )
+ m_ext->slotOpenURLRequested( u );
+ else
+ kdWarning( 1601 ) << "Save As failed." << endl;
+}
+
+bool ArkPart::saveFile()
+{
+ return true;
+}
+
+bool ArkPart::closeArchive()
+{
+ awidget->file_close();
+ awidget->setModified( false );
+ return ReadWritePart::closeURL();
+}
+
+bool ArkPart::closeURL()
+{
+ if ( !isReadWrite() || !awidget->isModified() || awidget->realURL().isLocalFile() )
+ return closeArchive();
+
+ QString docName = awidget->realURL().prettyURL();
+
+ int res = KMessageBox::warningYesNoCancel( widget(),
+ i18n( "The archive \"%1\" has been modified.\n"
+ "Do you want to save it?" ).arg( docName ),
+ i18n( "Save Archive?" ), KStdGuiItem::save(), KStdGuiItem::discard() );
+
+ switch ( res )
+ {
+ case KMessageBox::Yes :
+ return awidget->file_save_as( awidget->realURL() ) && closeArchive();
+
+ case KMessageBox::No :
+ return closeArchive();
+
+ default : // case KMessageBox::Cancel
+ return false;
+ }
+}
+
+void ArkPart::slotFilePopup( const QPoint &pPoint )
+{
+ if ( factory() )
+ static_cast<KPopupMenu *>(factory()->container("file_popup", this))->popup(pPoint);
+}
+
+void ArkPart::transferStarted( KIO::Job *job )
+{
+ m_job = job;
+
+ m_bar->slotSetBusy( i18n( "Downloading %1..." ).arg( m_url.prettyURL() ),
+ (job != 0), (job != 0) );
+
+ if ( job )
+ {
+ disableActions();
+ connect( job, SIGNAL( percent(KIO::Job*, unsigned long) ),
+ SLOT( progressInformation(KIO::Job*, unsigned long) ) );
+ connect( m_bar->cancelButton(), SIGNAL( clicked() ),
+ SLOT( cancelTransfer() ) );
+ }
+}
+
+void ArkPart::transferCompleted()
+{
+ if ( m_job )
+ {
+ disconnect( m_job, SIGNAL( percent(KIO::Job*, unsigned long) ),
+ this, SLOT( progressInformation(KIO::Job*, unsigned long) ) );
+ m_job = 0;
+ }
+
+ m_bar->slotSetReady();
+}
+
+void ArkPart::transferCanceled( const QString& errMsg )
+{
+ m_job = 0;
+ if ( !errMsg.isEmpty() )
+ {
+ KMessageBox::error( awidget, errMsg );
+ }
+ initialEnables();
+ m_bar->slotSetReady();
+}
+
+void ArkPart::progressInformation( KIO::Job *, unsigned long progress )
+{
+ m_bar->setProgress( progress );
+}
+
+void ArkPart::cancelTransfer()
+{
+ disconnect( m_bar->cancelButton(), SIGNAL( clicked() ),
+ this, SLOT( cancelTransfer() ) );
+ if ( m_job )
+ {
+ m_job->kill( false );
+ transferCanceled( QString() );
+ }
+}
+
+ArkBrowserExtension::ArkBrowserExtension( KParts::ReadOnlyPart * parent, const char * name )
+ : KParts::BrowserExtension( parent, name )
+{
+}
+
+void ArkBrowserExtension::slotOpenURLRequested( const KURL & url )
+{
+ emit openURLRequest( url, KParts::URLArgs() );
+}
+
+ArkStatusBarExtension::ArkStatusBarExtension( KParts::ReadWritePart * parent )
+ : KParts::StatusBarExtension( parent ),
+ m_bBusy( false ),
+ m_pStatusLabelSelect( 0 ),
+ m_pStatusLabelTotal( 0 ),
+ m_pBusyText( 0 ),
+ m_cancelButton( 0 ),
+ m_pProgressBar( 0 ),
+ m_pTimer( 0 )
+{
+}
+
+ArkStatusBarExtension::~ArkStatusBarExtension()
+{
+}
+
+void ArkStatusBarExtension::setupStatusBar()
+{
+ if ( m_pTimer // setup already done
+ || !statusBar() )
+ {
+ return;
+ }
+
+ m_pTimer = new QTimer( this );
+ connect( m_pTimer, SIGNAL( timeout() ), this, SLOT( slotProgress() ) );
+
+ m_pStatusLabelTotal = new KSqueezedTextLabel( statusBar(), "StatusLabelTotal" );
+ m_pStatusLabelTotal->setFrameStyle( QFrame::NoFrame );
+ m_pStatusLabelTotal->setAlignment( AlignRight );
+ m_pStatusLabelTotal->setText( i18n( "Total: 0 files" ) );
+
+ m_pStatusLabelSelect = new QLabel( statusBar(), "StatusLabelSelect" );
+ m_pStatusLabelSelect->setFrameStyle( QFrame::NoFrame );
+ m_pStatusLabelSelect->setAlignment( AlignLeft );
+ m_pStatusLabelSelect->setText(i18n( "0 files selected" ) );
+
+ m_cancelButton = new KPushButton( SmallIcon( "cancel" ), QString(), statusBar(), "CancelButton" );
+
+ addStatusBarItem( m_pStatusLabelSelect, 3000, false );
+ addStatusBarItem( m_pStatusLabelTotal, 3000, false );
+}
+
+void ArkStatusBarExtension::slotSetStatusBarText( const QString & text )
+{
+ if ( !statusBar() )
+ return;
+
+ setupStatusBar();
+ m_pStatusLabelTotal->setText( text );
+}
+
+void ArkStatusBarExtension::slotSetStatusBarSelectedFiles( const QString & text )
+{
+
+ if ( !statusBar() )
+ return;
+
+ setupStatusBar();
+ m_pStatusLabelSelect->setText( text );
+}
+
+void ArkStatusBarExtension::slotSetBusy( const QString & text, bool showCancelButton, bool detailedProgress )
+{
+ if ( m_bBusy || !statusBar() )
+ return;
+
+ setupStatusBar();
+ if ( !m_pBusyText )
+ {
+ m_pBusyText = new QLabel( statusBar() );
+
+ m_pBusyText->setAlignment( AlignLeft );
+ m_pBusyText->setFrameStyle( QFrame::Panel | QFrame::Raised );
+ }
+
+ if ( !m_pProgressBar )
+ {
+ m_pProgressBar = new KProgress( statusBar() );
+ m_pProgressBar->setFixedHeight( m_pBusyText->fontMetrics().height() );
+ }
+
+ if ( !detailedProgress )
+ {
+ m_pProgressBar->setTotalSteps( 0 );
+ m_pProgressBar->setPercentageVisible( false );
+ }
+ else
+ {
+ m_pProgressBar->setTotalSteps(100);
+ m_pProgressBar->setPercentageVisible( true );
+ }
+
+ m_pBusyText->setText( text );
+
+ removeStatusBarItem( m_pStatusLabelSelect );
+ removeStatusBarItem( m_pStatusLabelTotal );
+
+ addStatusBarItem( m_pBusyText, 5, true );
+ addStatusBarItem( m_pProgressBar, 1, true );
+ if ( showCancelButton )
+ {
+ addStatusBarItem( m_cancelButton, 0, true );
+ }
+
+ if ( !detailedProgress )
+ {
+ m_pTimer->start( 200, false );
+ }
+ m_bBusy = true;
+}
+
+void ArkStatusBarExtension::slotSetReady()
+{
+ if ( !m_bBusy || !statusBar() )
+ return;
+
+ setupStatusBar();
+ m_pTimer->stop();
+ m_pProgressBar->setProgress( 0 );
+
+ removeStatusBarItem( m_pBusyText );
+ removeStatusBarItem( m_pProgressBar );
+ removeStatusBarItem( m_cancelButton );
+
+ addStatusBarItem( m_pStatusLabelSelect, 3000, false );
+ addStatusBarItem( m_pStatusLabelTotal, 3000, false );
+
+ m_bBusy = false;
+}
+
+void ArkStatusBarExtension::slotProgress()
+{
+ if ( !statusBar() )
+ return;
+
+ setupStatusBar();
+ m_pProgressBar->setProgress( m_pProgressBar->progress() + 4 );
+}
+
+void ArkStatusBarExtension::setProgress( unsigned long progress )
+{
+ if ( m_pProgressBar && ( m_pProgressBar->totalSteps() != 0 ) )
+ {
+ m_pProgressBar->setProgress( progress );
+ }
+}
+
+#include "ark_part.moc"
diff --git a/ark/ark_part.desktop b/ark/ark_part.desktop
new file mode 100644
index 0000000..e167f26
--- /dev/null
+++ b/ark/ark_part.desktop
@@ -0,0 +1,135 @@
+[Desktop Entry]
+MimeType=application/x-gzip;application/x-lha;application/x-tar;application/x-tgz;application/x-tbz;application/x-tbz2;application/x-zip;application/x-bzip;application/x-tzo;application/x-lzop;application/x-rar;application/x-zoo;application/x-tarz;application/x-archive;application/x-bzip2;application/x-jar;application/x-deb;application/x-ace;application/x-7z;application/x-arc;application/x-arj;application/x-compress;application/x-cpio;application/x-pak
+Comment=Archive Handling Tool
+Comment[af]=Argief Handtering Program
+Comment[ar]=أداة التعامل مع الملفات المضغوطة
+Comment[az]=Arxiv İşləmə Vasitəsi
+Comment[bg]=Работа с архиви
+Comment[br]=Ostilh merañ an dielloù
+Comment[bs]=Uslužni program za arhiviranje
+Comment[ca]=Eina per a treballar amb arxius
+Comment[cs]=Program pro práci s archívy
+Comment[cy]=Erfyn Triniaeth Archif
+Comment[da]=Arkivbehandlingsværktøj
+Comment[de]=Archiv-Verwaltung
+Comment[el]=Εργαλείο χειρισμού αρχειοθηκών
+Comment[eo]=Administrilo por arĥivoj
+Comment[es]=Herramienta para archivos comprimidos
+Comment[et]=Arhiivide haldamise rakendus
+Comment[eu]=Artxiboak Kudeatzeko tresna
+Comment[fa]=ابزار گرداندن بایگانی
+Comment[fi]=Pakettienhallintatyökalu
+Comment[fr]=Outil de manipulation d'archives
+Comment[ga]=Uirlis Láimhseála Cartlainne
+Comment[gl]=Ferramenta de Manexo de Arquivos
+Comment[he]=כלי לניהול ארכיונים
+Comment[hi]=अभिलेख संभाल औज़ार
+Comment[hr]=Uslužni program za arhiviranje
+Comment[hu]=Tömörítóprogram
+Comment[id]=Program bantu menangani archive
+Comment[is]=Vinna með safnskrár
+Comment[it]=Gestione degli archivi
+Comment[ja]=アーカイバツール
+Comment[ka]=არქივებთან სამუშაო ხელსაწყო
+Comment[kk]=Архивпен айналысу құралы
+Comment[km]=ឧបករណ៍​គ្រប់គ្រង​ប័ណ្ណសារ
+Comment[lt]=Archyvo valdymo priemonė
+Comment[lv]=Arhīvu Apstrādes Rīks
+Comment[mk]=Алатка за справување со архивирани датотеки
+Comment[ms]=Alatan Pengendalian Arkib
+Comment[mt]=Għodda biex tuża l-arkivji
+Comment[nb]=Arkivbehandlingsverktøy
+Comment[nds]=En Warktüüch för de Archivpleeg
+Comment[ne]=ह्यान्डलिङ उपकरण सङ्ग्रह गर्नुहोस्
+Comment[nl]=Hulpprogramma voor het beheer van archieven
+Comment[nn]=Verktøy for arkivhandsaming
+Comment[pa]=ਪੁਰਾਲੇਖ ਬਣਾਉਣ ਸੰਦ
+Comment[pl]=Program obsługi archiwów
+Comment[pt]=Programa de gestão de arquivos
+Comment[pt_BR]=Gerenciador de arquivos empacotados
+Comment[ro]=Utilitar de manipulare arhive
+Comment[ru]=Программа работы с архивами
+Comment[sk]=Program na prácu s archívmi
+Comment[sl]=Orodje za ravnanje z arhivi
+Comment[sr]=Алат за руковање архивама
+Comment[sr@Latn]=Alat za rukovanje arhivama
+Comment[sv]=Verktyg för att hantera filarkiv
+Comment[ta]= காப்பகத்தை கையாளும் கருவி
+Comment[tg]=Асбобҳои Дасткории Бойгонӣ
+Comment[th]=เครื่องมือจัดการแฟ้มบีบอัดทั้งหลาย
+Comment[tr]=Arşiv İşleme Aracı
+Comment[uk]=Засіб роботи з архівами
+Comment[uz]=Arxiv uchun vosita
+Comment[uz@cyrillic]=Архив учун восита
+Comment[ven]=Tshishumiswa tshau fara tsha fhethu huno vhulungwa zwa kale
+Comment[vi]=Công cụ xử lí các file nén
+Comment[wa]=Usteye po-z apougnî les årtchives
+Comment[xh]=Isixhobo sokuphatha i Archive
+Comment[zh_CN]=文件压缩归档处理工具
+Comment[zh_TW]=壓縮檔案處理工具
+Comment[zu]=Ithuluzi Lokuphatha Umqulu
+Name=Archiver
+Name[af]=Argifeerder
+Name[ar]=الضاغط
+Name[az]=Arxivci
+Name[br]=Dieller
+Name[bs]=Arhiver
+Name[ca]=Arxivador
+Name[cs]=Archivátor
+Name[cy]=Archifydd
+Name[da]=Arkivbehandler
+Name[de]=Archivprogramm
+Name[el]=Πρόγραμμα αρχειοθέτησης
+Name[eo]=Arĥivilo
+Name[es]=Archivador
+Name[et]=Arhiveerija
+Name[eu]=Artxibalaria
+Name[fa]=بایگانی‌کننده
+Name[fr]=Archiveur
+Name[gl]=Arquivador
+Name[he]=מנהל הארכיונים
+Name[hi]=अभिलेखक
+Name[hr]=Arhiver
+Name[hu]=Ark fájltömörítő
+Name[is]=Skráasafnari
+Name[it]=Utilità di archiviazione
+Name[ja]=アーカイバ
+Name[ka]=არქივარიუსი
+Name[kk]=Архивтегіш
+Name[km]=កម្មវិធី​ប័ណ្ណសារ
+Name[lt]=Archyvatorius
+Name[lv]=Arhivators
+Name[mk]=Архивер
+Name[ms]=Pengarkib
+Name[nb]=Arkivbehandler
+Name[ne]=पुरालेखक
+Name[nl]=Archiefgereedschap
+Name[nn]=Arkiverar
+Name[pa]=ਆਕੀਵਰ
+Name[pl]=Ark
+Name[pt]=Ark
+Name[pt_BR]=Arquivador
+Name[ro]=Arhivator
+Name[ru]=Архиватор
+Name[sk]=Archivátor
+Name[sl]=Arhivar
+Name[sr]=Архивер
+Name[sr@Latn]=Arhiver
+Name[sv]=Arkiverare
+Name[ta]= காப்பகம்
+Name[tg]=Бойгонигар
+Name[th]=อาร์ไคว์ฟเออร์
+Name[tr]=Arşivci
+Name[uk]=Архіватор
+Name[uz]=Arxivlagich
+Name[uz@cyrillic]=Архивлагич
+Name[ven]=Muvhulungi nwa zwithu zwa kale
+Name[vi]=Luư trữ
+Name[wa]=Årtchiveu
+Name[xh]=Umenzi woshicilelo lukawonke-wonke noxwebhu lweMbali
+Name[zh_CN]=压缩存档工具
+Name[zu]=Umqulu
+Icon=ark
+Type=Service
+ServiceTypes=KParts/ReadOnlyPart
+X-KDE-Library=libarkpart
diff --git a/ark/ark_part.h b/ark/ark_part.h
new file mode 100644
index 0000000..b5b7f6f
--- /dev/null
+++ b/ark/ark_part.h
@@ -0,0 +1,148 @@
+/*
+ Copyright (C)
+
+ 2001: Macadamian Technologies Inc (author: Jian Huang, jian@macadamian.com)
+ 2005: Henrique Pinto <henrique.pinto@kdemail.net>
+
+ 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.
+
+ This program 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 program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+*/
+
+#ifndef ARK_PART_H
+#define ARK_PART_H
+
+#include <kparts/part.h>
+#include <kparts/browserextension.h>
+#include <kparts/statusbarextension.h>
+#include <kparts/factory.h>
+#include <kaction.h>
+#include <kprogress.h>
+
+#include <qlabel.h>
+
+class KAboutData;
+class KPushButton;
+
+class ArkWidget;
+
+namespace KIO
+{
+ class Job;
+}
+
+
+class ArkBrowserExtension: public KParts::BrowserExtension
+{
+ Q_OBJECT
+public:
+ ArkBrowserExtension( KParts::ReadOnlyPart * parent, const char * name = 0L );
+public slots:
+ void slotOpenURLRequested( const KURL & url );
+};
+
+class ArkStatusBarExtension: public KParts::StatusBarExtension
+{
+ Q_OBJECT
+public:
+ ArkStatusBarExtension( KParts::ReadWritePart * parent );
+ ~ArkStatusBarExtension();
+
+ void setProgress( unsigned long progress );
+ KPushButton* cancelButton() const { return m_cancelButton; }
+
+public slots:
+ void slotSetStatusBarSelectedFiles( const QString & text );
+ void slotSetStatusBarText( const QString & text );
+ void slotSetBusy( const QString & text, bool showCancelButton = false, bool detailedProgress = false );
+ void slotSetReady();
+ void slotProgress();
+
+protected:
+ void setupStatusBar();
+
+private:
+ bool m_bBusy;
+ QLabel *m_pStatusLabelSelect; // How many files are selected
+ QLabel *m_pStatusLabelTotal; // How many files in archive
+ QLabel *m_pBusyText;
+ KPushButton *m_cancelButton; // Cancel an operation
+ KProgress *m_pProgressBar;
+ QTimer *m_pTimer;
+};
+
+
+class ArkPart: public KParts::ReadWritePart
+{
+ Q_OBJECT
+public:
+ ArkPart( QWidget *parentWidget, const char *widgetName, QObject *parent,
+ const char *name, const QStringList &, bool readWrite );
+ virtual ~ArkPart();
+
+ static KAboutData* createAboutData();
+
+public slots:
+ void fixEnables();//rename to slotFixEnables()...
+ void disableActions();
+ void slotFilePopup( const QPoint & pPoint );
+ void file_save_as();
+ bool saveFile();
+ bool openURL( const KURL & url );
+ bool closeURL();
+ void transferStarted( KIO::Job * );
+ void transferCompleted();
+ void transferCanceled( const QString& errMsg );
+ void progressInformation( KIO::Job *, unsigned long );
+ void cancelTransfer();
+
+signals:
+ void fixActionState( const bool & bHaveFiles );
+ void removeRecentURL( const KURL & url );
+ void addRecentURL( const KURL & url );
+
+protected:
+ virtual bool openFile(); //Opening an archive file
+ bool closeArchive();
+ void setupActions();
+ void initialEnables();
+ void init();
+
+private:
+ ArkWidget *awidget;
+ ArkBrowserExtension *m_ext;
+ ArkStatusBarExtension *m_bar;
+
+ KAction *saveAsAction;
+ KAction *addFileAction;
+ KAction *addDirAction;
+ KAction *extractAction;
+ KAction *deleteAction;
+ KAction *selectAllAction;
+ KAction *viewAction;
+ KAction *helpAction;
+ KAction *openWithAction;
+ KAction *deselectAllAction;
+ KAction *invertSelectionAction;
+ KAction *editAction;
+
+ // the following have different enable rules from the above KActions
+ KAction *popupViewAction;
+ KAction *popupOpenWithAction;
+ KToggleAction *showSearchBar;
+
+ KIO::Job *m_job;
+};
+
+#endif // ARK_PART_H
diff --git a/ark/ark_part.rc b/ark/ark_part.rc
new file mode 100644
index 0000000..ff0a894
--- /dev/null
+++ b/ark/ark_part.rc
@@ -0,0 +1,57 @@
+<!DOCTYPE kpartgui>
+<kpartgui name="ark_kparts" version="8">
+<ActionProperties>
+ <Action name="select_all" icon="ark_selectall"/>
+</ActionProperties>
+<MenuBar>
+ <Menu name="file"><text>&amp;File</text>
+ <Action name="file_save_as"/>
+ </Menu>
+ <Menu name="edit"><text>&amp;Edit</text>
+ <Action name="select"/>
+ <Action name="select_all"/>
+ <Action name="deselect_all"/>
+ <Action name="invert_selection"/>
+ </Menu>
+ <Menu name="action"><text>&amp;Action</text>
+ <Action name="addfile"/>
+ <Action name="adddir"/>
+ <Action name="delete"/>
+ <Action name="extract"/>
+ <Action name="view"/>
+ <Action name="open_with"/>
+ <Action name="edit"/>
+ </Menu>
+ <Menu noMerge="1" name="settings">
+ <text>&amp;Settings</text>
+ <Merge name="StandardToolBarMenuHandler"/>
+ <Action name="options_show_search_bar" group="settings_show"/>
+ <Separator/>
+ <Action name="options_configure_keybinding" group="settings_configure"/>
+ <Action name="options_configure_toolbars" group="settings_configure"/>
+ <Action name="options_configure_ark" group="settings_configure"/>
+ </Menu>
+</MenuBar>
+<ToolBar name="mainToolBar">
+ <Action name="addfile"/>
+ <Action name="adddir"/>
+ <Separator lineSeparator="true"/>
+ <Action name="extract"/>
+ <Action name="delete"/>
+ <Action name="view"/>
+ <Merge/>
+</ToolBar>
+<Menu name="file_popup">
+ <Action name="extract"/>
+ <Action name="delete"/>
+ <Action name="view"/>
+ <Action name="open_with"/>
+ <Action name="edit"/>
+</Menu>
+<Menu name="archive_popup">
+ <Action name="addfile"/>
+ <Action name="adddir"/>
+ <Separator lineSeparator="true"/>
+ <Action name="select_all"/>
+</Menu>
+</kpartgui>
diff --git a/ark/ark_part_readonly.rc b/ark/ark_part_readonly.rc
new file mode 100644
index 0000000..c124aae
--- /dev/null
+++ b/ark/ark_part_readonly.rc
@@ -0,0 +1,42 @@
+<!DOCTYPE kpartgui>
+<kpartgui name="ark_kparts" version="7">
+<ActionProperties>
+ <Action name="select_all" icon="ark_selectall"/>
+</ActionProperties>
+<MenuBar>
+ <Menu name="file"><text>&amp;File</text>
+ <Action name="file_save_as"/>
+ </Menu>
+ <Menu name="edit"><text>&amp;Edit</text>
+ <Action name="select"/>
+ <Action name="select_all"/>
+ <Action name="deselect_all"/>
+ <Action name="invert_selection"/>
+ </Menu>
+ <Menu name="action"><text>&amp;Action</text>
+ <Action name="extract"/>
+ <Action name="view"/>
+ <Action name="open_with"/>
+ </Menu>
+ <Menu noMerge="1" name="settings">
+ <text>&amp;Settings</text>
+ <Merge name="StandardToolBarMenuHandler"/>
+ <Action name="options_show_search_bar" group="settings_show"/>
+ <Separator/>
+ <Action name="options_configure_keybinding" group="settings_configure"/>
+ <Action name="options_configure_toolbars" group="settings_configure"/>
+ <Action name="options_configure_ark" group="settings_configure"/>
+ </Menu>
+</MenuBar>
+<ToolBar name="mainToolBar">
+ <Action name="extract"/>
+ <Action name="view"/>
+</ToolBar>
+<Menu name="file_popup">
+ <Action name="extract"/>
+ <Action name="view"/>
+ <Action name="open_with"/>
+ <Separator lineSeparator="true"/>
+ <Action name="select_all"/>
+</Menu>
+</kpartgui>
diff --git a/ark/arkapp.cpp b/ark/arkapp.cpp
new file mode 100644
index 0000000..c117d0b
--- /dev/null
+++ b/ark/arkapp.cpp
@@ -0,0 +1,294 @@
+/*
+
+ ark -- archiver for the KDE project
+
+ Copyright (C)
+
+ 2002-2003: Helio Chissini de Castro <helio@conectiva.com.br>
+ 2003: Georg Robbers <Georg.Robbers@urz.uni-hd.de>
+ 1999-2000: Corel Corporation (author: Emily Ezust emilye@corel.com)
+ 1999: Francois-Xavier Duranceau duranceau@kde.org
+
+ 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.
+
+ This program 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 program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+*/
+
+#include <dcopclient.h>
+#include <kdebug.h>
+#include <kcmdlineargs.h>
+#include <klocale.h>
+#include <unistd.h>
+#include <qfile.h>
+#include <errno.h>
+
+
+#include "arkapp.h"
+
+ArkApplication *ArkApplication::mInstance = NULL;
+
+// a helper function to follow a symlink and obtain the real filename
+// Used in the ArkApplication functions that use the archive filename
+// to make sure an archive isn't opened twice in different windows
+// Now, readlink only gives one level so this function recurses.
+
+static QString resolveFilename(const QString & _arkname)
+{
+ char *buff;
+ int nread;
+ int iter = 1;
+
+ while ( true )
+ {
+ buff = new char[BUFSIZ*iter];
+ nread = readlink( QFile::encodeName(_arkname), buff, BUFSIZ);
+ if (-1 == nread)
+ {
+ if ( EINVAL == errno ) // not a symbolic link. Stopping condition.
+ {
+ delete [] buff;
+ return _arkname;
+ }
+ else if ( ENAMETOOLONG == errno )
+ {
+ kdDebug(1601) << "resolveFilename: have to reallocate - name too long!" << endl;
+ iter++;
+ delete [] buff;
+ continue;
+ }
+ else
+ {
+ delete [] buff;
+ // the other errors will be taken care of already in simply
+ // // opening the archive (i.e., the user will be notified)
+ return "";
+ }
+ }
+ else
+ {
+ buff[nread] = '\0'; // readlink doesn't null terminate
+ QString name = QFile::decodeName( buff );
+ delete [] buff;
+
+ // watch out for relative pathnames
+ if (name.at(0) != '/')
+ {
+ // copy the path from _arkname
+ int index = _arkname.findRev('/');
+ name = _arkname.left(index + 1) + name;
+ }
+ kdDebug(1601) << "Now resolve " << name << endl;
+
+ return resolveFilename( name );
+ }
+ }
+}
+
+
+ArkApplication * ArkApplication::getInstance()
+{
+ if (mInstance == NULL)
+ {
+ mInstance = new ArkApplication();
+ }
+ return mInstance;
+}
+
+ArkApplication::ArkApplication()
+ : KUniqueApplication(), m_windowCount(0)
+{
+ m_mainwidget = new QWidget;
+ setMainWidget(m_mainwidget);
+}
+
+int
+ArkApplication::newInstance()
+{
+
+ // If we are restored by session management, we don't need to open
+ // another window on startup.
+ if (restoringSession()) return 0;
+
+ KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
+
+ if ( args->isSet( "extract-to" ) )
+ {
+ if ( args->count() == 2 )
+ {
+ MainWindow *arkWin = new MainWindow();
+
+ arkWin->extractTo( args->url( 0 ), args->url( 1 ), args->isSet( "guess-name" ) );
+ return 0;
+ }
+ else
+ {
+ KCmdLineArgs::usage( i18n( "Wrong number of arguments specified" ) );
+ return 0;
+ }
+ }
+
+ if ( args->isSet( "add-to" ) && ( !args->isSet( "add" ) ) )
+ {
+ if ( args->count() < 2 )
+ {
+ KCmdLineArgs::usage( i18n( "You need to specify at least one file to be added to the archive." ) );
+ return 0;
+ }
+ else
+ {
+ KURL::List URLList;
+ for ( int c = 0; c < args->count()-1 ; c++ )
+ URLList.append( args->url( c ) );
+
+ MainWindow *arkWin = new MainWindow();
+
+ arkWin->addToArchive( URLList, args->cwd(), args->url( args->count()-1 ) );
+ return 0;
+ }
+ }
+
+ if ( args->isSet( "add" ) && args->isSet( "add-to" ) ) // HACK
+ {
+ bool oneFile = (args->count() == 2 ) ;
+
+ QString extension = args->arg( 0 );
+ KURL archiveName = args->url( 1 ); // the filename
+
+ // if more than one file -> use directory name
+ if ( !oneFile )
+ archiveName.setPath( archiveName.directory() );
+
+ archiveName.setFileName( archiveName.fileName() + extension );
+ KURL::List URLList;
+ for ( int c = 1; c < args->count(); c++ )
+ URLList.append( args->url( c ) );
+
+ MainWindow *arkWin = new MainWindow();
+
+ arkWin->addToArchive( URLList, args->cwd(), archiveName, !oneFile );
+ return 0;
+ }
+
+
+ if ( args->isSet( "add" ) && ( !args->isSet( "add-to" ) ) )
+ {
+ if ( args->count() < 1 )
+ {
+ KCmdLineArgs::usage( i18n( "You need to specify at least one file to be added to the archive." ) );
+ return 0;
+ }
+ else
+ {
+ KURL::List URLList;
+ for ( int c = 0; c < args->count() ; c++ )
+ URLList.append( args->url( c ) );
+
+ MainWindow *arkWin = new MainWindow();
+
+ arkWin->addToArchive( URLList, args->cwd() );
+ return 0;
+ }
+ }
+
+
+ int i = 0;
+ KURL url;
+ bool doAutoExtract = args->isSet("extract");
+ bool tempFile = KCmdLineArgs::isTempFileSet();
+ do
+ {
+ if (args->count() > 0)
+ {
+ url = args->url(i);
+ }
+ MainWindow *arkWin = new MainWindow();
+ arkWin->show();
+ if(doAutoExtract)
+ {
+ arkWin->setExtractOnly(true);
+ }
+ if (!url.isEmpty())
+ {
+ arkWin->openURL(url, tempFile);
+ }
+
+ ++i;
+ } while (i < args->count());
+
+ args->clear();
+ return 0;
+}
+
+
+void
+ArkApplication::addOpenArk(const KURL & _arkname, MainWindow *_ptr)
+{
+ QString realName;
+ if( _arkname.isLocalFile() )
+ {
+ realName = resolveFilename( _arkname.path() ); // follow symlink
+ kdDebug(1601) << " Real name of " << _arkname.prettyURL() << " is " << realName << endl;
+ }
+ else
+ realName = _arkname.prettyURL();
+ openArksList.append(realName);
+ m_windowsHash.replace(realName, _ptr);
+ kdDebug(1601) << "Saved ptr " << _ptr << " added open ark: " << realName << endl;
+}
+
+void
+ArkApplication::removeOpenArk(const KURL & _arkname)
+{
+ QString realName;
+ if ( _arkname.isLocalFile() )
+ realName = resolveFilename( _arkname.path() ); // follow symlink
+ else
+ realName = _arkname.prettyURL();
+ kdDebug(1601) << "Removing name " << _arkname.prettyURL() << endl;
+ openArksList.remove(realName);
+ m_windowsHash.remove(realName);
+}
+
+void
+ArkApplication::raiseArk(const KURL & _arkname)
+{
+ kdDebug( 1601 ) << "ArkApplication::raiseArk " << endl;
+ MainWindow *window;
+ QString realName;
+ if( _arkname.isLocalFile() )
+ realName = resolveFilename(_arkname.path()); // follow symlink
+ else
+ realName = _arkname.prettyURL();
+ window = m_windowsHash[realName];
+ kdDebug(1601) << "ArkApplication::raiseArk " << window << endl;
+ // raise didn't seem to be enough. Not sure why!
+ // This might be annoying though.
+ //window->hide();
+ //window->show();
+ window->raise();
+}
+
+bool
+ArkApplication::isArkOpenAlready(const KURL & _arkname)
+{
+ QString realName;
+ if ( _arkname.isLocalFile() )
+ realName = resolveFilename(_arkname.path()); // follow symlink
+ else
+ realName = _arkname.prettyURL();
+ return ( openArksList.findIndex(realName) != -1 );
+}
+
+#include "arkapp.moc"
+
diff --git a/ark/arkapp.h b/ark/arkapp.h
new file mode 100644
index 0000000..1d1b474
--- /dev/null
+++ b/ark/arkapp.h
@@ -0,0 +1,93 @@
+/*
+
+ ark -- archiver for the KDE project
+
+ Copyright (C)
+
+ 2002: Helio Chissini de Castro <helio@conectiva.com.br>
+ 1999-2000: Corel Corporation (author: Emily Ezust emilye@corel.com)
+ 1999: Francois-Xavier Duranceau duranceau@kde.org
+
+ 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.
+
+ This program 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 program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+*/
+
+#ifndef ARKAPP_H
+#define ARKAPP_H
+
+#include "mainwindow.h"
+
+// QT includes
+#include <qdict.h>
+
+// KDE includes
+#include <kuniqueapplication.h>
+
+class QString;
+class QStringList;
+
+class EqualKey
+{
+ public:
+ bool operator()(const QString & str1, const QString & str2) const
+ {
+ return (str1 == str2);
+ }
+};
+
+
+// This class follows the singleton pattern.
+class ArkApplication : public KUniqueApplication
+{
+ Q_OBJECT
+ public:
+ virtual int newInstance();
+ virtual ~ArkApplication() {}
+
+ // keep track of windows so we know when to quit
+ int windowCount() { return m_windowCount; }
+ int addWindow() { ++m_windowCount; return m_windowCount; }
+ void removeWindow() { --m_windowCount;}
+
+ // keep track of open archive names so we don't open one twice
+ // note that ArkWidget is not a pointer to const because raise()
+ // requires later a pointer to nonconst.
+ void addOpenArk(const KURL & _arkname, MainWindow * _ptr);
+ void removeOpenArk(const KURL & _arkname);
+
+ bool isArkOpenAlready(const KURL & _arkname);
+
+ void raiseArk(const KURL & _arkname);
+
+ // use this function to access data from other modules.
+ static ArkApplication *getInstance();
+
+ protected:
+ ArkApplication();
+
+ private:
+ QWidget *m_mainwidget; // to be the parent of all ArkWidgets
+ int m_windowCount;
+
+ QStringList openArksList;
+
+ // a hash to obtain the window associated with a filename.
+ // given a QString key, you get an ArkWidget * pointer.
+ QDict<MainWindow> m_windowsHash;
+
+ static ArkApplication *mInstance;
+};
+
+#endif // ARKAPP_H
diff --git a/ark/arkfactory.cpp b/ark/arkfactory.cpp
new file mode 100644
index 0000000..8fcd262
--- /dev/null
+++ b/ark/arkfactory.cpp
@@ -0,0 +1,68 @@
+/*
+ ark -- archiver for the KDE project
+
+ Copyright (C) 2003: Georg Robbers <georg.robbers@urz.uni-hd.de>
+
+ 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.
+
+ This program 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 program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+*/
+
+#include <kaboutdata.h>
+#include <kinstance.h>
+
+#include "ark_part.h"
+#include "arkfactory.h"
+
+KInstance* ArkFactory::s_instance = 0L;
+KAboutData* ArkFactory::s_about = 0L;
+int ArkFactory::instanceNumber = 0;
+
+K_EXPORT_COMPONENT_FACTORY( libarkpart, ArkFactory )
+
+ArkFactory::~ArkFactory()
+{
+ delete s_instance;
+ delete s_about;
+ s_instance = 0L;
+}
+
+KParts::Part * ArkFactory::createPartObject( QWidget *parentWidget,
+ const char *widgetName, QObject *parent,
+ const char *name, const char *classname,
+ const QStringList &args )
+{
+ bool readWrite = false; // for e.g. Browser/View or KParts::ReadOnlyPart
+ if ( QCString( classname ) == "KParts::ReadWritePart"
+ || QCString( classname ) == "ArkPart" )
+ {
+ readWrite = true;
+ }
+ ArkPart* obj = new ArkPart( parentWidget, widgetName, parent, name,
+ args, readWrite );
+ //kdDebug( 1601 ) << "classname is: " << QCString( classname ) << endl;
+ return obj;
+}
+
+KInstance* ArkFactory::instance()
+{
+ instanceNumber++;
+ if( !s_instance )
+ {
+ s_about = ArkPart::createAboutData();
+ s_instance = new KInstance( s_about );
+ }
+ return s_instance;
+}
+
diff --git a/ark/arkfactory.h b/ark/arkfactory.h
new file mode 100644
index 0000000..ec3534a
--- /dev/null
+++ b/ark/arkfactory.h
@@ -0,0 +1,43 @@
+/*
+ ark -- archiver for the KDE project
+
+ Copyright (C) 2003: Georg Robbers <georg.robbers@urz.uni-hd.de>
+
+ 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.
+
+ This program 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 program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+*/
+
+#ifndef ARKFACTORY_H
+#define ARKFACTORY_H
+#include <kparts/factory.h>
+
+class ArkFactory : public KParts::Factory
+{
+public:
+ ArkFactory() : KParts::Factory() {}
+ virtual ~ArkFactory();
+ virtual KParts::Part *createPartObject(
+ QWidget *parentWidget = 0,const char *widgetName = 0,
+ QObject *parent = 0, const char *name = 0,
+ const char *classname = "KParts::Part",
+ const QStringList &args = QStringList() );
+ static KInstance* instance();
+ private:
+ static KInstance* s_instance;
+ static KAboutData* s_about;
+ static int instanceNumber;
+};
+
+#endif
diff --git a/ark/arkui.rc b/ark/arkui.rc
new file mode 100644
index 0000000..335abc8
--- /dev/null
+++ b/ark/arkui.rc
@@ -0,0 +1,22 @@
+<!DOCTYPE kpartgui>
+<kpartgui name="ark" version="9">
+<MenuBar>
+ <Menu name="file"><text>&amp;File</text>
+ <Action name="new_window"/>
+ <Action name="reload_arch"/>
+ <Merge/>
+ </Menu>
+ <Menu name="settings">
+ <DefineGroup name="settings_show" append="show_merge"/>
+ <DefineGroup name="settings_configure" append="configure_merge"/>
+ </Menu>
+ <Merge/>
+</MenuBar>
+<Menu name="archive_popup">
+ <Action name="file_new"/>
+ <Action name="file_open"/>
+ <Action name="file_close"/>
+ <Separator lineSeparator="true"/>
+ <Merge/>
+</Menu>
+</kpartgui>
diff --git a/ark/arkutils.cpp b/ark/arkutils.cpp
new file mode 100644
index 0000000..1b4ed0a
--- /dev/null
+++ b/ark/arkutils.cpp
@@ -0,0 +1,230 @@
+/*
+
+ $Id$
+
+ ark -- archiver for the KDE project
+
+ Copyright (C)
+
+ 2002: Helio Chissini de Castro <helio@conectiva.com.br>
+ 2001: Corel Corporation (author: Michael Jarrett, michaelj@corel.com)
+ 1999-2000: Corel Corporation (author: Emily Ezust, emilye@corel.com)
+ 1999: Francois-Xavier Duranceau duranceau@kde.org
+ 1997-1999: Rob Palmbos palm9744@kettering.edu
+ 2003: Hans Petter Bieker <bieker@kde.org>
+
+ 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.
+
+ This program 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 program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+*/
+
+#include <config.h>
+
+// C includes
+#include <stdlib.h>
+#include <time.h>
+
+#include <errno.h>
+#include <sys/param.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+
+#include <unistd.h>
+#include <config.h>
+
+#ifdef _HPUX_SOURCE
+#include <sys/vfs.h>
+#endif
+
+// for statfs:
+#ifdef BSD4_4
+#include <sys/mount.h>
+#elif defined(__linux__)
+#include <sys/vfs.h>
+#elif defined(__sun)
+#include <sys/statvfs.h>
+#define STATFS statvfs
+#elif defined(_AIX)
+#include <sys/statfs.h>
+#endif
+
+#ifndef STATFS
+#define STATFS statfs
+#endif
+
+// KDE includes
+#include <kdebug.h>
+#include <kmessagebox.h>
+#include <klocale.h>
+#include <klargefile.h>
+
+// Qt includes
+#include <qfile.h>
+
+#include "arkutils.h"
+
+QString ArkUtils::getTimeStamp(const QString &_month,
+ const QString &_day,
+ const QString &_yearOrTime)
+{
+ // Make the date format sortable.
+ // Month is in _month, day is in _day.
+ // In _yearOrTime is either a year or a time.
+ // If it's March, we'll see the year for all dates up to October 1999.
+ // (five months' difference - e.g., if it's Apr, then get years up to Nov)
+
+ char month[4];
+ strncpy(month, _month.ascii(), 3);
+ month[3] = '\0';
+ int nMonth = getMonth(month);
+ int nDay = _day.toInt();
+
+ kdDebug(1601) << "Month is " << nMonth << ", Day is " << nDay << endl;
+
+ time_t t = time(0);
+ if (t == -1)
+ exit(1);
+ struct tm *now = localtime(&t);
+ int thisYear = now->tm_year + 1900;
+ int thisMonth = now->tm_mon + 1;
+
+ QString year, timestamp;
+
+ if (_yearOrTime.contains(":"))
+ // it has a timestamp so we have to figure out the year
+ {
+ year.sprintf("%d", ArkUtils::getYear(nMonth, thisYear, thisMonth));
+ timestamp = _yearOrTime;
+ }
+ else
+ {
+ year = _yearOrTime;
+ if (year.right(1) == " ")
+ year = year.left(4);
+ if (year.left(1) == " ")
+ year = year.right(4);
+
+ timestamp = "??:??";
+ }
+
+ QString retval;
+ retval.sprintf("%s-%.2d-%.2d %s",
+ year.utf8().data(), nMonth, nDay,
+ timestamp.utf8().data());
+ return retval;
+}
+
+int ArkUtils::getMonth(const char *strMonth)
+ // returns numeric value for three-char month string
+{
+ static char months[13][4] = { "", "Jan", "Feb", "Mar", "Apr", "May", "Jun",
+ "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
+ int nIndex;
+ for (nIndex = 1; nIndex < 13; ++nIndex)
+ {
+ if (0 == strcmp(strMonth, months[nIndex]))
+ return nIndex;
+ }
+ return 0;
+}
+
+// This function gets the year from an LHA or ls -l timestamp.
+// Note: LHA doesn't seem to display the year if the file is more
+// than 6 months into the future, so this will fail to give the correct
+// year (of course it is hoped that there are not too many files lying
+// around from the future).
+
+int ArkUtils::getYear(int theMonth, int thisYear, int thisMonth)
+{
+ int monthDiff = QABS(thisMonth - theMonth);
+ if (monthDiff > 6)
+ return (thisYear - 1);
+ else
+ return thisYear;
+}
+
+QString ArkUtils::fixYear(const QString& strYear)
+{
+ // returns 4-digit year by guessing from two-char year string.
+ // Remember: this is used for file timestamps. There probably aren't any
+ // files that were created before 1970, so that's our cutoff. Of course,
+ // in 2070 we'll have some problems....
+
+ if ( strYear.length() != 2 ) return strYear;
+
+ bool ok;
+ int y = strYear.toInt( &ok );
+
+ if ( ok )
+ {
+ if ( y > 70 )
+ y += 1900;
+ else
+ y += 2000;
+
+ return QString::number( y );
+ }
+ else
+ return QString::null;
+}
+
+bool
+ArkUtils::haveDirPermissions( const QString &strFile )
+{
+ return ( access( QFile::encodeName( strFile ), W_OK ) == 0 );
+}
+
+bool
+ArkUtils::diskHasSpace(const QString &dir, KIO::filesize_t size)
+ // check if disk has enough space to accommodate (a) new file(s) of
+ // the given size in the partition containing the given directory
+{
+ kdDebug( 1601 ) << "diskHasSpace() " << "dir: " << dir << " Size: " << size << endl;
+
+ struct STATFS buf;
+ if (STATFS(QFile::encodeName(dir), &buf) == 0)
+ {
+ double nAvailable = (double)buf.f_bavail * buf.f_bsize;
+ if ( nAvailable < (double)size )
+ {
+ KMessageBox::error(0, i18n("You have run out of disk space."));
+ return false;
+ }
+ }
+ else
+ {
+ // something bad happened
+ kdWarning( 1601 ) << "diskHasSpace() failed" << endl;
+ // Q_ASSERT(0);
+ }
+ return true;
+}
+
+KIO::filesize_t
+ArkUtils::getSizes(QStringList *list)
+{
+ KIO::filesize_t sum = 0;
+ QString str;
+ KDE_struct_stat st;
+
+ for ( QStringList::Iterator it = list->begin(); it != list->end(); ++it)
+ {
+ str = *it;
+ str = str.right(str.length()-5);
+ if (KDE_stat(QFile::encodeName(str), &st ) < 0)
+ continue;
+ sum += st.st_size;
+ }
+ return sum;
+}
diff --git a/ark/arkutils.h b/ark/arkutils.h
new file mode 100644
index 0000000..4ddea65
--- /dev/null
+++ b/ark/arkutils.h
@@ -0,0 +1,56 @@
+// -*-C++-*- emacs magic for .h files
+/*
+
+ $Id$
+
+ ark -- archiver for the KDE project
+
+ Copyright (C)
+
+ 1997-1999: Rob Palmbos palm9744@kettering.edu
+ 1999: Francois-Xavier Duranceau duranceau@kde.org
+ 1999-2000: Corel Corporation (author: Emily Ezust, emilye@corel.com)
+ 2001: Corel Corporation (author: Michael Jarrett, michaelj@corel.com)
+ 2003: Hans Petter Bieker <bieker@kde.org>
+
+ 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.
+
+ This program 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 program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+*/
+
+#ifndef ARKUTILS_H
+#define ARKUTILS_H
+
+#include <qstring.h>
+
+#include <kio/global.h>
+
+class QStringList;
+
+// various functions for massaging timestamps
+namespace ArkUtils
+{
+ int getYear(int theMonth, int thisYear, int thisMonth);
+ int getMonth(const char *strMonth);
+ QString fixYear(const QString& strYear);
+
+ QString getTimeStamp(const QString &month,
+ const QString &day,
+ const QString &year);
+ bool haveDirPermissions(const QString &strFile);
+ bool diskHasSpace(const QString &dir, KIO::filesize_t size);
+ KIO::filesize_t getSizes(QStringList *list);
+}
+
+#endif
diff --git a/ark/arkviewer.cpp b/ark/arkviewer.cpp
new file mode 100644
index 0000000..1ea76ac
--- /dev/null
+++ b/ark/arkviewer.cpp
@@ -0,0 +1,103 @@
+/*
+ * ark: A program for modifying archives via a GUI.
+ *
+ * Copyright (C) 2004, Henrique Pinto <henrique.pinto@kdemail.net>
+ *
+ * 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.
+ *
+ * This program 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 program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "arkviewer.h"
+
+#include <klocale.h>
+#include <kparts/componentfactory.h>
+#include <kmimetype.h>
+#include <kdebug.h>
+#include <kurl.h>
+#include <kglobal.h>
+#include <kiconloader.h>
+
+#include <qvbox.h>
+#include <qlayout.h>
+#include <qlabel.h>
+#include <qframe.h>
+#include <qurl.h>
+
+
+ArkViewer::ArkViewer( QWidget * parent, const char * name )
+ : KDialogBase( parent, name, false, QString::null, Close ), m_part( 0 )
+{
+ m_widget = new QVBox( this );
+ m_widget->layout()->setSpacing( 10 );
+
+ connect( this, SIGNAL( finished() ), this, SLOT( slotFinished() ) );
+
+ setMainWidget( m_widget );
+}
+
+ArkViewer::~ArkViewer()
+{
+ saveDialogSize( "ArkViewer" );
+}
+
+void ArkViewer::slotFinished()
+{
+ delete m_part;
+ m_part = 0;
+ delayedDestruct();
+}
+
+bool ArkViewer::view( const KURL& filename )
+{
+ KMimeType::Ptr mimetype = KMimeType::findByURL( filename, 0, true );
+
+ setCaption( filename.fileName() );
+
+ QSize size = configDialogSize( "ArkViewer" );
+ if (size.width() < 200)
+ size = QSize(560, 400);
+ setInitialSize( size );
+
+ QFrame *header = new QFrame( m_widget );
+ QHBoxLayout *headerLayout = new QHBoxLayout( header );
+ headerLayout->setAutoAdd( true );
+
+ QLabel *iconLabel = new QLabel( header );
+ iconLabel->setPixmap( mimetype->pixmap( KIcon::Desktop ) );
+ iconLabel->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Minimum );
+
+ QVBox *headerRight = new QVBox( header );
+ new QLabel( QString( "<qt><b>%1</b></qt>" )
+ .arg( filename.fileName() ), headerRight
+ );
+ new QLabel( mimetype->comment(), headerRight );
+
+ header->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Maximum );
+
+ m_part = KParts::ComponentFactory::createPartInstanceFromQuery<KParts::ReadOnlyPart>( mimetype->name(), QString::null, m_widget, 0, this );
+
+ if ( m_part )
+ {
+ m_part->openURL( filename );
+ show();
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+}
+
+#include "arkviewer.moc"
diff --git a/ark/arkviewer.h b/ark/arkviewer.h
new file mode 100644
index 0000000..e0fda83
--- /dev/null
+++ b/ark/arkviewer.h
@@ -0,0 +1,47 @@
+#ifndef ARKVIEWER_H
+#define ARKVIEWER_H
+
+/*
+ * ark: A program for modifying archives via a GUI.
+ *
+ * Copyright (C) 2004, Henrique Pinto <henrique.pinto@kdemail.net>
+ *
+ * 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.
+ *
+ * This program 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 program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include <kdialogbase.h>
+#include <kparts/part.h>
+
+class ArkViewer : public KDialogBase
+{
+ Q_OBJECT
+
+ public:
+ ArkViewer( QWidget* parent = 0, const char * name = 0 );
+ ~ArkViewer();
+
+ bool view( const KURL& filename );
+
+ protected slots:
+ void slotFinished();
+
+ private:
+ KParts::ReadOnlyPart *m_part;
+ QWidget *m_widget;
+};
+
+#endif // ARKVIEWER_H
+
diff --git a/ark/arkwidget.cpp b/ark/arkwidget.cpp
new file mode 100644
index 0000000..d0fa3d4
--- /dev/null
+++ b/ark/arkwidget.cpp
@@ -0,0 +1,2262 @@
+/*
+
+ ark -- archiver for the KDE project
+
+ Copyright (C)
+
+ 2004-2005: Henrique Pinto <henrique.pinto@kdemail.net>
+ 2003: Georg Robbers <Georg.Robbers@urz.uni-hd.de>
+ 2002-2003: Helio Chissini de Castro <helio@conectiva.com.br>
+ 2001-2002: Roberto Teixeira <maragato@kde.org>
+ 2001: Corel Corporation (author: Michael Jarrett, michaelj@corel.com)
+ 1999-2000: Corel Corporation (author: Emily Ezust, emilye@corel.com)
+ 1999: Francois-Xavier Duranceau duranceau@kde.org
+ 1997-1999: Rob Palmbos palm9744@kettering.edu
+
+ 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.
+
+ This program 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 program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+*/
+
+#include <sys/types.h>
+#include <sys/stat.h>
+
+// Qt includes
+#include <qlayout.h>
+#include <qstringlist.h>
+#include <qlabel.h>
+#include <qcheckbox.h>
+#include <qdir.h>
+
+// KDE includes
+#include <kdebug.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+#include <kio/netaccess.h>
+#include <kio/job.h>
+#include <kopenwith.h>
+#include <ktempfile.h>
+#include <kmimemagic.h>
+#include <kmimetype.h>
+#include <kstandarddirs.h>
+#include <ktempdir.h>
+#include <kprocess.h>
+#include <kfiledialog.h>
+#include <kdirselectdialog.h>
+#include <kurldrag.h>
+#include <klistviewsearchline.h>
+#include <ktoolbar.h>
+#include <kconfigdialog.h>
+#include <ktrader.h>
+#include <kurl.h>
+
+// settings
+#include "settings.h"
+#include "general.h"
+#include "addition.h"
+#include "extraction.h"
+#include <kpopupmenu.h>
+#include <kdialog.h>
+
+// ark includes
+#include "arkapp.h"
+#include "archiveformatdlg.h"
+#include "extractiondialog.h"
+#include "arkwidget.h"
+#include "filelistview.h"
+#include "arkutils.h"
+#include "archiveformatinfo.h"
+#include "compressedfile.h"
+#include "searchbar.h"
+#include "arkviewer.h"
+
+static void viewInExternalViewer( ArkWidget* parent, const KURL& filename )
+{
+ QString mimetype = KMimeType::findByURL( filename )->name();
+ bool view = true;
+
+ if ( KRun::isExecutable( mimetype ) )
+ {
+ QString text = i18n( "The file you're trying to view may be an executable. Running untrusted executables may compromise your system's security.\nAre you sure you want to run that file?" );
+ view = ( KMessageBox::warningContinueCancel( parent, text, QString::null, i18n("Run Nevertheless") ) == KMessageBox::Continue );
+ }
+
+ if ( view )
+ KRun::runURL( filename, mimetype );
+
+}
+
+//----------------------------------------------------------------------
+//
+// Class ArkWidget starts here
+//
+//----------------------------------------------------------------------
+
+ArkWidget::ArkWidget( QWidget *parent, const char *name )
+ : QVBox(parent, name), m_bBusy( false ), m_bBusyHold( false ),
+ m_extractOnly( false ), m_extractRemote(false),
+ m_openAsMimeType(QString::null), m_pTempAddList(NULL),
+ m_bArchivePopupEnabled( false ),
+ m_convert_tmpDir( NULL ), m_convertSuccess( false ),
+ m_createRealArchTmpDir( NULL ), m_extractRemoteTmpDir( NULL ),
+ m_modified( false ), m_searchToolBar( 0 ), m_searchBar( 0 ),
+ arch( 0 ), m_archType( UNKNOWN_FORMAT ), m_fileListView( 0 ),
+ m_nSizeOfFiles( 0 ), m_nSizeOfSelectedFiles( 0 ), m_nNumFiles( 0 ),
+ m_nNumSelectedFiles( 0 ), m_bIsArchiveOpen( false ),
+ m_bIsSimpleCompressedFile( false ),
+ m_bDropSourceIsSelf( false ), m_extractList( 0 )
+{
+ m_tmpDir = new KTempDir( locateLocal( "tmp", "ark" ) );
+
+ if ( m_tmpDir->status() != 0 )
+ {
+ kdWarning( 1601 ) << "Could not create a temporary directory. status() returned "
+ << m_tmpDir->status() << "." << endl;
+ m_tmpDir = NULL;
+ }
+
+ m_searchToolBar = new KToolBar( this, "searchBar" );
+ m_searchToolBar->boxLayout()->setSpacing( KDialog::spacingHint() );
+
+ QLabel * l1 = new QLabel( i18n( "&Search:" ), m_searchToolBar, "kde toolbar widget" );
+ m_searchBar = new SearchBar( m_searchToolBar, 0 );
+ l1->setBuddy( m_searchBar );
+
+ m_searchToolBar->setStretchableWidget( m_searchBar );
+
+ if ( !ArkSettings::showSearchBar() )
+ m_searchToolBar->hide();
+
+ createFileListView();
+
+ m_searchBar->setListView( m_fileListView );
+
+ // enable DnD
+ setAcceptDrops(true);
+ setFocusProxy(m_searchBar);
+}
+
+ArkWidget::~ArkWidget()
+{
+ cleanArkTmpDir();
+ ready();
+ delete m_pTempAddList;
+ delete m_fileListView;
+ m_fileListView = 0;
+ delete arch;
+ ArkSettings::writeConfig();
+}
+
+void ArkWidget::cleanArkTmpDir()
+{
+ removeDownloadedFiles();
+ if ( m_tmpDir )
+ {
+ m_tmpDir->unlink();
+ delete m_tmpDir;
+ m_tmpDir = NULL;
+ }
+}
+
+void ArkWidget::closeArch()
+{
+ if ( isArchiveOpen() )
+ {
+ delete arch;
+ arch = 0;
+ m_bIsArchiveOpen = false;
+ }
+
+ if ( m_fileListView )
+ {
+ m_fileListView->clear();
+ m_fileListView->clearHeaders();
+ }
+}
+
+////////////////////////////////////////////////////////////////////
+///////////////////////// updateStatusTotals ///////////////////////
+////////////////////////////////////////////////////////////////////
+
+void
+ArkWidget::updateStatusTotals()
+{
+ m_nNumFiles = m_fileListView->totalFiles();
+ m_nSizeOfFiles = m_fileListView->totalSize();
+
+ QString strInfo = i18n( "%n file %1", "%n files %1", m_nNumFiles )
+ .arg( KIO::convertSize( m_nSizeOfFiles ) );
+ emit setStatusBarText(strInfo);
+}
+
+void
+ArkWidget::busy( const QString & text )
+{
+ emit setBusy( text );
+
+ if ( m_bBusy )
+ return;
+
+ m_fileListView->setEnabled( false );
+
+ QApplication::setOverrideCursor( waitCursor );
+ m_bBusy = true;
+}
+
+void
+ArkWidget::holdBusy()
+{
+ if ( !m_bBusy || m_bBusyHold )
+ return;
+
+ m_bBusyHold = true;
+ QApplication::restoreOverrideCursor();
+}
+
+void
+ArkWidget::resumeBusy()
+{
+ if ( !m_bBusyHold )
+ return;
+
+ m_bBusyHold = false;
+ QApplication::setOverrideCursor( waitCursor );
+}
+
+void
+ArkWidget::ready()
+{
+ if ( !m_bBusy )
+ return;
+
+ m_fileListView->setEnabled( true );
+
+ QApplication::restoreOverrideCursor();
+ emit setReady();
+ m_bBusyHold = false;
+ m_bBusy = false;
+}
+
+//////////////////////////////////////////////////////////////////////
+////////////////////// file_save_as //////////////////////////////////
+//////////////////////////////////////////////////////////////////////
+
+KURL
+ArkWidget::getSaveAsFileName()
+{
+ QString defaultMimeType;
+ if ( m_openAsMimeType.isNull() )
+ defaultMimeType = KMimeType::findByPath( m_strArchName )->name();
+ else
+ defaultMimeType = m_openAsMimeType;
+
+ KURL u;
+ QString suggestedName;
+ if ( m_realURL.isLocalFile() )
+ suggestedName = m_realURL.url();
+ else
+ suggestedName = m_realURL.fileName( false );
+
+ do
+ {
+ u = getCreateFilename( i18n( "Save Archive As" ), defaultMimeType, true, suggestedName );
+ if ( u.isEmpty() )
+ return u;
+ if( allowedArchiveName( u ) || ( ArchiveFormatInfo::self()->archTypeByExtension( u.path() ) != UNKNOWN_FORMAT ) )
+ break;
+ KMessageBox::error( this, i18n( "Please save your archive in the same format as the original.\nHint: Use one of the suggested extensions." ) );
+ }
+ while ( true );
+ return u;
+}
+
+bool
+ArkWidget::file_save_as( const KURL & u )
+{
+ bool success = KIO::NetAccess::upload( m_strArchName, u, this );
+ if ( m_modified && success )
+ m_modified = false;
+ return success;
+}
+
+void
+ArkWidget::convertTo( const KURL & u )
+{
+ busy( i18n( "Saving..." ) );
+ m_convert_tmpDir = new KTempDir( tmpDir() + "convtmp" );
+ m_convert_tmpDir->setAutoDelete( true );
+ connect( arch, SIGNAL( sigExtract( bool ) ), this, SLOT( convertSlotExtractDone( bool ) ) );
+ m_convert_saveAsURL = u;
+ arch->unarchFile( 0, m_convert_tmpDir->name() );
+}
+
+void
+ArkWidget::convertSlotExtractDone( bool )
+{
+ kdDebug( 1601 ) << k_funcinfo << endl;
+ disconnect( arch, SIGNAL( sigExtract( bool ) ), this, SLOT( convertSlotExtractDone( bool ) ) );
+ QTimer::singleShot( 0, this, SLOT( convertSlotCreate() ) );
+}
+
+void
+ArkWidget::convertSlotCreate()
+{
+ file_close();
+ connect( this, SIGNAL( createDone( bool ) ), this, SLOT( convertSlotCreateDone( bool ) ) );
+ QString archToCreate;
+ if ( m_convert_saveAsURL.isLocalFile() )
+ archToCreate = m_convert_saveAsURL.path();
+ else
+ archToCreate = tmpDir() + m_convert_saveAsURL.fileName();
+
+ createArchive( archToCreate );
+}
+
+
+void
+ArkWidget::convertSlotCreateDone( bool success )
+{
+ disconnect( this, SIGNAL( createDone( bool ) ), this, SLOT( convertSlotCreateDone( bool ) ) );
+ kdDebug( 1601 ) << k_funcinfo << endl;
+ if ( !success )
+ {
+ kdWarning( 1601 ) << "Error while converting. (convertSlotCreateDone)" << endl;
+ return;
+ }
+ QDir dir( m_convert_tmpDir->name() );
+ QStringList entries = dir.entryList();
+ entries.remove( ".." );
+ entries.remove( "." );
+ QStringList::Iterator it = entries.begin();
+ for ( ; it != entries.end(); ++it )
+ {
+ ///////////////////////////////////////////////////////
+ // BIG TODO: get rid of 'the assume //
+ // 'file:/', do some black magic //
+ // to find the basedir, chdir there, //
+ // and break the rest of the world' //
+ // hack. See also action_edit ... //
+ // addFile should be: //
+ // addFile( const QString & baseDir, //
+ // const QStringList & filesToAdd ) //
+ //////////////////////////////////////////////////////
+ *it = QString::fromLatin1( "file:" )+ m_convert_tmpDir->name() + *it;
+ }
+ bool bOldRecVal = ArkSettings::rarRecurseSubdirs();
+ connect( arch, SIGNAL( sigAdd( bool ) ), this, SLOT( convertSlotAddDone( bool ) ) );
+ arch->addFile( entries );
+ ArkSettings::setRarRecurseSubdirs( bOldRecVal );
+}
+
+void
+ArkWidget::convertSlotAddDone( bool success )
+{
+ disconnect( arch, SIGNAL( sigAdd( bool ) ), this, SLOT( convertSlotAddDone( bool ) ) );
+ kdDebug( 1601 ) << k_funcinfo << endl;
+ m_convertSuccess = success;
+ // needed ? (TarArch, lzo)
+ QTimer::singleShot( 0, this, SLOT( convertFinish() ) );
+}
+
+void
+ArkWidget::convertFinish()
+{
+ kdDebug( 1601 ) << k_funcinfo << endl;
+ delete m_convert_tmpDir;
+ m_convert_tmpDir = NULL;
+
+ ready();
+ if ( m_convertSuccess )
+ {
+ if ( m_convert_saveAsURL.isLocalFile() )
+ {
+ emit openURLRequest( m_convert_saveAsURL );
+ }
+ else
+ {
+ KIO::NetAccess::upload( tmpDir()
+ + m_convert_saveAsURL.fileName(), m_convert_saveAsURL, this );
+ // TODO: save bandwidth - we already have a local tmp file ...
+ emit openURLRequest( m_convert_saveAsURL );
+ }
+ }
+ else
+ {
+ kdWarning( 1601 ) << "Error while converting (convertSlotAddDone)" << endl;
+ }
+}
+
+bool
+ArkWidget::allowedArchiveName( const KURL & u )
+{
+ if (u.isEmpty())
+ return false;
+
+ QString archMimeType = KMimeType::findByURL( m_url )->name();
+ if ( !m_openAsMimeType.isNull() )
+ archMimeType = m_openAsMimeType;
+ QString newArchMimeType = KMimeType::findByPath( u.path() )->name();
+ if ( archMimeType == newArchMimeType )
+ return true;
+
+ return false;
+}
+
+void
+ArkWidget::extractTo( const KURL & targetDirectory, const KURL & archive, bool bGuessName )
+{
+ m_extractTo_targetDirectory = targetDirectory;
+
+ if ( bGuessName ) // suggest an extract directory based on archive name
+ {
+ const QString fileName = guessName( archive );
+ m_extractTo_targetDirectory.setPath( targetDirectory.path( 1 ) + fileName + '/' );
+ }
+
+ if ( !KIO::NetAccess::exists( m_extractTo_targetDirectory, false, this ) )
+ {
+ if ( !KIO::NetAccess::mkdir( m_extractTo_targetDirectory, this ) )
+ {
+ KMessageBox::error( 0, i18n( "Could not create the folder %1" ).arg(
+ targetDirectory.prettyURL() ) );
+ emit request_file_quit();
+ return;
+ }
+ }
+
+ connect( this, SIGNAL( openDone( bool ) ), this, SLOT( extractToSlotOpenDone( bool ) ) );
+}
+
+const QString
+ArkWidget::guessName( const KURL &archive )
+{
+ QString fileName = archive.fileName();
+ QStringList list = KMimeType::findByPath( fileName )->patterns();
+ QStringList::Iterator it = list.begin();
+ QString ext;
+ for ( ; it != list.end(); ++it )
+ {
+ ext = (*it).remove( '*' );
+ if ( fileName.endsWith( ext ) )
+ {
+ fileName = fileName.left( fileName.findRev( ext ) );
+ break;
+ }
+ }
+
+ return fileName;
+}
+
+void
+ArkWidget::extractToSlotOpenDone( bool success )
+{
+ disconnect( this, SIGNAL( openDone( bool ) ), this, SLOT( extractToSlotOpenDone( bool ) ) );
+ if ( !success )
+ {
+ KMessageBox::error( this, i18n( "An error occurred while opening the archive %1." ).arg( m_url.prettyURL() ) );
+ emit request_file_quit();
+ return;
+ }
+
+ QString extractDir = m_extractTo_targetDirectory.path();
+ // little code duplication from action_extract():
+ if ( !m_extractTo_targetDirectory.isLocalFile() )
+ {
+ m_extractRemoteTmpDir = new KTempDir( tmpDir() + "extremote" );
+ m_extractRemoteTmpDir->setAutoDelete( true );
+
+ extractDir = m_extractRemoteTmpDir->name();
+ m_extractRemote = true;
+
+ if ( m_extractRemoteTmpDir->status() != 0 )
+ {
+ kdWarning(1601) << "Unable to create " << extractDir << endl;
+ m_extractRemote = false;
+ emit request_file_quit();
+ return;
+ }
+ }
+
+ QStringList empty;
+ QStringList alreadyExisting = existingFiles( extractDir, empty );
+ kdDebug( 1601 ) << "Already existing files count: " << existingFiles( extractDir, empty ).count() << endl;
+ bool keepGoing = true;
+ if ( !ArkSettings::extractOverwrite() && !alreadyExisting.isEmpty() )
+ {
+ keepGoing = ( KMessageBox::Continue == KMessageBox::warningContinueCancelList( this,
+ i18n( "The following files will not be extracted\nbecause they "
+ "already exist:" ), alreadyExisting ) );
+ }
+
+ if ( keepGoing ) // if the user's OK with those failures, go ahead
+ {
+ // unless we have no space!
+ if ( ArkUtils::diskHasSpace( extractDir, m_nSizeOfFiles ) )
+ {
+ disableAll();
+ connect( arch, SIGNAL( sigExtract( bool ) ), this, SLOT( extractToSlotExtractDone( bool ) ) );
+ arch->unarchFile( 0, extractDir );
+ }
+ else
+ {
+ KMessageBox::error( this, i18n( "Not enough free disc space to extract the archive." ) );
+ emit request_file_quit();
+ return;
+ }
+ }
+ else
+ emit request_file_quit();
+}
+
+void
+ArkWidget::extractToSlotExtractDone( bool success )
+{
+ disconnect( arch, SIGNAL( sigExtract( bool ) ), this, SLOT( extractToSlotExtractDone( bool ) ) );
+ if ( !success )
+ {
+ kdDebug( 1601 ) << "Last Shell Output" << arch->getLastShellOutput() << endl;
+ KMessageBox::error( this, i18n( "An error occurred while extracting the archive." ) );
+ emit request_file_quit();
+ return;
+ }
+
+ if ( m_extractRemote )
+ {
+ connect( this, SIGNAL( extractRemoteMovingDone() ), this, SIGNAL( request_file_quit() ) );
+ extractRemoteInitiateMoving( m_extractTo_targetDirectory );
+ }
+ else
+ emit request_file_quit();
+}
+
+bool
+ArkWidget::addToArchive( const KURL::List & filesToAdd, const KURL & archive)
+{
+ m_addToArchive_filesToAdd = filesToAdd;
+ m_addToArchive_archive = archive;
+ if ( !KIO::NetAccess::exists( archive, false, this ) )
+ {
+ if ( !m_openAsMimeType.isEmpty() )
+ {
+ QStringList extensions = KMimeType::mimeType( m_openAsMimeType )->patterns();
+ QStringList::Iterator it = extensions.begin();
+ QString file = archive.path();
+ for ( ; it != extensions.end() && !file.endsWith( ( *it ).remove( '*' ) ); ++it )
+ ;
+
+ if ( it == extensions.end() )
+ {
+ file += ArchiveFormatInfo::self()->defaultExtension( m_openAsMimeType );
+ const_cast< KURL & >( archive ).setPath( file );
+ }
+ }
+
+ connect( this, SIGNAL( createDone( bool ) ), this, SLOT( addToArchiveSlotCreateDone( bool ) ) );
+
+ // TODO: remote Archives should be handled by createArchive
+ if ( archive.isLocalFile() )
+ {
+ if ( !createArchive( archive.path() ) )
+ return false;
+ }
+ else
+ {
+ if ( !createArchive( tmpDir() + archive.fileName() ) )
+ return false;
+ }
+ return true;
+
+ }
+ connect( this, SIGNAL( openDone( bool ) ), this, SLOT( addToArchiveSlotOpenDone( bool ) ) );
+ return true;
+}
+
+void
+ArkWidget::addToArchiveSlotCreateDone( bool success )
+{
+ disconnect( this, SIGNAL( createDone( bool ) ), this, SLOT( addToArchiveSlotCreateDone( bool ) ) );
+ if ( !success )
+ {
+ kdDebug( 1601 ) << "Could not create the archive" << endl;
+ emit request_file_quit();
+ return;
+ }
+ addToArchiveSlotOpenDone( true );
+}
+
+void
+ArkWidget::addToArchiveSlotOpenDone( bool success )
+{
+ kdDebug( 1601 ) << k_funcinfo << endl;
+ disconnect( this, SIGNAL( openDone( bool ) ), this, SLOT( addToArchiveSlotOpenDone( bool ) ) );
+ // TODO: handle dirs with addDir ( or better+easier: get rid of the need to do that entirely )
+ if ( !success )
+ {
+ emit request_file_quit();
+ return;
+ }
+
+ if ( m_bIsSimpleCompressedFile && (m_nNumFiles == 1))
+ {
+ QString strFilename;
+ KURL url = askToCreateRealArchive();
+ strFilename = url.path();
+ if (!strFilename.isEmpty())
+ {
+ connect( this, SIGNAL( createRealArchiveDone( bool ) ), this, SLOT( addToArchiveSlotAddDone( bool ) ) );
+ createRealArchive( strFilename, m_addToArchive_filesToAdd.toStringList() );
+ return;
+ }
+ else
+ {
+ emit request_file_quit();
+ return;
+ }
+ }
+
+/* QStringList list = m_addToArchive_filesToAdd.toStringList();
+ if ( !ArkUtils::diskHasSpace( tmpDir(), ArkUtils::getSizes( &list ) ) )
+ {
+ KMessageBox::error( this, i18n( "Not enough free disc space to extract the archive." ) );
+ emit request_file_quit();
+ return;
+ }*/
+
+ disableAll();
+ // if they are URLs, we have to download them, replace the URLs
+ // with filenames, and remember to delete the temporaries later.
+/* for ( QStringList::Iterator it = list.begin();
+ it != list.end(); ++it)
+ {
+ QString str = *it;
+ KURL url( toLocalFile( str ) );
+ *it = url.prettyURL();
+ }
+*/
+ KURL::List list = m_addToArchive_filesToAdd;
+
+
+ // Remote URLs need to be downloaded.
+ KURL::List::Iterator end( list.end() );
+ for ( KURL::List::Iterator it = list.begin(); it != end; ++it )
+ {
+ if (!(*it).isLocalFile())
+ {
+ *it = toLocalFile( *it );
+ }
+ }
+
+ kdDebug( 1601 ) << "Adding: " << list << endl;
+
+ connect( arch, SIGNAL( sigAdd( bool ) ), this, SLOT( addToArchiveSlotAddDone( bool ) ) );
+ arch->addFile( list.toStringList() );
+}
+
+void
+ArkWidget::addToArchiveSlotAddDone( bool success )
+{
+ kdDebug( 1601 ) << k_funcinfo << endl;
+ disconnect( this, SLOT( addToArchiveSlotAddDone( bool ) ) );
+ if ( !success )
+ {
+ KMessageBox::error( this, i18n( "An error occurred while adding the files to the archive." ) );
+ }
+ if ( !m_addToArchive_archive.isLocalFile() )
+ KIO::NetAccess::upload( m_strArchName, m_addToArchive_archive, this );
+ emit request_file_quit();
+ return;
+}
+
+void ArkWidget::setOpenAsMimeType( const QString & mimeType )
+{
+ m_openAsMimeType = mimeType;
+}
+
+void
+ArkWidget::file_open(const KURL& url)
+{
+ if ( url.isEmpty() )
+ {
+ kdDebug( 1601 ) << "file_open: url empty" << endl;
+ return;
+ }
+
+ if ( isArchiveOpen() )
+ file_close(); // close old arch. If we don't, our temp file is wrong!
+
+ if ( !url.isLocalFile() )
+ {
+ kdWarning ( 1601 ) << url.prettyURL() << " is not a local URL in ArkWidget::file_open( KURL). Aborting. " << endl;
+ return;
+ }
+
+
+ QString strFile = url.path();
+
+ kdDebug( 1601 ) << "File to open: " << strFile << endl;
+
+ QFileInfo fileInfo( strFile );
+ if ( !fileInfo.exists() )
+ {
+ KMessageBox::error(this, i18n("The archive %1 does not exist.").arg(strFile));
+ emit removeRecentURL( m_realURL );
+ return;
+ }
+ else if ( !fileInfo.isReadable() )
+ {
+ KMessageBox::error(this, i18n("You do not have permission to access that archive.") );
+ emit removeRecentURL( m_realURL );
+ return;
+ }
+
+ // see if the user is just opening the same file that's already
+ // open (erm...)
+
+ if (strFile == m_strArchName && m_bIsArchiveOpen)
+ {
+ kdDebug( 1601 ) << "file_open: strFile == m_strArchName" << endl;
+ return;
+ }
+
+ // no errors if we made it this far.
+
+ // Set the current archive filename to the filename
+ m_strArchName = strFile;
+ m_url = url;
+ //arch->clearShellOutput();
+
+ openArchive( strFile );
+}
+
+
+// File menu /////////////////////////////////////////////////////////
+
+KURL
+ArkWidget::getCreateFilename(const QString & _caption,
+ const QString & _defaultMimeType,
+ bool allowCompressed,
+ const QString & _suggestedName )
+{
+ int choice=0;
+ bool fileExists = true;
+ QString strFile;
+ KURL url;
+
+ KFileDialog dlg( ":ArkSaveAsDialog", QString::null, this, "SaveAsDialog", true );
+ dlg.setCaption( _caption );
+ dlg.setOperationMode( KFileDialog::Saving );
+ dlg.setMimeFilter( ArchiveFormatInfo::self()->supportedMimeTypes( allowCompressed ),
+ _defaultMimeType.isNull() ? "application/x-tgz" : _defaultMimeType );
+ if ( !_suggestedName.isEmpty() )
+ dlg.setSelection( _suggestedName );
+
+ while ( fileExists )
+ // keep asking for filenames as long as the user doesn't want to
+ // overwrite existing ones; break if they agree to overwrite
+ // or if the file doesn't already exist. Return if they cancel.
+ // Also check for proper extensions.
+ {
+ dlg.exec();
+ url = dlg.selectedURL();
+ strFile = url.path();
+
+ if (strFile.isEmpty())
+ return QString::null;
+
+ //the user chose to save as the current archive
+ //or wanted to create a new one with the same name
+ //no need to do anything
+ if (strFile == m_strArchName && m_bIsArchiveOpen)
+ return QString::null;
+
+ QStringList extensions = dlg.currentFilterMimeType()->patterns();
+ QStringList::Iterator it = extensions.begin();
+ for ( ; it != extensions.end() && !strFile.endsWith( ( *it ).remove( '*' ) ); ++it )
+ ;
+
+ if ( it == extensions.end() )
+ {
+ strFile += ArchiveFormatInfo::self()->defaultExtension( dlg.currentFilterMimeType()->name() );
+ url.setPath( strFile );
+ }
+
+ kdDebug(1601) << "Trying to create an archive named " << strFile << endl;
+ fileExists = QFile::exists( strFile );
+ if( fileExists )
+ {
+ choice = KMessageBox::warningYesNoCancel(0,
+ i18n("Archive already exists. Do you wish to overwrite it?"),
+ i18n("Archive Already Exists"), i18n("Overwrite"), i18n("Do Not Overwrite"));
+
+ if ( choice == KMessageBox::Yes )
+ {
+ QFile::remove( strFile );
+ break;
+ }
+ else if ( choice == KMessageBox::Cancel )
+ {
+ return QString::null;
+ }
+ else
+ {
+ continue;
+ }
+ }
+ // if we got here, the file does not already exist.
+ if ( !ArkUtils::haveDirPermissions( url.directory() ) )
+ {
+ KMessageBox::error( this,
+ i18n( "You do not have permission"
+ " to write to the directory %1" ).arg(url.directory() ) );
+ return QString::null;
+ }
+ } // end of while loop
+
+ return url;
+}
+
+void
+ArkWidget::file_new()
+{
+ QString strFile;
+ KURL url = getCreateFilename(i18n("Create New Archive") );
+ strFile = url.path();
+ if (!strFile.isEmpty())
+ {
+ file_close();
+ createArchive( strFile );
+ }
+}
+
+void
+ArkWidget::extractOnlyOpenDone()
+{
+ bool done = action_extract();
+
+ // last extract dir is still set, but this is not a problem
+ if( !done )
+ {
+ emit request_file_quit();
+ }
+
+}
+
+void
+ArkWidget::slotExtractDone(bool success)
+{
+ disconnect( arch, SIGNAL( sigExtract( bool ) ),
+ this, SLOT( slotExtractDone(bool) ) );
+ ready();
+
+ if(m_extractList != 0)
+ delete m_extractList;
+ m_extractList = 0;
+
+ if( m_fileListView ) // avoid race condition, don't do updates if application is exiting
+ {
+ m_fileListView->setUpdatesEnabled(true);
+ fixEnables();
+ }
+
+ if ( m_extractRemote )
+ {
+ extractRemoteInitiateMoving( m_extractURL );
+ }
+ else if( m_extractOnly )
+ {
+ emit request_file_quit();
+ }
+
+ if ( success && ArkSettings::openDestinationFolder() )
+ {
+ KRun::runURL( m_extractURL, "inode/directory" );
+ }
+
+ kdDebug(1601) << "-ArkWidget::slotExtractDone" << endl;
+}
+
+void
+ArkWidget::extractRemoteInitiateMoving( const KURL & target )
+{
+ KURL srcDirURL;
+ KURL src;
+ QString srcDir;
+
+ srcDir = m_extractRemoteTmpDir->name();
+ srcDirURL.setPath( srcDir );
+
+ QDir dir( srcDir );
+ dir.setFilter( QDir::All | QDir::Hidden );
+ QStringList lst( dir.entryList() );
+ lst.remove( "." );
+ lst.remove( ".." );
+
+ KURL::List srcList;
+ for( QStringList::ConstIterator it = lst.begin(); it != lst.end() ; ++it)
+ {
+ src = srcDirURL;
+ src.addPath( *it );
+ srcList.append( src );
+ }
+
+ m_extractURL.adjustPath( 1 );
+
+ KIO::CopyJob *job = KIO::copy( srcList, target, this );
+ connect( job, SIGNAL(result(KIO::Job*)),
+ this, SLOT(slotExtractRemoteDone(KIO::Job*)) );
+
+ m_extractRemote = false;
+}
+
+void
+ArkWidget::slotExtractRemoteDone(KIO::Job *job)
+{
+ delete m_extractRemoteTmpDir;
+ m_extractRemoteTmpDir = NULL;
+
+ if ( job->error() )
+ job->showErrorDialog();
+
+ emit extractRemoteMovingDone();
+
+ if ( m_extractOnly )
+ emit request_file_quit();
+}
+
+
+void
+ArkWidget::disableAll() // private
+{
+ emit disableAllActions();
+ m_fileListView->setUpdatesEnabled(true);
+}
+
+void
+ArkWidget::fixEnables() // private
+{
+ emit fixActions(); //connected to the part
+}
+
+void
+ArkWidget::file_close()
+{
+ if ( isArchiveOpen() )
+ {
+ closeArch();
+ emit setWindowCaption( QString::null );
+ emit removeOpenArk( m_strArchName );
+ updateStatusTotals();
+ updateStatusSelection();
+ fixEnables();
+ }
+ else
+ {
+ closeArch();
+ }
+
+ m_strArchName = QString::null;
+ m_url = KURL();
+}
+
+
+KURL
+ArkWidget::askToCreateRealArchive()
+{
+ // ask user whether to create a real archive from a compressed file
+ // returns filename if so
+ KURL url;
+ int choice =
+ KMessageBox::warningYesNo(0, i18n("You are currently working with a simple compressed file.\nWould you like to make it into an archive so that it can contain multiple files?\nIf so, you must choose a name for your new archive."), i18n("Warning"),i18n("Make Into Archive"),i18n("Do Not Make"));
+ if (choice == KMessageBox::Yes)
+ {
+ url = getCreateFilename( i18n("Create New Archive"),
+ QString::null, false );
+ }
+ else
+ url.setPath( QString::null );
+ return url;
+}
+
+void
+ArkWidget::createRealArchive( const QString & strFilename, const QStringList & filesToAdd )
+{
+ Arch * newArch = getNewArchive( strFilename );
+ busy( i18n( "Creating archive..." ) );
+ if ( !newArch )
+ return;
+ if ( !filesToAdd.isEmpty() )
+ m_pTempAddList = new QStringList( filesToAdd );
+ m_compressedFile = static_cast< CompressedFile * >( arch )->tempFileName();
+ KURL u1, u2;
+ u1.setPath( m_compressedFile );
+ m_createRealArchTmpDir = new KTempDir( tmpDir() + "create_real_arch" );
+ u2.setPath( m_createRealArchTmpDir->name() + u1.fileName() );
+ KIO::NetAccess::copy( u1, u2, this );
+ m_compressedFile = "file:" + u2.path(); // AGAIN THE 5 SPACES Hack :-(
+ connect( newArch, SIGNAL( sigCreate( Arch *, bool, const QString &, int ) ),
+ this, SLOT( createRealArchiveSlotCreate( Arch *, bool,
+ const QString &, int ) ) );
+ file_close();
+ newArch->create();
+}
+
+void
+ArkWidget::createRealArchiveSlotCreate( Arch * newArch, bool success,
+ const QString & fileName, int nbr )
+{
+ slotCreate( newArch, success, fileName, nbr );
+
+ if ( !success )
+ return;
+
+ QStringList listForCompressedFile;
+ listForCompressedFile.append(m_compressedFile);
+ disableAll();
+
+ connect( newArch, SIGNAL( sigAdd( bool ) ), this,
+ SLOT( createRealArchiveSlotAddDone( bool ) ) );
+
+ newArch->addFile(listForCompressedFile);
+}
+
+void
+ArkWidget::createRealArchiveSlotAddDone( bool success )
+{
+ kdDebug( 1601 ) << "createRealArchiveSlotAddDone+, success:" << success << endl;
+ disconnect( arch, SIGNAL( sigAdd( bool ) ), this,
+ SLOT( createRealArchiveSlotAddDone( bool ) ) );
+
+ m_createRealArchTmpDir->unlink();
+ delete m_createRealArchTmpDir;
+ m_createRealArchTmpDir = NULL;
+
+
+ if ( !success )
+ return;
+
+ ready();
+
+ if ( m_pTempAddList == NULL )
+ {
+ // now get the files to be added
+ // we don't know which files to add yet
+ action_add();
+ }
+ else
+ {
+ connect( arch, SIGNAL( sigAdd( bool ) ), this,
+ SLOT( createRealArchiveSlotAddFilesDone( bool ) ) );
+ // files were dropped in
+ addFile( m_pTempAddList );
+ }
+}
+
+void
+ArkWidget::createRealArchiveSlotAddFilesDone( bool success )
+{
+ //kdDebug( 1601 ) << "createRealArchiveSlotAddFilesDone+, success:" << success << endl;
+ disconnect( arch, SIGNAL( sigAdd( bool ) ), this,
+ SLOT( createRealArchiveSlotAddFilesDone( bool ) ) );
+ delete m_pTempAddList;
+ m_pTempAddList = NULL;
+ emit createRealArchiveDone( success );
+}
+
+
+
+
+// Action menu /////////////////////////////////////////////////////////
+
+void
+ArkWidget::action_add()
+{
+ if (m_bIsSimpleCompressedFile && (m_nNumFiles == 1))
+ {
+ QString strFilename;
+ KURL url = askToCreateRealArchive();
+ strFilename = url.path();
+ if (!strFilename.isEmpty())
+ {
+ createRealArchive(strFilename);
+ }
+ return;
+ }
+
+ KFileDialog fileDlg( ":ArkAddDir", QString::null, this, "adddlg", true );
+ fileDlg.setMode( KFile::Mode( KFile::Files | KFile::ExistingOnly ) );
+ fileDlg.setCaption(i18n("Select Files to Add"));
+
+ if(fileDlg.exec())
+ {
+ KURL::List addList;
+ addList = fileDlg.selectedURLs();
+ QStringList * list = new QStringList();
+ //Here we pre-calculate the end of the list
+ KURL::List::ConstIterator endList = addList.end();
+ for (KURL::List::ConstIterator it = addList.begin(); it != endList; ++it)
+ list->append( KURL::decode_string( (*it).url() ) );
+
+ if ( list->count() > 0 )
+ {
+ if ( m_bIsSimpleCompressedFile && list->count() > 1 )
+ {
+ QString strFilename;
+ KURL url = askToCreateRealArchive();
+ strFilename = url.path();
+ if (!strFilename.isEmpty())
+ {
+ createRealArchive(strFilename);
+ }
+ delete list;
+ return;
+ }
+ addFile( list );
+ }
+ delete list;
+ }
+}
+
+void
+ArkWidget::addFile(QStringList *list)
+{
+ if ( !ArkUtils::diskHasSpace( tmpDir(), ArkUtils::getSizes( list ) ) )
+ return;
+
+ disableAll();
+ busy( i18n( "Adding files..." ) );
+ // if they are URLs, we have to download them, replace the URLs
+ // with filenames, and remember to delete the temporaries later.
+ for (QStringList::Iterator it = list->begin(); it != list->end(); ++it)
+ {
+ QString str = *it;
+ *it = toLocalFile(KURL(str)).prettyURL();
+
+ }
+
+ connect( arch, SIGNAL( sigAdd( bool ) ), this, SLOT( slotAddDone( bool ) ) );
+ arch->addFile( ( *list ) );
+}
+
+void
+ArkWidget::action_add_dir()
+{
+ KURL u = KDirSelectDialog::selectDirectory( ":ArkAddDir",
+ false, this,
+ i18n("Select Folder to Add"));
+
+ QString dir = KURL::decode_string( u.url(-1) );
+ if ( !dir.isEmpty() )
+ {
+ busy( i18n( "Adding folder..." ) );
+ disableAll();
+ u = toLocalFile(u);
+ connect( arch, SIGNAL( sigAdd( bool ) ), this, SLOT( slotAddDone( bool ) ) );
+ arch->addDir( u.prettyURL() );
+ }
+
+}
+
+void
+ArkWidget::slotAddDone(bool _bSuccess)
+{
+ disconnect( arch, SIGNAL( sigAdd( bool ) ), this, SLOT( slotAddDone( bool ) ) );
+ m_fileListView->setUpdatesEnabled(true);
+ m_fileListView->triggerUpdate();
+ ready();
+
+ if (_bSuccess)
+ {
+ m_modified = true;
+ //simulate reload
+ KURL u;
+ u.setPath( arch->fileName() );
+ file_close();
+ file_open( u );
+ emit setWindowCaption( u.path() );
+ }
+ removeDownloadedFiles();
+ fixEnables();
+}
+
+
+
+KURL
+ArkWidget::toLocalFile( const KURL& url )
+{
+ KURL localURL = url;
+
+ if(!url.isLocalFile())
+ {
+ QString strURL = url.prettyURL();
+
+ QString tempfile = tmpDir();
+ tempfile += strURL.right(strURL.length() - strURL.findRev("/") - 1);
+ deleteAfterUse(tempfile); // remember for deletion
+ KURL tempurl; tempurl.setPath( tempfile );
+ if( !KIO::NetAccess::dircopy(url, tempurl, this) )
+ return KURL();
+ localURL = tempfile;
+ }
+ return localURL;
+}
+
+void
+ArkWidget::deleteAfterUse( const QString& path )
+{
+ mpDownloadedList.append( path );
+}
+
+void
+ArkWidget::removeDownloadedFiles()
+{
+ if (!mpDownloadedList.isEmpty())
+ {
+ // It is necessary to remove those files even if tmpDir() is getting deleted:
+ // not all files in mpDownloadedList are from tmpDir() - e.g. when using --tempfile
+ // But of course we could decide to not add files from tmpDir() into mpDownloadedList.
+ QStringList::ConstIterator it = mpDownloadedList.begin();
+ QStringList::ConstIterator end = mpDownloadedList.end();
+ for ( ; it != end ; ++it )
+ QFile::remove( *it );
+ mpDownloadedList.clear();
+ }
+}
+
+void
+ArkWidget::action_delete()
+{
+ // remove selected files and create a list to send to the archive
+ // Warn the user if he/she/it tries to delete a directory entry in
+ // a tar file - it actually deletes the contents of the directory
+ // as well.
+
+ if (m_fileListView->isSelectionEmpty())
+ {
+ return; // shouldn't happen - delete should have been disabled!
+ }
+
+ QStringList list = m_fileListView->selectedFilenames();
+
+ // ask for confirmation
+ if ( KMessageBox::warningContinueCancelList( this,
+ i18n( "Do you really want to delete the selected items?" ),
+ list,
+ QString::null,
+ KStdGuiItem::del(),
+ "confirmDelete" )
+ != KMessageBox::Continue)
+ {
+ return;
+ }
+
+ // Remove the entries from the list view
+ QListViewItemIterator it( m_fileListView );
+ while ( it.current() )
+ {
+ if ( it.current()->isSelected() )
+ delete *it;
+ else
+ ++it;
+ }
+
+ disableAll();
+ busy( i18n( "Removing..." ) );
+ connect( arch, SIGNAL( sigDelete( bool ) ), this, SLOT( slotDeleteDone( bool ) ) );
+ arch->remove(&list);
+ kdDebug(1601) << "-ArkWidget::action_delete" << endl;
+}
+
+void
+ArkWidget::slotDeleteDone(bool _bSuccess)
+{
+ disconnect( arch, SIGNAL( sigDelete( bool ) ), this, SLOT( slotDeleteDone( bool ) ) );
+ kdDebug(1601) << "+ArkWidget::slotDeleteDone" << endl;
+ m_fileListView->setUpdatesEnabled(true);
+ m_fileListView->triggerUpdate();
+ if (_bSuccess)
+ {
+ m_modified = true;
+ updateStatusTotals();
+ updateStatusSelection();
+ }
+ // disable the select all and extract options if there are no files left
+ fixEnables();
+ ready();
+ kdDebug(1601) << "-ArkWidget::slotDeleteDone" << endl;
+
+}
+
+
+
+void
+ArkWidget::slotOpenWith()
+{
+ connect( arch, SIGNAL( sigExtract( bool ) ), this,
+ SLOT( openWithSlotExtractDone( bool ) ) );
+
+ showCurrentFile();
+}
+
+void
+ArkWidget::openWithSlotExtractDone( bool success )
+{
+ disconnect( arch, SIGNAL( sigExtract( bool ) ), this,
+ SLOT( openWithSlotExtractDone( bool ) ) );
+
+ if ( success )
+ {
+ KURL::List list;
+ list.append(m_viewURL);
+ KOpenWithDlg l( list, i18n("Open with:"), QString::null, (QWidget*)0L);
+ if ( l.exec() )
+ {
+ KService::Ptr service = l.service();
+ if ( !!service )
+ {
+ KRun::run( *service, list );
+ }
+ else
+ {
+ QString exec = l.text();
+ exec += " %f";
+ KRun::run( exec, list );
+ }
+ }
+ }
+
+ if( m_fileListView )
+ {
+ m_fileListView->setUpdatesEnabled(true);
+ fixEnables();
+ }
+}
+
+
+void
+ArkWidget::prepareViewFiles( const QStringList & fileList )
+{
+ QString destTmpDirectory;
+ destTmpDirectory = tmpDir();
+
+ // Make sure to delete previous file already there...
+ for(QStringList::ConstIterator it = fileList.begin();
+ it != fileList.end(); ++it)
+ QFile::remove(destTmpDirectory + *it);
+
+ m_viewList = new QStringList( fileList );
+ arch->unarchFile( m_viewList, destTmpDirectory, true);
+}
+
+bool
+ArkWidget::reportExtractFailures( const QString & _dest, QStringList *_list )
+{
+ // reports extract failures when Overwrite = False and the file
+ // exists already in the destination directory.
+ // If list is null, it means we are extracting all files.
+ // Otherwise the list contains the files we are to extract.
+
+ bool redoExtraction = false;
+ QString strFilename;
+
+ QStringList list = *_list;
+ QStringList filesExisting = existingFiles( _dest, list );
+
+ int numFilesToReport = filesExisting.count();
+
+ // now report on the contents
+ holdBusy();
+ if (numFilesToReport != 0)
+ {
+ redoExtraction = ( KMessageBox::Cancel == KMessageBox::warningContinueCancelList( this,
+ i18n( "The following files will not be extracted\nbecause they "
+ "already exist:" ), filesExisting ) );
+ }
+ resumeBusy();
+ return redoExtraction;
+}
+
+QStringList
+ArkWidget::existingFiles( const QString & _dest, QStringList & _list )
+{
+ QString strFilename, tmp;
+
+ QString strDestDir = _dest;
+
+ // make sure the destination directory has a / at the end.
+ if ( !strDestDir.endsWith( "/" ) )
+ {
+ strDestDir += '/';
+ }
+
+ if (_list.isEmpty())
+ {
+ _list = m_fileListView->fileNames();
+ }
+
+ QStringList existingFiles;
+ // now the list contains all the names we must verify.
+ for (QStringList::Iterator it = _list.begin(); it != _list.end(); ++it)
+ {
+ strFilename = *it;
+ QString strFullName = strDestDir + strFilename;
+
+ // if the filename ends with an "/", it means it is a directory
+ if ( QFile::exists( strFullName ) && !strFilename.endsWith("/") )
+ {
+ existingFiles.append( strFilename );
+ }
+ }
+ return existingFiles;
+}
+
+
+
+
+
+bool
+ArkWidget::action_extract()
+{
+ KURL fileToExtract;
+ fileToExtract.setPath( arch->fileName() );
+
+ //before we start, make sure the archive is still there
+ if (!KIO::NetAccess::exists( fileToExtract.prettyURL(), true, this ) )
+ {
+ KMessageBox::error(0, i18n("The archive to extract from no longer exists."));
+ return false;
+ }
+
+ //if more than one entry in the archive is root level, suggest a path prefix
+ QString prefix = m_fileListView->childCount() > 1 ?
+ QChar( '/' ) + guessName( realURL() )
+ : QString();
+
+ // Should the extraction dialog show an option for extracting only selected files?
+ bool enableSelected = ( m_nNumSelectedFiles > 0 ) &&
+ ( m_fileListView->totalFiles() > 1);
+
+ QString base = ArkSettings::extractionHistory().isEmpty()?
+ QString() : ArkSettings::extractionHistory().first();
+ if ( base.isEmpty() )
+ {
+ // Perhaps the KDE Documents folder is a better choice?
+ base = QDir::homeDirPath();
+ }
+
+ // Default URL shown in the extraction dialog;
+ KURL defaultDir( base );
+
+ if ( m_extractOnly )
+ {
+ defaultDir = KURL::fromPathOrURL( QDir::currentDirPath() );
+ }
+
+ ExtractionDialog *dlg = new ExtractionDialog( this, 0, enableSelected, defaultDir, prefix, m_url.fileName() );
+
+ bool bRedoExtract = false;
+
+ // list of files to be extracted
+ m_extractList = new QStringList;
+ if ( dlg->exec() )
+ {
+ //m_extractURL will always be the location the user chose to
+ //m_extract to, whether local or remote
+ m_extractURL = dlg->extractionDirectory();
+
+ //extractDir will either be the real, local extract dir,
+ //or in case of a extract to remote location, a local tmp dir
+ QString extractDir;
+
+ if ( !m_extractURL.isLocalFile() )
+ {
+ m_extractRemoteTmpDir = new KTempDir( tmpDir() + "extremote" );
+ m_extractRemoteTmpDir->setAutoDelete( true );
+
+ extractDir = m_extractRemoteTmpDir->name();
+ m_extractRemote = true;
+ if ( m_extractRemoteTmpDir->status() != 0 )
+ {
+ kdWarning( 1601 ) << "Unable to create temporary directory" << extractDir << endl;
+ m_extractRemote = false;
+ delete dlg;
+ return false;
+ }
+ }
+ else
+ {
+ extractDir = m_extractURL.path();
+ }
+
+ // if overwrite is false, then we need to check for failure of
+ // extractions.
+ bool bOvwrt = ArkSettings::extractOverwrite();
+
+ if ( dlg->selectedOnly() == false )
+ {
+ if (!bOvwrt) // send empty list to indicate we're extracting all
+ {
+ bRedoExtract = reportExtractFailures(extractDir, m_extractList);
+ }
+
+ if (!bRedoExtract) // if the user's OK with those failures, go ahead
+ {
+ // unless we have no space!
+ if ( ArkUtils::diskHasSpace( extractDir, m_nSizeOfFiles ) )
+ {
+ disableAll();
+ busy( i18n( "Extracting..." ) );
+ connect( arch, SIGNAL( sigExtract( bool ) ), this, SLOT( slotExtractDone(bool) ) );
+ arch->unarchFile(0, extractDir);
+ }
+ }
+ }
+ else
+ {
+ KIO::filesize_t nTotalSize = 0;
+ // make a list to send to unarchFile
+ QStringList selectedFiles = m_fileListView->selectedFilenames();
+ for ( QStringList::const_iterator it = selectedFiles.constBegin();
+ it != selectedFiles.constEnd();
+ ++it )
+ {
+ m_extractList->append( QFile::encodeName( *it ) );
+ }
+
+ if (!bOvwrt)
+ {
+ bRedoExtract = reportExtractFailures(extractDir, m_extractList);
+ }
+ if (!bRedoExtract)
+ {
+ if (ArkUtils::diskHasSpace(extractDir, nTotalSize))
+ {
+ disableAll();
+ busy( i18n( "Extracting..." ) );
+ connect( arch, SIGNAL( sigExtract( bool ) ),
+ this, SLOT( slotExtractDone(bool) ) );
+ arch->unarchFile(m_extractList, extractDir); // extract selected files
+ }
+ }
+ }
+
+ delete dlg;
+ }
+ else
+ {
+ delete dlg;
+ return false;
+ }
+
+ // user might want to change some options or the selection...
+ if (bRedoExtract)
+ {
+ return action_extract();
+ }
+
+ return true;
+}
+
+void
+ArkWidget::action_edit()
+{
+ // begin an edit. This is like a view, but once the process exits,
+ // the file is put back into the archive. If the user tries to quit or
+ // close the archive, there will be a warning that any changes to the
+ // files open under "Edit" will be lost unless the archive remains open.
+ // [hmm, does that really make sense? I'll leave it for now.]
+
+ busy( i18n( "Extracting..." ) );
+ connect( arch, SIGNAL( sigExtract( bool ) ), this,
+ SLOT( editSlotExtractDone() ) );
+ showCurrentFile();
+}
+
+void
+ArkWidget::editSlotExtractDone()
+{
+ disconnect( arch, SIGNAL( sigExtract( bool ) ),
+ this, SLOT( editSlotExtractDone() ) );
+ ready();
+ editStart();
+
+ // avoid race condition, don't do updates if application is exiting
+ if( m_fileListView )
+ {
+ m_fileListView->setUpdatesEnabled(true);
+ fixEnables();
+ }
+}
+
+void
+ArkWidget::editStart()
+{
+ kdDebug(1601) << "Edit in progress..." << endl;
+ KURL::List list;
+ // edit will be in progress until the KProcess terminates.
+ KOpenWithDlg l( list, i18n("Edit with:"),
+ QString::null, (QWidget*)0L );
+ if ( l.exec() )
+ {
+ KProcess *kp = new KProcess;
+
+ *kp << l.text() << m_strFileToView;
+ connect( kp, SIGNAL(processExited(KProcess *)),
+ this, SLOT(slotEditFinished(KProcess *)) );
+ if ( kp->start(KProcess::NotifyOnExit, KProcess::AllOutput) == false )
+ {
+ KMessageBox::error(0, i18n("Trouble editing the file..."));
+ }
+ }
+}
+
+void
+ArkWidget::slotEditFinished(KProcess *kp)
+{
+ kdDebug(1601) << "+ArkWidget::slotEditFinished" << endl;
+ connect( arch, SIGNAL( sigAdd( bool ) ), this, SLOT( editSlotAddDone( bool ) ) );
+ delete kp;
+ QStringList list;
+ // now put the file back into the archive.
+ list.append(m_strFileToView);
+ disableAll();
+
+
+ // BUG: this puts any edited file back at the archive toplevel...
+ // there's only one file, and it's in the temp directory.
+ // If the filename has more than three /'s then we should
+ // change to the first level directory so that the paths
+ // come out right.
+ QStringList::Iterator it = list.begin();
+ QString filename = *it;
+ QString path;
+ if (filename.contains('/') > 3)
+ {
+ kdDebug(1601) << "Filename is originally: " << filename << endl;
+ int i = filename.find('/', 5);
+ path = filename.left(1+i);
+ kdDebug(1601) << "Changing to dir: " << path << endl;
+ QDir::setCurrent(path);
+ filename = filename.right(filename.length()-i-1);
+ // HACK!! We need a relative path. If I have "file:", it
+ // will look like an absolute path. So five spaces here to get
+ // chopped off later....
+ filename = " " + filename;
+ *it = filename;
+ }
+
+ busy( i18n( "Readding edited file..." ) );
+ arch->addFile( list );
+
+ kdDebug(1601) << "-ArkWidget::slotEditFinished" << endl;
+}
+
+void
+ArkWidget::editSlotAddDone( bool success )
+{
+ ready();
+ disconnect( arch, SIGNAL( sigAdd( bool ) ), this, SLOT( editSlotAddDone( bool ) ) );
+ slotAddDone( success );
+}
+
+void
+ArkWidget::action_view()
+{
+ connect( arch, SIGNAL( sigExtract( bool ) ), this,
+ SLOT( viewSlotExtractDone( bool ) ) );
+ busy( i18n( "Extracting file to view" ) );
+ showCurrentFile();
+}
+
+void
+ArkWidget::viewSlotExtractDone( bool success )
+{
+ if ( success )
+ {
+ chmod( QFile::encodeName( m_strFileToView ), 0400 );
+ bool view = true;
+
+ if ( ArkSettings::useIntegratedViewer() )
+ {
+ ArkViewer * viewer = new ArkViewer( this, "viewer" );
+
+ if ( !viewer->view( m_viewURL ) )
+ {
+ QString text = i18n( "The internal viewer is not able to display this file. Would you like to view it using an external program?" );
+ view = ( KMessageBox::warningYesNo( this, text, QString::null, i18n("View Externally"), i18n("Do Not View") ) == KMessageBox::Yes );
+
+ if ( view )
+ viewInExternalViewer( this, m_viewURL );
+ }
+ }
+ else
+ {
+ viewInExternalViewer( this, m_viewURL );
+ }
+ }
+
+ disconnect( arch, SIGNAL( sigExtract( bool ) ), this,
+ SLOT( viewSlotExtractDone( bool ) ) );
+
+ delete m_viewList;
+
+ // avoid race condition, don't do updates if application is exiting
+ if( m_fileListView )
+ {
+ m_fileListView->setUpdatesEnabled(true);
+ fixEnables();
+ }
+ ready();
+}
+
+
+void
+ArkWidget::showCurrentFile()
+{
+ if ( !m_fileListView->currentItem() )
+ return;
+
+ QString name = m_fileListView->currentItem()->fileName();
+
+ QString fullname = tmpDir();
+ fullname += name;
+
+ if(fullname.contains("../"))
+ fullname.remove("../");
+
+ //Convert the QString filename to KURL to escape the bad characters
+ m_viewURL.setPath(fullname);
+
+ m_strFileToView = fullname;
+ kdDebug(1601) << "File to be extracted: " << m_viewURL << endl;
+
+ QStringList extractList;
+ extractList.append(name);
+
+ if (ArkUtils::diskHasSpace( tmpDir(), m_fileListView->currentItem()->fileSize() ) )
+ {
+ disableAll();
+ prepareViewFiles( extractList );
+ }
+}
+
+// Popup /////////////////////////////////////////////////////////////
+
+void
+ArkWidget::setArchivePopupEnabled( bool b )
+{
+ m_bArchivePopupEnabled = b;
+}
+
+void
+ArkWidget::doPopup( QListViewItem *pItem, const QPoint &pPoint, int nCol ) // slot
+// do the right-click popup menus
+{
+ if ( nCol == 0 || !m_bArchivePopupEnabled )
+ {
+ m_fileListView->setCurrentItem(pItem);
+ m_fileListView->setSelected(pItem, true);
+ emit signalFilePopup( pPoint );
+ }
+ else // clicked anywhere else but the name column
+ {
+ emit signalArchivePopup( pPoint );
+ }
+}
+
+
+void
+ArkWidget::viewFile( QListViewItem* item ) // slot
+// show contents when double click
+{
+ // Preview, if it is a file
+ if ( item->childCount() == 0)
+ emit action_view();
+ else // Change opened state if it is a dir
+ item->setOpen( !item->isOpen() );
+}
+
+
+// Service functions /////////////////////////////////////////////////
+
+void
+ArkWidget::slotSelectionChanged()
+{
+ updateStatusSelection();
+}
+
+
+////////////////////////////////////////////////////////////////////
+//////////////////// updateStatusSelection /////////////////////////
+////////////////////////////////////////////////////////////////////
+
+void
+ArkWidget::updateStatusSelection()
+{
+ m_nNumSelectedFiles = m_fileListView->selectedFilesCount();
+ m_nSizeOfSelectedFiles = m_fileListView->selectedSize();
+
+ QString strInfo;
+ if (m_nNumSelectedFiles == 0)
+ {
+ strInfo = i18n("0 files selected");
+ }
+ else if (m_nNumSelectedFiles != 1)
+ {
+ strInfo = i18n("%1 files selected %2")
+ .arg(KGlobal::locale()->formatNumber(m_nNumSelectedFiles, 0))
+ .arg(KIO::convertSize(m_nSizeOfSelectedFiles));
+ }
+ else
+ {
+ strInfo = i18n("1 file selected %2")
+ .arg(KIO::convertSize(m_nSizeOfSelectedFiles));
+ }
+
+ emit setStatusBarSelectedFiles(strInfo);
+ fixEnables();
+}
+
+
+// Drag & Drop ////////////////////////////////////////////////////////
+
+void
+ArkWidget::dragMoveEvent(QDragMoveEvent *e)
+{
+ if (KURLDrag::canDecode(e) && !m_bDropSourceIsSelf)
+ {
+ e->accept();
+ }
+}
+
+
+void
+ArkWidget::dropEvent(QDropEvent* e)
+{
+ kdDebug( 1601 ) << "+ArkWidget::dropEvent" << endl;
+
+ KURL::List list;
+
+ if ( KURLDrag::decode( e, list ) )
+ {
+ QStringList urlList = list.toStringList();
+ dropAction( urlList );
+ }
+
+ kdDebug(1601) << "-dropEvent" << endl;
+}
+
+//////////////////////////////////////////////////////////////////////
+///////////////////////// dropAction /////////////////////////////////
+//////////////////////////////////////////////////////////////////////
+
+void
+ArkWidget::dropAction( QStringList & list )
+{
+ // Called by dropEvent
+
+ // The possibilities treated are as follows:
+ // drop a regular file into a window with
+ // * an open archive - add it.
+ // * no open archive - ask user to open an archive for adding file or cancel
+ // drop an archive into a window with
+ // * an open archive - ask user to add to open archive or to open it freshly
+ // * no open archive - open it
+ // drop many files (can be a mix of archives and regular) into a window with
+ // * an open archive - add them.
+ // * no open archive - ask user to open an archive for adding files or cancel
+
+ // and don't forget about gzip files.
+
+ QString str;
+ QStringList urls; // to be sent to addFile
+
+ str = list.first();
+
+ if ( 1 == list.count() &&
+ ( UNKNOWN_FORMAT != ArchiveFormatInfo::self()->archTypeByExtension( str ) ) )
+ {
+ // if there's one thing being dropped and it's an archive
+ if (isArchiveOpen())
+ {
+ // ask them if they want to add the dragged archive to the current
+ // one or open it as the new current archive
+ int nRet = KMessageBox::warningYesNoCancel(this,
+ i18n("Do you wish to add this to the current archive or open it as a new archive?"),
+ QString::null,
+ i18n("&Add"), i18n("&Open"));
+ if (KMessageBox::Yes == nRet) // add it
+ {
+ if (m_bIsSimpleCompressedFile && (m_nNumFiles == 1))
+ {
+ QString strFilename;
+ KURL url = askToCreateRealArchive();
+ strFilename = url.path();
+ if (!strFilename.isEmpty())
+ {
+ createRealArchive( strFilename, list );
+ }
+ return;
+ }
+
+ addFile( &list );
+ return;
+ }
+ else if (KMessageBox::Cancel == nRet) // cancel
+ {
+ return;
+ }
+ }
+
+ // if I made it here, there's either no archive currently open
+ // or they selected "Open".
+ KURL url = str;
+
+ emit openURLRequest( url );
+ }
+ else
+ {
+ if (isArchiveOpen())
+ {
+ if (m_bIsSimpleCompressedFile && (m_nNumFiles == 1))
+ {
+ QString strFilename;
+ KURL url = askToCreateRealArchive();
+ strFilename = url.path();
+ if (!strFilename.isEmpty())
+ {
+ createRealArchive( strFilename, list );
+ }
+ return;
+ }
+ // add the files to the open archive
+ addFile( &list );
+ }
+ else
+ {
+ // no archive is open, so we ask if the user wants to open one
+ // for this/these file/files.
+
+ QString str;
+ str = (list.count() > 1)
+ ? i18n("There is no archive currently open. Do you wish to create one now for these files?")
+ : i18n("There is no archive currently open. Do you wish to create one now for this file?");
+ int nRet = KMessageBox::warningYesNo(this, str, QString::null, i18n("Create Archive"), i18n("Do Not Create"));
+ if (nRet == KMessageBox::Yes) // yes
+ {
+ file_new();
+ if (isArchiveOpen()) // they still could have canceled!
+ {
+ addFile( &list );
+ }
+ }
+ // else // basically a cancel on the drop.
+ }
+ }
+}
+
+void
+ArkWidget::startDrag( const QStringList & fileList )
+{
+ mDragFiles = fileList;
+ connect( arch, SIGNAL( sigExtract( bool ) ), this, SLOT( startDragSlotExtractDone( bool ) ) );
+ prepareViewFiles( fileList );
+}
+
+void
+ArkWidget::startDragSlotExtractDone( bool )
+{
+ disconnect( arch, SIGNAL( sigExtract( bool ) ),
+ this, SLOT( startDragSlotExtractDone( bool ) ) );
+
+ KURL::List list;
+
+ for (QStringList::Iterator it = mDragFiles.begin(); it != mDragFiles.end(); ++it)
+ {
+ KURL url;
+ url.setPath( tmpDir() + *it );
+ list.append( url );
+ }
+
+ KURLDrag *drg = new KURLDrag(list, m_fileListView->viewport(), "Ark Archive Drag" );
+ m_bDropSourceIsSelf = true;
+ drg->dragCopy();
+ m_bDropSourceIsSelf = false;
+}
+
+
+void
+ArkWidget::arkWarning(const QString& msg)
+{
+ KMessageBox::information(this, msg);
+}
+
+void
+ArkWidget::createFileListView()
+{
+ kdDebug(1601) << "ArkWidget::createFileListView" << endl;
+ if ( !m_fileListView )
+ {
+ m_fileListView = new FileListView(this);
+
+ connect( m_fileListView, SIGNAL( selectionChanged() ),
+ this, SLOT( slotSelectionChanged() ) );
+ connect( m_fileListView, SIGNAL( rightButtonPressed(QListViewItem *, const QPoint &, int) ),
+ this, SLOT(doPopup(QListViewItem *, const QPoint &, int)));
+ connect( m_fileListView, SIGNAL( startDragRequest( const QStringList & ) ),
+ this, SLOT( startDrag( const QStringList & ) ) );
+ connect( m_fileListView, SIGNAL( executed(QListViewItem *, const QPoint &, int ) ),
+ this, SLOT( viewFile(QListViewItem*) ) );
+ connect( m_fileListView, SIGNAL( returnPressed(QListViewItem * ) ),
+ this, SLOT( viewFile(QListViewItem*) ) );
+ }
+ m_fileListView->clear();
+}
+
+
+Arch * ArkWidget::getNewArchive( const QString & _fileName, const QString& _mimetype )
+{
+ Arch * newArch = 0;
+
+ QString type = _mimetype.isNull()? KMimeType::findByURL( KURL::fromPathOrURL(_fileName) )->name() : _mimetype;