From 090dce1cee5e7a7efb9703dba9149217dd1117e0 Mon Sep 17 00:00:00 2001
From: Timothy Pearson <kb9vqf@pearsoncomputing.net>
Date: Sun, 27 Jan 2013 00:56:26 -0600
Subject: Rename a number of libraries and executables to avoid conflicts with
 KDE4

---
 ChangeLog                               |    2 +-
 acinclude.m4                            |    8 +-
 plugin/smb4k_konqplugin.cpp             |    4 +-
 po/de.po                                |   94 +-
 po/es.po                                |   94 +-
 po/it.po                                |   94 +-
 po/ja.po                                |   94 +-
 po/sv.po                                |   94 +-
 po/uk.po                                |   94 +-
 smb4k.kdevses                           |    4 +-
 smb4k/configdlg/Makefile.am             |   10 +-
 smb4k/configdlg/smb4kconfigdialog.cpp   | 1222 ---------------------
 smb4k/configdlg/smb4kconfigdialog.h     |  210 ----
 smb4k/configdlg/smb4tdeconfigdialog.cpp | 1222 +++++++++++++++++++++
 smb4k/configdlg/smb4tdeconfigdialog.h   |  210 ++++
 smb4k/configdlg/smb4tdersyncoptions.cpp |    2 +-
 smb4k/core/Makefile.am                  |    6 +-
 smb4k/core/smb4kcore.h                  |    2 +-
 smb4k/core/smb4kfileio.cpp              | 1795 -------------------------------
 smb4k/core/smb4kfileio.h                |  247 -----
 smb4k/core/smb4kglobal.cpp              |    2 +-
 smb4k/core/smb4kglobal.h                |    2 +-
 smb4k/core/smb4kglobal_p.h              |    2 +-
 smb4k/core/smb4khomesshareshandler.h    |    2 +-
 smb4k/core/smb4kprint.cpp               |    2 +-
 smb4k/core/smb4ksambaoptionshandler.h   |    2 +-
 smb4k/core/smb4ksettings.cpp            |    2 +-
 smb4k/core/smb4tdefileio.cpp            | 1795 +++++++++++++++++++++++++++++++
 smb4k/core/smb4tdefileio.h              |  247 +++++
 smb4k/dialogs/smb4kbookmarkeditor.cpp   |    2 +-
 smb4k/iconview/smb4ksharesiconview.cpp  |    2 +-
 smb4k/listview/smb4kshareslistview.cpp  |    2 +-
 smb4k/main.cpp                          |    2 +-
 smb4k/smb4k.cpp                         |    4 +-
 smb4k/smb4ksystemtray.cpp               |    4 +-
 35 files changed, 3790 insertions(+), 3790 deletions(-)
 delete mode 100644 smb4k/configdlg/smb4kconfigdialog.cpp
 delete mode 100644 smb4k/configdlg/smb4kconfigdialog.h
 create mode 100644 smb4k/configdlg/smb4tdeconfigdialog.cpp
 create mode 100644 smb4k/configdlg/smb4tdeconfigdialog.h
 delete mode 100644 smb4k/core/smb4kfileio.cpp
 delete mode 100644 smb4k/core/smb4kfileio.h
 create mode 100644 smb4k/core/smb4tdefileio.cpp
 create mode 100644 smb4k/core/smb4tdefileio.h

diff --git a/ChangeLog b/ChangeLog
index 46e36ba..8077ace 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -59,7 +59,7 @@ Smb4K 0.9.0:
   compatibility with older versions of Smb4K.
 - Replaced the old configuration dialog with a new one based on TDEConfigDialog
   to take advantange of the TDEConfig XT infrastructure. It is a KDE module
-  library: libsmb4kconfigdialog.
+  library: libsmb4tdeconfigdialog.
 - Added some configuration options:
   + The '-S <arg>' (signing state) and '-P' (use machine account) arguments of
     smbclient are now supported.
diff --git a/acinclude.m4 b/acinclude.m4
index 60985a2..d58e432 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -602,7 +602,7 @@ AC_DEFUN([KDE_SUBST_PROGRAMS],
         fi
 
         if test -n "$trinity2ornewer"; then
-            KDE_FIND_PATH(kconfig_compiler, KCONFIG_COMPILER, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(kconfig_compiler)])
+            KDE_FIND_PATH(tdeconfig_compiler, KCONFIG_COMPILER, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(tdeconfig_compiler)])
             KDE_FIND_PATH(dcopidlng, DCOPIDLNG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidlng)])
         fi
         if test -n "$trinity3ornewer"; then
@@ -1788,7 +1788,7 @@ if test "$kde_qtver" = 1; then
   kde_check_lib="libtdecore.la"
 else
   kde_check_header="ksharedptr.h"
-  kde_check_lib="libkio.la"
+  kde_check_lib="libtdeio.la"
 fi
 
 if test -z "$1"; then
@@ -2094,7 +2094,7 @@ elif test $kde_qtver = 2; then
    AC_SUBST(LIB_KIO, "-lkio")
    AC_SUBST(LIB_KSYCOCA, "-ltdesycoca")
    AC_SUBST(LIB_SMB, "-lsmb")
-   AC_SUBST(LIB_KFILE, "-lkfile")
+   AC_SUBST(LIB_KFILE, "-ltdefile")
    AC_SUBST(LIB_KAB, "-lkab")
    AC_SUBST(LIB_KHTML, "-ltdehtml")
    AC_SUBST(LIB_KSPELL, "-ltdespell")
@@ -2104,7 +2104,7 @@ else
    AC_SUBST(LIB_TDECORE, "-ltdecore -lXext $(LIB_QT)")
    AC_SUBST(LIB_TDEUI, "-ltdeui $(LIB_TDECORE)")
    AC_SUBST(LIB_KFM, "-lkfm $(LIB_TDECORE)")
-   AC_SUBST(LIB_KFILE, "-lkfile $(LIB_KFM) $(LIB_TDEUI)")
+   AC_SUBST(LIB_KFILE, "-ltdefile $(LIB_KFM) $(LIB_TDEUI)")
    AC_SUBST(LIB_KAB, "-lkab $(LIB_KIMGIO) $(LIB_TDECORE)")
 fi
 ])
diff --git a/plugin/smb4k_konqplugin.cpp b/plugin/smb4k_konqplugin.cpp
index 6c4a6f5..d1a5dd5 100644
--- a/plugin/smb4k_konqplugin.cpp
+++ b/plugin/smb4k_konqplugin.cpp
@@ -45,7 +45,7 @@
 #include <ktoolbarbutton.h>
 #include <kaction.h>
 #include <kactionclasses.h>
-#include <kconfigdialog.h>
+#include <tdeconfigdialog.h>
 
 // plugin specific includes
 // #include "smb4k_konqplugin.moc"
@@ -184,7 +184,7 @@ void KonqSidebar_Smb4K::slotSearch()
 void KonqSidebar_Smb4K::slotSmb4KOptionsDlg()
 {
   // Load the factory of the config dialog:
-  KLibFactory *config_factory = KLibLoader::self()->factory( "libsmb4kconfigdialog" );
+  KLibFactory *config_factory = KLibLoader::self()->factory( "libsmb4tdeconfigdialog" );
 
   if ( config_factory )
   {
diff --git a/po/de.po b/po/de.po
index 7995434..55d06f2 100644
--- a/po/de.po
+++ b/po/de.po
@@ -500,18 +500,18 @@ msgstr "Benutze nmblookup (empfohlen)"
 msgid "Use smbclient"
 msgstr "Benutze smbclient"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:162
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:162
 msgid "User Interface"
 msgstr "Benutzerschnittstelle"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:163
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:163
 #: smb4k/browser/smb4knetworkbrowser.cpp:50
 #: smb4k/browser/smb4knetworkbrowser_part.cpp:186
 #: smb4k/browser/smb4knetworkbrowser_part.cpp:319
 msgid "Network"
 msgstr "Netzwerk"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:164
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:164
 #: smb4k/listview/smb4kshareslistview_part.cpp:144
 #: smb4k/listview/smb4kshareslistview_part.cpp:346
 #: smb4k/iconview/smb4ksharesiconview_part.cpp:141
@@ -519,28 +519,28 @@ msgstr "Netzwerk"
 msgid "Shares"
 msgstr "Freigaben"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:165
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:165
 #: smb4k/configdlg/smb4ksambaoptions.cpp:89
 #: smb4k/core/smb4kpasswordhandler.cpp:237
 msgid "Authentication"
 msgstr "Authentifizierung"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:166
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:166
 msgid "Samba"
 msgstr "Samba"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:167
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:167
 #: smb4k/dialogs/smb4ksynchronizationdialog.cpp:47
 msgid "Synchronization"
 msgstr "Synchronisation"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:168
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:168
 msgid "Super User"
 msgstr "Administrator"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:327
-#: smb4k/configdlg/smb4kconfigdialog.cpp:328
-#: smb4k/configdlg/smb4kconfigdialog.cpp:1039
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:327
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:328
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:1039
 #: smb4k/configdlg/smb4ksambaoptions.cpp:400
 #: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:180
 #: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:253
@@ -549,25 +549,25 @@ msgstr "Administrator"
 msgid "auto"
 msgstr "automatisch"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:331
-#: smb4k/configdlg/smb4kconfigdialog.cpp:352
-#: smb4k/configdlg/smb4kconfigdialog.cpp:441
-#: smb4k/configdlg/smb4kconfigdialog.cpp:451
-#: smb4k/configdlg/smb4kconfigdialog.cpp:1098
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:331
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:352
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:441
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:451
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:1098
 #: smb4k/configdlg/smb4ksambaoptions.cpp:428
 msgid "yes"
 msgstr "ja"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:332
-#: smb4k/configdlg/smb4kconfigdialog.cpp:353
-#: smb4k/configdlg/smb4kconfigdialog.cpp:1099
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:332
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:353
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:1099
 #: smb4k/configdlg/smb4ksambaoptions.cpp:427
 msgid "no"
 msgstr "nein"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:360
-#: smb4k/configdlg/smb4kconfigdialog.cpp:458
-#: smb4k/configdlg/smb4kconfigdialog.cpp:1060
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:360
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:458
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:1060
 #: smb4k/configdlg/smb4ksambaoptions.cpp:215
 #: smb4k/configdlg/smb4ksambaoptions.cpp:418
 #: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:289
@@ -578,8 +578,8 @@ msgstr "nein"
 msgid "read-write"
 msgstr "beschreibbar"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:361
-#: smb4k/configdlg/smb4kconfigdialog.cpp:1061
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:361
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:1061
 #: smb4k/configdlg/smb4ksambaoptions.cpp:216
 #: smb4k/configdlg/smb4ksambaoptions.cpp:419
 #: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:290
@@ -588,56 +588,56 @@ msgstr "beschreibbar"
 msgid "read-only"
 msgstr "schreibgeschützt"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:460
-#: smb4k/configdlg/smb4kconfigdialog.cpp:465
-#: smb4k/configdlg/smb4kconfigdialog.cpp:1072
-#: smb4k/configdlg/smb4kconfigdialog.cpp:1082
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:460
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:465
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:1072
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:1082
 #: smb4k/configdlg/smb4ksambaoptions.cpp:141
 #: smb4k/configdlg/smb4ksambaoptions.cpp:167
 msgid "default"
 msgstr "Standard"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:707
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:707
 msgid "[Network] The custom master browser has not been entered.\n"
 msgstr ""
 "[Netzwerk] Der benutzerdefinierte Masterbrowser ist nicht eingetragen "
 "worden.\n"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:722
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:722
 msgid "[Network] The broadcast areas have not been entered.\n"
 msgstr "[Netzwerk] Die Broadcastbereiche sind nicht eingetragen worden.\n"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:733
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:733
 msgid "[Shares] The mount prefix is empty.\n"
 msgstr "[Freigaben] Das Basisverzeichnis zum Einhängen der Freigaben ist leer.\n"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:748
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:748
 msgid "[Authentication] The default user name has not been entered.\n"
 msgstr ""
 "[Authentifizierung] Der standardmäßige Benutzername wurde nicht "
 "eingetragen.\n"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:759
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:759
 msgid "[Samba] The file mask is empty.\n"
 msgstr "[Samba] Die Dateimaske ist leer.\n"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:770
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:770
 msgid "[Samba] The directory mask is empty.\n"
 msgstr "[Samba] Die Verzeichnismaske ist leer.\n"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:781
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:781
 msgid "[Samba] The UID is empty.\n"
 msgstr "[Samba] Die Benutzerkennung (UID) ist leer.\n"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:792
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:792
 msgid "[Samba] The GID is empty.\n"
 msgstr "[Samba] Die Gruppenkennung (GID) ist leer.\n"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:803
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:803
 msgid "[Synchronization] The rsync prefix is empty.\n"
 msgstr "[Synchronisation] Das Basisverzeichnis für rsync ist leer.\n"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:816
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:816
 msgid ""
 "[Synchronization] The directory where partially transferred files should be "
 "stored is empty.\n"
@@ -645,33 +645,33 @@ msgstr ""
 "[Synchronisation] Das Verzeichnis, in dem teilweise übertragene Dateien "
 "abgelegt werden sollen, ist leer.\n"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:829
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:829
 msgid "[Synchronization] The exclude patterns have not been entered.\n"
 msgstr "[Synchronisation] Die Ausschlussmuster wurden nicht eingetragen.\n"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:842
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:842
 msgid "[Synchronization] The path of the exclude file is empty.\n"
 msgstr "[Synchronisation] Der Pfad der Ausschlussdatei ist leer.\n"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:855
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:855
 msgid "[Synchronization] The include patterns have not been entered.\n"
 msgstr "[Synchronisation] Die Einschlussmuster wurden nicht eingetragen.\n"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:868
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:868
 msgid "[Synchronization] The path of the include file is empty.\n"
 msgstr "[Synchronisation] Der Pfad zur Einschlussdatei ist leer.\n"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:887
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:887
 msgid "[Synchronization] The backup suffix has not been defined.\n"
 msgstr ""
 "[Synchronisation] Das Suffix für die Sicherheitskopien wurde nicht "
 "angegeben.\n"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:900
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:900
 msgid "[Synchronization] The backup directory is empty.\n"
 msgstr "[Synchronisation] Das Verzeichnis für die Sicherheitskopien ist leer.\n"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:908
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:908
 msgid ""
 "The configuration could not be written, because one setting is incomplete:\n"
 "%1Please correct this issue."
@@ -680,7 +680,7 @@ msgstr ""
 "vollständig ist:\n"
 "%1Bitte korrigieren Sie dieses Problem."
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:912
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:912
 msgid ""
 "The configuration could not be written, because %1 settings are incomplete:\n"
 "%1Please correct these issues."
@@ -689,7 +689,7 @@ msgstr ""
 "vollständig sind:\n"
 "%1Bitte korrigieren Sie diese Probleme."
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:1191
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:1191
 msgid "Smb4TDEConfigDialog"
 msgstr "Smb4TDEConfigDialog"
 
@@ -1364,7 +1364,7 @@ msgstr ""
 "Freigaben zuzugreifen.\n"
 "Wollen Sie fortfahren?"
 
-#: smb4k/core/smb4kfileio.cpp:923 smb4k/core/smb4kfileio.cpp:1057
+#: smb4k/core/smb4tdefileio.cpp:923 smb4k/core/smb4tdefileio.cpp:1057
 msgid "Buffer size exceeded"
 msgstr "Puffergröße überschritten"
 
diff --git a/po/es.po b/po/es.po
index 25a1533..718228f 100644
--- a/po/es.po
+++ b/po/es.po
@@ -504,18 +504,18 @@ msgstr "Utilizar nmblookup (recomendado)"
 msgid "Use smbclient"
 msgstr "Utilizar smbclient"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:162
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:162
 msgid "User Interface"
 msgstr "Interfaz de usuario"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:163
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:163
 #: smb4k/browser/smb4knetworkbrowser.cpp:50
 #: smb4k/browser/smb4knetworkbrowser_part.cpp:186
 #: smb4k/browser/smb4knetworkbrowser_part.cpp:319
 msgid "Network"
 msgstr "Red"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:164
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:164
 #: smb4k/listview/smb4kshareslistview_part.cpp:144
 #: smb4k/listview/smb4kshareslistview_part.cpp:346
 #: smb4k/iconview/smb4ksharesiconview_part.cpp:141
@@ -523,28 +523,28 @@ msgstr "Red"
 msgid "Shares"
 msgstr "Recursos compartidos"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:165
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:165
 #: smb4k/configdlg/smb4ksambaoptions.cpp:89
 #: smb4k/core/smb4kpasswordhandler.cpp:237
 msgid "Authentication"
 msgstr "Autenticación"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:166
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:166
 msgid "Samba"
 msgstr "Samba"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:167
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:167
 #: smb4k/dialogs/smb4ksynchronizationdialog.cpp:47
 msgid "Synchronization"
 msgstr "Sincronización"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:168
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:168
 msgid "Super User"
 msgstr "Superusuario"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:327
-#: smb4k/configdlg/smb4kconfigdialog.cpp:328
-#: smb4k/configdlg/smb4kconfigdialog.cpp:1039
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:327
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:328
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:1039
 #: smb4k/configdlg/smb4ksambaoptions.cpp:400
 #: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:180
 #: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:253
@@ -553,25 +553,25 @@ msgstr "Superusuario"
 msgid "auto"
 msgstr "automático"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:331
-#: smb4k/configdlg/smb4kconfigdialog.cpp:352
-#: smb4k/configdlg/smb4kconfigdialog.cpp:441
-#: smb4k/configdlg/smb4kconfigdialog.cpp:451
-#: smb4k/configdlg/smb4kconfigdialog.cpp:1098
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:331
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:352
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:441
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:451
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:1098
 #: smb4k/configdlg/smb4ksambaoptions.cpp:428
 msgid "yes"
 msgstr "si"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:332
-#: smb4k/configdlg/smb4kconfigdialog.cpp:353
-#: smb4k/configdlg/smb4kconfigdialog.cpp:1099
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:332
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:353
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:1099
 #: smb4k/configdlg/smb4ksambaoptions.cpp:427
 msgid "no"
 msgstr "no"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:360
-#: smb4k/configdlg/smb4kconfigdialog.cpp:458
-#: smb4k/configdlg/smb4kconfigdialog.cpp:1060
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:360
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:458
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:1060
 #: smb4k/configdlg/smb4ksambaoptions.cpp:215
 #: smb4k/configdlg/smb4ksambaoptions.cpp:418
 #: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:289
@@ -582,8 +582,8 @@ msgstr "no"
 msgid "read-write"
 msgstr "lectura-escritura"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:361
-#: smb4k/configdlg/smb4kconfigdialog.cpp:1061
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:361
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:1061
 #: smb4k/configdlg/smb4ksambaoptions.cpp:216
 #: smb4k/configdlg/smb4ksambaoptions.cpp:419
 #: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:290
@@ -592,52 +592,52 @@ msgstr "lectura-escritura"
 msgid "read-only"
 msgstr "sólo-lectura"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:460
-#: smb4k/configdlg/smb4kconfigdialog.cpp:465
-#: smb4k/configdlg/smb4kconfigdialog.cpp:1072
-#: smb4k/configdlg/smb4kconfigdialog.cpp:1082
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:460
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:465
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:1072
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:1082
 #: smb4k/configdlg/smb4ksambaoptions.cpp:141
 #: smb4k/configdlg/smb4ksambaoptions.cpp:167
 msgid "default"
 msgstr "predeterminado"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:707
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:707
 msgid "[Network] The custom master browser has not been entered.\n"
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:722
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:722
 msgid "[Network] The broadcast areas have not been entered.\n"
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:733
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:733
 msgid "[Shares] The mount prefix is empty.\n"
 msgstr "[Recursos] El prefijo de montaje está vacío.\n"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:748
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:748
 msgid "[Authentication] The default user name has not been entered.\n"
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:759
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:759
 msgid "[Samba] The file mask is empty.\n"
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:770
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:770
 msgid "[Samba] The directory mask is empty.\n"
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:781
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:781
 msgid "[Samba] The UID is empty.\n"
 msgstr "[Samba] El UID está vacío.\n"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:792
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:792
 msgid "[Samba] The GID is empty.\n"
 msgstr "[Samba] El GID está vacío.\n"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:803
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:803
 msgid "[Synchronization] The rsync prefix is empty.\n"
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:816
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:816
 msgid ""
 "[Synchronization] The directory where partially transferred files should be "
 "stored is empty.\n"
@@ -645,43 +645,43 @@ msgstr ""
 "[Sincronización] El directorio donde los archivos parcialmente transferidos "
 "deberían estar está vacío.\n"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:829
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:829
 msgid "[Synchronization] The exclude patterns have not been entered.\n"
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:842
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:842
 msgid "[Synchronization] The path of the exclude file is empty.\n"
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:855
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:855
 msgid "[Synchronization] The include patterns have not been entered.\n"
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:868
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:868
 msgid "[Synchronization] The path of the include file is empty.\n"
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:887
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:887
 msgid "[Synchronization] The backup suffix has not been defined.\n"
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:900
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:900
 msgid "[Synchronization] The backup directory is empty.\n"
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:908
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:908
 msgid ""
 "The configuration could not be written, because one setting is incomplete:\n"
 "%1Please correct this issue."
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:912
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:912
 msgid ""
 "The configuration could not be written, because %1 settings are incomplete:\n"
 "%1Please correct these issues."
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:1191
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:1191
 msgid "Smb4TDEConfigDialog"
 msgstr "Smb4TDEConfigDialog"
 
@@ -1350,7 +1350,7 @@ msgstr ""
 "CIFS. Konqueror fallará si intenta acceder a uno.\n"
 "¿Desea continuar?"
 
-#: smb4k/core/smb4kfileio.cpp:923 smb4k/core/smb4kfileio.cpp:1057
+#: smb4k/core/smb4tdefileio.cpp:923 smb4k/core/smb4tdefileio.cpp:1057
 msgid "Buffer size exceeded"
 msgstr "Tamaño del búfer excedido"
 
diff --git a/po/it.po b/po/it.po
index 52b566d..ba87cd2 100644
--- a/po/it.po
+++ b/po/it.po
@@ -517,18 +517,18 @@ msgstr "Usa nmblookup (raccomandato)"
 msgid "Use smbclient"
 msgstr "Usa smbclient"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:162
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:162
 msgid "User Interface"
 msgstr "Interfaccia utente"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:163
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:163
 #: smb4k/browser/smb4knetworkbrowser.cpp:50
 #: smb4k/browser/smb4knetworkbrowser_part.cpp:186
 #: smb4k/browser/smb4knetworkbrowser_part.cpp:319
 msgid "Network"
 msgstr "Rete"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:164
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:164
 #: smb4k/listview/smb4kshareslistview_part.cpp:144
 #: smb4k/listview/smb4kshareslistview_part.cpp:346
 #: smb4k/iconview/smb4ksharesiconview_part.cpp:141
@@ -536,28 +536,28 @@ msgstr "Rete"
 msgid "Shares"
 msgstr "Condivisioni"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:165
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:165
 #: smb4k/configdlg/smb4ksambaoptions.cpp:89
 #: smb4k/core/smb4kpasswordhandler.cpp:237
 msgid "Authentication"
 msgstr "Autenticazione"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:166
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:166
 msgid "Samba"
 msgstr "Samba"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:167
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:167
 #: smb4k/dialogs/smb4ksynchronizationdialog.cpp:47
 msgid "Synchronization"
 msgstr "Sincronizzazione"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:168
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:168
 msgid "Super User"
 msgstr "Amministratore"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:327
-#: smb4k/configdlg/smb4kconfigdialog.cpp:328
-#: smb4k/configdlg/smb4kconfigdialog.cpp:1039
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:327
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:328
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:1039
 #: smb4k/configdlg/smb4ksambaoptions.cpp:400
 #: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:180
 #: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:253
@@ -566,25 +566,25 @@ msgstr "Amministratore"
 msgid "auto"
 msgstr "auto"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:331
-#: smb4k/configdlg/smb4kconfigdialog.cpp:352
-#: smb4k/configdlg/smb4kconfigdialog.cpp:441
-#: smb4k/configdlg/smb4kconfigdialog.cpp:451
-#: smb4k/configdlg/smb4kconfigdialog.cpp:1098
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:331
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:352
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:441
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:451
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:1098
 #: smb4k/configdlg/smb4ksambaoptions.cpp:428
 msgid "yes"
 msgstr "si"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:332
-#: smb4k/configdlg/smb4kconfigdialog.cpp:353
-#: smb4k/configdlg/smb4kconfigdialog.cpp:1099
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:332
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:353
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:1099
 #: smb4k/configdlg/smb4ksambaoptions.cpp:427
 msgid "no"
 msgstr "no"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:360
-#: smb4k/configdlg/smb4kconfigdialog.cpp:458
-#: smb4k/configdlg/smb4kconfigdialog.cpp:1060
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:360
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:458
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:1060
 #: smb4k/configdlg/smb4ksambaoptions.cpp:215
 #: smb4k/configdlg/smb4ksambaoptions.cpp:418
 #: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:289
@@ -595,8 +595,8 @@ msgstr "no"
 msgid "read-write"
 msgstr "lettura-scrittura"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:361
-#: smb4k/configdlg/smb4kconfigdialog.cpp:1061
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:361
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:1061
 #: smb4k/configdlg/smb4ksambaoptions.cpp:216
 #: smb4k/configdlg/smb4ksambaoptions.cpp:419
 #: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:290
@@ -605,95 +605,95 @@ msgstr "lettura-scrittura"
 msgid "read-only"
 msgstr "solo lettura"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:460
-#: smb4k/configdlg/smb4kconfigdialog.cpp:465
-#: smb4k/configdlg/smb4kconfigdialog.cpp:1072
-#: smb4k/configdlg/smb4kconfigdialog.cpp:1082
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:460
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:465
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:1072
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:1082
 #: smb4k/configdlg/smb4ksambaoptions.cpp:141
 #: smb4k/configdlg/smb4ksambaoptions.cpp:167
 msgid "default"
 msgstr "predefinito"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:707
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:707
 msgid "[Network] The custom master browser has not been entered.\n"
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:722
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:722
 msgid "[Network] The broadcast areas have not been entered.\n"
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:733
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:733
 msgid "[Shares] The mount prefix is empty.\n"
 msgstr "[Condivisioni] Il percorso di montaggio è vuoto.\n"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:748
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:748
 msgid "[Authentication] The default user name has not been entered.\n"
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:759
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:759
 msgid "[Samba] The file mask is empty.\n"
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:770
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:770
 msgid "[Samba] The directory mask is empty.\n"
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:781
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:781
 msgid "[Samba] The UID is empty.\n"
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:792
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:792
 msgid "[Samba] The GID is empty.\n"
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:803
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:803
 msgid "[Synchronization] The rsync prefix is empty.\n"
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:816
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:816
 #, fuzzy
 msgid ""
 "[Synchronization] The directory where partially transferred files should be "
 "stored is empty.\n"
 msgstr "Conserva i file parzialmente trasferiti in"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:829
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:829
 msgid "[Synchronization] The exclude patterns have not been entered.\n"
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:842
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:842
 msgid "[Synchronization] The path of the exclude file is empty.\n"
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:855
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:855
 msgid "[Synchronization] The include patterns have not been entered.\n"
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:868
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:868
 msgid "[Synchronization] The path of the include file is empty.\n"
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:887
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:887
 msgid "[Synchronization] The backup suffix has not been defined.\n"
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:900
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:900
 msgid "[Synchronization] The backup directory is empty.\n"
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:908
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:908
 msgid ""
 "The configuration could not be written, because one setting is incomplete:\n"
 "%1Please correct this issue."
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:912
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:912
 msgid ""
 "The configuration could not be written, because %1 settings are incomplete:\n"
 "%1Please correct these issues."
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:1191
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:1191
 #, fuzzy
 msgid "Smb4TDEConfigDialog"
 msgstr "Smb4KMontaggio"
@@ -1383,7 +1383,7 @@ msgstr ""
 "di esse.\n"
 "Si desidera continuare?"
 
-#: smb4k/core/smb4kfileio.cpp:923 smb4k/core/smb4kfileio.cpp:1057
+#: smb4k/core/smb4tdefileio.cpp:923 smb4k/core/smb4tdefileio.cpp:1057
 msgid "Buffer size exceeded"
 msgstr "Dimensione del buffer superata"
 
diff --git a/po/ja.po b/po/ja.po
index bc3d028..6c5ffb1 100644
--- a/po/ja.po
+++ b/po/ja.po
@@ -501,18 +501,18 @@ msgstr "nmblookup を使用(推奨)"
 msgid "Use smbclient"
 msgstr "smbclient を使用"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:162
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:162
 msgid "User Interface"
 msgstr "ユーザインターフェイス"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:163
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:163
 #: smb4k/browser/smb4knetworkbrowser.cpp:50
 #: smb4k/browser/smb4knetworkbrowser_part.cpp:186
 #: smb4k/browser/smb4knetworkbrowser_part.cpp:319
 msgid "Network"
 msgstr "ネットワーク"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:164
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:164
 #: smb4k/listview/smb4kshareslistview_part.cpp:144
 #: smb4k/listview/smb4kshareslistview_part.cpp:346
 #: smb4k/iconview/smb4ksharesiconview_part.cpp:141
@@ -520,28 +520,28 @@ msgstr "ネットワーク"
 msgid "Shares"
 msgstr "共有"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:165
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:165
 #: smb4k/configdlg/smb4ksambaoptions.cpp:89
 #: smb4k/core/smb4kpasswordhandler.cpp:237
 msgid "Authentication"
 msgstr "認証"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:166
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:166
 msgid "Samba"
 msgstr "Samba"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:167
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:167
 #: smb4k/dialogs/smb4ksynchronizationdialog.cpp:47
 msgid "Synchronization"
 msgstr "同期化"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:168
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:168
 msgid "Super User"
 msgstr "スーパー ユーザ"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:327
-#: smb4k/configdlg/smb4kconfigdialog.cpp:328
-#: smb4k/configdlg/smb4kconfigdialog.cpp:1039
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:327
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:328
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:1039
 #: smb4k/configdlg/smb4ksambaoptions.cpp:400
 #: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:180
 #: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:253
@@ -550,25 +550,25 @@ msgstr "スーパー ユーザ"
 msgid "auto"
 msgstr "自動(オート)"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:331
-#: smb4k/configdlg/smb4kconfigdialog.cpp:352
-#: smb4k/configdlg/smb4kconfigdialog.cpp:441
-#: smb4k/configdlg/smb4kconfigdialog.cpp:451
-#: smb4k/configdlg/smb4kconfigdialog.cpp:1098
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:331
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:352
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:441
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:451
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:1098
 #: smb4k/configdlg/smb4ksambaoptions.cpp:428
 msgid "yes"
 msgstr "はい"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:332
-#: smb4k/configdlg/smb4kconfigdialog.cpp:353
-#: smb4k/configdlg/smb4kconfigdialog.cpp:1099
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:332
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:353
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:1099
 #: smb4k/configdlg/smb4ksambaoptions.cpp:427
 msgid "no"
 msgstr "いいえ"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:360
-#: smb4k/configdlg/smb4kconfigdialog.cpp:458
-#: smb4k/configdlg/smb4kconfigdialog.cpp:1060
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:360
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:458
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:1060
 #: smb4k/configdlg/smb4ksambaoptions.cpp:215
 #: smb4k/configdlg/smb4ksambaoptions.cpp:418
 #: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:289
@@ -579,8 +579,8 @@ msgstr "いいえ"
 msgid "read-write"
 msgstr "読出し-書込み"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:361
-#: smb4k/configdlg/smb4kconfigdialog.cpp:1061
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:361
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:1061
 #: smb4k/configdlg/smb4ksambaoptions.cpp:216
 #: smb4k/configdlg/smb4ksambaoptions.cpp:419
 #: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:290
@@ -589,83 +589,83 @@ msgstr "読出し-書込み"
 msgid "read-only"
 msgstr "読み出し専用"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:460
-#: smb4k/configdlg/smb4kconfigdialog.cpp:465
-#: smb4k/configdlg/smb4kconfigdialog.cpp:1072
-#: smb4k/configdlg/smb4kconfigdialog.cpp:1082
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:460
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:465
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:1072
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:1082
 #: smb4k/configdlg/smb4ksambaoptions.cpp:141
 #: smb4k/configdlg/smb4ksambaoptions.cpp:167
 msgid "default"
 msgstr "デフォルト"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:707
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:707
 msgid "[Network] The custom master browser has not been entered.\n"
 msgstr "[ネットワーク] カスタム マスターブラウザーは入力されていません \n"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:722
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:722
 msgid "[Network] The broadcast areas have not been entered.\n"
 msgstr "[ネットワーク] ブロードキャスト エリアは入力されていません \n"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:733
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:733
 msgid "[Shares] The mount prefix is empty.\n"
 msgstr "[共有] マウントプレフィックスは空です \n"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:748
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:748
 msgid "[Authentication] The default user name has not been entered.\n"
 msgstr "[認証] デフォルト・ユーザー名は入力されていません \n"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:759
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:759
 msgid "[Samba] The file mask is empty.\n"
 msgstr "[Samba] ファイル マスク は空です \n"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:770
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:770
 msgid "[Samba] The directory mask is empty.\n"
 msgstr "[Samba] ディレクトリ マスク は空です \n"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:781
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:781
 msgid "[Samba] The UID is empty.\n"
 msgstr "[Samba] UID は空です \n"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:792
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:792
 msgid "[Samba] The GID is empty.\n"
 msgstr "[Samba] GID は空です \n"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:803
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:803
 msgid "[Synchronization] The rsync prefix is empty.\n"
 msgstr "[同期化] rsync サフィックスは空です \n"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:816
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:816
 msgid ""
 "[Synchronization] The directory where partially transferred files should be "
 "stored is empty.\n"
 msgstr ""
 "[同期化] 部分的に転送されるファイルが保存されるディレクトリーは空です \n"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:829
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:829
 msgid "[Synchronization] The exclude patterns have not been entered.\n"
 msgstr "[同期化] 除外 パターンは入力されていません \n"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:842
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:842
 msgid "[Synchronization] The path of the exclude file is empty.\n"
 msgstr "[同期化] 除外 ファイルのパスは空です \n"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:855
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:855
 msgid "[Synchronization] The include patterns have not been entered.\n"
 msgstr "[同期化] 包括(インクルード) パターンは入力されていません \n"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:868
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:868
 msgid "[Synchronization] The path of the include file is empty.\n"
 msgstr "[同期化] 包括(インクルード) ファイルのパスは空です \n"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:887
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:887
 msgid "[Synchronization] The backup suffix has not been defined.\n"
 msgstr "[同期化] バックアップサフィックスは定義されていません \n"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:900
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:900
 msgid "[Synchronization] The backup directory is empty.\n"
 msgstr "[同期化]バックアップ・ディレクトリーは空です \n"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:908
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:908
 msgid ""
 "The configuration could not be written, because one setting is incomplete:\n"
 "%1Please correct this issue."
@@ -673,7 +673,7 @@ msgstr ""
 "ひとつの設定が不完全なので、構成(コンフィグレーション)ができません:\n"
 "%1 この問題を修正してください"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:912
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:912
 msgid ""
 "The configuration could not be written, because %1 settings are incomplete:\n"
 "%1Please correct these issues."
@@ -681,7 +681,7 @@ msgstr ""
 "%1 設定が不完全なので、設定ファイルに記述することができません。:\n"
 "これら( %1 )の問題を修正してください"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:1191
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:1191
 msgid "Smb4TDEConfigDialog"
 msgstr "Smb4K設定・ダイアログ"
 
@@ -1358,7 +1358,7 @@ msgstr ""
 "ングするでしょう。\n"
 "それでも、あなたは、続行しますか？"
 
-#: smb4k/core/smb4kfileio.cpp:923 smb4k/core/smb4kfileio.cpp:1057
+#: smb4k/core/smb4tdefileio.cpp:923 smb4k/core/smb4tdefileio.cpp:1057
 msgid "Buffer size exceeded"
 msgstr "バッファー・サイズが越えました"
 
diff --git a/po/sv.po b/po/sv.po
index cc0b1bf..d8b33c3 100644
--- a/po/sv.po
+++ b/po/sv.po
@@ -250,7 +250,7 @@ msgid "Remote SMB port:"
 msgstr "Avlägsen SMB-port:"
 
 #: smb4k/configdlg/smb4ksambaoptions.cpp:89
-#: smb4k/configdlg/smb4kconfigdialog.cpp:165
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:165
 #: smb4k/core/smb4kpasswordhandler.cpp:237
 msgid "Authentication"
 msgstr "Autentisering"
@@ -314,10 +314,10 @@ msgstr "Linux charset:"
 
 #: smb4k/configdlg/smb4ksambaoptions.cpp:141
 #: smb4k/configdlg/smb4ksambaoptions.cpp:167
-#: smb4k/configdlg/smb4kconfigdialog.cpp:460
-#: smb4k/configdlg/smb4kconfigdialog.cpp:465
-#: smb4k/configdlg/smb4kconfigdialog.cpp:1072
-#: smb4k/configdlg/smb4kconfigdialog.cpp:1082
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:460
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:465
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:1072
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:1082
 msgid "default"
 msgstr "grundinställning"
 
@@ -345,9 +345,9 @@ msgstr ""
 
 #: smb4k/configdlg/smb4ksambaoptions.cpp:215
 #: smb4k/configdlg/smb4ksambaoptions.cpp:418
-#: smb4k/configdlg/smb4kconfigdialog.cpp:360
-#: smb4k/configdlg/smb4kconfigdialog.cpp:458
-#: smb4k/configdlg/smb4kconfigdialog.cpp:1060
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:360
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:458
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:1060
 #: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:289
 #: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:422
 #: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:704
@@ -358,8 +358,8 @@ msgstr "läs-skriv"
 
 #: smb4k/configdlg/smb4ksambaoptions.cpp:216
 #: smb4k/configdlg/smb4ksambaoptions.cpp:419
-#: smb4k/configdlg/smb4kconfigdialog.cpp:361
-#: smb4k/configdlg/smb4kconfigdialog.cpp:1061
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:361
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:1061
 #: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:290
 #: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:423
 #: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:988
@@ -524,9 +524,9 @@ msgid "Protocol:"
 msgstr "Protokoll"
 
 #: smb4k/configdlg/smb4ksambaoptions.cpp:400
-#: smb4k/configdlg/smb4kconfigdialog.cpp:327
-#: smb4k/configdlg/smb4kconfigdialog.cpp:328
-#: smb4k/configdlg/smb4kconfigdialog.cpp:1039
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:327
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:328
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:1039
 #: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:180
 #: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:253
 #: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:874
@@ -548,18 +548,18 @@ msgid "Kerberos:"
 msgstr ""
 
 #: smb4k/configdlg/smb4ksambaoptions.cpp:427
-#: smb4k/configdlg/smb4kconfigdialog.cpp:332
-#: smb4k/configdlg/smb4kconfigdialog.cpp:353
-#: smb4k/configdlg/smb4kconfigdialog.cpp:1099
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:332
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:353
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:1099
 msgid "no"
 msgstr ""
 
 #: smb4k/configdlg/smb4ksambaoptions.cpp:428
-#: smb4k/configdlg/smb4kconfigdialog.cpp:331
-#: smb4k/configdlg/smb4kconfigdialog.cpp:352
-#: smb4k/configdlg/smb4kconfigdialog.cpp:441
-#: smb4k/configdlg/smb4kconfigdialog.cpp:451
-#: smb4k/configdlg/smb4kconfigdialog.cpp:1098
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:331
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:352
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:441
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:451
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:1098
 msgid "yes"
 msgstr ""
 
@@ -1127,18 +1127,18 @@ msgstr "Docka i systembrickan"
 msgid "Preview Dialog"
 msgstr "Förhandsgranskning"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:162
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:162
 msgid "User Interface"
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:163
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:163
 #: smb4k/browser/smb4knetworkbrowser_part.cpp:186
 #: smb4k/browser/smb4knetworkbrowser_part.cpp:319
 #: smb4k/browser/smb4knetworkbrowser.cpp:50
 msgid "Network"
 msgstr "Nätverk"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:164
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:164
 #: smb4k/listview/smb4kshareslistview_part.cpp:144
 #: smb4k/listview/smb4kshareslistview_part.cpp:346
 #: smb4k/iconview/smb4ksharesiconview_part.cpp:141
@@ -1146,100 +1146,100 @@ msgstr "Nätverk"
 msgid "Shares"
 msgstr "Kataloger"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:166
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:166
 msgid "Samba"
 msgstr "Samba"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:167
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:167
 #: smb4k/dialogs/smb4ksynchronizationdialog.cpp:47
 #, fuzzy
 msgid "Synchronization"
 msgstr "Fransk översättning"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:168
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:168
 msgid "Super User"
 msgstr "Superanvändare"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:707
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:707
 msgid "[Network] The custom master browser has not been entered.\n"
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:722
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:722
 msgid "[Network] The broadcast areas have not been entered.\n"
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:733
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:733
 #, fuzzy
 msgid "[Shares] The mount prefix is empty.\n"
 msgstr "Montera kataloger:"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:748
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:748
 msgid "[Authentication] The default user name has not been entered.\n"
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:759
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:759
 msgid "[Samba] The file mask is empty.\n"
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:770
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:770
 msgid "[Samba] The directory mask is empty.\n"
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:781
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:781
 msgid "[Samba] The UID is empty.\n"
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:792
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:792
 msgid "[Samba] The GID is empty.\n"
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:803
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:803
 msgid "[Synchronization] The rsync prefix is empty.\n"
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:816
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:816
 msgid ""
 "[Synchronization] The directory where partially transferred files should be "
 "stored is empty.\n"
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:829
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:829
 msgid "[Synchronization] The exclude patterns have not been entered.\n"
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:842
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:842
 msgid "[Synchronization] The path of the exclude file is empty.\n"
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:855
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:855
 msgid "[Synchronization] The include patterns have not been entered.\n"
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:868
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:868
 msgid "[Synchronization] The path of the include file is empty.\n"
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:887
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:887
 msgid "[Synchronization] The backup suffix has not been defined.\n"
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:900
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:900
 msgid "[Synchronization] The backup directory is empty.\n"
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:908
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:908
 msgid ""
 "The configuration could not be written, because one setting is incomplete:\n"
 "%1Please correct this issue."
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:912
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:912
 msgid ""
 "The configuration could not be written, because %1 settings are incomplete:\n"
 "%1Please correct these issues."
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:1191
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:1191
 msgid "Smb4TDEConfigDialog"
 msgstr ""
 
@@ -3195,7 +3195,7 @@ msgid ""
 "password to write the necessary changes to the configuration file."
 msgstr ""
 
-#: smb4k/core/smb4kfileio.cpp:923 smb4k/core/smb4kfileio.cpp:1057
+#: smb4k/core/smb4tdefileio.cpp:923 smb4k/core/smb4tdefileio.cpp:1057
 #, fuzzy
 msgid "Buffer size exceeded"
 msgstr "Buffertstorlek:"
diff --git a/po/uk.po b/po/uk.po
index ebcd8d5..33a5350 100644
--- a/po/uk.po
+++ b/po/uk.po
@@ -538,18 +538,18 @@ msgstr "Вживати nmblookup (рекомендовано)"
 msgid "Use smbclient"
 msgstr "Вживати smbclient"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:162
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:162
 msgid "User Interface"
 msgstr "Інтерфейс користувача"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:163
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:163
 #: smb4k/browser/smb4knetworkbrowser.cpp:50
 #: smb4k/browser/smb4knetworkbrowser_part.cpp:186
 #: smb4k/browser/smb4knetworkbrowser_part.cpp:319
 msgid "Network"
 msgstr "Мережа"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:164
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:164
 #: smb4k/listview/smb4kshareslistview_part.cpp:144
 #: smb4k/listview/smb4kshareslistview_part.cpp:346
 #: smb4k/iconview/smb4ksharesiconview_part.cpp:141
@@ -557,28 +557,28 @@ msgstr "Мережа"
 msgid "Shares"
 msgstr "Спільні ресурси"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:165
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:165
 #: smb4k/configdlg/smb4ksambaoptions.cpp:89
 #: smb4k/core/smb4kpasswordhandler.cpp:237
 msgid "Authentication"
 msgstr "Автентифікація"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:166
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:166
 msgid "Samba"
 msgstr "Samba"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:167
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:167
 #: smb4k/dialogs/smb4ksynchronizationdialog.cpp:47
 msgid "Synchronization"
 msgstr "Синхронізація"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:168
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:168
 msgid "Super User"
 msgstr "Суперкористувач"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:327
-#: smb4k/configdlg/smb4kconfigdialog.cpp:328
-#: smb4k/configdlg/smb4kconfigdialog.cpp:1039
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:327
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:328
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:1039
 #: smb4k/configdlg/smb4ksambaoptions.cpp:400
 #: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:180
 #: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:253
@@ -587,25 +587,25 @@ msgstr "Суперкористувач"
 msgid "auto"
 msgstr "авто"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:331
-#: smb4k/configdlg/smb4kconfigdialog.cpp:352
-#: smb4k/configdlg/smb4kconfigdialog.cpp:441
-#: smb4k/configdlg/smb4kconfigdialog.cpp:451
-#: smb4k/configdlg/smb4kconfigdialog.cpp:1098
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:331
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:352
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:441
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:451
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:1098
 #: smb4k/configdlg/smb4ksambaoptions.cpp:428
 msgid "yes"
 msgstr "так"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:332
-#: smb4k/configdlg/smb4kconfigdialog.cpp:353
-#: smb4k/configdlg/smb4kconfigdialog.cpp:1099
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:332
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:353
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:1099
 #: smb4k/configdlg/smb4ksambaoptions.cpp:427
 msgid "no"
 msgstr "ні"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:360
-#: smb4k/configdlg/smb4kconfigdialog.cpp:458
-#: smb4k/configdlg/smb4kconfigdialog.cpp:1060
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:360
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:458
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:1060
 #: smb4k/configdlg/smb4ksambaoptions.cpp:215
 #: smb4k/configdlg/smb4ksambaoptions.cpp:418
 #: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:289
@@ -616,8 +616,8 @@ msgstr "ні"
 msgid "read-write"
 msgstr "читання-запис"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:361
-#: smb4k/configdlg/smb4kconfigdialog.cpp:1061
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:361
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:1061
 #: smb4k/configdlg/smb4ksambaoptions.cpp:216
 #: smb4k/configdlg/smb4ksambaoptions.cpp:419
 #: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:290
@@ -626,96 +626,96 @@ msgstr "читання-запис"
 msgid "read-only"
 msgstr "тільки читання"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:460
-#: smb4k/configdlg/smb4kconfigdialog.cpp:465
-#: smb4k/configdlg/smb4kconfigdialog.cpp:1072
-#: smb4k/configdlg/smb4kconfigdialog.cpp:1082
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:460
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:465
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:1072
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:1082
 #: smb4k/configdlg/smb4ksambaoptions.cpp:141
 #: smb4k/configdlg/smb4ksambaoptions.cpp:167
 msgid "default"
 msgstr "типові"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:707
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:707
 msgid "[Network] The custom master browser has not been entered.\n"
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:722
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:722
 msgid "[Network] The broadcast areas have not been entered.\n"
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:733
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:733
 #, fuzzy
 msgid "[Shares] The mount prefix is empty.\n"
 msgstr "Префікс монтування:"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:748
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:748
 msgid "[Authentication] The default user name has not been entered.\n"
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:759
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:759
 msgid "[Samba] The file mask is empty.\n"
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:770
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:770
 msgid "[Samba] The directory mask is empty.\n"
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:781
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:781
 msgid "[Samba] The UID is empty.\n"
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:792
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:792
 msgid "[Samba] The GID is empty.\n"
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:803
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:803
 msgid "[Synchronization] The rsync prefix is empty.\n"
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:816
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:816
 #, fuzzy
 msgid ""
 "[Synchronization] The directory where partially transferred files should be "
 "stored is empty.\n"
 msgstr "Покласти частково перенесений файл у"
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:829
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:829
 msgid "[Synchronization] The exclude patterns have not been entered.\n"
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:842
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:842
 msgid "[Synchronization] The path of the exclude file is empty.\n"
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:855
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:855
 msgid "[Synchronization] The include patterns have not been entered.\n"
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:868
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:868
 msgid "[Synchronization] The path of the include file is empty.\n"
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:887
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:887
 msgid "[Synchronization] The backup suffix has not been defined.\n"
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:900
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:900
 msgid "[Synchronization] The backup directory is empty.\n"
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:908
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:908
 msgid ""
 "The configuration could not be written, because one setting is incomplete:\n"
 "%1Please correct this issue."
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:912
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:912
 msgid ""
 "The configuration could not be written, because %1 settings are incomplete:\n"
 "%1Please correct these issues."
 msgstr ""
 
-#: smb4k/configdlg/smb4kconfigdialog.cpp:1191
+#: smb4k/configdlg/smb4tdeconfigdialog.cpp:1191
 msgid "Smb4TDEConfigDialog"
 msgstr "Smb4TDEConfigDialog"
 
@@ -1403,7 +1403,7 @@ msgstr ""
 "ресурсами CIFS. Konqueror зависає при спробі доступу до них.\n"
 "Хочете продовжити?"
 
-#: smb4k/core/smb4kfileio.cpp:923 smb4k/core/smb4kfileio.cpp:1057
+#: smb4k/core/smb4tdefileio.cpp:923 smb4k/core/smb4tdefileio.cpp:1057
 msgid "Buffer size exceeded"
 msgstr "Перевищено розмір буфера"
 
diff --git a/smb4k.kdevses b/smb4k.kdevses
index c8a01d3..b577c59 100644
--- a/smb4k.kdevses
+++ b/smb4k.kdevses
@@ -5,10 +5,10 @@
   <Doc0 NumberOfViews="1" URL="file:///home/alex/Entwicklung/smb4k_09/ChangeLog" >
    <View0 Encoding="" line="0" Type="Source" />
   </Doc0>
-  <Doc1 NumberOfViews="1" URL="file:///home/alex/Entwicklung/smb4k_09/smb4k/core/smb4kfileio.cpp" >
+  <Doc1 NumberOfViews="1" URL="file:///home/alex/Entwicklung/smb4k_09/smb4k/core/smb4tdefileio.cpp" >
    <View0 Encoding="" line="0" Type="Source" />
   </Doc1>
-  <Doc2 NumberOfViews="1" URL="file:///home/alex/Entwicklung/smb4k_09/smb4k/configdlg/smb4kconfigdialog.cpp" >
+  <Doc2 NumberOfViews="1" URL="file:///home/alex/Entwicklung/smb4k_09/smb4k/configdlg/smb4tdeconfigdialog.cpp" >
    <View0 Encoding="" line="0" Type="Source" />
   </Doc2>
   <Doc3 NumberOfViews="1" URL="file:///home/alex/Entwicklung/smb4k_09/smb4k/configdlg/smb4ksuperuseroptions.cpp" >
diff --git a/smb4k/configdlg/Makefile.am b/smb4k/configdlg/Makefile.am
index 356c121..405392a 100644
--- a/smb4k/configdlg/Makefile.am
+++ b/smb4k/configdlg/Makefile.am
@@ -1,12 +1,12 @@
 INCLUDES = $(all_includes)
 METASOURCES = AUTO
-kde_module_LTLIBRARIES = libsmb4kconfigdialog.la
-noinst_HEADERS = smb4kauthoptions.h smb4kconfigdialog.h smb4knetworkoptions.h \
+kde_module_LTLIBRARIES = libsmb4tdeconfigdialog.la
+noinst_HEADERS = smb4kauthoptions.h smb4tdeconfigdialog.h smb4knetworkoptions.h \
 	smb4tdersyncoptions.h smb4ksambaoptions.h smb4kshareoptions.h smb4ksuperuseroptions.h \
 	smb4kuserinterfaceoptions.h
-libsmb4kconfigdialog_la_SOURCES = smb4kauthoptions.cpp smb4kconfigdialog.cpp \
+libsmb4tdeconfigdialog_la_SOURCES = smb4kauthoptions.cpp smb4tdeconfigdialog.cpp \
 	smb4knetworkoptions.cpp smb4tdersyncoptions.cpp smb4ksambaoptions.cpp smb4kshareoptions.cpp \
 	smb4ksuperuseroptions.cpp smb4kuserinterfaceoptions.cpp
-libsmb4kconfigdialog_la_LIBADD = $(top_builddir)/smb4k/core/libsmb4kcore.la \
+libsmb4tdeconfigdialog_la_LIBADD = $(top_builddir)/smb4k/core/libsmb4kcore.la \
 	$(LIB_TDECORE) $(LIB_TDEUI) $(LIB_QT)
-libsmb4kconfigdialog_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries) $(LIB_TDECORE) $(LIB_KFILE)
+libsmb4tdeconfigdialog_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries) $(LIB_TDECORE) $(LIB_KFILE)
diff --git a/smb4k/configdlg/smb4kconfigdialog.cpp b/smb4k/configdlg/smb4kconfigdialog.cpp
deleted file mode 100644
index fc04c0d..0000000
--- a/smb4k/configdlg/smb4kconfigdialog.cpp
+++ /dev/null
@@ -1,1222 +0,0 @@
-/***************************************************************************
-    smb4kconfigdialog  -  The configuration dialog of Smb4K
-                             -------------------
-    begin                : Sa Apr 14 2007
-    copyright            : (C) 2007 by Alexander Reinholdt
-    email                : dustpuppy@users.berlios.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                                                    *
- ***************************************************************************/
-
-// TQt includes
-#include <tqradiobutton.h>
-#include <tqcheckbox.h>
-
-// KDE includes
-#include <klistview.h>
-#include <klineedit.h>
-#include <kpushbutton.h>
-#include <kmessagebox.h>
-#include <kurlrequester.h>
-
-// system specific includes
-#include <unistd.h>
-#include <sys/types.h>
-
-// application specific includes
-#include "smb4kconfigdialog.h"
-#include "smb4kuserinterfaceoptions.h"
-#include "smb4knetworkoptions.h"
-#include "smb4kshareoptions.h"
-#include "smb4kauthoptions.h"
-#include "smb4ksuperuseroptions.h"
-#include "smb4ksambaoptions.h"
-#include "smb4tdersyncoptions.h"
-#include "../core/smb4ksettings.h"
-#include "../core/smb4kglobal.h"
-#include "../core/smb4ksambaoptionsinfo.h"
-#include "../core/smb4ksambaoptionshandler.h"
-#include "../core/smb4kcore.h"
-#include "../core/smb4kauthinfo.h"
-#include "../core/smb4kpasswordhandler.h"
-
-using namespace Smb4TDEGlobal;
-
-TDEInstance *Smb4TDEConfigDialogFactory::m_instance = 0L;
-TDEAboutData *Smb4TDEConfigDialogFactory::m_about = 0L;
-
-// Variables we need to determine if super user entries
-// have to be written to /etc/sudoers or /etc/super.tab
-bool use_sudo = false;
-bool use_super = false;
-#ifdef __linux__
-bool force_unmount = false;
-#endif
-bool always_use_su = false;
-
-// Use this variable to determine if the dialog should be
-// closed after Smb4KFileIO::finished() was emitted.
-bool close_dialog = false;
-
-
-Smb4TDEConfigDialog::Smb4TDEConfigDialog( Smb4KSettings *settings, TQWidget *parent, const char *name )
-: TDEConfigDialog( parent, name, settings )
-{
-  // FIXME: I guess, normally we would not need to close destructively,
-  // but at the moment there are issues with the KURLRequester in file
-  // mode. To work around those, we are closing the dialog destructively.
-  // Maybe we can remove this if we moved to KDE4.
-  setWFlags( TQt::WDestructiveClose );
-
-  // Add the pages:
-  Smb4KUserInterfaceOptions *interface_options = new Smb4KUserInterfaceOptions( this, "UserInterfaceOptions" );
-  Smb4KNetworkOptions* network_options =         new Smb4KNetworkOptions( this, "NetworkOptions" );
-  Smb4KShareOptions *share_options=              new Smb4KShareOptions( this, "ShareOptions" );
-  Smb4KAuthOptions *auth_options =               new Smb4KAuthOptions( this, "AuthenticationOptions" );
-  Smb4KSambaOptions *samba_options =             new Smb4KSambaOptions( this, "SambaOptions" );
-  Smb4KRsyncOptions *rsync_options =             new Smb4KRsyncOptions( this, "SynchronizationOptions" );
-  Smb4KSuperUserOptions *super_user_options =    new Smb4KSuperUserOptions( this, "SuperUserOptions" );
-
-  // Disable widgets if the respective programs are not installed.
-  if ( Smb4KSettings::rsync().isEmpty() )
-  {
-    rsync_options->setEnabled( false );
-  }
-
-  if ( Smb4KSettings::sudo().isEmpty() && Smb4KSettings::super().isEmpty() )
-  {
-    super_user_options->setEnabled( false );
-  }
-  else
-  {
-    // The search for the programs and all related actions have been
-    // done by the core. We only need to disable widgets here.
-    if ( Smb4KSettings::sudo().isEmpty() )
-    {
-      TQRadioButton *sudo = static_cast<TQRadioButton *>( TQT_TQWIDGET(super_user_options->child( "SudoButton", TQRADIOBUTTON_OBJECT_NAME_STRING, true )) );
-
-      if ( sudo )
-      {
-        sudo->setEnabled( false );
-      }
-    }
-    else if ( Smb4KSettings::super().isEmpty() )
-    {
-      TQRadioButton *super = static_cast<TQRadioButton *>( TQT_TQWIDGET(super_user_options->child( "SuperButton", TQRADIOBUTTON_OBJECT_NAME_STRING, true )) );
-
-      if ( super )
-      {
-        super->setEnabled( false );
-      }
-    }
-    else
-    {
-      // Do nothing
-    }
-  }
-
-  // There are a few settings we need to the initial values of.
-  // Initialize them here:
-  switch ( Smb4KSettings::superUserProgram() )
-  {
-    case Smb4KSettings::EnumSuperUserProgram::Sudo:
-    {
-      use_sudo = true;
-
-      break;
-    }
-    case Smb4KSettings::EnumSuperUserProgram::Super:
-    {
-      use_super = true;
-
-      break;
-    }
-    default:
-    {
-      break;
-    }
-  }
-
-
-#ifdef __linux__
-  force_unmount = Smb4KSettings::useForceUnmount();
-#endif
-  always_use_su = Smb4KSettings::alwaysUseSuperUser();
-
-  // Now add the pages to the configuration dialog
-  addPage( interface_options, i18n( "User Interface" ), "view_choose" );
-  addPage( network_options, i18n( "Network" ), "network" );
-  addPage( share_options, i18n( "Shares" ), "hdd_mount" );
-  addPage( auth_options, i18n( "Authentication" ), "identity" );
-  addPage( samba_options, i18n( "Samba" ), "samba" );
-  addPage( rsync_options, i18n( "Synchronization" ), "bottom" );
-  addPage( super_user_options, i18n( "Super User" ), "penguin" );
-
-  // Stuff that's not managed by TDEConfig XT is loaded by
-  // Smb4TDEConfigDialog::showEvent()!
-
-  // Resize the dialog
-  setInitialSize( configDialogSize( *(Smb4KSettings::self()->config()), "ConfigDialog" ) );
-
-  // Connections
-  connect( samba_options,       TQT_SIGNAL( customSettingsChanged() ),
-           this,                TQT_SLOT( slotCustomSambaSettingsChanged() ) );
-
-  connect( super_user_options,  TQT_SIGNAL( removeEntries() ),
-           this,                TQT_SLOT( slotRemoveSuperUserEntries() ) );
-
-  connect( Smb4KCore::fileIO(), TQT_SIGNAL( failed() ),
-           this,                TQT_SLOT( slotReceivedFileIOFailed() ) );
-
-  connect( Smb4KCore::fileIO(), TQT_SIGNAL( finished() ),
-           this,                TQT_SLOT( slotReceivedFileIOFinished() ) );
-}
-
-
-Smb4TDEConfigDialog::~Smb4TDEConfigDialog()
-{
-}
-
-
-void Smb4TDEConfigDialog::loadCustomSambaOptions()
-{
-  // Get the list view:
-  KListView *custom_list = static_cast<KListView *>( TQT_TQWIDGET(child( "CustomOptionsList", "KListView", true )) );
-
-  if ( !custom_list )
-  {
-    return;
-  }
-
-  // First of all clear the list view:
-  custom_list->clear();
-
-  // Now get the default values:
-  TQString default_filesystem, protocol_hint, default_uid, default_gid;
-  bool write_access = true;
-
-  switch( Smb4KSettings::filesystem() )
-  {
-    case Smb4KSettings::EnumFilesystem::CIFS:
-    {
-      default_filesystem = "cifs";
-
-      break;
-    }
-    case Smb4KSettings::EnumFilesystem::SMBFS:
-    {
-      default_filesystem = "smbfs";
-
-      break;
-    }
-    default:
-    {
-      // FIXME: Set default_filesystem to "cifs"?
-      break;
-    }
-  }
-
-  switch ( Smb4KSettings::protocolHint() )
-  {
-    case Smb4KSettings::EnumProtocolHint::Automatic:
-    {
-      // In this case the user leaves it to the net
-      // command to determine the right protocol.
-      protocol_hint = TQString();
-
-      break;
-    }
-    case Smb4KSettings::EnumProtocolHint::RPC:
-    {
-      protocol_hint = "rpc";
-
-      break;
-    }
-    case Smb4KSettings::EnumProtocolHint::RAP:
-    {
-      protocol_hint = "rap";
-
-      break;
-    }
-    case Smb4KSettings::EnumProtocolHint::ADS:
-    {
-      protocol_hint = "ads";
-
-      break;
-    }
-    default:
-    {
-      protocol_hint = TQString();
-
-      break;
-    }
-  }
-
-  switch( Smb4KSettings::writeAccess() )
-  {
-    case Smb4KSettings::EnumWriteAccess::ReadWrite:
-    {
-      write_access = true;
-
-      break;
-    }
-    case Smb4KSettings::EnumWriteAccess::ReadOnly:
-    {
-      write_access = false;
-
-      break;
-    }
-    default:
-    {
-      break;
-    }
-  }
-
-  const TQValueList<Smb4KSambaOptionsInfo *> &list = optionsHandler()->customOptionsList();
-
-  for ( TQValueList<Smb4KSambaOptionsInfo *>::ConstIterator it = list.begin();
-        it != list.end(); ++it )
-  {
-    // If the only modification is that the share is to be remounted,
-    // we will not put it into the list:
-    if ( (*it)->type() == Smb4KSambaOptionsInfo::Share &&
-         (*it)->remount() &&
-         (*it)->port() == Smb4KSettings::remotePort() &&
-#ifndef __FreeBSD__
-         TQString::compare( (*it)->filesystem(), default_filesystem ) == 0 &&
-         (*it)->writeAccess() == write_access &&
-         (*it)->kerberos() == Smb4KSettings::useKerberos() /* FreeBSD does not know Kerberos for mounting */ &&
-#endif
-         ((TQString::compare( default_filesystem, "cifs" ) == 0 && (*it)->uid().toInt() == (int)getuid()) ||
-         (!(*it)->uid().isEmpty() && TQString::compare( (*it)->uid(), Smb4KSettings::userID() ) == 0)) &&
-         ((TQString::compare( default_filesystem, "cifs" ) == 0 && (*it)->gid().toInt() == (int)getgid()) ||
-         (!(*it)->gid().isEmpty() && TQString::compare( (*it)->gid(), Smb4KSettings::groupID() ) == 0)) )
-    {
-      continue;
-    }
-
-    // Now put the item in the list:
-    KListViewItem *item = new KListViewItem( custom_list );
-
-    item->setText( Smb4KSambaOptions::ItemName, (*it)->itemName() );
-
-    item->setText( Smb4KSambaOptions::Port, ((*it)->port() != -1 ?
-                   TQString( "%1" ).arg( (*it)->port() ) :
-                   TQString( "%1" ).arg( Smb4KSettings::remotePort() )) );
-
-    switch ( (*it)->type() )
-    {
-      case Smb4KSambaOptionsInfo::Host:
-      {
-        item->setText( Smb4KSambaOptions::Protocol, !(*it)->protocol().isEmpty() ?
-                       (TQString::compare( (*it)->protocol(), "auto" ) == 0 ? i18n( "auto" ) : (*it)->protocol().upper()) :
-                       (protocol_hint.isEmpty() ? i18n( "auto" ) : protocol_hint.upper()) );
-
-        item->setText( Smb4KSambaOptions::Kerberos, (*it)->kerberos() ?
-                       i18n( "yes" ) :
-                       i18n( "no" ) );
-
-#ifndef __FreeBSD__
-        item->setText( Smb4KSambaOptions::FileSystem, "-" );
-
-        item->setText( Smb4KSambaOptions::WriteAccess, "-" );
-#endif
-
-        item->setText( Smb4KSambaOptions::UID, "-" );
-
-        item->setText( Smb4KSambaOptions::GID, "-" );
-
-        break;
-      }
-      case Smb4KSambaOptionsInfo::Share:
-      {
-        item->setText( Smb4KSambaOptions::Protocol, "-" );
-
-#ifndef __FreeBSD__
-        item->setText( Smb4KSambaOptions::Kerberos, (*it)->kerberos() ?
-                       i18n( "yes" ) :
-                       i18n( "no" ) );
-
-        item->setText( Smb4KSambaOptions::FileSystem, !(*it)->filesystem().isEmpty() ?
-                       (*it)->filesystem().upper() :
-                        default_filesystem.upper() );
-
-        item->setText( Smb4KSambaOptions::WriteAccess, (*it)->writeAccess() ?
-                       i18n( "read-write" ) :
-                       i18n( "read-only" ) );
-#else
-        // FreeBSD does not know Kerberos for mounting
-        item->setText( Smb4KSambaOptions::Kerberos, "-" );
-#endif
-        item->setText( Smb4KSambaOptions::UID, !(*it)->uid().isEmpty() ?
-                       (*it)->uid() :
-                       Smb4KSettings::userID() );
-
-        item->setText( Smb4KSambaOptions::GID, !(*it)->gid().isEmpty() ?
-                       (*it)->gid() :
-                       Smb4KSettings::groupID() );
-
-        break;
-      }
-      default:
-      {
-        break;
-      }
-    }
-  }
-
-  Smb4KSambaOptions *samba_options = static_cast<Smb4KSambaOptions *>( TQT_TQWIDGET(child( "SambaOptions", "Smb4KSambaOptions", true )) );
-
-  if ( samba_options )
-  {
-    samba_options->resetCustomTab();
-  }
-}
-
-
-void Smb4TDEConfigDialog::saveCustomSambaOptions()
-{
-  // Get the list view:
-  KListView *custom_list = static_cast<KListView *>( TQT_TQWIDGET(child( "CustomOptionsList", "KListView", true )) );
-
-  if ( !custom_list )
-  {
-    return;
-  }
-
-  if ( custom_list->childCount() != 0 )
-  {
-    // First remove all items that have been deleted in the
-    // configuration dialog:
-    TQValueList<Smb4KSambaOptionsInfo *> list = optionsHandler()->customOptionsList();
-
-    for ( TQValueList<Smb4KSambaOptionsInfo *>::Iterator it = list.begin(); it != list.end(); ++it )
-    {
-      if ( !custom_list->findItem( (*it)->itemName(), Smb4KSambaOptions::ItemName ) )
-      {
-        optionsHandler()->removeItem( (*it)->itemName(), false );
-
-        continue;
-      }
-      else
-      {
-        continue;
-      }
-    }
-
-    // Now updated the remaining items:
-    TQListViewItemIterator it( custom_list );
-
-    while ( it.current() )
-    {
-      TQListViewItem *item = it.current();
-
-      Smb4KSambaOptionsInfo *info = optionsHandler()->findItem( item->text( Smb4KSambaOptions::ItemName ) );
-
-      if ( info )
-      {
-        switch( info->type() )
-        {
-          case Smb4KSambaOptionsInfo::Host:
-          {
-            info->setProtocol( (TQString::compare( item->text( Smb4KSambaOptions::Protocol ), "-" ) != 0 ?
-                               item->text( Smb4KSambaOptions::Protocol ).lower() :
-                               TQString()) );
-
-            info->setKerberos( (TQString::compare( item->text( Smb4KSambaOptions::Kerberos ), i18n( "yes" ) ) == 0) );
-
-            info->setPort( item->text( Smb4KSambaOptions::Port ).toInt() );
-
-            break;
-          }
-          case Smb4KSambaOptionsInfo::Share:
-          {
-#ifndef __FreeBSD__
-            // FreeBSD does not know Kerberos for mounting
-            info->setKerberos( (TQString::compare( item->text( Smb4KSambaOptions::Kerberos ), i18n( "yes" ) ) == 0) );
-
-            info->setFilesystem( (TQString::compare( item->text( Smb4KSambaOptions::FileSystem ), "-" ) != 0 ?
-                                 item->text( Smb4KSambaOptions::FileSystem ).lower() :
-                                 TQString()) );
-
-            info->setWriteAccess( (TQString::compare( item->text( Smb4KSambaOptions::WriteAccess ),
-                                  i18n( "read-write" ) ) == 0) );
-#endif
-            info->setUID( (TQString::compare( item->text( Smb4KSambaOptions::UID ), i18n( "default" ) ) != 0 &&
-                          TQString::compare( item->text( Smb4KSambaOptions::UID ), "-" ) != 0) ?
-                          item->text( Smb4KSambaOptions::UID ) :
-                          TQString() );
-
-            info->setGID( (TQString::compare( item->text( Smb4KSambaOptions::GID ), i18n( "default" ) ) != 0 &&
-                          TQString::compare( item->text( Smb4KSambaOptions::GID ), "-" ) != 0) ?
-                          item->text( Smb4KSambaOptions::GID ) :
-                          TQString() );
-
-            info->setPort( item->text( Smb4KSambaOptions::Port ).toInt() );
-
-            break;
-          }
-          default:
-          {
-            break;
-          }
-        }
-      }
-      else
-      {
-        // We do not have this case.
-      }
-
-      ++it;
-    }
-  }
-  else
-  {
-    // Remove all items, if the list view is empty:
-    TQValueList<Smb4KSambaOptionsInfo *> list = optionsHandler()->customOptionsList();
-
-    for ( TQValueList<Smb4KSambaOptionsInfo *>::Iterator it = list.begin(); it != list.end(); ++it )
-    {
-      if ( !(*it)->remount() )
-      {
-        optionsHandler()->removeItem( (*it)->itemName(), false );
-
-        continue;
-      }
-      else
-      {
-        continue;
-      }
-    }
-  }
-
-  optionsHandler()->sync();
-}
-
-
-void Smb4TDEConfigDialog::loadAuthenticationData()
-{
-  // Load the default login info and put it into the configuration
-  // page:
-  Smb4KAuthInfo auth( TQString::null, TQString::null, TQString::null );
-
-  (void) passwordHandler()->readDefaultAuth( &auth );
-
-  KLineEdit *default_user = static_cast<KLineEdit *>( TQT_TQWIDGET(child( "DefaultUserName", "KLineEdit", true )) );
-
-  if ( default_user )
-  {
-    default_user->setText( auth.user() );
-  }
-
-  KLineEdit *default_pass = static_cast<KLineEdit *>( TQT_TQWIDGET(child( "DefaultPassword", "KLineEdit", true )) );
-
-  if ( default_pass )
-  {
-    default_pass->setText( auth.password() );
-  }
-}
-
-
-void Smb4TDEConfigDialog::saveAuthenticationData()
-{
-  // Read the default login info from the configuration page
-  // and pass it to the password handler, but only if the wallet
-  // is open at this time. Otherwise we could end up with empty
-  // entries:
-  if ( passwordHandler()->walletIsOpen() )
-  {
-    Smb4KAuthInfo auth( TQString::null, TQString::null, TQString::null );
-
-    KLineEdit *default_user = static_cast<KLineEdit *>( TQT_TQWIDGET(child( "DefaultUserName", "KLineEdit", true )) );
-
-    if ( default_user )
-    {
-      auth.setUser( default_user->text() );
-    }
-
-    KLineEdit *default_pass = static_cast<KLineEdit *>( TQT_TQWIDGET(child( "DefaultPassword", "KLineEdit", true )) );
-
-    if ( default_pass )
-    {
-      auth.setPassword( default_pass->text() );
-    }
-
-    passwordHandler()->writeDefaultAuth( &auth );
-  }
-  else
-  {
-    // Do nothing
-  }
-}
-
-
-bool Smb4TDEConfigDialog::writeSuperUserEntries()
-{
-  TQRadioButton *sudo =  static_cast<TQRadioButton *>( TQT_TQWIDGET(child( "SudoButton", TQRADIOBUTTON_OBJECT_NAME_STRING, true )) );
-  TQRadioButton *super = static_cast<TQRadioButton *>( TQT_TQWIDGET(child( "SuperButton", TQRADIOBUTTON_OBJECT_NAME_STRING, true )) );
-#ifdef __linux__
-  TQCheckBox *force =    static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_UseForceUnmount", TQCHECKBOX_OBJECT_NAME_STRING, true )) );
-#endif
-  TQCheckBox *full_use = static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_AlwaysUseSuperUser", TQCHECKBOX_OBJECT_NAME_STRING, true )) );
-
-  // Check if we need to write anything at all:
-  Smb4KFileIO::Operation op = Smb4KFileIO::NoOperation;
-  bool success = true;
-
-#ifdef __linux__
-  if ( sudo && super && force && full_use )
-#else
-  if ( sudo && super && full_use )
-#endif
-  {
-    if ( sudo->isChecked() )
-    {
-#ifdef __linux__
-      if ( (!use_sudo && (force->isChecked() || full_use->isChecked())) ||
-           (use_sudo &&
-           ((force->isChecked() && force_unmount != force->isChecked()) ||
-           (full_use->isChecked() && always_use_su != full_use->isChecked()))) )
-#else
-      if ( (!use_sudo && full_use->isChecked()) ||
-           (use_sudo &&
-           (full_use->isChecked() && always_use_su != full_use->isChecked())) )
-#endif
-      {
-        success = Smb4KCore::fileIO()->writeSudoers( (op = Smb4KFileIO::Insert) );
-      }
-    }
-    else if ( super->isChecked() )
-    {
-#ifdef __linux__
-      if ( (!use_super && (force->isChecked() || full_use->isChecked())) ||
-           (use_super &&
-           ((force->isChecked() && force_unmount != force->isChecked()) ||
-           (full_use->isChecked() && always_use_su != full_use->isChecked()))) )
-#else
-      if ( (!use_super && full_use->isChecked()) ||
-           (use_super &&
-           (full_use->isChecked() && always_use_su != full_use->isChecked())) )
-#endif
-      {
-        success = Smb4KCore::fileIO()->writeSuperTab( (op = Smb4KFileIO::Insert) );
-      }
-    }
-    else
-    {
-      // Do nothing
-    }
-
-    use_sudo =      sudo->isChecked();
-    use_super =     super->isChecked();
-#ifdef __linux__
-    force_unmount = force->isChecked();
-#endif
-    always_use_su = full_use->isChecked();
-  }
-  else
-  {
-    // Do nothing
-  }
-
-  return (!success || op == Smb4KFileIO::NoOperation) ? false : true;
-}
-
-
-void Smb4TDEConfigDialog::removeSuperUserEntries()
-{
-  TQRadioButton *sudo =  static_cast<TQRadioButton *>( TQT_TQWIDGET(child( "SudoButton", TQRADIOBUTTON_OBJECT_NAME_STRING, true )) );
-  TQRadioButton *super = static_cast<TQRadioButton *>( TQT_TQWIDGET(child( "SuperButton", TQRADIOBUTTON_OBJECT_NAME_STRING, true )) );
-#ifdef __linux__
-  TQCheckBox *force =    static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_UseForceUnmount", TQCHECKBOX_OBJECT_NAME_STRING, true )) );
-#endif
-  TQCheckBox *full_use = static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_AlwaysUseSuperUser", TQCHECKBOX_OBJECT_NAME_STRING, true )) );
-
-#ifdef __linux__
-  if ( sudo && super && force && full_use )
-#else
-  if ( sudo && super && full_use )
-#endif
-
-  {
-    if ( sudo->isChecked() )
-    {
-      Smb4KCore::fileIO()->writeSudoers( Smb4KFileIO::Remove );
-    }
-    else if ( super->isChecked() )
-    {
-      Smb4KCore::fileIO()->writeSuperTab( Smb4KFileIO::Remove );
-    }
-    else
-    {
-      // Do nothing
-    }
-
-#ifdef __linux__
-    force->setChecked( false );
-#endif
-    full_use->setChecked( false );
-
-    use_sudo =      sudo->isChecked();
-    use_super =     super->isChecked();
-#ifdef __linux__
-    force_unmount = force->isChecked();
-#endif
-    always_use_su = full_use->isChecked();
-  }
-  else
-  {
-    // Do nothing
-  }
-}
-
-
-bool Smb4TDEConfigDialog::checkSettings()
-{
-  bool ok = true;
-  TQString issues = TQString();
-  int index = 0;
-
-  // If the user chose "Query custom master browser" in the
-  // "Network" tab, there must be a master browser present:
-  TQRadioButton *query_custom_master = static_cast<TQRadioButton *>( TQT_TQWIDGET(child( "CustomMasterBrowserLabel", TQRADIOBUTTON_OBJECT_NAME_STRING, true )) );
-  KLineEdit *custom_master_input    = static_cast<KLineEdit *>( TQT_TQWIDGET(child( "kcfg_CustomMasterBrowser", "KLineEdit", true )) );
-
-  if ( query_custom_master && custom_master_input &&
-       query_custom_master->isChecked() &&
-       custom_master_input->text().stripWhiteSpace().isEmpty() )
-  {
-    ok = false;
-    index++;
-
-    issues.append( "* "+i18n( "[Network] The custom master browser has not been entered.\n" ) );
-  }
-
-  // If the user chose "Scan broadcast areas" in the
-  // "Network" tab, there must broadcast areas present:
-  TQRadioButton *scan_bcast_areas    = static_cast<TQRadioButton *>( TQT_TQWIDGET(child( "BroadcastAreasLabel", TQRADIOBUTTON_OBJECT_NAME_STRING, true )) );
-  KLineEdit *bcast_areas_input      = static_cast<KLineEdit *>( TQT_TQWIDGET(child( "kcfg_BroadcastAreas", "KLineEdit", true )) );
-
-  if ( scan_bcast_areas && bcast_areas_input &&
-       scan_bcast_areas->isChecked() &&
-       bcast_areas_input->text().stripWhiteSpace().isEmpty() )
-  {
-    ok = false;
-    index++;
-
-    issues.append( "* "+i18n( "[Network] The broadcast areas have not been entered.\n" ) );
-  }
-
-  // The mount prefix must not be empty:
-  KURLRequester *mount_prefix       = static_cast<KURLRequester *>( TQT_TQWIDGET(child( "kcfg_MountPrefix", "KURLRequester", true )) );
-
-  if ( mount_prefix && mount_prefix->url().stripWhiteSpace().isEmpty() )
-  {
-    ok = false;
-    index++;
-
-    issues.append( "* "+i18n( "[Shares] The mount prefix is empty.\n" ) );
-  }
-
-  // If the user wants to use a default login, the user
-  // name must not be empty.
-  TQCheckBox *use_default_login      = static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_UseDefaultLogin", TQCHECKBOX_OBJECT_NAME_STRING, true )) );
-  KLineEdit *default_user_name      = static_cast<KLineEdit *>( TQT_TQWIDGET(child( "kcfg_DefaultUserName", "KLineEdit", true )) );
-
-  if ( use_default_login && default_user_name &&
-       use_default_login->isChecked() &&
-       default_user_name->text().stripWhiteSpace().isEmpty() )
-  {
-    ok = false;
-    index++;
-
-    issues.append( "* "+i18n( "[Authentication] The default user name has not been entered.\n" ) );
-  }
-
-  // The file mask must not be empty.
-  KLineEdit *file_mask              = static_cast<KLineEdit *>( TQT_TQWIDGET(child( "kcfg_FileMask", "KLineEdit", true )) );
-
-  if ( file_mask && file_mask->text().stripWhiteSpace().isEmpty() )
-  {
-    ok = false;
-    index++;
-
-    issues.append( "* "+i18n( "[Samba] The file mask is empty.\n" ) );
-  }
-
-  // The directory mask must not be empty.
-  KLineEdit *directory_mask         = static_cast<KLineEdit *>( TQT_TQWIDGET(child( "kcfg_DirectoryMask", "KLineEdit", true )) );
-
-  if ( directory_mask && directory_mask->text().stripWhiteSpace().isEmpty() )
-  {
-    ok = false;
-    index++;
-
-    issues.append( "* "+i18n( "[Samba] The directory mask is empty.\n" ) );
-  }
-
-  // The UID must not be empty.
-  KLineEdit *user_id                = static_cast<KLineEdit *>( TQT_TQWIDGET(child( "kcfg_UserID", "KLineEdit", true )) );
-
-  if ( user_id && user_id->text().stripWhiteSpace().isEmpty() )
-  {
-    ok = false;
-    index++;
-
-    issues.append( "* "+i18n( "[Samba] The UID is empty.\n" ) );
-  }
-
-  // The GID must not be empty.
-  KLineEdit *group_id               = static_cast<KLineEdit *>( TQT_TQWIDGET(child( "kcfg_GroupID", "KLineEdit", true )) );
-
-  if ( group_id && group_id->text().stripWhiteSpace().isEmpty() )
-  {
-    ok = false;
-    index++;
-
-    issues.append( "* "+i18n( "[Samba] The GID is empty.\n" ) );
-  }
-
-  // The rsync prefix must not be empty.
-  KURLRequester *rsync_prefix       = static_cast<KURLRequester *>( TQT_TQWIDGET(child( "kcfg_RsyncPrefix", "KURLRequester", true )) );
-
-  if ( rsync_prefix && rsync_prefix->url().stripWhiteSpace().isEmpty() )
-  {
-    ok = false;
-    index++;
-
-    issues.append( "* "+i18n( "[Synchronization] The rsync prefix is empty.\n" ) );
-  }
-
-  // The path where to store partial files must not be empty.
-  TQCheckBox *use_partical_directory = static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_UsePartialDirectory", TQCHECKBOX_OBJECT_NAME_STRING, true )) );
-  KURLRequester *partial_directory  = static_cast<KURLRequester *>( TQT_TQWIDGET(child( "kcfg_PartialDirectory", "KURLRequester", true )) );
-
-  if ( use_partical_directory && use_partical_directory->isChecked() &&
-       partial_directory && partial_directory->url().stripWhiteSpace().isEmpty() )
-  {
-    ok = false;
-    index++;
-
-    issues.append( "* "+i18n( "[Synchronization] The directory where partially transferred files should be stored is empty.\n" ) );
-  }
-
-  // The the exclude patterns must not be empty.
-  TQCheckBox *use_exclude_pattern    = static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_UseExcludePattern", TQCHECKBOX_OBJECT_NAME_STRING, true )) );
-  KLineEdit *exclude_pattern        = static_cast<KLineEdit *>( TQT_TQWIDGET(child( "kcfg_ExcludePattern", "KLineEdit", true )) );
-
-  if ( use_exclude_pattern && use_exclude_pattern->isChecked() &&
-       exclude_pattern && exclude_pattern->text().stripWhiteSpace().isEmpty() )
-  {
-    ok = false;
-    index++;
-
-    issues.append( "* "+i18n( "[Synchronization] The exclude patterns have not been entered.\n" ) );
-  }
-
-  // The the path of the exclude file must not be empty.
-  TQCheckBox *use_exclude_file       = static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_UseExcludeFrom", TQCHECKBOX_OBJECT_NAME_STRING, true )) );
-  KURLRequester *exclude_file       = static_cast<KURLRequester *>( TQT_TQWIDGET(child( "kcfg_ExcludeFrom", "KURLRequester", true )) );
-
-  if ( use_exclude_file && use_exclude_file->isChecked() &&
-       exclude_file && exclude_file->url().stripWhiteSpace().isEmpty() )
-  {
-    ok = false;
-    index++;
-
-    issues.append( "* "+i18n( "[Synchronization] The path of the exclude file is empty.\n" ) );
-  }
-
-  // The the include patterns must not be empty.
-  TQCheckBox *use_include_pattern    = static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_UseIncludePattern", TQCHECKBOX_OBJECT_NAME_STRING, true )) );
-  KLineEdit *include_pattern        = static_cast<KLineEdit *>( TQT_TQWIDGET(child( "kcfg_IncludePattern", "KLineEdit", true )) );
-
-  if ( use_include_pattern && use_include_pattern->isChecked() &&
-       include_pattern && include_pattern->text().stripWhiteSpace().isEmpty() )
-  {
-    ok = false;
-    index++;
-
-    issues.append( "* "+i18n( "[Synchronization] The include patterns have not been entered.\n" ) );
-  }
-
-  // The the path of the exclude file must not be empty.
-  TQCheckBox *use_include_file       = static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_UseIncludeFrom", TQCHECKBOX_OBJECT_NAME_STRING, true )) );
-  KURLRequester *include_file       = static_cast<KURLRequester *>( TQT_TQWIDGET(child( "kcfg_IncludeFrom", "KURLRequester", true )) );
-
-  if ( use_include_file && use_include_file->isChecked() &&
-       include_file && include_file->url().stripWhiteSpace().isEmpty() )
-  {
-    ok = false;
-    index++;
-
-    issues.append( "* "+i18n( "[Synchronization] The path of the include file is empty.\n" ) );
-  }
-
-  // If you make backups, check that the suffix and that the
-  // backup directory is not empty.
-  TQCheckBox *make_backups           = static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_MakeBackups", TQCHECKBOX_OBJECT_NAME_STRING, true )) );
-
-  if ( make_backups && make_backups->isChecked() )
-  {
-    // The backup suffix must not be empty.
-    TQCheckBox *use_backup_suffix    = static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_UseBackupSuffix", TQCHECKBOX_OBJECT_NAME_STRING, true )) );
-    KLineEdit *backup_suffix        = static_cast<KLineEdit *>( TQT_TQWIDGET(child( "kcfg_BackupSuffix", "KLineEdit", true )) );
-
-    if ( use_backup_suffix && use_backup_suffix->isChecked() &&
-         backup_suffix && backup_suffix->text().stripWhiteSpace().isEmpty() )
-    {
-      ok = false;
-      index++;
-
-      issues.append( "* "+i18n( "[Synchronization] The backup suffix has not been defined.\n" ) );
-    }
-
-    // The the path for backups must not be empty.
-    TQCheckBox *use_backup_dir       = static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_UseBackupDirectory", TQCHECKBOX_OBJECT_NAME_STRING, true )) );
-    KURLRequester *backup_dir       = static_cast<KURLRequester *>( TQT_TQWIDGET(child( "kcfg_BackupDirectory", "KURLRequester", true )) );
-
-    if ( use_backup_dir && use_backup_dir->isChecked() &&
-         backup_dir && backup_dir->url().stripWhiteSpace().isEmpty() )
-    {
-      ok = false;
-      index++;
-
-      issues.append( "* "+i18n( "[Synchronization] The backup directory is empty.\n" ) );
-    }
-  }
-
-  if ( !ok )
-  {
-    if ( index == 1 )
-    {
-      KMessageBox::error( this, i18n( "The configuration could not be written, because one setting is incomplete:\n%1Please correct this issue." ).arg( issues ) );
-    }
-    else
-    {
-      KMessageBox::error( this, i18n( "The configuration could not be written, because %1 settings are incomplete:\n%1Please correct these issues." ).arg( index ).arg( issues ) );
-    }
-  }
-
-  return ok;
-}
-
-
-void Smb4TDEConfigDialog::showEvent( TQShowEvent *e )
-{
-  // Spontaneous show events come from outside the application.
-  // We do not want to react on them.
-  if ( !e->spontaneous() )
-  {
-    loadCustomSambaOptions();
-    loadAuthenticationData();
-  }
-}
-
-
-/////////////////////////////////////////////////////////////////////////////
-// TQT_SLOT IMPLEMENTATIONS
-/////////////////////////////////////////////////////////////////////////////
-
-void Smb4TDEConfigDialog::slotApply()
-{
-  // If some settings are not complete, stop here and give
-  // the user the opportunity to fill in the needed string(s).
-  if ( !checkSettings() )
-  {
-    return;
-  }
-
-  saveCustomSambaOptions();
-  saveAuthenticationData();
-
-  if ( writeSuperUserEntries() )
-  {
-    // Disable this widget until Smb4KFileIO::finished()
-    // is received.
-    setEnabled( false );
-  }
-
-  // The 'Apply' button will be disabled by TDEConfigDialog, so we do not
-  // need to do it here.
-
-  TDEConfigDialog::slotApply();
-}
-
-
-void Smb4TDEConfigDialog::slotOk()
-{
-  // If some settings are not complete, stop here and give
-  // the user the opportunity to fill in the needed string(s).
-  if ( !checkSettings() )
-  {
-    return;
-  }
-
-  saveCustomSambaOptions();
-  saveAuthenticationData();
-
-  saveDialogSize( *(Smb4KSettings::self()->config()), "ConfigDialog" );
-
-  // If the something needs to be written to either /etc/super.tab
-  // or /etc/sudoers, do not close the dialog but wait until the
-  // Smb4KFileIO::finished() signal is received.
-  if ( !writeSuperUserEntries() )
-  {
-    TDEConfigDialog::slotOk();
-  }
-  else
-  {
-    // Disable this widget until Smb4KFileIO::finished()
-    // is received.
-    setEnabled( false );
-
-    // Tell Smb4TDEConfigDialog::slotReceivedFileIOFinished()
-    // to close the dialog.
-    close_dialog = true;
-  }
-}
-
-
-void Smb4TDEConfigDialog::slotCancel()
-{
-  // Reset the custom Samba options tab:
-  Smb4KSambaOptions *samba_options = static_cast<Smb4KSambaOptions *>( TQT_TQWIDGET(child( "SambaOptions", "Smb4KSambaOptions", true )) );
-
-  if ( samba_options )
-  {
-    samba_options->resetCustomTab();
-  }
-
-  TDEConfigDialog::slotCancel();
-}
-
-
-void Smb4TDEConfigDialog::slotCustomSambaSettingsChanged()
-{
-  // Get the list view and all other input widgets:
-  KListView *view = static_cast<KListView *>( TQT_TQWIDGET(child( "CustomOptionsList", "KListView", true )) );
-
-  if ( !view )
-  {
-    return;
-  }
-
-  // Get the list of custom options:
-  TQValueList<Smb4KSambaOptionsInfo *> list = optionsHandler()->customOptionsList();
-
-  bool changed = false;
-
-  // Loop through the list view items to see what changed and if
-  // we need to enable the 'Apply' button:
-  for ( TQValueList<Smb4KSambaOptionsInfo *>::ConstIterator it = list.begin();
-        it != list.end(); ++it )
-  {
-    // Find the item in the list view:
-    TQListViewItem *item = view->findItem( (*it)->itemName(), Smb4KSambaOptions::ItemName );
-
-    if ( item )
-    {
-      if ( (*it)->type() == Smb4KSambaOptionsInfo::Host )
-      {
-        // Check if the protocol changed.
-        if ( ((*it)->protocol().isEmpty() &&
-             TQString::compare( item->text( Smb4KSambaOptions::Protocol ).lower(), i18n( "auto" ) ) != 0) ||
-             TQString::compare( (*it)->protocol(), item->text( Smb4KSambaOptions::Protocol ).lower() ) != 0 )
-        {
-          changed = true;
-
-          break;
-        }
-      }
-      else if ( (*it)->type() == Smb4KSambaOptionsInfo::Share )
-      {
-#ifndef __FreeBSD__
-        // Check if the file system changed.
-        if ( TQString::compare( (*it)->filesystem(), item->text( Smb4KSambaOptions::FileSystem ).lower() ) != 0 )
-        {
-          changed = true;
-
-          break;
-        }
-
-        // Check if the write access changed.
-        TQString write_access = (*it)->writeAccess() ?
-                               i18n( "read-write" ) :
-                               i18n( "read-only" );
-
-        if ( TQString::compare( write_access, item->text( Smb4KSambaOptions::WriteAccess ) ) != 0 )
-        {
-          changed = true;
-
-          break;
-        }
-#endif
-        // Check if the UID changed.
-        if ( ((*it)->uid().isEmpty() &&
-             TQString::compare( i18n( "default" ), item->text( Smb4KSambaOptions::UID ) ) != 0) ||
-             TQString::compare( (*it)->uid(), item->text( Smb4KSambaOptions::UID ) ) != 0 )
-        {
-          changed = true;
-
-          break;
-        }
-
-        // Check if the GID changed.
-        if ( ((*it)->gid().isEmpty() &&
-             TQString::compare( i18n( "default" ), item->text( Smb4KSambaOptions::GID ) ) != 0) ||
-             TQString::compare( (*it)->gid(), item->text( Smb4KSambaOptions::GID ) ) != 0 )
-        {
-          changed = true;
-
-          break;
-        }
-      }
-      else
-      {
-        // Something went wrong. Stop right here.
-        break;
-      }
-
-      // Check if the Kerberos entry changed.
-      TQString kerberos = (*it)->kerberos() ?
-                         i18n( "yes" ) :
-                         i18n( "no" );
-
-      if ( TQString::compare( kerberos, item->text( Smb4KSambaOptions::Kerberos ) ) != 0 )
-      {
-        changed = true;
-
-        break;
-      }
-
-      // Check if the port value changed.
-      if ( (*it)->port() != item->text( Smb4KSambaOptions::Port ).toInt() )
-      {
-        changed = true;
-
-        break;
-      }
-    }
-    else
-    {
-      break;
-    }
-  }
-
-  enableButtonApply( changed );
-}
-
-
-void Smb4TDEConfigDialog::slotRemoveSuperUserEntries()
-{
-  // Disable this widget until Smb4KFileIO::finished()
-  // is received.
-  setEnabled( false );
-
-  removeSuperUserEntries();
-}
-
-
-void Smb4TDEConfigDialog::slotReceivedFileIOFailed()
-{
-#ifdef __linux__
-  TQCheckBox *force =    static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_UseForceUnmount", TQCHECKBOX_OBJECT_NAME_STRING, true )) );
-#endif
-  TQCheckBox *full_use = static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_AlwaysUseSuperUser", TQCHECKBOX_OBJECT_NAME_STRING, true )) );
-
-#ifdef __linux__
-  if ( force && full_use )
-  {
-    force->setChecked( false );
-#else
-  if ( full_use )
-  {
-#endif
-    full_use->setChecked( false );
-  }
-}
-
-
-void Smb4TDEConfigDialog::slotReceivedFileIOFinished()
-{
-  // Enable the widget again.
-  setEnabled( true );
-
-  if ( close_dialog )
-  {
-    TDEConfigDialog::slotOk();
-  }
-}
-
-
-/////////////////////////////////////////////////////////////////////////////
-// FACTORY STUFF
-/////////////////////////////////////////////////////////////////////////////
-
-Smb4TDEConfigDialogFactory::Smb4TDEConfigDialogFactory()
-: KLibFactory()
-{
-}
-
-
-Smb4TDEConfigDialogFactory::~Smb4TDEConfigDialogFactory()
-{
-  delete m_instance;
-  delete m_about;
-
-  m_instance = 0L;
-}
-
-
-TDEInstance *Smb4TDEConfigDialogFactory::instance()
-{
-  if( !m_instance )
-  {
-    m_about = new TDEAboutData( "smb4kconfigdialog", I18N_NOOP( "Smb4TDEConfigDialog" ), "1.0" );
-    m_about->addAuthor("Alexander Reinholdt", 0, "dustpuppy@users.berlios.de");
-    m_about->setLicense( TDEAboutData::License_GPL );
-    m_instance = new TDEInstance( m_about );
-  }
-
-  return m_instance;
-}
-
-
-TQObject *Smb4TDEConfigDialogFactory::createObject( TQObject *parent, const char *name, const char *,
-const TQStringList & )
-{
-  return TQT_TQOBJECT( new Smb4TDEConfigDialog( Smb4KSettings::self(), TQT_TQWIDGET( parent ), name ) );
-}
-
-
-/////////////////////////////////////////////////////////////////////////////
-// INIT
-/////////////////////////////////////////////////////////////////////////////
-
-
-extern "C"
-{
-  void *init_libsmb4kconfigdialog()
-  {
-    TDEGlobal::locale()->insertCatalogue( "smb4k" );
-    return new Smb4TDEConfigDialogFactory;
-  }
-}
-
-#include "smb4kconfigdialog.moc"
diff --git a/smb4k/configdlg/smb4kconfigdialog.h b/smb4k/configdlg/smb4kconfigdialog.h
deleted file mode 100644
index 55aab71..0000000
--- a/smb4k/configdlg/smb4kconfigdialog.h
+++ /dev/null
@@ -1,210 +0,0 @@
-/***************************************************************************
-    smb4kconfigdialog  -  The configuration dialog of Smb4K
-                             -------------------
-    begin                : Sa Apr 14 2007
-    copyright            : (C) 2007 by Alexander Reinholdt
-    email                : dustpuppy@users.berlios.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 SMB4KCONFIGDIALOG_H
-#define SMB4KCONFIGDIALOG_H
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-// KDE includes
-#include <kconfigdialog.h>
-#include <klibloader.h>
-#include <kaboutdata.h>
-#include <kinstance.h>
-
-// forward declarations
-class Smb4KSettings;
-
-/**
- * This is the (new) configuration dialog of Smb4K.
- *
- * @author Alexander Reinholdt <dustpuppy@users.berlios.de>
- */
-
-class Smb4TDEConfigDialog : public TDEConfigDialog
-{
-  Q_OBJECT
-  
-
-  public:
-    /**
-     * The constructor.
-     *
-     * @param settings      The Smb4KSettings object that needs to be passed
-     *                      so that the settings can be managed.
-     *
-     * @param parent        The parent widget
-     *
-     * @param name          The name of this dialog
-     */
-    Smb4TDEConfigDialog( Smb4KSettings *settings, TQWidget *parent = 0, const char *name = 0 );
-
-    /**
-     * The destructor
-     */
-    ~Smb4TDEConfigDialog();
-
-  protected:
-    /**
-     * Reimplemented from TQWidget to do last things before the
-     * configuration dialog is shown.
-     *
-     * @param e             The show event object
-     */
-    void showEvent( TQShowEvent *e );
-
-  protected slots:
-    /**
-     * Reimplemented from TDEConfigDialog. This slot does application
-     * specific stuff first and then executes TDEConfigDialog::slotApply().
-     */
-    void slotApply();
-
-    /**
-     * Reimplemented from TDEConfigDialog. This slot does application
-     * specific stuff first and then executes TDEConfigDialog::slotOk().
-     */
-    void slotOk();
-
-    /**
-     *Reimplemented from TDEConfigDialog. This slot does application
-     * specific stuff first and then executes TDEConfigDialog::slotCancel().
-     */
-    void slotCancel();
-
-    /**
-     * The custom Samba settings changed. Decide if we have to
-     * enable the 'Apply' button or not.
-     */
-    void slotCustomSambaSettingsChanged();
-
-    /**
-     * The 'Remove Entries' button in the 'Super User' page has been
-     * clicked. Initialize the removal of Smb4K's configuration entries
-     * from the configuration file of the currently chosen program.
-     */
-    void slotRemoveSuperUserEntries();
-
-    /**
-     * This slot is activated if the Smb4KFileIO::failed() signal is
-     * received. It deselects all check boxes in the "Super User" page.
-     */
-    void slotReceivedFileIOFailed();
-
-    /**
-     * This slot is activated if the Smb4KFileIO::finished() signal is
-     * received. It closes the dialog by invoking TDEConfigDialog::slotOk().
-     */
-    void slotReceivedFileIOFinished();
-
-  private:
-    /**
-     * Load the custom Samba options
-     */
-    void loadCustomSambaOptions();
-
-    /**
-     * Save the custom Samba options
-     */
-    void saveCustomSambaOptions();
-
-    /**
-     * Load the authentication data
-     */
-    void loadAuthenticationData();
-
-    /**
-     * Save the authentication data
-     */
-    void saveAuthenticationData();
-
-    /**
-     * Write super user configuration entries to configuration file.
-     *
-     * @returns TRUE if something needs to be written.
-     */
-    bool writeSuperUserEntries();
-
-    /**
-     * Remove super user configuration entries from the configuration file.
-     */
-    void removeSuperUserEntries();
-
-    /**
-     * Checks that mandatorily needed input is provided for settings that
-     * need it. This function will report all missing input to the user
-     * via a message box.
-     *
-     * @returns TRUE if the check passed and FALSE if it failed.
-     */
-    bool checkSettings();
-};
-
-
-class TDEInstance;
-class TDEAboutData;
-
-
-class Smb4TDEConfigDialogFactory : KLibFactory
-{
-  Q_OBJECT
-  
-
-  public:
-    /**
-     * The constructor.
-     */
-    Smb4TDEConfigDialogFactory();
-
-    /**
-     * The destructor.
-     */
-    virtual ~Smb4TDEConfigDialogFactory();
-
-    /**
-     * The instance
-     */
-    static TDEInstance *instance();
-
-  protected:
-    TQObject *createObject( TQObject *parent = 0, const char *name = 0,
-                           const char *classname = TQOBJECT_OBJECT_NAME_STRING,
-                           const TQStringList &args = TQStringList() );
-
-  private:
-    /**
-     * The factory's instance
-     */
-    static TDEInstance *m_instance;
-
-    /**
-     * The factory's TDEAboutData object
-     */
-    static TDEAboutData *m_about;
-};
-
-#endif
diff --git a/smb4k/configdlg/smb4tdeconfigdialog.cpp b/smb4k/configdlg/smb4tdeconfigdialog.cpp
new file mode 100644
index 0000000..d603385
--- /dev/null
+++ b/smb4k/configdlg/smb4tdeconfigdialog.cpp
@@ -0,0 +1,1222 @@
+/***************************************************************************
+    smb4tdeconfigdialog  -  The configuration dialog of Smb4K
+                             -------------------
+    begin                : Sa Apr 14 2007
+    copyright            : (C) 2007 by Alexander Reinholdt
+    email                : dustpuppy@users.berlios.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                                                    *
+ ***************************************************************************/
+
+// TQt includes
+#include <tqradiobutton.h>
+#include <tqcheckbox.h>
+
+// KDE includes
+#include <klistview.h>
+#include <klineedit.h>
+#include <kpushbutton.h>
+#include <kmessagebox.h>
+#include <kurlrequester.h>
+
+// system specific includes
+#include <unistd.h>
+#include <sys/types.h>
+
+// application specific includes
+#include "smb4tdeconfigdialog.h"
+#include "smb4kuserinterfaceoptions.h"
+#include "smb4knetworkoptions.h"
+#include "smb4kshareoptions.h"
+#include "smb4kauthoptions.h"
+#include "smb4ksuperuseroptions.h"
+#include "smb4ksambaoptions.h"
+#include "smb4tdersyncoptions.h"
+#include "../core/smb4ksettings.h"
+#include "../core/smb4kglobal.h"
+#include "../core/smb4ksambaoptionsinfo.h"
+#include "../core/smb4ksambaoptionshandler.h"
+#include "../core/smb4kcore.h"
+#include "../core/smb4kauthinfo.h"
+#include "../core/smb4kpasswordhandler.h"
+
+using namespace Smb4TDEGlobal;
+
+TDEInstance *Smb4TDEConfigDialogFactory::m_instance = 0L;
+TDEAboutData *Smb4TDEConfigDialogFactory::m_about = 0L;
+
+// Variables we need to determine if super user entries
+// have to be written to /etc/sudoers or /etc/super.tab
+bool use_sudo = false;
+bool use_super = false;
+#ifdef __linux__
+bool force_unmount = false;
+#endif
+bool always_use_su = false;
+
+// Use this variable to determine if the dialog should be
+// closed after Smb4KFileIO::finished() was emitted.
+bool close_dialog = false;
+
+
+Smb4TDEConfigDialog::Smb4TDEConfigDialog( Smb4KSettings *settings, TQWidget *parent, const char *name )
+: TDEConfigDialog( parent, name, settings )
+{
+  // FIXME: I guess, normally we would not need to close destructively,
+  // but at the moment there are issues with the KURLRequester in file
+  // mode. To work around those, we are closing the dialog destructively.
+  // Maybe we can remove this if we moved to KDE4.
+  setWFlags( TQt::WDestructiveClose );
+
+  // Add the pages:
+  Smb4KUserInterfaceOptions *interface_options = new Smb4KUserInterfaceOptions( this, "UserInterfaceOptions" );
+  Smb4KNetworkOptions* network_options =         new Smb4KNetworkOptions( this, "NetworkOptions" );
+  Smb4KShareOptions *share_options=              new Smb4KShareOptions( this, "ShareOptions" );
+  Smb4KAuthOptions *auth_options =               new Smb4KAuthOptions( this, "AuthenticationOptions" );
+  Smb4KSambaOptions *samba_options =             new Smb4KSambaOptions( this, "SambaOptions" );
+  Smb4KRsyncOptions *rsync_options =             new Smb4KRsyncOptions( this, "SynchronizationOptions" );
+  Smb4KSuperUserOptions *super_user_options =    new Smb4KSuperUserOptions( this, "SuperUserOptions" );
+
+  // Disable widgets if the respective programs are not installed.
+  if ( Smb4KSettings::rsync().isEmpty() )
+  {
+    rsync_options->setEnabled( false );
+  }
+
+  if ( Smb4KSettings::sudo().isEmpty() && Smb4KSettings::super().isEmpty() )
+  {
+    super_user_options->setEnabled( false );
+  }
+  else
+  {
+    // The search for the programs and all related actions have been
+    // done by the core. We only need to disable widgets here.
+    if ( Smb4KSettings::sudo().isEmpty() )
+    {
+      TQRadioButton *sudo = static_cast<TQRadioButton *>( TQT_TQWIDGET(super_user_options->child( "SudoButton", TQRADIOBUTTON_OBJECT_NAME_STRING, true )) );
+
+      if ( sudo )
+      {
+        sudo->setEnabled( false );
+      }
+    }
+    else if ( Smb4KSettings::super().isEmpty() )
+    {
+      TQRadioButton *super = static_cast<TQRadioButton *>( TQT_TQWIDGET(super_user_options->child( "SuperButton", TQRADIOBUTTON_OBJECT_NAME_STRING, true )) );
+
+      if ( super )
+      {
+        super->setEnabled( false );
+      }
+    }
+    else
+    {
+      // Do nothing
+    }
+  }
+
+  // There are a few settings we need to the initial values of.
+  // Initialize them here:
+  switch ( Smb4KSettings::superUserProgram() )
+  {
+    case Smb4KSettings::EnumSuperUserProgram::Sudo:
+    {
+      use_sudo = true;
+
+      break;
+    }
+    case Smb4KSettings::EnumSuperUserProgram::Super:
+    {
+      use_super = true;
+
+      break;
+    }
+    default:
+    {
+      break;
+    }
+  }
+
+
+#ifdef __linux__
+  force_unmount = Smb4KSettings::useForceUnmount();
+#endif
+  always_use_su = Smb4KSettings::alwaysUseSuperUser();
+
+  // Now add the pages to the configuration dialog
+  addPage( interface_options, i18n( "User Interface" ), "view_choose" );
+  addPage( network_options, i18n( "Network" ), "network" );
+  addPage( share_options, i18n( "Shares" ), "hdd_mount" );
+  addPage( auth_options, i18n( "Authentication" ), "identity" );
+  addPage( samba_options, i18n( "Samba" ), "samba" );
+  addPage( rsync_options, i18n( "Synchronization" ), "bottom" );
+  addPage( super_user_options, i18n( "Super User" ), "penguin" );
+
+  // Stuff that's not managed by TDEConfig XT is loaded by
+  // Smb4TDEConfigDialog::showEvent()!
+
+  // Resize the dialog
+  setInitialSize( configDialogSize( *(Smb4KSettings::self()->config()), "ConfigDialog" ) );
+
+  // Connections
+  connect( samba_options,       TQT_SIGNAL( customSettingsChanged() ),
+           this,                TQT_SLOT( slotCustomSambaSettingsChanged() ) );
+
+  connect( super_user_options,  TQT_SIGNAL( removeEntries() ),
+           this,                TQT_SLOT( slotRemoveSuperUserEntries() ) );
+
+  connect( Smb4KCore::fileIO(), TQT_SIGNAL( failed() ),
+           this,                TQT_SLOT( slotReceivedFileIOFailed() ) );
+
+  connect( Smb4KCore::fileIO(), TQT_SIGNAL( finished() ),
+           this,                TQT_SLOT( slotReceivedFileIOFinished() ) );
+}
+
+
+Smb4TDEConfigDialog::~Smb4TDEConfigDialog()
+{
+}
+
+
+void Smb4TDEConfigDialog::loadCustomSambaOptions()
+{
+  // Get the list view:
+  KListView *custom_list = static_cast<KListView *>( TQT_TQWIDGET(child( "CustomOptionsList", "KListView", true )) );
+
+  if ( !custom_list )
+  {
+    return;
+  }
+
+  // First of all clear the list view:
+  custom_list->clear();
+
+  // Now get the default values:
+  TQString default_filesystem, protocol_hint, default_uid, default_gid;
+  bool write_access = true;
+
+  switch( Smb4KSettings::filesystem() )
+  {
+    case Smb4KSettings::EnumFilesystem::CIFS:
+    {
+      default_filesystem = "cifs";
+
+      break;
+    }
+    case Smb4KSettings::EnumFilesystem::SMBFS:
+    {
+      default_filesystem = "smbfs";
+
+      break;
+    }
+    default:
+    {
+      // FIXME: Set default_filesystem to "cifs"?
+      break;
+    }
+  }
+
+  switch ( Smb4KSettings::protocolHint() )
+  {
+    case Smb4KSettings::EnumProtocolHint::Automatic:
+    {
+      // In this case the user leaves it to the net
+      // command to determine the right protocol.
+      protocol_hint = TQString();
+
+      break;
+    }
+    case Smb4KSettings::EnumProtocolHint::RPC:
+    {
+      protocol_hint = "rpc";
+
+      break;
+    }
+    case Smb4KSettings::EnumProtocolHint::RAP:
+    {
+      protocol_hint = "rap";
+
+      break;
+    }
+    case Smb4KSettings::EnumProtocolHint::ADS:
+    {
+      protocol_hint = "ads";
+
+      break;
+    }
+    default:
+    {
+      protocol_hint = TQString();
+
+      break;
+    }
+  }
+
+  switch( Smb4KSettings::writeAccess() )
+  {
+    case Smb4KSettings::EnumWriteAccess::ReadWrite:
+    {
+      write_access = true;
+
+      break;
+    }
+    case Smb4KSettings::EnumWriteAccess::ReadOnly:
+    {
+      write_access = false;
+
+      break;
+    }
+    default:
+    {
+      break;
+    }
+  }
+
+  const TQValueList<Smb4KSambaOptionsInfo *> &list = optionsHandler()->customOptionsList();
+
+  for ( TQValueList<Smb4KSambaOptionsInfo *>::ConstIterator it = list.begin();
+        it != list.end(); ++it )
+  {
+    // If the only modification is that the share is to be remounted,
+    // we will not put it into the list:
+    if ( (*it)->type() == Smb4KSambaOptionsInfo::Share &&
+         (*it)->remount() &&
+         (*it)->port() == Smb4KSettings::remotePort() &&
+#ifndef __FreeBSD__
+         TQString::compare( (*it)->filesystem(), default_filesystem ) == 0 &&
+         (*it)->writeAccess() == write_access &&
+         (*it)->kerberos() == Smb4KSettings::useKerberos() /* FreeBSD does not know Kerberos for mounting */ &&
+#endif
+         ((TQString::compare( default_filesystem, "cifs" ) == 0 && (*it)->uid().toInt() == (int)getuid()) ||
+         (!(*it)->uid().isEmpty() && TQString::compare( (*it)->uid(), Smb4KSettings::userID() ) == 0)) &&
+         ((TQString::compare( default_filesystem, "cifs" ) == 0 && (*it)->gid().toInt() == (int)getgid()) ||
+         (!(*it)->gid().isEmpty() && TQString::compare( (*it)->gid(), Smb4KSettings::groupID() ) == 0)) )
+    {
+      continue;
+    }
+
+    // Now put the item in the list:
+    KListViewItem *item = new KListViewItem( custom_list );
+
+    item->setText( Smb4KSambaOptions::ItemName, (*it)->itemName() );
+
+    item->setText( Smb4KSambaOptions::Port, ((*it)->port() != -1 ?
+                   TQString( "%1" ).arg( (*it)->port() ) :
+                   TQString( "%1" ).arg( Smb4KSettings::remotePort() )) );
+
+    switch ( (*it)->type() )
+    {
+      case Smb4KSambaOptionsInfo::Host:
+      {
+        item->setText( Smb4KSambaOptions::Protocol, !(*it)->protocol().isEmpty() ?
+                       (TQString::compare( (*it)->protocol(), "auto" ) == 0 ? i18n( "auto" ) : (*it)->protocol().upper()) :
+                       (protocol_hint.isEmpty() ? i18n( "auto" ) : protocol_hint.upper()) );
+
+        item->setText( Smb4KSambaOptions::Kerberos, (*it)->kerberos() ?
+                       i18n( "yes" ) :
+                       i18n( "no" ) );
+
+#ifndef __FreeBSD__
+        item->setText( Smb4KSambaOptions::FileSystem, "-" );
+
+        item->setText( Smb4KSambaOptions::WriteAccess, "-" );
+#endif
+
+        item->setText( Smb4KSambaOptions::UID, "-" );
+
+        item->setText( Smb4KSambaOptions::GID, "-" );
+
+        break;
+      }
+      case Smb4KSambaOptionsInfo::Share:
+      {
+        item->setText( Smb4KSambaOptions::Protocol, "-" );
+
+#ifndef __FreeBSD__
+        item->setText( Smb4KSambaOptions::Kerberos, (*it)->kerberos() ?
+                       i18n( "yes" ) :
+                       i18n( "no" ) );
+
+        item->setText( Smb4KSambaOptions::FileSystem, !(*it)->filesystem().isEmpty() ?
+                       (*it)->filesystem().upper() :
+                        default_filesystem.upper() );
+
+        item->setText( Smb4KSambaOptions::WriteAccess, (*it)->writeAccess() ?
+                       i18n( "read-write" ) :
+                       i18n( "read-only" ) );
+#else
+        // FreeBSD does not know Kerberos for mounting
+        item->setText( Smb4KSambaOptions::Kerberos, "-" );
+#endif
+        item->setText( Smb4KSambaOptions::UID, !(*it)->uid().isEmpty() ?
+                       (*it)->uid() :
+                       Smb4KSettings::userID() );
+
+        item->setText( Smb4KSambaOptions::GID, !(*it)->gid().isEmpty() ?
+                       (*it)->gid() :
+                       Smb4KSettings::groupID() );
+
+        break;
+      }
+      default:
+      {
+        break;
+      }
+    }
+  }
+
+  Smb4KSambaOptions *samba_options = static_cast<Smb4KSambaOptions *>( TQT_TQWIDGET(child( "SambaOptions", "Smb4KSambaOptions", true )) );
+
+  if ( samba_options )
+  {
+    samba_options->resetCustomTab();
+  }
+}
+
+
+void Smb4TDEConfigDialog::saveCustomSambaOptions()
+{
+  // Get the list view:
+  KListView *custom_list = static_cast<KListView *>( TQT_TQWIDGET(child( "CustomOptionsList", "KListView", true )) );
+
+  if ( !custom_list )
+  {
+    return;
+  }
+
+  if ( custom_list->childCount() != 0 )
+  {
+    // First remove all items that have been deleted in the
+    // configuration dialog:
+    TQValueList<Smb4KSambaOptionsInfo *> list = optionsHandler()->customOptionsList();
+
+    for ( TQValueList<Smb4KSambaOptionsInfo *>::Iterator it = list.begin(); it != list.end(); ++it )
+    {
+      if ( !custom_list->findItem( (*it)->itemName(), Smb4KSambaOptions::ItemName ) )
+      {
+        optionsHandler()->removeItem( (*it)->itemName(), false );
+
+        continue;
+      }
+      else
+      {
+        continue;
+      }
+    }
+
+    // Now updated the remaining items:
+    TQListViewItemIterator it( custom_list );
+
+    while ( it.current() )
+    {
+      TQListViewItem *item = it.current();
+
+      Smb4KSambaOptionsInfo *info = optionsHandler()->findItem( item->text( Smb4KSambaOptions::ItemName ) );
+
+      if ( info )
+      {
+        switch( info->type() )
+        {
+          case Smb4KSambaOptionsInfo::Host:
+          {
+            info->setProtocol( (TQString::compare( item->text( Smb4KSambaOptions::Protocol ), "-" ) != 0 ?
+                               item->text( Smb4KSambaOptions::Protocol ).lower() :
+                               TQString()) );
+
+            info->setKerberos( (TQString::compare( item->text( Smb4KSambaOptions::Kerberos ), i18n( "yes" ) ) == 0) );
+
+            info->setPort( item->text( Smb4KSambaOptions::Port ).toInt() );
+
+            break;
+          }
+          case Smb4KSambaOptionsInfo::Share:
+          {
+#ifndef __FreeBSD__
+            // FreeBSD does not know Kerberos for mounting
+            info->setKerberos( (TQString::compare( item->text( Smb4KSambaOptions::Kerberos ), i18n( "yes" ) ) == 0) );
+
+            info->setFilesystem( (TQString::compare( item->text( Smb4KSambaOptions::FileSystem ), "-" ) != 0 ?
+                                 item->text( Smb4KSambaOptions::FileSystem ).lower() :
+                                 TQString()) );
+
+            info->setWriteAccess( (TQString::compare( item->text( Smb4KSambaOptions::WriteAccess ),
+                                  i18n( "read-write" ) ) == 0) );
+#endif
+            info->setUID( (TQString::compare( item->text( Smb4KSambaOptions::UID ), i18n( "default" ) ) != 0 &&
+                          TQString::compare( item->text( Smb4KSambaOptions::UID ), "-" ) != 0) ?
+                          item->text( Smb4KSambaOptions::UID ) :
+                          TQString() );
+
+            info->setGID( (TQString::compare( item->text( Smb4KSambaOptions::GID ), i18n( "default" ) ) != 0 &&
+                          TQString::compare( item->text( Smb4KSambaOptions::GID ), "-" ) != 0) ?
+                          item->text( Smb4KSambaOptions::GID ) :
+                          TQString() );
+
+            info->setPort( item->text( Smb4KSambaOptions::Port ).toInt() );
+
+            break;
+          }
+          default:
+          {
+            break;
+          }
+        }
+      }
+      else
+      {
+        // We do not have this case.
+      }
+
+      ++it;
+    }
+  }
+  else
+  {
+    // Remove all items, if the list view is empty:
+    TQValueList<Smb4KSambaOptionsInfo *> list = optionsHandler()->customOptionsList();
+
+    for ( TQValueList<Smb4KSambaOptionsInfo *>::Iterator it = list.begin(); it != list.end(); ++it )
+    {
+      if ( !(*it)->remount() )
+      {
+        optionsHandler()->removeItem( (*it)->itemName(), false );
+
+        continue;
+      }
+      else
+      {
+        continue;
+      }
+    }
+  }
+
+  optionsHandler()->sync();
+}
+
+
+void Smb4TDEConfigDialog::loadAuthenticationData()
+{
+  // Load the default login info and put it into the configuration
+  // page:
+  Smb4KAuthInfo auth( TQString::null, TQString::null, TQString::null );
+
+  (void) passwordHandler()->readDefaultAuth( &auth );
+
+  KLineEdit *default_user = static_cast<KLineEdit *>( TQT_TQWIDGET(child( "DefaultUserName", "KLineEdit", true )) );
+
+  if ( default_user )
+  {
+    default_user->setText( auth.user() );
+  }
+
+  KLineEdit *default_pass = static_cast<KLineEdit *>( TQT_TQWIDGET(child( "DefaultPassword", "KLineEdit", true )) );
+
+  if ( default_pass )
+  {
+    default_pass->setText( auth.password() );
+  }
+}
+
+
+void Smb4TDEConfigDialog::saveAuthenticationData()
+{
+  // Read the default login info from the configuration page
+  // and pass it to the password handler, but only if the wallet
+  // is open at this time. Otherwise we could end up with empty
+  // entries:
+  if ( passwordHandler()->walletIsOpen() )
+  {
+    Smb4KAuthInfo auth( TQString::null, TQString::null, TQString::null );
+
+    KLineEdit *default_user = static_cast<KLineEdit *>( TQT_TQWIDGET(child( "DefaultUserName", "KLineEdit", true )) );
+
+    if ( default_user )
+    {
+      auth.setUser( default_user->text() );
+    }
+
+    KLineEdit *default_pass = static_cast<KLineEdit *>( TQT_TQWIDGET(child( "DefaultPassword", "KLineEdit", true )) );
+
+    if ( default_pass )
+    {
+      auth.setPassword( default_pass->text() );
+    }
+
+    passwordHandler()->writeDefaultAuth( &auth );
+  }
+  else
+  {
+    // Do nothing
+  }
+}
+
+
+bool Smb4TDEConfigDialog::writeSuperUserEntries()
+{
+  TQRadioButton *sudo =  static_cast<TQRadioButton *>( TQT_TQWIDGET(child( "SudoButton", TQRADIOBUTTON_OBJECT_NAME_STRING, true )) );
+  TQRadioButton *super = static_cast<TQRadioButton *>( TQT_TQWIDGET(child( "SuperButton", TQRADIOBUTTON_OBJECT_NAME_STRING, true )) );
+#ifdef __linux__
+  TQCheckBox *force =    static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_UseForceUnmount", TQCHECKBOX_OBJECT_NAME_STRING, true )) );
+#endif
+  TQCheckBox *full_use = static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_AlwaysUseSuperUser", TQCHECKBOX_OBJECT_NAME_STRING, true )) );
+
+  // Check if we need to write anything at all:
+  Smb4KFileIO::Operation op = Smb4KFileIO::NoOperation;
+  bool success = true;
+
+#ifdef __linux__
+  if ( sudo && super && force && full_use )
+#else
+  if ( sudo && super && full_use )
+#endif
+  {
+    if ( sudo->isChecked() )
+    {
+#ifdef __linux__
+      if ( (!use_sudo && (force->isChecked() || full_use->isChecked())) ||
+           (use_sudo &&
+           ((force->isChecked() && force_unmount != force->isChecked()) ||
+           (full_use->isChecked() && always_use_su != full_use->isChecked()))) )
+#else
+      if ( (!use_sudo && full_use->isChecked()) ||
+           (use_sudo &&
+           (full_use->isChecked() && always_use_su != full_use->isChecked())) )
+#endif
+      {
+        success = Smb4KCore::fileIO()->writeSudoers( (op = Smb4KFileIO::Insert) );
+      }
+    }
+    else if ( super->isChecked() )
+    {
+#ifdef __linux__
+      if ( (!use_super && (force->isChecked() || full_use->isChecked())) ||
+           (use_super &&
+           ((force->isChecked() && force_unmount != force->isChecked()) ||
+           (full_use->isChecked() && always_use_su != full_use->isChecked()))) )
+#else
+      if ( (!use_super && full_use->isChecked()) ||
+           (use_super &&
+           (full_use->isChecked() && always_use_su != full_use->isChecked())) )
+#endif
+      {
+        success = Smb4KCore::fileIO()->writeSuperTab( (op = Smb4KFileIO::Insert) );
+      }
+    }
+    else
+    {
+      // Do nothing
+    }
+
+    use_sudo =      sudo->isChecked();
+    use_super =     super->isChecked();
+#ifdef __linux__
+    force_unmount = force->isChecked();
+#endif
+    always_use_su = full_use->isChecked();
+  }
+  else
+  {
+    // Do nothing
+  }
+
+  return (!success || op == Smb4KFileIO::NoOperation) ? false : true;
+}
+
+
+void Smb4TDEConfigDialog::removeSuperUserEntries()
+{
+  TQRadioButton *sudo =  static_cast<TQRadioButton *>( TQT_TQWIDGET(child( "SudoButton", TQRADIOBUTTON_OBJECT_NAME_STRING, true )) );
+  TQRadioButton *super = static_cast<TQRadioButton *>( TQT_TQWIDGET(child( "SuperButton", TQRADIOBUTTON_OBJECT_NAME_STRING, true )) );
+#ifdef __linux__
+  TQCheckBox *force =    static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_UseForceUnmount", TQCHECKBOX_OBJECT_NAME_STRING, true )) );
+#endif
+  TQCheckBox *full_use = static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_AlwaysUseSuperUser", TQCHECKBOX_OBJECT_NAME_STRING, true )) );
+
+#ifdef __linux__
+  if ( sudo && super && force && full_use )
+#else
+  if ( sudo && super && full_use )
+#endif
+
+  {
+    if ( sudo->isChecked() )
+    {
+      Smb4KCore::fileIO()->writeSudoers( Smb4KFileIO::Remove );
+    }
+    else if ( super->isChecked() )
+    {
+      Smb4KCore::fileIO()->writeSuperTab( Smb4KFileIO::Remove );
+    }
+    else
+    {
+      // Do nothing
+    }
+
+#ifdef __linux__
+    force->setChecked( false );
+#endif
+    full_use->setChecked( false );
+
+    use_sudo =      sudo->isChecked();
+    use_super =     super->isChecked();
+#ifdef __linux__
+    force_unmount = force->isChecked();
+#endif
+    always_use_su = full_use->isChecked();
+  }
+  else
+  {
+    // Do nothing
+  }
+}
+
+
+bool Smb4TDEConfigDialog::checkSettings()
+{
+  bool ok = true;
+  TQString issues = TQString();
+  int index = 0;
+
+  // If the user chose "Query custom master browser" in the
+  // "Network" tab, there must be a master browser present:
+  TQRadioButton *query_custom_master = static_cast<TQRadioButton *>( TQT_TQWIDGET(child( "CustomMasterBrowserLabel", TQRADIOBUTTON_OBJECT_NAME_STRING, true )) );
+  KLineEdit *custom_master_input    = static_cast<KLineEdit *>( TQT_TQWIDGET(child( "kcfg_CustomMasterBrowser", "KLineEdit", true )) );
+
+  if ( query_custom_master && custom_master_input &&
+       query_custom_master->isChecked() &&
+       custom_master_input->text().stripWhiteSpace().isEmpty() )
+  {
+    ok = false;
+    index++;
+
+    issues.append( "* "+i18n( "[Network] The custom master browser has not been entered.\n" ) );
+  }
+
+  // If the user chose "Scan broadcast areas" in the
+  // "Network" tab, there must broadcast areas present:
+  TQRadioButton *scan_bcast_areas    = static_cast<TQRadioButton *>( TQT_TQWIDGET(child( "BroadcastAreasLabel", TQRADIOBUTTON_OBJECT_NAME_STRING, true )) );
+  KLineEdit *bcast_areas_input      = static_cast<KLineEdit *>( TQT_TQWIDGET(child( "kcfg_BroadcastAreas", "KLineEdit", true )) );
+
+  if ( scan_bcast_areas && bcast_areas_input &&
+       scan_bcast_areas->isChecked() &&
+       bcast_areas_input->text().stripWhiteSpace().isEmpty() )
+  {
+    ok = false;
+    index++;
+
+    issues.append( "* "+i18n( "[Network] The broadcast areas have not been entered.\n" ) );
+  }
+
+  // The mount prefix must not be empty:
+  KURLRequester *mount_prefix       = static_cast<KURLRequester *>( TQT_TQWIDGET(child( "kcfg_MountPrefix", "KURLRequester", true )) );
+
+  if ( mount_prefix && mount_prefix->url().stripWhiteSpace().isEmpty() )
+  {
+    ok = false;
+    index++;
+
+    issues.append( "* "+i18n( "[Shares] The mount prefix is empty.\n" ) );
+  }
+
+  // If the user wants to use a default login, the user
+  // name must not be empty.
+  TQCheckBox *use_default_login      = static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_UseDefaultLogin", TQCHECKBOX_OBJECT_NAME_STRING, true )) );
+  KLineEdit *default_user_name      = static_cast<KLineEdit *>( TQT_TQWIDGET(child( "kcfg_DefaultUserName", "KLineEdit", true )) );
+
+  if ( use_default_login && default_user_name &&
+       use_default_login->isChecked() &&
+       default_user_name->text().stripWhiteSpace().isEmpty() )
+  {
+    ok = false;
+    index++;
+
+    issues.append( "* "+i18n( "[Authentication] The default user name has not been entered.\n" ) );
+  }
+
+  // The file mask must not be empty.
+  KLineEdit *file_mask              = static_cast<KLineEdit *>( TQT_TQWIDGET(child( "kcfg_FileMask", "KLineEdit", true )) );
+
+  if ( file_mask && file_mask->text().stripWhiteSpace().isEmpty() )
+  {
+    ok = false;
+    index++;
+
+    issues.append( "* "+i18n( "[Samba] The file mask is empty.\n" ) );
+  }
+
+  // The directory mask must not be empty.
+  KLineEdit *directory_mask         = static_cast<KLineEdit *>( TQT_TQWIDGET(child( "kcfg_DirectoryMask", "KLineEdit", true )) );
+
+  if ( directory_mask && directory_mask->text().stripWhiteSpace().isEmpty() )
+  {
+    ok = false;
+    index++;
+
+    issues.append( "* "+i18n( "[Samba] The directory mask is empty.\n" ) );
+  }
+
+  // The UID must not be empty.
+  KLineEdit *user_id                = static_cast<KLineEdit *>( TQT_TQWIDGET(child( "kcfg_UserID", "KLineEdit", true )) );
+
+  if ( user_id && user_id->text().stripWhiteSpace().isEmpty() )
+  {
+    ok = false;
+    index++;
+
+    issues.append( "* "+i18n( "[Samba] The UID is empty.\n" ) );
+  }
+
+  // The GID must not be empty.
+  KLineEdit *group_id               = static_cast<KLineEdit *>( TQT_TQWIDGET(child( "kcfg_GroupID", "KLineEdit", true )) );
+
+  if ( group_id && group_id->text().stripWhiteSpace().isEmpty() )
+  {
+    ok = false;
+    index++;
+
+    issues.append( "* "+i18n( "[Samba] The GID is empty.\n" ) );
+  }
+
+  // The rsync prefix must not be empty.
+  KURLRequester *rsync_prefix       = static_cast<KURLRequester *>( TQT_TQWIDGET(child( "kcfg_RsyncPrefix", "KURLRequester", true )) );
+
+  if ( rsync_prefix && rsync_prefix->url().stripWhiteSpace().isEmpty() )
+  {
+    ok = false;
+    index++;
+
+    issues.append( "* "+i18n( "[Synchronization] The rsync prefix is empty.\n" ) );
+  }
+
+  // The path where to store partial files must not be empty.
+  TQCheckBox *use_partical_directory = static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_UsePartialDirectory", TQCHECKBOX_OBJECT_NAME_STRING, true )) );
+  KURLRequester *partial_directory  = static_cast<KURLRequester *>( TQT_TQWIDGET(child( "kcfg_PartialDirectory", "KURLRequester", true )) );
+
+  if ( use_partical_directory && use_partical_directory->isChecked() &&
+       partial_directory && partial_directory->url().stripWhiteSpace().isEmpty() )
+  {
+    ok = false;
+    index++;
+
+    issues.append( "* "+i18n( "[Synchronization] The directory where partially transferred files should be stored is empty.\n" ) );
+  }
+
+  // The the exclude patterns must not be empty.
+  TQCheckBox *use_exclude_pattern    = static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_UseExcludePattern", TQCHECKBOX_OBJECT_NAME_STRING, true )) );
+  KLineEdit *exclude_pattern        = static_cast<KLineEdit *>( TQT_TQWIDGET(child( "kcfg_ExcludePattern", "KLineEdit", true )) );
+
+  if ( use_exclude_pattern && use_exclude_pattern->isChecked() &&
+       exclude_pattern && exclude_pattern->text().stripWhiteSpace().isEmpty() )
+  {
+    ok = false;
+    index++;
+
+    issues.append( "* "+i18n( "[Synchronization] The exclude patterns have not been entered.\n" ) );
+  }
+
+  // The the path of the exclude file must not be empty.
+  TQCheckBox *use_exclude_file       = static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_UseExcludeFrom", TQCHECKBOX_OBJECT_NAME_STRING, true )) );
+  KURLRequester *exclude_file       = static_cast<KURLRequester *>( TQT_TQWIDGET(child( "kcfg_ExcludeFrom", "KURLRequester", true )) );
+
+  if ( use_exclude_file && use_exclude_file->isChecked() &&
+       exclude_file && exclude_file->url().stripWhiteSpace().isEmpty() )
+  {
+    ok = false;
+    index++;
+
+    issues.append( "* "+i18n( "[Synchronization] The path of the exclude file is empty.\n" ) );
+  }
+
+  // The the include patterns must not be empty.
+  TQCheckBox *use_include_pattern    = static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_UseIncludePattern", TQCHECKBOX_OBJECT_NAME_STRING, true )) );
+  KLineEdit *include_pattern        = static_cast<KLineEdit *>( TQT_TQWIDGET(child( "kcfg_IncludePattern", "KLineEdit", true )) );
+
+  if ( use_include_pattern && use_include_pattern->isChecked() &&
+       include_pattern && include_pattern->text().stripWhiteSpace().isEmpty() )
+  {
+    ok = false;
+    index++;
+
+    issues.append( "* "+i18n( "[Synchronization] The include patterns have not been entered.\n" ) );
+  }
+
+  // The the path of the exclude file must not be empty.
+  TQCheckBox *use_include_file       = static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_UseIncludeFrom", TQCHECKBOX_OBJECT_NAME_STRING, true )) );
+  KURLRequester *include_file       = static_cast<KURLRequester *>( TQT_TQWIDGET(child( "kcfg_IncludeFrom", "KURLRequester", true )) );
+
+  if ( use_include_file && use_include_file->isChecked() &&
+       include_file && include_file->url().stripWhiteSpace().isEmpty() )
+  {
+    ok = false;
+    index++;
+
+    issues.append( "* "+i18n( "[Synchronization] The path of the include file is empty.\n" ) );
+  }
+
+  // If you make backups, check that the suffix and that the
+  // backup directory is not empty.
+  TQCheckBox *make_backups           = static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_MakeBackups", TQCHECKBOX_OBJECT_NAME_STRING, true )) );
+
+  if ( make_backups && make_backups->isChecked() )
+  {
+    // The backup suffix must not be empty.
+    TQCheckBox *use_backup_suffix    = static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_UseBackupSuffix", TQCHECKBOX_OBJECT_NAME_STRING, true )) );
+    KLineEdit *backup_suffix        = static_cast<KLineEdit *>( TQT_TQWIDGET(child( "kcfg_BackupSuffix", "KLineEdit", true )) );
+
+    if ( use_backup_suffix && use_backup_suffix->isChecked() &&
+         backup_suffix && backup_suffix->text().stripWhiteSpace().isEmpty() )
+    {
+      ok = false;
+      index++;
+
+      issues.append( "* "+i18n( "[Synchronization] The backup suffix has not been defined.\n" ) );
+    }
+
+    // The the path for backups must not be empty.
+    TQCheckBox *use_backup_dir       = static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_UseBackupDirectory", TQCHECKBOX_OBJECT_NAME_STRING, true )) );
+    KURLRequester *backup_dir       = static_cast<KURLRequester *>( TQT_TQWIDGET(child( "kcfg_BackupDirectory", "KURLRequester", true )) );
+
+    if ( use_backup_dir && use_backup_dir->isChecked() &&
+         backup_dir && backup_dir->url().stripWhiteSpace().isEmpty() )
+    {
+      ok = false;
+      index++;
+
+      issues.append( "* "+i18n( "[Synchronization] The backup directory is empty.\n" ) );
+    }
+  }
+
+  if ( !ok )
+  {
+    if ( index == 1 )
+    {
+      KMessageBox::error( this, i18n( "The configuration could not be written, because one setting is incomplete:\n%1Please correct this issue." ).arg( issues ) );
+    }
+    else
+    {
+      KMessageBox::error( this, i18n( "The configuration could not be written, because %1 settings are incomplete:\n%1Please correct these issues." ).arg( index ).arg( issues ) );
+    }
+  }
+
+  return ok;
+}
+
+
+void Smb4TDEConfigDialog::showEvent( TQShowEvent *e )
+{
+  // Spontaneous show events come from outside the application.
+  // We do not want to react on them.
+  if ( !e->spontaneous() )
+  {
+    loadCustomSambaOptions();
+    loadAuthenticationData();
+  }
+}
+
+
+/////////////////////////////////////////////////////////////////////////////
+// TQT_SLOT IMPLEMENTATIONS
+/////////////////////////////////////////////////////////////////////////////
+
+void Smb4TDEConfigDialog::slotApply()
+{
+  // If some settings are not complete, stop here and give
+  // the user the opportunity to fill in the needed string(s).
+  if ( !checkSettings() )
+  {
+    return;
+  }
+
+  saveCustomSambaOptions();
+  saveAuthenticationData();
+
+  if ( writeSuperUserEntries() )
+  {
+    // Disable this widget until Smb4KFileIO::finished()
+    // is received.
+    setEnabled( false );
+  }
+
+  // The 'Apply' button will be disabled by TDEConfigDialog, so we do not
+  // need to do it here.
+
+  TDEConfigDialog::slotApply();
+}
+
+
+void Smb4TDEConfigDialog::slotOk()
+{
+  // If some settings are not complete, stop here and give
+  // the user the opportunity to fill in the needed string(s).
+  if ( !checkSettings() )
+  {
+    return;
+  }
+
+  saveCustomSambaOptions();
+  saveAuthenticationData();
+
+  saveDialogSize( *(Smb4KSettings::self()->config()), "ConfigDialog" );
+
+  // If the something needs to be written to either /etc/super.tab
+  // or /etc/sudoers, do not close the dialog but wait until the
+  // Smb4KFileIO::finished() signal is received.
+  if ( !writeSuperUserEntries() )
+  {
+    TDEConfigDialog::slotOk();
+  }
+  else
+  {
+    // Disable this widget until Smb4KFileIO::finished()
+    // is received.
+    setEnabled( false );
+
+    // Tell Smb4TDEConfigDialog::slotReceivedFileIOFinished()
+    // to close the dialog.
+    close_dialog = true;
+  }
+}
+
+
+void Smb4TDEConfigDialog::slotCancel()
+{
+  // Reset the custom Samba options tab:
+  Smb4KSambaOptions *samba_options = static_cast<Smb4KSambaOptions *>( TQT_TQWIDGET(child( "SambaOptions", "Smb4KSambaOptions", true )) );
+
+  if ( samba_options )
+  {
+    samba_options->resetCustomTab();
+  }
+
+  TDEConfigDialog::slotCancel();
+}
+
+
+void Smb4TDEConfigDialog::slotCustomSambaSettingsChanged()
+{
+  // Get the list view and all other input widgets:
+  KListView *view = static_cast<KListView *>( TQT_TQWIDGET(child( "CustomOptionsList", "KListView", true )) );
+
+  if ( !view )
+  {
+    return;
+  }
+
+  // Get the list of custom options:
+  TQValueList<Smb4KSambaOptionsInfo *> list = optionsHandler()->customOptionsList();
+
+  bool changed = false;
+
+  // Loop through the list view items to see what changed and if
+  // we need to enable the 'Apply' button:
+  for ( TQValueList<Smb4KSambaOptionsInfo *>::ConstIterator it = list.begin();
+        it != list.end(); ++it )
+  {
+    // Find the item in the list view:
+    TQListViewItem *item = view->findItem( (*it)->itemName(), Smb4KSambaOptions::ItemName );
+
+    if ( item )
+    {
+      if ( (*it)->type() == Smb4KSambaOptionsInfo::Host )
+      {
+        // Check if the protocol changed.
+        if ( ((*it)->protocol().isEmpty() &&
+             TQString::compare( item->text( Smb4KSambaOptions::Protocol ).lower(), i18n( "auto" ) ) != 0) ||
+             TQString::compare( (*it)->protocol(), item->text( Smb4KSambaOptions::Protocol ).lower() ) != 0 )
+        {
+          changed = true;
+
+          break;
+        }
+      }
+      else if ( (*it)->type() == Smb4KSambaOptionsInfo::Share )
+      {
+#ifndef __FreeBSD__
+        // Check if the file system changed.
+        if ( TQString::compare( (*it)->filesystem(), item->text( Smb4KSambaOptions::FileSystem ).lower() ) != 0 )
+        {
+          changed = true;
+
+          break;
+        }
+
+        // Check if the write access changed.
+        TQString write_access = (*it)->writeAccess() ?
+                               i18n( "read-write" ) :
+                               i18n( "read-only" );
+
+        if ( TQString::compare( write_access, item->text( Smb4KSambaOptions::WriteAccess ) ) != 0 )
+        {
+          changed = true;
+
+          break;
+        }
+#endif
+        // Check if the UID changed.
+        if ( ((*it)->uid().isEmpty() &&
+             TQString::compare( i18n( "default" ), item->text( Smb4KSambaOptions::UID ) ) != 0) ||
+             TQString::compare( (*it)->uid(), item->text( Smb4KSambaOptions::UID ) ) != 0 )
+        {
+          changed = true;
+
+          break;
+        }
+
+        // Check if the GID changed.
+        if ( ((*it)->gid().isEmpty() &&
+             TQString::compare( i18n( "default" ), item->text( Smb4KSambaOptions::GID ) ) != 0) ||
+             TQString::compare( (*it)->gid(), item->text( Smb4KSambaOptions::GID ) ) != 0 )
+        {
+          changed = true;
+
+          break;
+        }
+      }
+      else
+      {
+        // Something went wrong. Stop right here.
+        break;
+      }
+
+      // Check if the Kerberos entry changed.
+      TQString kerberos = (*it)->kerberos() ?
+                         i18n( "yes" ) :
+                         i18n( "no" );
+
+      if ( TQString::compare( kerberos, item->text( Smb4KSambaOptions::Kerberos ) ) != 0 )
+      {
+        changed = true;
+
+        break;
+      }
+
+      // Check if the port value changed.
+      if ( (*it)->port() != item->text( Smb4KSambaOptions::Port ).toInt() )
+      {
+        changed = true;
+
+        break;
+      }
+    }
+    else
+    {
+      break;
+    }
+  }
+
+  enableButtonApply( changed );
+}
+
+
+void Smb4TDEConfigDialog::slotRemoveSuperUserEntries()
+{
+  // Disable this widget until Smb4KFileIO::finished()
+  // is received.
+  setEnabled( false );
+
+  removeSuperUserEntries();
+}
+
+
+void Smb4TDEConfigDialog::slotReceivedFileIOFailed()
+{
+#ifdef __linux__
+  TQCheckBox *force =    static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_UseForceUnmount", TQCHECKBOX_OBJECT_NAME_STRING, true )) );
+#endif
+  TQCheckBox *full_use = static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_AlwaysUseSuperUser", TQCHECKBOX_OBJECT_NAME_STRING, true )) );
+
+#ifdef __linux__
+  if ( force && full_use )
+  {
+    force->setChecked( false );
+#else
+  if ( full_use )
+  {
+#endif
+    full_use->setChecked( false );
+  }
+}
+
+
+void Smb4TDEConfigDialog::slotReceivedFileIOFinished()
+{
+  // Enable the widget again.
+  setEnabled( true );
+
+  if ( close_dialog )
+  {
+    TDEConfigDialog::slotOk();
+  }
+}
+
+
+/////////////////////////////////////////////////////////////////////////////
+// FACTORY STUFF
+/////////////////////////////////////////////////////////////////////////////
+
+Smb4TDEConfigDialogFactory::Smb4TDEConfigDialogFactory()
+: KLibFactory()
+{
+}
+
+
+Smb4TDEConfigDialogFactory::~Smb4TDEConfigDialogFactory()
+{
+  delete m_instance;
+  delete m_about;
+
+  m_instance = 0L;
+}
+
+
+TDEInstance *Smb4TDEConfigDialogFactory::instance()
+{
+  if( !m_instance )
+  {
+    m_about = new TDEAboutData( "smb4tdeconfigdialog", I18N_NOOP( "Smb4TDEConfigDialog" ), "1.0" );
+    m_about->addAuthor("Alexander Reinholdt", 0, "dustpuppy@users.berlios.de");
+    m_about->setLicense( TDEAboutData::License_GPL );
+    m_instance = new TDEInstance( m_about );
+  }
+
+  return m_instance;
+}
+
+
+TQObject *Smb4TDEConfigDialogFactory::createObject( TQObject *parent, const char *name, const char *,
+const TQStringList & )
+{
+  return TQT_TQOBJECT( new Smb4TDEConfigDialog( Smb4KSettings::self(), TQT_TQWIDGET( parent ), name ) );
+}
+
+
+/////////////////////////////////////////////////////////////////////////////
+// INIT
+/////////////////////////////////////////////////////////////////////////////
+
+
+extern "C"
+{
+  void *init_libsmb4tdeconfigdialog()
+  {
+    TDEGlobal::locale()->insertCatalogue( "smb4k" );
+    return new Smb4TDEConfigDialogFactory;
+  }
+}
+
+#include "smb4tdeconfigdialog.moc"
diff --git a/smb4k/configdlg/smb4tdeconfigdialog.h b/smb4k/configdlg/smb4tdeconfigdialog.h
new file mode 100644
index 0000000..b47b05b
--- /dev/null
+++ b/smb4k/configdlg/smb4tdeconfigdialog.h
@@ -0,0 +1,210 @@
+/***************************************************************************
+    smb4tdeconfigdialog  -  The configuration dialog of Smb4K
+                             -------------------
+    begin                : Sa Apr 14 2007
+    copyright            : (C) 2007 by Alexander Reinholdt
+    email                : dustpuppy@users.berlios.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 SMB4KCONFIGDIALOG_H
+#define SMB4KCONFIGDIALOG_H
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+// KDE includes
+#include <tdeconfigdialog.h>
+#include <klibloader.h>
+#include <kaboutdata.h>
+#include <kinstance.h>
+
+// forward declarations
+class Smb4KSettings;
+
+/**
+ * This is the (new) configuration dialog of Smb4K.
+ *
+ * @author Alexander Reinholdt <dustpuppy@users.berlios.de>
+ */
+
+class Smb4TDEConfigDialog : public TDEConfigDialog
+{
+  Q_OBJECT
+  
+
+  public:
+    /**
+     * The constructor.
+     *
+     * @param settings      The Smb4KSettings object that needs to be passed
+     *                      so that the settings can be managed.
+     *
+     * @param parent        The parent widget
+     *
+     * @param name          The name of this dialog
+     */
+    Smb4TDEConfigDialog( Smb4KSettings *settings, TQWidget *parent = 0, const char *name = 0 );
+
+    /**
+     * The destructor
+     */
+    ~Smb4TDEConfigDialog();
+
+  protected:
+    /**
+     * Reimplemented from TQWidget to do last things before the
+     * configuration dialog is shown.
+     *
+     * @param e             The show event object
+     */
+    void showEvent( TQShowEvent *e );
+
+  protected slots:
+    /**
+     * Reimplemented from TDEConfigDialog. This slot does application
+     * specific stuff first and then executes TDEConfigDialog::slotApply().
+     */
+    void slotApply();
+
+    /**
+     * Reimplemented from TDEConfigDialog. This slot does application
+     * specific stuff first and then executes TDEConfigDialog::slotOk().
+     */
+    void slotOk();
+
+    /**
+     *Reimplemented from TDEConfigDialog. This slot does application
+     * specific stuff first and then executes TDEConfigDialog::slotCancel().
+     */
+    void slotCancel();
+
+    /**
+     * The custom Samba settings changed. Decide if we have to
+     * enable the 'Apply' button or not.
+     */
+    void slotCustomSambaSettingsChanged();
+
+    /**
+     * The 'Remove Entries' button in the 'Super User' page has been
+     * clicked. Initialize the removal of Smb4K's configuration entries
+     * from the configuration file of the currently chosen program.
+     */
+    void slotRemoveSuperUserEntries();
+
+    /**
+     * This slot is activated if the Smb4KFileIO::failed() signal is
+     * received. It deselects all check boxes in the "Super User" page.
+     */
+    void slotReceivedFileIOFailed();
+
+    /**
+     * This slot is activated if the Smb4KFileIO::finished() signal is
+     * received. It closes the dialog by invoking TDEConfigDialog::slotOk().
+     */
+    void slotReceivedFileIOFinished();
+
+  private:
+    /**
+     * Load the custom Samba options
+     */
+    void loadCustomSambaOptions();
+
+    /**
+     * Save the custom Samba options
+     */
+    void saveCustomSambaOptions();
+
+    /**
+     * Load the authentication data
+     */
+    void loadAuthenticationData();
+
+    /**
+     * Save the authentication data
+     */
+    void saveAuthenticationData();
+
+    /**
+     * Write super user configuration entries to configuration file.
+     *
+     * @returns TRUE if something needs to be written.
+     */
+    bool writeSuperUserEntries();
+
+    /**
+     * Remove super user configuration entries from the configuration file.
+     */
+    void removeSuperUserEntries();
+
+    /**
+     * Checks that mandatorily needed input is provided for settings that
+     * need it. This function will report all missing input to the user
+     * via a message box.
+     *
+     * @returns TRUE if the check passed and FALSE if it failed.
+     */
+    bool checkSettings();
+};
+
+
+class TDEInstance;
+class TDEAboutData;
+
+
+class Smb4TDEConfigDialogFactory : KLibFactory
+{
+  Q_OBJECT
+  
+
+  public:
+    /**
+     * The constructor.
+     */
+    Smb4TDEConfigDialogFactory();
+
+    /**
+     * The destructor.
+     */
+    virtual ~Smb4TDEConfigDialogFactory();
+
+    /**
+     * The instance
+     */
+    static TDEInstance *instance();
+
+  protected:
+    TQObject *createObject( TQObject *parent = 0, const char *name = 0,
+                           const char *classname = TQOBJECT_OBJECT_NAME_STRING,
+                           const TQStringList &args = TQStringList() );
+
+  private:
+    /**
+     * The factory's instance
+     */
+    static TDEInstance *m_instance;
+
+    /**
+     * The factory's TDEAboutData object
+     */
+    static TDEAboutData *m_about;
+};
+
+#endif
diff --git a/smb4k/configdlg/smb4tdersyncoptions.cpp b/smb4k/configdlg/smb4tdersyncoptions.cpp
index 71e810d..2fbbe8a 100644
--- a/smb4k/configdlg/smb4tdersyncoptions.cpp
+++ b/smb4k/configdlg/smb4tdersyncoptions.cpp
@@ -36,7 +36,7 @@
 #include <klineedit.h>
 #include <knuminput.h>
 #include <klineedit.h>
-#include <kfile.h>
+#include <tdefile.h>
 
 // application specific includes
 #include "smb4tdersyncoptions.h"
diff --git a/smb4k/core/Makefile.am b/smb4k/core/Makefile.am
index 12b7449..3d426b5 100644
--- a/smb4k/core/Makefile.am
+++ b/smb4k/core/Makefile.am
@@ -5,14 +5,14 @@ lib_LTLIBRARIES = libsmb4kcore.la
 libsmb4kcore_la_LDFLAGS = -no-undefined $(all_libraries) -ltdewalletclient \
 	-version-info 2:0:0
 include_HEADERS = smb4kauthinfo.h smb4kbookmark.h smb4kbookmarkhandler.h \
-	smb4kcore.h smb4kdefs.h smb4kerror.h smb4kfileio.h smb4kglobal.h \
+	smb4kcore.h smb4kdefs.h smb4kerror.h smb4tdefileio.h smb4kglobal.h \
 	smb4khomesshareshandler.h smb4kmounter.h smb4knetworkitems.h \
 	smb4kpasswordhandler.h smb4kpreviewer.h smb4kpreviewitem.h \
 	smb4kprint.h smb4kprintinfo.h smb4ksambaoptionshandler.h \
 	smb4ksambaoptionsinfo.h smb4kscanner.h smb4kshare.h \
 	smb4ksynchronizationinfo.h smb4ksynchronizer.h
 libsmb4kcore_la_SOURCES = smb4kauthinfo.cpp smb4kbookmark.cpp \
-	smb4kbookmarkhandler.cpp smb4kcore.cpp smb4kerror.cpp smb4kfileio.cpp smb4kglobal.cpp \
+	smb4kbookmarkhandler.cpp smb4kcore.cpp smb4kerror.cpp smb4tdefileio.cpp smb4kglobal.cpp \
 	smb4kglobal_p.cpp smb4khomesshareshandler.cpp smb4kmounter.cpp smb4kmounter_p.cpp \
 	smb4knetworkitems.cpp smb4kpasswordhandler.cpp smb4kpreviewer.cpp smb4kpreviewitem.cpp \
 	smb4kprint.cpp smb4kprintinfo.cpp smb4ksambaoptionshandler.cpp \
@@ -24,7 +24,7 @@ kde_kcfg_DATA = smb4k.kcfg
 
 # Build rules
 smb4kcore.lo: smb4ksettings.h
-smb4kfileio.lo: smb4ksettings.h
+smb4tdefileio.lo: smb4ksettings.h
 smb4kmounter.lo: smb4ksettings.h
 smb4kpasswordhandler.lo: smb4ksettings.h
 smb4kprint.lo: smb4ksettings.h
diff --git a/smb4k/core/smb4kcore.h b/smb4k/core/smb4kcore.h
index e49b4db..fd3a488 100644
--- a/smb4k/core/smb4kcore.h
+++ b/smb4k/core/smb4kcore.h
@@ -39,7 +39,7 @@
 // application specific includes
 #include "smb4kscanner.h"
 #include "smb4kmounter.h"
-#include "smb4kfileio.h"
+#include "smb4tdefileio.h"
 #include "smb4kbookmarkhandler.h"
 #include "smb4kprint.h"
 #include "smb4ksynchronizer.h"
diff --git a/smb4k/core/smb4kfileio.cpp b/smb4k/core/smb4kfileio.cpp
deleted file mode 100644
index 05d59a9..0000000
--- a/smb4k/core/smb4kfileio.cpp
+++ /dev/null
@@ -1,1795 +0,0 @@
-/***************************************************************************
-    smb4kfileio  -  Does file IO operations for Smb4K
-                             -------------------
-    begin                : Do Jan 1 2004
-    copyright            : (C) 2004-2007 by Alexander Reinholdt
-    email                : dustpuppy@users.berlios.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                                                    *
- ***************************************************************************/
-
-// TQt includes
-#include <tqdir.h>
-#include <tqfile.h>
-#include <tqtextstream.h>
-
-// KDE includes
-#include <kapplication.h>
-#include <kdebug.h>
-#include <klocale.h>
-
-// system specific includes
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <grp.h>
-#include <pwd.h>
-
-// application specific includes
-#include "smb4kfileio.h"
-#include "smb4kdefs.h"
-#include "smb4kerror.h"
-#include "smb4kglobal.h"
-#include "smb4ksettings.h"
-
-using namespace Smb4TDEGlobal;
-
-
-
-Smb4KFileIO::Smb4KFileIO( TQObject *parent, const char *name ) : TQObject( parent, name )
-{
-  m_operation =      NoOperation;
-  m_state =          Idle;
-  m_error_occurred = false;
-
-  m_proc = new TDEProcess( this, "FileIOProcess" );
-  m_proc->setUseShell( true );
-
-  connect( m_proc, TQT_SIGNAL( receivedStderr( TDEProcess *, char *, int ) ),
-           this,   TQT_SLOT( slotReceivedStderr( TDEProcess *, char *, int ) ) );
-
-  connect( m_proc, TQT_SIGNAL( receivedStdout( TDEProcess *, char *, int ) ),
-           this,   TQT_SLOT( slotReceivedStdout( TDEProcess *, char *, int ) ) );
-
-  connect( m_proc, TQT_SIGNAL( processExited( TDEProcess * ) ),
-           this,   TQT_SLOT( slotProcessExited( TDEProcess * ) ) );
-
-  connect( kapp,   TQT_SIGNAL( shutDown() ),
-           this,   TQT_SLOT( slotShutdown() ) );
-}
-
-
-Smb4KFileIO::~Smb4KFileIO()
-{
-}
-
-
-bool Smb4KFileIO::writeSudoers( Smb4KFileIO::Operation operation )
-{
-  m_operation = operation;
-  bool ok = false;
-
-  // Stop here if nothing has changed:
-  if ( m_operation == NoOperation )
-  {
-    emit finished();
-
-    ok = true;
-
-    return ok;
-  }
-
-  TQString file = "sudoers";
-
-  if ( createLockFile( file ) )
-  {
-    // Find the file first:
-    TQCString canonical_path = findFile( file );
-
-    if ( !canonical_path.isEmpty() )
-    {
-      // Stat the file, so that we know that it is safe to
-      // read from and write to it and whether we need to
-      // ask for the super user's password:
-      struct stat buf;
-
-      if ( lstat( canonical_path, &buf ) == -1 )
-      {
-        int error_number = errno;
-
-        Smb4KError::error( ERROR_GETTING_PERMISSIONS, canonical_path, strerror( error_number ) );
-
-        emit failed();
-        emit finished();
-
-        removeLockFile();
-
-        return ok; // false
-      }
-
-      // Look for the groups the user is in:
-      long ngroups_max;
-      ngroups_max = sysconf(_SC_NGROUPS_MAX);
-
-      gid_t list[ngroups_max];
-
-      if ( getgroups( ngroups_max, list ) == -1 )
-      {
-        int error_number = errno;
-
-        Smb4KError::error( ERROR_GETTING_GIDS, TQString(), strerror( error_number ) );
-
-        emit failed();
-        emit finished();
-
-        return ok; // false
-      }
-
-      gid_t sup_gid = 65534; // set this to gid 'nobody' for initialization
-      bool found_gid = false;
-      int i = 0;
-
-      while ( list[i] )
-      {
-        if ( list[i] == buf.st_gid )
-        {
-          sup_gid = list[i];
-          found_gid = true;
-        }
-
-        i++;
-      }
-
-      // Error out if the file is irregular.
-      // Yes, yes, I know that this is normally done in a different
-      // way and that there might be a race here, but, hey, right here
-      // I don't care!
-      if ( !S_ISREG( buf.st_mode ) || S_ISFIFO( buf.st_mode ) || S_ISLNK( buf.st_mode ) )
-      {
-        Smb4KError::error( ERROR_FILE_IS_IRREGULAR, canonical_path, TQString() );
-
-        emit failed();
-        emit finished();
-
-        removeLockFile();
-
-        return ok; // false
-      }
-
-      // Check access rights:
-      if ( (buf.st_uid == getuid() && (buf.st_mode & 00600) == (S_IWUSR | S_IRUSR)) /* user */ ||
-           (found_gid && buf.st_gid == sup_gid && (buf.st_mode & 00060) == (S_IWGRP | S_IRGRP)) /* group */ ||
-           ((buf.st_mode & 00006) == (S_IWOTH | S_IROTH)) /* others */ )
-      {
-        // The user has read and write access.
-
-        TQFile file ( canonical_path );
-        TQStringList contents;
-
-        if ( file.open( IO_ReadWrite ) )
-        {
-          TQTextStream ts( &file );
-          ts.setEncoding( TQTextStream::Locale );
-
-          contents = TQStringList::split( "\n", ts.read(), true );
-
-          bool write = false;
-
-          switch ( m_operation )
-          {
-            case Insert:
-            {
-              size_t hostnamelen = 255;
-              char *hn = new char[hostnamelen];
-
-              if ( gethostname( hn, hostnamelen ) == -1 )
-              {
-                int error_number = errno;
-                Smb4KError::error( ERROR_GETTING_HOSTNAME, TQString(), strerror( error_number ) );
-
-                emit failed();
-                emit finished();
-
-                removeLockFile();
-
-                return ok; // false
-              }
-
-              TQString hostname( hn );
-
-              delete [] hn;
-
-              if ( contents.grep( "# Entries for Smb4K users." ).count() == 0 )
-              {
-                contents.append( "# Entries for Smb4K users." );
-                contents.append( "# Generated by Smb4K. Please do not modify!" );
-                contents.append( "User_Alias\tSMB4KUSERS = "+TQString( "%1" ).arg( getpwuid( getuid() )->pw_name ) );
-                contents.append( "Defaults:SMB4KUSERS\tenv_keep += \"PASSWD USER\"" );
-                contents.append( "SMB4KUSERS\t"+hostname+" = NOPASSWD: "+Smb4KSettings::smb4k_kill() );
-                contents.append( "SMB4KUSERS\t"+hostname+" = NOPASSWD: "+Smb4KSettings::smb4k_umount() );
-                contents.append( "SMB4KUSERS\t"+hostname+" = NOPASSWD: "+Smb4KSettings::smb4k_mount() );
-                contents.append( "# End of Smb4K user entries." );
-
-                write = true;
-              }
-              else
-              {
-                // Find the beginning and the end of the entries in
-                // the sudoers file:
-                TQStringList::Iterator begin = contents.find( "# Entries for Smb4K users." );
-                TQStringList::Iterator end = contents.find( "# End of Smb4K user entries." );
-
-                for ( TQStringList::Iterator it = begin; it != end; ++it )
-                {
-                  if ( (*it).startsWith( "User_Alias\tSMB4KUSERS" ) && (*it).contains( getpwuid( getuid() )->pw_name, true ) == 0 )
-                  {
-                    (*it).append( ","+TQString( getpwuid( getuid() )->pw_name ) );
-
-                    write = true;
-
-                    break;
-                  }
-                  else
-                  {
-                    continue;
-                  }
-                }
-              }
-
-              break;
-            }
-            case Remove:
-            {
-              // Find the beginning and the end of the entries in
-              // the sudoers file:
-              TQStringList::Iterator begin = contents.find( "# Entries for Smb4K users." );
-              TQStringList::Iterator end = contents.find( "# End of Smb4K user entries." );
-
-              // Now, check if the user is in the list of users. If he is,
-              // remove him from there or remove all if he is the only one:
-              for ( TQStringList::Iterator it = begin; it != end; ++it )
-              {
-                if ( (*it).startsWith( "User_Alias\tSMB4KUSERS" ) )
-                {
-                  TQString users = (*it).section( "=", 1, 1 ).stripWhiteSpace();
-
-                  if ( users.contains( "," ) == 0 )
-                  {
-                    // In this case, there is only one user in the list. Check if
-                    // it is the user who requested the removal:
-                    if ( TQString::compare( users, getpwuid( getuid() )->pw_name ) == 0 )
-                    {
-                      // They are equal. Remove everything:
-                      contents.erase( begin, end );
-                      contents.remove( end );
-
-                      write = true;
-
-                      break;
-                    }
-                    else
-                    {
-                      // They are not equal: Do nothing.
-                      break;
-                    }
-                  }
-                  else
-                  {
-                    // In this case there is more than one user in the list.
-                    // Remove the user who requested the removal:
-                    TQStringList list = TQStringList::split( ",", users, false );
-                    list.remove( getpwuid( getuid() )->pw_name );
-
-                    (*it).replace( users, list.join( "," ) );
-
-                    write = true;
-
-                    break;
-                  }
-                }
-                else
-                {
-                  continue;
-                }
-              }
-
-              break;
-            }
-            default:
-            {
-              file.close();
-
-              emit failed();
-              emit finished();
-
-              removeLockFile();
-
-              return ok; // false
-            }
-          };
-
-          if ( write )
-          {
-            // Prepare the contents: remove empty lines from the end.
-            TQStringList::Iterator it = contents.end();
-
-            // Move the iterator to the last entry in the list:
-            --it;
-
-            while ( (*it).stripWhiteSpace().isEmpty() )
-            {
-              it = contents.remove( it );
-              --it;
-            }
-
-            // Now write the contents to the file. The permissions
-            // will be preserved by this action.
-            ts << contents.join( "\n" ) << endl;
-
-            file.close();
-          }
-          else
-          {
-            // The entries are already in the file.
-          }
-
-          ok = true;
-
-          emit finished();
-
-          removeLockFile();
-
-          return ok;
-        }
-        else
-        {
-          Smb4KError::error( ERROR_OPENING_FILE, canonical_path, file.errorString() );
-
-          emit failed();
-          emit finished();
-
-          removeLockFile();
-
-          return ok; // false
-        }
-      }
-      else
-      {
-        // The user does not have enough access rights to perform
-        // the modification of the sudoers file. So, we need to use
-        // tdesu to get the contents of the file.
-
-        // Compose the command:
-        TQString command;
-        command.append( "tdesu -t -c \"smb4k_cat " );
-        command.append( canonical_path+"\"" );
-        command.append( " ; sleep 2" );
-
-        m_state = ReadSudoers;
-
-        ok = true;
-
-        *m_proc << command;
-        m_proc->start( TDEProcess::NotifyOnExit, TDEProcess::AllOutput );
-
-        // The process is not finished, so finished() will be emitted
-        // later and the lock file will also be removed at the end.
-
-        return ok;
-      }
-    }
-    else
-    {
-      Smb4KError::error( ERROR_FILE_NOT_FOUND, canonical_path );
-
-      emit failed();
-      emit finished();
-
-      removeLockFile();
-
-      return ok; // false
-    }
-  }
-  else
-  {
-    // The error message has already been shown by
-    // Smb4KFileIO::createLockFile()
-    emit failed();
-    emit finished();
-
-    // We need not remove the lock file here.
-
-    return ok; // false
-  }
-
-  return ok;
-}
-
-
-bool Smb4KFileIO::writeSuperTab( Smb4KFileIO::Operation operation )
-{
-  m_operation = operation;
-  bool ok = false;
-
-  // Stop here if nothing has changed:
-  if ( m_operation == NoOperation )
-  {
-    emit finished();
-
-    ok = true;
-
-    return ok;
-  }
-
-  TQString file = "super.tab";
-
-  if ( createLockFile( file ) )
-  {
-    // Find the file first:
-    TQCString canonical_path = findFile( file );
-
-    if ( !canonical_path.isEmpty() )
-    {
-      // Stat the file, so that we know that it is safe to
-      // read from and write to it and whether we need to
-      // ask for the super user's password:
-      struct stat buf;
-
-      if ( lstat( canonical_path, &buf ) == -1 )
-      {
-        int error_number = errno;
-
-        Smb4KError::error( ERROR_GETTING_PERMISSIONS, canonical_path, strerror( error_number ) );
-
-        emit failed();
-        emit finished();
-
-        removeLockFile();
-
-        return ok; // false
-      }
-
-      // Look for the groups the user is in:
-      long ngroups_max;
-      ngroups_max = sysconf(_SC_NGROUPS_MAX);
-
-      gid_t list[ngroups_max];
-
-      if ( getgroups( ngroups_max, list ) == -1 )
-      {
-        int error_number = errno;
-
-        Smb4KError::error( ERROR_GETTING_GIDS, TQString(), strerror( error_number ) );
-
-        emit failed();
-        emit finished();
-
-        return ok; // false
-      }
-
-      gid_t sup_gid = 65534; // set this to gid 'nobody' for initialization
-      bool found_gid = false;
-      int i = 0;
-
-      while ( list[i] )
-      {
-        if ( list[i] == buf.st_gid )
-        {
-          sup_gid = list[i];
-          found_gid = true;
-        }
-
-        i++;
-      }
-
-      // Error out if the file is irregular.
-      // Yes, yes, I know that this is normally done in a different
-      // way and that there might be a race here, but, hey, right here
-      // I don't care!
-      if ( !S_ISREG( buf.st_mode ) || S_ISFIFO( buf.st_mode ) || S_ISLNK( buf.st_mode ) )
-      {
-        Smb4KError::error( ERROR_FILE_IS_IRREGULAR, canonical_path, TQString() );
-
-        emit failed();
-        emit finished();
-
-        removeLockFile();
-
-        return ok; // false
-      }
-
-      // Check access rights:
-      if ( (buf.st_uid == getuid() && (buf.st_mode & 00600) == (S_IWUSR | S_IRUSR)) /* user */ ||
-           (found_gid && buf.st_gid == sup_gid && (buf.st_mode & 00060) == (S_IWGRP | S_IRGRP)) /* group */ ||
-           ((buf.st_mode & 00006) == (S_IWOTH | S_IROTH)) /* others */ )
-      {
-        // The user has read and write access.
-
-        TQFile file ( canonical_path );
-        TQStringList contents;
-
-        if ( file.open( IO_ReadWrite ) )
-        {
-          TQTextStream ts( &file );
-          ts.setEncoding( TQTextStream::Locale );
-
-          contents = TQStringList::split( "\n", ts.read(), true );
-
-          bool write = false;
-
-          switch ( m_operation )
-          {
-            case Insert:
-            {
-              size_t hostnamelen = 255;
-              char *hn = new char[hostnamelen];
-
-              if ( gethostname( hn, hostnamelen ) == -1 )
-              {
-                int error_number = errno;
-                Smb4KError::error( ERROR_GETTING_HOSTNAME, TQString(), strerror( error_number ) );
-
-                emit failed();
-                emit finished();
-
-                removeLockFile();
-
-                return ok; // false
-              }
-
-              TQString hostname( hn );
-
-              delete [] hn;
-
-              if ( contents.grep( "# Entries for Smb4K users." ).count() == 0 )
-              {
-                contents.append( "# Entries for Smb4K users." );
-                contents.append( "# Generated by Smb4K. Please do not modify!" );
-                contents.append( ":define Smb4KUsers "+TQString( "%1" ).arg( getpwuid( getuid() )->pw_name ) );
-#ifndef __FreeBSD__
-                contents.append( "smb4k_kill\t"+Smb4KSettings::smb4k_kill()+
-                                  "\t$(Smb4KUsers)\tuid=root\tgid=root" );
-                contents.append( "smb4k_umount\t"+Smb4KSettings::smb4k_umount()+
-                                "\t$(Smb4KUsers)\tuid=root\tgid=root" );
-                contents.append( "smb4k_mount\t"+Smb4KSettings::smb4k_mount()+
-                                "\t$(Smb4KUsers)\tuid=root\tgid=root\tenv=PASSWD,USER" );
-#else
-                contents.append( "smb4k_kill\t"+Smb4KSettings::smb4k_kill()+
-                                "\t$(Smb4KUsers)\tuid=root\tgid=wheel" );
-                contents.append( "smb4k_umount\t"+Smb4KSettings::smb4k_umount()+
-                                "\t$(Smb4KUsers)\tuid=root\tgid=wheel" );
-                contents.append( "smb4k_mount\t"+Smb4KSettings::smb4k_mount()+
-                                "\t$(Smb4KUsers)\tuid=root\tgid=wheel\tsetenv=HOME=$CALLER_HOME\tenv=PASSWD,USER" );
-#endif
-                contents.append( "# End of Smb4K user entries." );
-
-                write = true;
-              }
-              else
-              {
-                // Find the beginning and the end of the entries in
-                // the super.tab file:
-                TQStringList::Iterator begin = contents.find( "# Entries for Smb4K users." );
-                TQStringList::Iterator end = contents.find( "# End of Smb4K user entries." );
-
-                for ( TQStringList::Iterator it = begin; it != end; ++it )
-                {
-                  if ( (*it).startsWith( ":define Smb4KUsers" ) && (*it).contains( getpwuid( getuid() )->pw_name, true ) == 0 )
-                  {
-                    (*it).append( ","+TQString( getpwuid( getuid() )->pw_name ) );
-
-                    write = true;
-
-                    break;
-                  }
-                  else
-                  {
-                    continue;
-                  }
-                }
-              }
-
-              break;
-            }
-            case Remove:
-            {
-              // Find the beginning and the end of the entries in
-              // the super.tab file:
-              TQStringList::Iterator begin = contents.find( "# Entries for Smb4K users." );
-              TQStringList::Iterator end = contents.find( "# End of Smb4K user entries." );
-
-              // Now, check if the user is in the list of users. If he is,
-              // remove him from there or remove all if he is the only one:
-              for ( TQStringList::Iterator it = begin; it != end; ++it )
-              {
-                if ( (*it).startsWith( ":define Smb4KUsers" ) )
-                {
-                  TQString users = (*it).section( "Smb4KUsers", 1, 1 ).stripWhiteSpace();
-
-                  if ( users.contains( "," ) == 0 )
-                  {
-                    // In this case, there is only one user in the list. Check if
-                    // it is the user who requested the removal:
-                    if ( TQString::compare( users, getpwuid( getuid() )->pw_name ) == 0 )
-                    {
-                      // They are equal. Remove everything:
-                      contents.erase( begin, end );
-                      contents.remove( end );
-
-                      write = true;
-
-                      break;
-                    }
-                    else
-                    {
-                      // They are not equal: Do nothing.
-                      break;
-                    }
-                  }
-                  else
-                  {
-                    // In this case there is more than one user in the list.
-                    // Remove the user who requested the removal:
-                    TQStringList list = TQStringList::split( ",", users, false );
-                    list.remove( getpwuid( getuid() )->pw_name );
-
-                    (*it).replace( users, list.join( "," ) );
-
-                    write = true;
-
-                    break;
-                  }
-                }
-                else
-                {
-                  continue;
-                }
-              }
-
-              break;
-            }
-            default:
-            {
-              file.close();
-
-              emit failed();
-              emit finished();
-
-              removeLockFile();
-
-              return ok; // false
-            }
-          };
-
-          if ( write )
-          {
-            // Prepare the contents: remove empty lines from the end.
-            TQStringList::Iterator it = contents.end();
-
-            // Move the iterator to the last entry in the list:
-            --it;
-
-            while ( (*it).stripWhiteSpace().isEmpty() )
-            {
-              it = contents.remove( it );
-              --it;
-            }
-
-            // Now write the contents to the file. The permissions
-            // will be preserved by this action.
-            ts << contents.join( "\n" ) << endl;
-
-            file.close();
-          }
-          else
-          {
-            // The entries are already in the file.
-          }
-
-          ok = true;
-
-          emit finished();
-
-          removeLockFile();
-
-          return ok;
-        }
-        else
-        {
-          Smb4KError::error( ERROR_OPENING_FILE, canonical_path, file.errorString() );
-
-          emit failed();
-          emit finished();
-
-          removeLockFile();
-
-          return ok; // false
-        }
-      }
-      else
-      {
-        // The user does not have enough access rights to perform
-        // the modification of the sudoers file. So, we need to use
-        // tdesu to get the contents of the file.
-
-        // Compose the command:
-        TQString command;
-        command.append( "tdesu -t -c \"smb4k_cat " );
-        command.append( canonical_path+"\"" );
-        command.append( " ; sleep 2" );
-
-        m_state = ReadSuperTab;
-
-        ok = true;
-
-        *m_proc << command;
-        m_proc->start( TDEProcess::NotifyOnExit, TDEProcess::AllOutput );
-
-        // The process is not finished, so finished() will be emitted
-        // later and the lock file will also be removed at the end.
-
-        return ok;
-      }
-    }
-    else
-    {
-      Smb4KError::error( ERROR_FILE_NOT_FOUND, canonical_path );
-
-      emit failed();
-      emit finished();
-
-      removeLockFile();
-
-      return ok; // false
-    }
-  }
-  else
-  {
-    // The error message has already been shown by
-    // Smb4KFileIO::createLockFile()
-    emit failed();
-    emit finished();
-
-    // We need not remove the lock file here.
-
-    return ok; // false
-  }
-
-  return ok;
-}
-
-
-bool Smb4KFileIO::createLockFile( const TQString &filename )
-{
-  bool ok = false;
-
-  // Determine the directory where to write the lock file. First, try
-  // /var/lock and than /var/tmp. If that does not work either, fall
-  // back to /tmp.
-  if ( m_lock_file.isEmpty() )
-  {
-    TQValueList<TQCString> dirs;
-    dirs << "/var/lock" << "/var/tmp" << "/tmp";
-
-    struct stat buf;
-
-    for ( TQValueList<TQCString>::ConstIterator it = dirs.begin(); it != dirs.end(); ++it )
-    {
-      // First check if the directory is available and writable
-      if ( lstat( *it, &buf ) == -1 )
-      {
-        int error_number = errno;
-
-        if ( error_number != EACCES && error_number != ENOENT )
-        {
-          Smb4KError::error( ERROR_GETTING_PERMISSIONS, *it, strerror( error_number ) );
-
-          return ok; // false
-        }
-      }
-      else
-      {
-        // Look for the groups the user is in:
-        long ngroups_max;
-        ngroups_max = sysconf(_SC_NGROUPS_MAX);
-
-        gid_t list[ngroups_max];
-
-        if ( getgroups( ngroups_max, list ) == -1 )
-        {
-          int error_number = errno;
-
-          Smb4KError::error( ERROR_GETTING_GIDS, TQString(), strerror( error_number ) );
-
-          return ok; // false
-        }
-
-        gid_t sup_gid = 65534; // set this to gid 'nobody' for initialization
-        bool found_gid = false;
-        int i = 0;
-
-        while ( list[i] )
-        {
-          if ( list[i] == buf.st_gid )
-          {
-            sup_gid = list[i];
-            found_gid = true;
-          }
-
-          i++;
-        }
-
-        // Check whether we are stat'ing a directory and that the
-        // user has read/write permissions.
-        if ( S_ISDIR( buf.st_mode ) /* is directory */ &&
-            (buf.st_uid == getuid() && (buf.st_mode & 00600) == (S_IWUSR | S_IRUSR)) /* user */ ||
-            (found_gid && buf.st_gid == sup_gid && (buf.st_mode & 00060) == (S_IWGRP | S_IRGRP)) /* group */ ||
-            ((buf.st_mode & 00006) == (S_IWOTH | S_IROTH)) /* others */ )
-        {
-          m_lock_file = *it+"/smb4k.lock";
-
-          break;
-        }
-        else
-        {
-          continue;
-        }
-      }
-    }
-  }
-
-  int file_descriptor;
-
-  // Create the lock file if necessary and open it:
-  if ( (file_descriptor = open( m_lock_file, O_RDWR|O_CREAT, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH )) == -1 )
-  {
-    // Error out if the opening failed:
-    int error_number = errno;
-
-    Smb4KError::error( ERROR_OPENING_FILE, m_lock_file, strerror( error_number ) );
-
-    return ok; // false
-  }
-  else
-  {
-    // Check what we actually opened:
-
-    struct stat file_stat;
-
-    if ( fstat( file_descriptor, &file_stat ) == -1 )
-    {
-      // Error out if we could not get the information about the file:
-      int error_number = errno;
-
-      // FIXME for >= 0.8.x: Change error code to ERROR_GETTING_STAT
-      Smb4KError::error( ERROR_GETTING_PERMISSIONS, TQString(), strerror( error_number ) );
-
-      return ok;
-    }
-
-    if ( !S_ISREG( file_stat.st_mode ) || S_ISFIFO( file_stat.st_mode ) || S_ISLNK( file_stat.st_mode ) )
-    {
-      // Close the file and error out, if we have opened an
-      // "irregular" file (i.e. a symlink, a fifo, etc.).
-
-      Smb4KError::error( ERROR_FILE_IS_IRREGULAR, m_lock_file );
-
-      if ( close( file_descriptor ) == -1 )
-      {
-        int error_number = errno;
-
-        Smb4KError::error( ERROR_CLOSING_FILE, m_lock_file, strerror( error_number ) );
-      }
-
-      return ok; // false
-    }
-    else
-    {
-      // Continue if the file is regular.
-
-      char buffer[1000];
-      ssize_t size;
-
-      if ( (size = read( file_descriptor, buffer, 1000 )) == -1 )
-      {
-        int error_number = errno;
-
-        Smb4KError::error( ERROR_READING_FILE, m_lock_file, strerror( error_number ) );
-
-        return ok; // false
-      }
-
-      if ( size >= 1000 )
-      {
-        // FIXME for >= 0.8.x: Change error code to ERROR_BUFFER_EXCEEDED
-        Smb4KError::error( ERROR_UNKNOWN, TQString(), i18n( "Buffer size exceeded" ) );
-
-        return ok; // false
-      }
-
-      TQStringList contents = TQStringList::split( '\n', TQString::fromLocal8Bit( buffer, size ), false );
-      TQString test_string = ":"+filename;
-      TQString entry = contents.grep( test_string, true ).join( "\n" ).stripWhiteSpace();
-
-      if ( !entry.isEmpty() )
-      {
-        Smb4KError::error( ERROR_LOCKED, entry );
-
-        return ok; // false
-      }
-      else
-      {
-        contents << TQString( "%1:%2" ).arg( getpwuid( getuid() )->pw_name ).arg( filename );
-        TQCString out = contents.join( "\n" ).local8Bit();
-
-        if ( write( file_descriptor, out, out.length() ) == -1 )
-        {
-          int error_number = errno;
-
-          Smb4KError::error( ERROR_WRITING_FILE, m_lock_file, strerror( error_number ) );
-
-          return ok; // false
-        }
-
-        if ( close( file_descriptor ) == -1 )
-        {
-          int error_number = errno;
-
-          Smb4KError::error( ERROR_CLOSING_FILE, m_lock_file, strerror( error_number ) );
-
-          return ok; // false
-        }
-
-        ok = true;
-      }
-    }
-  }
-
-  return ok;
-}
-
-
-bool Smb4KFileIO::removeLockFile( const bool error_message )
-{
-  // We already have the name and location of the lock
-  // file, so we do not need to define it here.
-
-  int file_descriptor;
-  bool ok = false;
-
-  // Open the lock file:
-  if ( (file_descriptor = open( m_lock_file, O_RDWR )) == -1 )
-  {
-    // Error out if the opening failed:
-    int error_number = errno;
-
-    if ( error_message && error_number != ENOENT )
-    {
-      Smb4KError::error( ERROR_OPENING_FILE, m_lock_file, strerror( error_number ) );
-    }
-
-    return ok; // false
-  }
-  else
-  {
-    // Check what we actually opened:
-
-    struct stat file_stat;
-
-    if ( fstat( file_descriptor, &file_stat ) == -1 )
-    {
-      // Error out if we could not get the information about the file:
-      int error_number = errno;
-
-      if ( error_message )
-      {
-        // FIXME for >= 0.8.x: Change error code to ERROR_GETTING_STAT
-        Smb4KError::error( ERROR_GETTING_PERMISSIONS, TQString(), strerror( error_number ) );
-      }
-
-      return ok;
-    }
-
-    if ( !S_ISREG( file_stat.st_mode ) || S_ISFIFO( file_stat.st_mode ) || S_ISLNK( file_stat.st_mode ) )
-    {
-      // Close the file and error out, if we have opened an
-      // "irregular" file (i.e. a symlink, a fifo, etc.).
-
-      if ( error_message )
-      {
-        Smb4KError::error( ERROR_FILE_IS_IRREGULAR, m_lock_file );
-      }
-
-      if ( close( file_descriptor ) == -1 )
-      {
-        int error_number = errno;
-
-        if ( error_message )
-        {
-          Smb4KError::error( ERROR_CLOSING_FILE, m_lock_file, strerror( error_number ) );
-        }
-      }
-
-      return ok; // false
-    }
-    else
-    {
-      // Continue if the file is regular.
-
-      char buffer[1000];
-      ssize_t size;
-
-      if ( (size = read( file_descriptor, buffer, 1000 )) == -1 )
-      {
-        int error_number = errno;
-
-        if ( error_message )
-        {
-          Smb4KError::error( ERROR_READING_FILE, m_lock_file, strerror( error_number ) );
-        }
-
-        return ok; // false
-      }
-
-      if ( size >= 1000 )
-      {
-        if ( error_message )
-        {
-          // FIXME for >= 0.8.x: Change error code to ERROR_BUFFER_EXCEEDED
-          Smb4KError::error( ERROR_UNKNOWN, TQString(), i18n( "Buffer size exceeded" ) );
-        }
-
-        return ok; // false
-      }
-
-      TQStringList contents = TQStringList::split( '\n', TQString::fromLocal8Bit( buffer, size ), false );
-
-      // Prepare the contents of the file and write it to the disk.
-      // It it should be empty, remove the lock file.
-      for ( TQStringList::Iterator it = contents.begin(); it != contents.end(); it++ )
-      {
-        if ( (*it).startsWith( TQString( getpwuid( getuid() )->pw_name )+":" ) )
-        {
-          *it = TQString();
-
-          continue;
-        }
-        else
-        {
-          continue;
-        }
-      }
-
-      contents.remove( TQString() );
-
-      if ( !contents.isEmpty() )
-      {
-        // Write the remaining contents to the lock file:
-
-        TQCString out = contents.join( "\n" ).local8Bit();
-
-        if ( write( file_descriptor, out, out.length() ) == -1 )
-        {
-          int error_number = errno;
-
-          if ( error_message )
-          {
-            Smb4KError::error( ERROR_WRITING_FILE, m_lock_file, strerror( error_number ) );
-          }
-
-          return ok; // false
-        }
-
-        if ( close( file_descriptor ) == -1 )
-        {
-          int error_number = errno;
-
-          if ( error_message )
-          {
-            Smb4KError::error( ERROR_CLOSING_FILE, m_lock_file, strerror( error_number ) );
-          }
-
-          return ok; // false
-        }
-
-        ok = true;
-      }
-      else
-      {
-        // Close and remove the lock file:
-
-        if ( close( file_descriptor ) == -1 )
-        {
-          int error_number = errno;
-
-          if ( error_message )
-          {
-            Smb4KError::error( ERROR_CLOSING_FILE, m_lock_file, strerror( error_number ) );
-          }
-
-          return ok; // false
-        }
-
-        if ( unlink( m_lock_file ) == -1 )
-        {
-          int error_number = errno;
-
-          if ( error_message )
-          {
-            // FIXME for > 0.8.x: Replace error code with ERROR_REMOVING_FILE
-            Smb4KError::error( ERROR_UNKNOWN, m_lock_file, strerror( error_number ) );
-          }
-
-          return ok; // false
-        }
-
-        ok = true;
-      }
-    }
-  }
-
-  return ok;
-}
-
-
-const TQCString Smb4KFileIO::findFile( const TQString &filename )
-{
-  TQStringList paths;
-  paths << "/etc";
-  paths << "/etc/samba";
-  paths << "/usr/local/etc";
-  paths << "/usr/local/etc/samba";
-
-  TQString canonical_path = TQString();
-
-  for ( TQStringList::ConstIterator it = paths.begin(); it != paths.end(); it++ )
-  {
-    TQDir::setCurrent( *it );
-
-    if ( TQFile::exists( filename ) )
-    {
-      canonical_path = TQDir::current().canonicalPath()+"/"+filename;
-
-      break;
-    }
-    else
-    {
-      continue;
-    }
-  }
-
-  return canonical_path.local8Bit();
-}
-
-
-void Smb4KFileIO::processSudoers()
-{
-  // If the output buffer is empty, we stop, because
-  // that most likely means, the user cancelled the
-  // tdesu dialog.
-  if ( m_buffer.stripWhiteSpace().isEmpty() )
-  {
-    emit failed();
-    emit finished();
-
-    removeLockFile();
-
-    return;
-  }
-
-  TQStringList contents = TQStringList::split( "\n", m_buffer, true );
-  bool write = false;
-
-  switch ( m_operation )
-  {
-    case Insert:
-    {
-      size_t hostnamelen = 255;
-      char *hn = new char[hostnamelen];
-
-      if ( gethostname( hn, hostnamelen ) == -1 )
-      {
-        int error_number = errno;
-        Smb4KError::error( ERROR_GETTING_HOSTNAME, TQString(), strerror( error_number ) );
-
-        emit failed();
-        emit finished();
-
-        removeLockFile();
-      }
-
-      TQString hostname( hn );
-
-      delete [] hn;
-
-      if ( contents.grep( "# Entries for Smb4K users." ).count() == 0 )
-      {
-        contents.append( "# Entries for Smb4K users." );
-        contents.append( "# Generated by Smb4K. Please do not modify!" );
-        contents.append( "User_Alias\tSMB4KUSERS = "+TQString( "%1" ).arg( getpwuid( getuid() )->pw_name ) );
-        contents.append( "Defaults:SMB4KUSERS\tenv_keep += \"PASSWD USER\"" );
-        contents.append( "SMB4KUSERS\t"+hostname+" = NOPASSWD: "+Smb4KSettings::smb4k_kill() );
-        contents.append( "SMB4KUSERS\t"+hostname+" = NOPASSWD: "+Smb4KSettings::smb4k_umount() );
-        contents.append( "SMB4KUSERS\t"+hostname+" = NOPASSWD: "+Smb4KSettings::smb4k_mount() );
-        contents.append( "# End of Smb4K user entries." );
-
-        write = true;
-      }
-      else
-      {
-        // Find the beginning and the end of the entries in
-        // the sudoers file:
-        TQStringList::Iterator begin = contents.find( "# Entries for Smb4K users." );
-        TQStringList::Iterator end = contents.find( "# End of Smb4K user entries." );
-
-        for ( TQStringList::Iterator it = begin; it != end; ++it )
-        {
-          if ( (*it).startsWith( "User_Alias\tSMB4KUSERS" ) && (*it).contains( getpwuid( getuid() )->pw_name, true ) == 0 )
-          {
-            (*it).append( ","+TQString( getpwuid( getuid() )->pw_name ) );
-
-            write = true;
-
-            break;
-          }
-          else
-          {
-            continue;
-          }
-        }
-      }
-
-      break;
-    }
-    case Remove:
-    {
-      // Find the beginning and the end of the entries in
-      // the sudoers file:
-      TQStringList::Iterator begin = contents.find( "# Entries for Smb4K users." );
-      TQStringList::Iterator end = contents.find( "# End of Smb4K user entries." );
-
-      // Now, check if the user is in the list of users. If he is,
-      // remove him from there or remove all if he is the only one:
-      for ( TQStringList::Iterator it = begin; it != end; ++it )
-      {
-        if ( (*it).startsWith( "User_Alias\tSMB4KUSERS" ) )
-        {
-          TQString users = (*it).section( "=", 1, 1 ).stripWhiteSpace();
-
-          if ( users.contains( "," ) == 0 )
-          {
-            // In this case, there is only one user in the list. Check if
-            // it is the user who requested the removal:
-            if ( TQString::compare( users, getpwuid( getuid() )->pw_name ) == 0 )
-            {
-              // They are equal. Remove everything:
-              contents.erase( begin, end );
-              contents.remove( end );
-
-              write = true;
-
-              break;
-            }
-            else
-            {
-              // They are not equal: Do nothing.
-              break;
-            }
-          }
-          else
-          {
-            // In this case there is more than one user in the list.
-            // Remove the user who requested the removal:
-            TQStringList list = TQStringList::split( ",", users, false );
-            list.remove( getpwuid( getuid() )->pw_name );
-
-            (*it).replace( users, list.join( "," ) );
-
-            write = true;
-
-            break;
-          }
-        }
-        else
-        {
-          continue;
-        }
-      }
-
-      break;
-    }
-    default:
-    {
-      emit failed();
-      emit finished();
-
-      removeLockFile();
-
-      return;
-    }
-  }
-
-  if ( write )
-  {
-    // Prepare the contents: remove empty lines from the end.
-    TQStringList::Iterator it = contents.end();
-
-    // Move the iterator to the last entry in the list:
-    --it;
-
-    while ( (*it).stripWhiteSpace().isEmpty() )
-    {
-      it = contents.remove( it );
-      --it;
-    }
-
-    // Create a temporary file and write the data to it:
-    TQCString template_string = tempDir().local8Bit()+"/XXXXXX";
-    char tmp[template_string.length()+1];
-    (void) tqstrncpy( tmp, template_string, template_string.length()+1 );
-
-    TQFile temp_file;
-    int file_descriptor;
-
-    if ( (file_descriptor = mkstemp( tmp )) == -1 )
-    {
-      int err = errno;
-
-      Smb4KError::error( ERROR_CREATING_TEMP_FILE, tmp, strerror( err ) );
-
-      emit failed();
-      emit finished();
-
-      removeLockFile();
-
-      return;
-    }
-
-    if ( temp_file.open( IO_WriteOnly, file_descriptor ) )
-    {
-      TQTextStream ts( &temp_file );
-      ts.setEncoding( TQTextStream::Locale );
-
-      ts << contents.join( "\n" ) << endl;
-
-      temp_file.close();
-    }
-    else
-    {
-      Smb4KError::error( ERROR_WRITING_FILE, temp_file.name() );
-
-      emit failed();
-      emit finished();
-
-      removeLockFile();
-
-      return;
-    }
-
-    // Now move the file to the right location. Preserve the permissions
-    // and the owner:
-    TQString canonical_path = findFile( "sudoers" );
-    struct stat file_stat;
-
-    if ( stat( canonical_path.local8Bit(), &file_stat ) == -1 )
-    {
-      int error_number = errno;
-
-      Smb4KError::error( ERROR_GETTING_PERMISSIONS, TQString(), strerror( error_number ) );
-
-      emit failed();
-      emit finished();
-
-      removeLockFile();
-
-      return;
-    }
-
-    TQString perms = TQString( "%1" ).arg( (int)file_stat.st_mode, 0, 8 );
-    perms = perms.right( 4 );
-    TQString owner = TQString( "%1" ).arg( (int)file_stat.st_uid );
-    TQString group = TQString( "%1" ).arg( (int)file_stat.st_gid );
-    TQString temp_file_name = TQString( tmp );
-
-    // Assemble the command.
-    TQString command;
-    command.append( "tdesu -n -c \"smb4k_mv "+owner+":"+group+" "+perms+" " );
-    command.append( temp_file_name+" " );
-    command.append( canonical_path+"\" ; " );
-    command.append( "rm -f "+temp_file_name );
-
-    m_state = WriteSudoers;
-
-    *m_proc << command;
-
-    m_proc->start( TDEProcess::NotifyOnExit, TDEProcess::AllOutput );
-  }
-  else
-  {
-    // Everything OK.
-    emit finished();
-
-    removeLockFile();
-  }
-}
-
-
-void Smb4KFileIO::processSuperTab()
-{
-  // If the output buffer is empty, we stop, because
-  // that most likely means, the user cancelled the
-  // tdesu dialog.
-  if ( m_buffer.stripWhiteSpace().isEmpty() )
-  {
-    emit failed();
-    emit finished();
-
-    removeLockFile();
-
-    return;
-  }
-
-  TQStringList contents = TQStringList::split( "\n", m_buffer, true );
-  bool write = false;
-
-  switch ( m_operation )
-  {
-    case Insert:
-    {
-      size_t hostnamelen = 255;
-      char *hn = new char[hostnamelen];
-
-      if ( gethostname( hn, hostnamelen ) == -1 )
-      {
-        int error_number = errno;
-        Smb4KError::error( ERROR_GETTING_HOSTNAME, TQString(), strerror( error_number ) );
-
-        emit failed();
-        emit finished();
-
-        removeLockFile();
-      }
-
-      TQString hostname( hn );
-
-      delete [] hn;
-
-      if ( contents.grep( "# Entries for Smb4K users." ).count() == 0 )
-      {
-        contents.append( "# Entries for Smb4K users." );
-        contents.append( "# Generated by Smb4K. Please do not modify!" );
-        contents.append( ":define Smb4KUsers "+TQString( "%1" ).arg( getpwuid( getuid() )->pw_name ) );
-#ifndef __FreeBSD__
-        contents.append( "smb4k_kill\t"+Smb4KSettings::smb4k_kill()+
-                         "\t$(Smb4KUsers)\tuid=root\tgid=root" );
-        contents.append( "smb4k_umount\t"+Smb4KSettings::smb4k_umount()+
-                         "\t$(Smb4KUsers)\tuid=root\tgid=root" );
-        contents.append( "smb4k_mount\t"+Smb4KSettings::smb4k_mount()+
-                         "\t$(Smb4KUsers)\tuid=root\tgid=root\tenv=PASSWD,USER" );
-#else
-        contents.append( "smb4k_kill\t"+Smb4KSettings::smb4k_kill()+
-                         "\t$(Smb4KUsers)\tuid=root\tgid=wheel" );
-        contents.append( "smb4k_umount\t"+Smb4KSettings::smb4k_umount()+
-                         "\t$(Smb4KUsers)\tuid=root\tgid=wheel" );
-        contents.append( "smb4k_mount\t"+Smb4KSettings::smb4k_mount()+
-                         "\t$(Smb4KUsers)\tuid=root\tgid=wheel\tsetenv=HOME=$CALLER_HOME\tenv=PASSWD,USER" );
-#endif
-        contents.append( "# End of Smb4K user entries." );
-
-        write = true;
-      }
-      else
-      {
-        // Find the beginning and the end of the entries in
-        // the super.tab file:
-        TQStringList::Iterator begin = contents.find( "# Entries for Smb4K users." );
-        TQStringList::Iterator end = contents.find( "# End of Smb4K user entries." );
-
-        for ( TQStringList::Iterator it = begin; it != end; ++it )
-        {
-          if ( (*it).startsWith( ":define Smb4KUsers" ) && (*it).contains( getpwuid( getuid() )->pw_name, true ) == 0 )
-          {
-            (*it).append( ","+TQString( getpwuid( getuid() )->pw_name ) );
-
-            write = true;
-
-            break;
-          }
-          else
-          {
-            continue;
-          }
-        }
-      }
-
-      break;
-    }
-    case Remove:
-    {
-      // Find the beginning and the end of the entries in
-      // the super.tab file:
-      TQStringList::Iterator begin = contents.find( "# Entries for Smb4K users." );
-      TQStringList::Iterator end = contents.find( "# End of Smb4K user entries." );
-
-      // Now, check if the user is in the list of users. If he is,
-      // remove him from there or remove all if he is the only one:
-      for ( TQStringList::Iterator it = begin; it != end; ++it )
-      {
-        if ( (*it).startsWith( ":define Smb4KUsers" ) )
-        {
-          TQString users = (*it).section( "Smb4KUsers", 1, 1 ).stripWhiteSpace();
-
-          if ( users.contains( "," ) == 0 )
-          {
-            // In this case, there is only one user in the list. Check if
-            // it is the user who requested the removal:
-            if ( TQString::compare( users, getpwuid( getuid() )->pw_name ) == 0 )
-            {
-              // They are equal. Remove everything:
-              contents.erase( begin, end );
-              contents.remove( end );
-
-              write = true;
-
-              break;
-            }
-            else
-            {
-              // They are not equal: Do nothing.
-              break;
-            }
-          }
-          else
-          {
-            // In this case there is more than one user in the list.
-            // Remove the user who requested the removal:
-            TQStringList list = TQStringList::split( ",", users, false );
-            list.remove( getpwuid( getuid() )->pw_name );
-
-            (*it).replace( users, list.join( "," ) );
-
-            write = true;
-
-            break;
-          }
-        }
-        else
-        {
-          continue;
-        }
-      }
-
-      break;
-    }
-    default:
-    {
-      emit failed();
-      emit finished();
-
-      removeLockFile();
-
-      return;
-    }
-  }
-
-  if ( write )
-  {
-    // Prepare the contents: remove empty lines from the end.
-    TQStringList::Iterator it = contents.end();
-
-    // Move the iterator to the last entry in the list:
-    --it;
-
-    while ( (*it).stripWhiteSpace().isEmpty() )
-    {
-      it = contents.remove( it );
-      --it;
-    }
-
-    // Create a temporary file and write the data to it:
-    TQCString template_string = tempDir().local8Bit()+"/XXXXXX";
-    char tmp[template_string.length()+1];
-    (void) tqstrncpy( tmp, template_string, template_string.length()+1 );
-
-    TQFile temp_file;
-    int file_descriptor;
-
-    if ( (file_descriptor = mkstemp( tmp )) == -1 )
-    {
-      int err = errno;
-
-      Smb4KError::error( ERROR_CREATING_TEMP_FILE, tmp, strerror( err ) );
-
-      emit failed();
-      emit finished();
-
-      removeLockFile();
-
-      return;
-    }
-
-    if ( temp_file.open( IO_WriteOnly, file_descriptor ) )
-    {
-      TQTextStream ts( &temp_file );
-      ts.setEncoding( TQTextStream::Locale );
-
-      ts << contents.join( "\n" ) << endl;
-
-      temp_file.close();
-    }
-    else
-    {
-      Smb4KError::error( ERROR_WRITING_FILE, temp_file.name() );
-
-      emit failed();
-      emit finished();
-
-      removeLockFile();
-
-      return;
-    }
-
-    // Now move the file to the right location. Preserve the permissions
-    // and the owner:
-    TQString canonical_path = findFile( "super.tab" );
-    struct stat file_stat;
-
-    if ( stat( canonical_path.local8Bit(), &file_stat ) == -1 )
-    {
-      int error_number = errno;
-
-      Smb4KError::error( ERROR_GETTING_PERMISSIONS, TQString(), strerror( error_number ) );
-
-      emit failed();
-      emit finished();
-
-      removeLockFile();
-
-      return;
-    }
-
-    TQString perms = TQString( "%1" ).arg( (int)file_stat.st_mode, 0, 8 );
-    perms = perms.right( 4 );
-    TQString owner = TQString( "%1" ).arg( (int)file_stat.st_uid );
-    TQString group = TQString( "%1" ).arg( (int)file_stat.st_gid );
-    TQString temp_file_name = TQString( tmp );
-
-    // Assemble the command.
-    TQString command;
-    command.append( "tdesu -n -c \"smb4k_mv "+owner+":"+group+" "+perms+" " );
-    command.append( temp_file_name+" " );
-    command.append( canonical_path+"\" ; " );
-    command.append( "rm -f "+temp_file_name );
-
-    m_state = WriteSuperTab;
-
-    *m_proc << command;
-
-    m_proc->start( TDEProcess::NotifyOnExit, TDEProcess::AllOutput );
-  }
-  else
-  {
-    // Everything OK.
-    emit finished();
-
-    removeLockFile();
-  }
-}
-
-/////////////////////////////////////////////////////////////////////////////
-// TQT_SLOT IMPLEMENTATIONS
-/////////////////////////////////////////////////////////////////////////////
-
-void Smb4KFileIO::slotShutdown()
-{
-  removeLockFile( false );
-}
-
-
-void Smb4KFileIO::slotReceivedStderr( TDEProcess *, char *buf, int len )
-{
-  TQString error_output = TQString::fromLocal8Bit( buf, len );
-
-  if ( error_output.contains( "smb4k_mv" ) != 0 )
-  {
-    m_error_occurred = true;
-
-    TQString canonical_path = findFile( (m_state == WriteSudoers ? "sudoers" : "super.tab") );
-
-    Smb4KError::error( ERROR_WRITING_FILE, canonical_path, m_buffer );
-
-    emit failed();
-    emit finished();
-
-    removeLockFile();
-  }
-  else if ( error_output.contains( "smb4k_cat" ) != 0 )
-  {
-    m_error_occurred = true;
-
-    TQString canonical_path = findFile( (m_state == ReadSudoers ? "sudoers" : "super.tab") );
-
-    Smb4KError::error( ERROR_READING_FILE, canonical_path, m_buffer );
-
-    emit failed();
-    emit finished();
-
-    removeLockFile();
-  }
-}
-
-
-void Smb4KFileIO::slotReceivedStdout( TDEProcess *, char *buf, int len )
-{
-  m_buffer.append( TQString::fromLocal8Bit( buf, len ) );
-}
-
-
-void Smb4KFileIO::slotProcessExited( TDEProcess * )
-{
-  m_proc->clearArguments();
-
-  if ( !m_error_occurred )
-  {
-    switch ( m_state )
-    {
-      case ReadSudoers:
-      {
-        processSudoers();
-
-        break;
-      }
-      case WriteSudoers:
-      {
-        emit finished();
-
-        removeLockFile();
-
-        break;
-      }
-      case ReadSuperTab:
-      {
-        processSuperTab();
-
-        break;
-      }
-      default:
-      {
-        emit finished();
-
-        removeLockFile();
-
-        break;
-      }
-    }
-  }
-  else
-  {
-    // Smb4KFileIO::slotReceivedStderr() has already done the
-    // necessary things.
-  }
-
-  m_buffer = TQString();
-  m_state = Idle;
-  m_error_occurred = false;
-}
-
-#include "smb4kfileio.moc"
diff --git a/smb4k/core/smb4kfileio.h b/smb4k/core/smb4kfileio.h
deleted file mode 100644
index b014fcf..0000000
--- a/smb4k/core/smb4kfileio.h
+++ /dev/null
@@ -1,247 +0,0 @@
-/***************************************************************************
-    smb4kfileio  -  Does file IO operations for Smb4K
-                             -------------------
-    begin                : Do Jan 1 2004
-    copyright            : (C) 2004-2007 by Alexander Reinholdt
-    email                : dustpuppy@users.berlios.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 SMB4KFILEIO_H
-#define SMB4KFILEIO_H
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-// TQt includes
-#include <tqobject.h>
-#include <tqstring.h>
-#include <tqcstring.h>
-
-// KDE include
-#include <kprocess.h>
-
-
-/**
- * This class belongs to the core classes of Smb4K. It handles IO
- * operations that are performed on system configuration files.
- *
- * @author Alexander Reinholdt <dustpuppy@mail.berlios.de>
- */
-
-class Smb4KFileIO : public TQObject
-{
-  Q_OBJECT
-  
-
-  public:
-    /**
-     * The constructor
-     *
-     * @param parent      The parent object of this class
-     *
-     * @param name        The name of this class
-     */
-    Smb4KFileIO( TQObject *parent = 0, const char *name = 0 );
-
-    /**
-     * The destructor
-     */
-    ~Smb4KFileIO();
-
-    /**
-     * Enumeration that determines for which super user program we perform
-     * the current action.
-     */
-    enum Operation { Insert, Remove, NoOperation };
-
-    /**
-     * This function writes changes to the sudoers configuration file.
-     *
-     * @param operation   Defines whether entries should be inserted or if
-     *                    they should be removed. With Smb4KFileIO::NoOperation
-     *                    the function exits immediately and returns TRUE.
-     *
-     * @returns TRUE if the write process was successfully initiate and FALSE
-     * otherwise.
-     *
-     * @note You need to connect to the finished() and failed() signals to find
-     * out if the the write process finished successfully.
-     *
-     */
-    bool writeSudoers( Smb4KFileIO::Operation operation );
-
-    /**
-     * This function writes changes to the super.tab configuration file.
-     *
-     * @param operation   Defines whether entries should be inserted or if
-     *                    they should be removed. With Smb4KFileIO::NoOperation
-     *                    the function exits immediately and returns TRUE.
-     *
-     * @returns TRUE if the write process was successfully initiate and FALSE
-     * otherwise.
-     *
-     * @note You need to connect to the finished() and failed() signals to find
-     * out if the the write process finished successfully.
-     *
-     */
-    bool writeSuperTab( Smb4KFileIO::Operation operation );
-
-  signals:
-    /**
-     * This signal is emitted when somthing went wrong with the writing to
-     * the system configuration files.
-     */
-    void failed();
-
-    /**
-     * This signal is emitted when the writing to the system configuration
-     * files has finished. It is emitted in case the writing was successful
-     * as well as in case it wasn't.
-     */
-    void finished();
-
-  protected slots:
-    /**
-     * This slot is invokes when the application is closed. It is connected
-     * to TDEApplication::shutDown().
-     */
-    void slotShutdown();
-
-    /**
-     * This slot receives shell program output from Stderr.
-     *
-     * @param proc            The TDEProcess object
-     *
-     * @param buf             The buffer that holds the error output
-     *
-     * @param len             The length of the buffer
-     */
-    void slotReceivedStderr( TDEProcess *proc, char *buf, int len );
-
-    /**
-     * This slot receives shell program output from Stdout.
-     *
-     * @param proc            The TDEProcess object
-     *
-     * @param buf             The buffer that holds the output
-     *
-     * @param len             The length of the buffer
-     */
-    void slotReceivedStdout( TDEProcess *proc, char *buf, int len );
-
-    /**
-     * This slot is called, when the process exited.
-     *
-     * @param proc            The TDEProcess object
-     */
-    void slotProcessExited( TDEProcess *proc );
-
-  private:
-    /**
-     * This function creates a lock file in /tmp if it does not
-     * exist already. If the user is not allowed to write to the
-     * desired file a the moment, the user will be shown an error
-     * dialog and the function will return FALSE.
-     *
-     * Checks are performed to make sure it is save to write to an
-     * existing lock file using the system call lstat().
-     *
-     * @param filename        The name of the file that is to be modified.
-     *
-     * @returns TRUE if the creation was successful and FALSE if
-     * something went wrong.
-     */
-    bool createLockFile( const TQString &filename );
-
-    /**
-     * This function removes the lock file or at least the
-     * entry within it.
-     *
-     * Checks are performed to make sure it is save to write to an
-     * existing lock file using the system call lstat().
-     *
-     * @param shutdown        Should be set to FALSE if you do not want to have
-     *                        any error message shown. Otherwise you should set it
-     *                        to TRUE.
-     *
-     * @returns TRUE if the removal was successful and FALSE if
-     * something went wrong.
-     */
-    bool removeLockFile( const bool error_message = true );
-
-    /**
-     * This function finds a file.
-     *
-     * @param filename        The name of the file
-     *
-     * @returns the canonical path of the file or an empty string if it could not be
-     *          found.
-     */
-    const TQCString findFile( const TQString &filename );
-
-    /**
-     * Enumeration that is used to tell the process what has to be done.
-     */
-    enum State { ReadSudoers, ReadSuperTab, WriteSudoers, WriteSuperTab, Idle };
-
-    /**
-     * This integer holds one of the entries of the enumeration above.
-     */
-    State m_state;
-
-    /**
-     * This buffer holds the output that was received at Stdout.
-     */
-    TQString m_buffer;
-
-    /**
-     * Process the sudoers file.
-     */
-    void processSudoers();
-
-    /**
-     * Process the sudoers file.
-     */
-    void processSuperTab();
-
-    /**
-     * This is the absolute path of the lock file.
-     */
-    TQCString m_lock_file;
-
-    /**
-     * Which operation should be performed
-     */
-    Operation m_operation;
-
-    /**
-     * The TDEProcess object
-     */
-    TDEProcess *m_proc;
-
-    /**
-     * Tell if an error occurred.
-     */
-    bool m_error_occurred;
-};
-
-
-#endif
diff --git a/smb4k/core/smb4kglobal.cpp b/smb4k/core/smb4kglobal.cpp
index e2e98ce..a1d09c8 100644
--- a/smb4k/core/smb4kglobal.cpp
+++ b/smb4k/core/smb4kglobal.cpp
@@ -24,7 +24,7 @@
  ***************************************************************************/
 
 // KDE includes
-#include <kconfig.h>
+#include <tdeconfig.h>
 #include <kdebug.h>
 
 // application specific includes
diff --git a/smb4k/core/smb4kglobal.h b/smb4k/core/smb4kglobal.h
index 1c7db8a..c6da2a4 100644
--- a/smb4k/core/smb4kglobal.h
+++ b/smb4k/core/smb4kglobal.h
@@ -29,7 +29,7 @@
 #include <tqstring.h>
 #include <tqtimer.h>
 
-#include <kconfig.h>
+#include <tdeconfig.h>
 
 // forward declarations:
 class Smb4KPasswordHandler;
diff --git a/smb4k/core/smb4kglobal_p.h b/smb4k/core/smb4kglobal_p.h
index 898d66e..8148f3a 100644
--- a/smb4k/core/smb4kglobal_p.h
+++ b/smb4k/core/smb4kglobal_p.h
@@ -35,7 +35,7 @@
 #include <tqtimer.h>
 
 // KDE includes
-#include <kconfig.h>
+#include <tdeconfig.h>
 
 // application specific includes
 #include "smb4kpasswordhandler.h"
diff --git a/smb4k/core/smb4khomesshareshandler.h b/smb4k/core/smb4khomesshareshandler.h
index 44c3710..b343698 100644
--- a/smb4k/core/smb4khomesshareshandler.h
+++ b/smb4k/core/smb4khomesshareshandler.h
@@ -35,7 +35,7 @@
 
 // KDE includes
 #include <kdialogbase.h>
-#include <kconfig.h>
+#include <tdeconfig.h>
 
 
 /**
diff --git a/smb4k/core/smb4kprint.cpp b/smb4k/core/smb4kprint.cpp
index 3661db0..ae7655c 100644
--- a/smb4k/core/smb4kprint.cpp
+++ b/smb4k/core/smb4kprint.cpp
@@ -29,7 +29,7 @@
 
 // KDE includes
 #include <kurl.h>
-#include <kfileitem.h>
+#include <tdefileitem.h>
 #include <kdebug.h>
 
 // system includes
diff --git a/smb4k/core/smb4ksambaoptionshandler.h b/smb4k/core/smb4ksambaoptionshandler.h
index 7e20c83..eca3f9e 100644
--- a/smb4k/core/smb4ksambaoptionshandler.h
+++ b/smb4k/core/smb4ksambaoptionshandler.h
@@ -35,7 +35,7 @@
 #include <tqmap.h>
 
 // KDE includes
-#include <kconfig.h>
+#include <tdeconfig.h>
 
 // forward declarations
 class Smb4KSambaOptionsInfo;
diff --git a/smb4k/core/smb4ksettings.cpp b/smb4k/core/smb4ksettings.cpp
index 8fc39bb..3aa8240 100644
--- a/smb4k/core/smb4ksettings.cpp
+++ b/smb4k/core/smb4ksettings.cpp
@@ -1,4 +1,4 @@
-// This file is generated by kconfig_compiler from smb4k.kcfg.
+// This file is generated by tdeconfig_compiler from smb4k.kcfg.
 // All changes you do to this file will be lost.
 
 #include "smb4ksettings.h"
diff --git a/smb4k/core/smb4tdefileio.cpp b/smb4k/core/smb4tdefileio.cpp
new file mode 100644
index 0000000..617763c
--- /dev/null
+++ b/smb4k/core/smb4tdefileio.cpp
@@ -0,0 +1,1795 @@
+/***************************************************************************
+    smb4tdefileio  -  Does file IO operations for Smb4K
+                             -------------------
+    begin                : Do Jan 1 2004
+    copyright            : (C) 2004-2007 by Alexander Reinholdt
+    email                : dustpuppy@users.berlios.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                                                    *
+ ***************************************************************************/
+
+// TQt includes
+#include <tqdir.h>
+#include <tqfile.h>
+#include <tqtextstream.h>
+
+// KDE includes
+#include <kapplication.h>
+#include <kdebug.h>
+#include <klocale.h>
+
+// system specific includes
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <grp.h>
+#include <pwd.h>
+
+// application specific includes
+#include "smb4tdefileio.h"
+#include "smb4kdefs.h"
+#include "smb4kerror.h"
+#include "smb4kglobal.h"
+#include "smb4ksettings.h"
+
+using namespace Smb4TDEGlobal;
+
+
+
+Smb4KFileIO::Smb4KFileIO( TQObject *parent, const char *name ) : TQObject( parent, name )
+{
+  m_operation =      NoOperation;
+  m_state =          Idle;
+  m_error_occurred = false;
+
+  m_proc = new TDEProcess( this, "FileIOProcess" );
+  m_proc->setUseShell( true );
+
+  connect( m_proc, TQT_SIGNAL( receivedStderr( TDEProcess *, char *, int ) ),
+           this,   TQT_SLOT( slotReceivedStderr( TDEProcess *, char *, int ) ) );
+
+  connect( m_proc, TQT_SIGNAL( receivedStdout( TDEProcess *, char *, int ) ),
+           this,   TQT_SLOT( slotReceivedStdout( TDEProcess *, char *, int ) ) );
+
+  connect( m_proc, TQT_SIGNAL( processExited( TDEProcess * ) ),
+           this,   TQT_SLOT( slotProcessExited( TDEProcess * ) ) );
+
+  connect( kapp,   TQT_SIGNAL( shutDown() ),
+           this,   TQT_SLOT( slotShutdown() ) );
+}
+
+
+Smb4KFileIO::~Smb4KFileIO()
+{
+}
+
+
+bool Smb4KFileIO::writeSudoers( Smb4KFileIO::Operation operation )
+{
+  m_operation = operation;
+  bool ok = false;
+
+  // Stop here if nothing has changed:
+  if ( m_operation == NoOperation )
+  {
+    emit finished();
+
+    ok = true;
+
+    return ok;
+  }
+
+  TQString file = "sudoers";
+
+  if ( createLockFile( file ) )
+  {
+    // Find the file first:
+    TQCString canonical_path = findFile( file );
+
+    if ( !canonical_path.isEmpty() )
+    {
+      // Stat the file, so that we know that it is safe to
+      // read from and write to it and whether we need to
+      // ask for the super user's password:
+      struct stat buf;
+
+      if ( lstat( canonical_path, &buf ) == -1 )
+      {
+        int error_number = errno;
+
+        Smb4KError::error( ERROR_GETTING_PERMISSIONS, canonical_path, strerror( error_number ) );
+
+        emit failed();
+        emit finished();
+
+        removeLockFile();
+
+        return ok; // false
+      }
+
+      // Look for the groups the user is in:
+      long ngroups_max;
+      ngroups_max = sysconf(_SC_NGROUPS_MAX);
+
+      gid_t list[ngroups_max];
+
+      if ( getgroups( ngroups_max, list ) == -1 )
+      {
+        int error_number = errno;
+
+        Smb4KError::error( ERROR_GETTING_GIDS, TQString(), strerror( error_number ) );
+
+        emit failed();
+        emit finished();
+
+        return ok; // false
+      }
+
+      gid_t sup_gid = 65534; // set this to gid 'nobody' for initialization
+      bool found_gid = false;
+      int i = 0;
+
+      while ( list[i] )
+      {
+        if ( list[i] == buf.st_gid )
+        {
+          sup_gid = list[i];
+          found_gid = true;
+        }
+
+        i++;
+      }
+
+      // Error out if the file is irregular.
+      // Yes, yes, I know that this is normally done in a different
+      // way and that there might be a race here, but, hey, right here
+      // I don't care!
+      if ( !S_ISREG( buf.st_mode ) || S_ISFIFO( buf.st_mode ) || S_ISLNK( buf.st_mode ) )
+      {
+        Smb4KError::error( ERROR_FILE_IS_IRREGULAR, canonical_path, TQString() );
+
+        emit failed();
+        emit finished();
+
+        removeLockFile();
+
+        return ok; // false
+      }
+
+      // Check access rights:
+      if ( (buf.st_uid == getuid() && (buf.st_mode & 00600) == (S_IWUSR | S_IRUSR)) /* user */ ||
+           (found_gid && buf.st_gid == sup_gid && (buf.st_mode & 00060) == (S_IWGRP | S_IRGRP)) /* group */ ||
+           ((buf.st_mode & 00006) == (S_IWOTH | S_IROTH)) /* others */ )
+      {
+        // The user has read and write access.
+
+        TQFile file ( canonical_path );
+        TQStringList contents;
+
+        if ( file.open( IO_ReadWrite ) )
+        {
+          TQTextStream ts( &file );
+          ts.setEncoding( TQTextStream::Locale );
+
+          contents = TQStringList::split( "\n", ts.read(), true );
+
+          bool write = false;
+
+          switch ( m_operation )
+          {
+            case Insert:
+            {
+              size_t hostnamelen = 255;
+              char *hn = new char[hostnamelen];
+
+              if ( gethostname( hn, hostnamelen ) == -1 )
+              {
+                int error_number = errno;
+                Smb4KError::error( ERROR_GETTING_HOSTNAME, TQString(), strerror( error_number ) );
+
+                emit failed();
+                emit finished();
+
+                removeLockFile();
+
+                return ok; // false
+              }
+
+              TQString hostname( hn );
+
+              delete [] hn;
+
+              if ( contents.grep( "# Entries for Smb4K users." ).count() == 0 )
+              {
+                contents.append( "# Entries for Smb4K users." );
+                contents.append( "# Generated by Smb4K. Please do not modify!" );
+                contents.append( "User_Alias\tSMB4KUSERS = "+TQString( "%1" ).arg( getpwuid( getuid() )->pw_name ) );
+                contents.append( "Defaults:SMB4KUSERS\tenv_keep += \"PASSWD USER\"" );
+                contents.append( "SMB4KUSERS\t"+hostname+" = NOPASSWD: "+Smb4KSettings::smb4k_kill() );
+                contents.append( "SMB4KUSERS\t"+hostname+" = NOPASSWD: "+Smb4KSettings::smb4k_umount() );
+                contents.append( "SMB4KUSERS\t"+hostname+" = NOPASSWD: "+Smb4KSettings::smb4k_mount() );
+                contents.append( "# End of Smb4K user entries." );
+
+                write = true;
+              }
+              else
+              {
+                // Find the beginning and the end of the entries in
+                // the sudoers file:
+                TQStringList::Iterator begin = contents.find( "# Entries for Smb4K users." );
+                TQStringList::Iterator end = contents.find( "# End of Smb4K user entries." );
+
+                for ( TQStringList::Iterator it = begin; it != end; ++it )
+                {
+                  if ( (*it).startsWith( "User_Alias\tSMB4KUSERS" ) && (*it).contains( getpwuid( getuid() )->pw_name, true ) == 0 )
+                  {
+                    (*it).append( ","+TQString( getpwuid( getuid() )->pw_name ) );
+
+                    write = true;
+
+                    break;
+                  }
+                  else
+                  {
+                    continue;
+                  }
+                }
+              }
+
+              break;
+            }
+            case Remove:
+            {
+              // Find the beginning and the end of the entries in
+              // the sudoers file:
+              TQStringList::Iterator begin = contents.find( "# Entries for Smb4K users." );
+              TQStringList::Iterator end = contents.find( "# End of Smb4K user entries." );
+
+              // Now, check if the user is in the list of users. If he is,
+              // remove him from there or remove all if he is the only one:
+              for ( TQStringList::Iterator it = begin; it != end; ++it )
+              {
+                if ( (*it).startsWith( "User_Alias\tSMB4KUSERS" ) )
+                {
+                  TQString users = (*it).section( "=", 1, 1 ).stripWhiteSpace();
+
+                  if ( users.contains( "," ) == 0 )
+                  {
+                    // In this case, there is only one user in the list. Check if
+                    // it is the user who requested the removal:
+                    if ( TQString::compare( users, getpwuid( getuid() )->pw_name ) == 0 )
+                    {
+                      // They are equal. Remove everything:
+                      contents.erase( begin, end );
+                      contents.remove( end );
+
+                      write = true;
+
+                      break;
+                    }
+                    else
+                    {
+                      // They are not equal: Do nothing.
+                      break;
+                    }
+                  }
+                  else
+                  {
+                    // In this case there is more than one user in the list.
+                    // Remove the user who requested the removal:
+                    TQStringList list = TQStringList::split( ",", users, false );
+                    list.remove( getpwuid( getuid() )->pw_name );
+
+                    (*it).replace( users, list.join( "," ) );
+
+                    write = true;
+
+                    break;
+                  }
+                }
+                else
+                {
+                  continue;
+                }
+              }
+
+              break;
+            }
+            default:
+            {
+              file.close();
+
+              emit failed();
+              emit finished();
+
+              removeLockFile();
+
+              return ok; // false
+            }
+          };
+
+          if ( write )
+          {
+            // Prepare the contents: remove empty lines from the end.
+            TQStringList::Iterator it = contents.end();
+
+            // Move the iterator to the last entry in the list:
+            --it;
+
+            while ( (*it).stripWhiteSpace().isEmpty() )
+            {
+              it = contents.remove( it );
+              --it;
+            }
+
+            // Now write the contents to the file. The permissions
+            // will be preserved by this action.
+            ts << contents.join( "\n" ) << endl;
+
+            file.close();
+          }
+          else
+          {
+            // The entries are already in the file.
+          }
+
+          ok = true;
+
+          emit finished();
+
+          removeLockFile();
+
+          return ok;
+        }
+        else
+        {
+          Smb4KError::error( ERROR_OPENING_FILE, canonical_path, file.errorString() );
+
+          emit failed();
+          emit finished();
+
+          removeLockFile();
+
+          return ok; // false
+        }
+      }
+      else
+      {
+        // The user does not have enough access rights to perform
+        // the modification of the sudoers file. So, we need to use
+        // tdesu to get the contents of the file.
+
+        // Compose the command:
+        TQString command;
+        command.append( "tdesu -t -c \"smb4k_cat " );
+        command.append( canonical_path+"\"" );
+        command.append( " ; sleep 2" );
+
+        m_state = ReadSudoers;
+
+        ok = true;
+
+        *m_proc << command;
+        m_proc->start( TDEProcess::NotifyOnExit, TDEProcess::AllOutput );
+
+        // The process is not finished, so finished() will be emitted
+        // later and the lock file will also be removed at the end.
+
+        return ok;
+      }
+    }
+    else
+    {
+      Smb4KError::error( ERROR_FILE_NOT_FOUND, canonical_path );
+
+      emit failed();
+      emit finished();
+
+      removeLockFile();
+
+      return ok; // false
+    }
+  }
+  else
+  {
+    // The error message has already been shown by
+    // Smb4KFileIO::createLockFile()
+    emit failed();
+    emit finished();
+
+    // We need not remove the lock file here.
+
+    return ok; // false
+  }
+
+  return ok;
+}
+
+
+bool Smb4KFileIO::writeSuperTab( Smb4KFileIO::Operation operation )
+{
+  m_operation = operation;
+  bool ok = false;
+
+  // Stop here if nothing has changed:
+  if ( m_operation == NoOperation )
+  {
+    emit finished();
+
+    ok = true;
+
+    return ok;
+  }
+
+  TQString file = "super.tab";
+
+  if ( createLockFile( file ) )
+  {
+    // Find the file first:
+    TQCString canonical_path = findFile( file );
+
+    if ( !canonical_path.isEmpty() )
+    {
+      // Stat the file, so that we know that it is safe to
+      // read from and write to it and whether we need to
+      // ask for the super user's password:
+      struct stat buf;
+
+      if ( lstat( canonical_path, &buf ) == -1 )
+      {
+        int error_number = errno;
+
+        Smb4KError::error( ERROR_GETTING_PERMISSIONS, canonical_path, strerror( error_number ) );
+
+        emit failed();
+        emit finished();
+
+        removeLockFile();
+
+        return ok; // false
+      }
+
+      // Look for the groups the user is in:
+      long ngroups_max;
+      ngroups_max = sysconf(_SC_NGROUPS_MAX);
+
+      gid_t list[ngroups_max];
+
+      if ( getgroups( ngroups_max, list ) == -1 )
+      {
+        int error_number = errno;
+
+        Smb4KError::error( ERROR_GETTING_GIDS, TQString(), strerror( error_number ) );
+
+        emit failed();
+        emit finished();
+
+        return ok; // false
+      }
+
+      gid_t sup_gid = 65534; // set this to gid 'nobody' for initialization
+      bool found_gid = false;
+      int i = 0;
+
+      while ( list[i] )
+      {
+        if ( list[i] == buf.st_gid )
+        {
+          sup_gid = list[i];
+          found_gid = true;
+        }
+
+        i++;
+      }
+
+      // Error out if the file is irregular.
+      // Yes, yes, I know that this is normally done in a different
+      // way and that there might be a race here, but, hey, right here
+      // I don't care!
+      if ( !S_ISREG( buf.st_mode ) || S_ISFIFO( buf.st_mode ) || S_ISLNK( buf.st_mode ) )
+      {
+        Smb4KError::error( ERROR_FILE_IS_IRREGULAR, canonical_path, TQString() );
+
+        emit failed();
+        emit finished();
+
+        removeLockFile();
+
+        return ok; // false
+      }
+
+      // Check access rights:
+      if ( (buf.st_uid == getuid() && (buf.st_mode & 00600) == (S_IWUSR | S_IRUSR)) /* user */ ||
+           (found_gid && buf.st_gid == sup_gid && (buf.st_mode & 00060) == (S_IWGRP | S_IRGRP)) /* group */ ||
+           ((buf.st_mode & 00006) == (S_IWOTH | S_IROTH)) /* others */ )
+      {
+        // The user has read and write access.
+
+        TQFile file ( canonical_path );
+        TQStringList contents;
+
+        if ( file.open( IO_ReadWrite ) )
+        {
+          TQTextStream ts( &file );
+          ts.setEncoding( TQTextStream::Locale );
+
+          contents = TQStringList::split( "\n", ts.read(), true );
+
+          bool write = false;
+
+          switch ( m_operation )
+          {
+            case Insert:
+            {
+              size_t hostnamelen = 255;
+              char *hn = new char[hostnamelen];
+
+              if ( gethostname( hn, hostnamelen ) == -1 )
+              {
+                int error_number = errno;
+                Smb4KError::error( ERROR_GETTING_HOSTNAME, TQString(), strerror( error_number ) );
+
+                emit failed();
+                emit finished();
+
+                removeLockFile();
+
+                return ok; // false
+              }
+
+              TQString hostname( hn );
+
+              delete [] hn;
+
+              if ( contents.grep( "# Entries for Smb4K users." ).count() == 0 )
+              {
+                contents.append( "# Entries for Smb4K users." );
+                contents.append( "# Generated by Smb4K. Please do not modify!" );
+                contents.append( ":define Smb4KUsers "+TQString( "%1" ).arg( getpwuid( getuid() )->pw_name ) );
+#ifndef __FreeBSD__
+                contents.append( "smb4k_kill\t"+Smb4KSettings::smb4k_kill()+
+                                  "\t$(Smb4KUsers)\tuid=root\tgid=root" );
+                contents.append( "smb4k_umount\t"+Smb4KSettings::smb4k_umount()+
+                                "\t$(Smb4KUsers)\tuid=root\tgid=root" );
+                contents.append( "smb4k_mount\t"+Smb4KSettings::smb4k_mount()+
+                                "\t$(Smb4KUsers)\tuid=root\tgid=root\tenv=PASSWD,USER" );
+#else
+                contents.append( "smb4k_kill\t"+Smb4KSettings::smb4k_kill()+
+                                "\t$(Smb4KUsers)\tuid=root\tgid=wheel" );
+                contents.append( "smb4k_umount\t"+Smb4KSettings::smb4k_umount()+
+                                "\t$(Smb4KUsers)\tuid=root\tgid=wheel" );
+                contents.append( "smb4k_mount\t"+Smb4KSettings::smb4k_mount()+
+                                "\t$(Smb4KUsers)\tuid=root\tgid=wheel\tsetenv=HOME=$CALLER_HOME\tenv=PASSWD,USER" );
+#endif
+                contents.append( "# End of Smb4K user entries." );
+
+                write = true;
+              }
+              else
+              {
+                // Find the beginning and the end of the entries in
+                // the super.tab file:
+                TQStringList::Iterator begin = contents.find( "# Entries for Smb4K users." );
+                TQStringList::Iterator end = contents.find( "# End of Smb4K user entries." );
+
+                for ( TQStringList::Iterator it = begin; it != end; ++it )
+                {
+                  if ( (*it).startsWith( ":define Smb4KUsers" ) && (*it).contains( getpwuid( getuid() )->pw_name, true ) == 0 )
+                  {
+                    (*it).append( ","+TQString( getpwuid( getuid() )->pw_name ) );
+
+                    write = true;
+
+                    break;
+                  }
+                  else
+                  {
+                    continue;
+                  }
+                }
+              }
+
+              break;
+            }
+            case Remove:
+            {
+              // Find the beginning and the end of the entries in
+              // the super.tab file:
+              TQStringList::Iterator begin = contents.find( "# Entries for Smb4K users." );
+              TQStringList::Iterator end = contents.find( "# End of Smb4K user entries." );
+
+              // Now, check if the user is in the list of users. If he is,
+              // remove him from there or remove all if he is the only one:
+              for ( TQStringList::Iterator it = begin; it != end; ++it )
+              {
+                if ( (*it).startsWith( ":define Smb4KUsers" ) )
+                {
+                  TQString users = (*it).section( "Smb4KUsers", 1, 1 ).stripWhiteSpace();
+
+                  if ( users.contains( "," ) == 0 )
+                  {
+                    // In this case, there is only one user in the list. Check if
+                    // it is the user who requested the removal:
+                    if ( TQString::compare( users, getpwuid( getuid() )->pw_name ) == 0 )
+                    {
+                      // They are equal. Remove everything:
+                      contents.erase( begin, end );
+                      contents.remove( end );
+
+                      write = true;
+
+                      break;
+                    }
+                    else
+                    {
+                      // They are not equal: Do nothing.
+                      break;
+                    }
+                  }
+                  else
+                  {
+                    // In this case there is more than one user in the list.
+                    // Remove the user who requested the removal:
+                    TQStringList list = TQStringList::split( ",", users, false );
+                    list.remove( getpwuid( getuid() )->pw_name );
+
+                    (*it).replace( users, list.join( "," ) );
+
+                    write = true;
+
+                    break;
+                  }
+                }
+                else
+                {
+                  continue;
+                }
+              }
+
+              break;
+            }
+            default:
+            {
+              file.close();
+
+              emit failed();
+              emit finished();
+
+              removeLockFile();
+
+              return ok; // false
+            }
+          };
+
+          if ( write )
+          {
+            // Prepare the contents: remove empty lines from the end.
+            TQStringList::Iterator it = contents.end();
+
+            // Move the iterator to the last entry in the list:
+            --it;
+
+            while ( (*it).stripWhiteSpace().isEmpty() )
+            {
+              it = contents.remove( it );
+              --it;
+            }
+
+            // Now write the contents to the file. The permissions
+            // will be preserved by this action.
+            ts << contents.join( "\n" ) << endl;
+
+            file.close();
+          }
+          else
+          {
+            // The entries are already in the file.
+          }
+
+          ok = true;
+
+          emit finished();
+
+          removeLockFile();
+
+          return ok;
+        }
+        else
+        {
+          Smb4KError::error( ERROR_OPENING_FILE, canonical_path, file.errorString() );
+
+          emit failed();
+          emit finished();
+
+          removeLockFile();
+
+          return ok; // false
+        }
+      }
+      else
+      {
+        // The user does not have enough access rights to perform
+        // the modification of the sudoers file. So, we need to use
+        // tdesu to get the contents of the file.
+
+        // Compose the command:
+        TQString command;
+        command.append( "tdesu -t -c \"smb4k_cat " );
+        command.append( canonical_path+"\"" );
+        command.append( " ; sleep 2" );
+
+        m_state = ReadSuperTab;
+
+        ok = true;
+
+        *m_proc << command;
+        m_proc->start( TDEProcess::NotifyOnExit, TDEProcess::AllOutput );
+
+        // The process is not finished, so finished() will be emitted
+        // later and the lock file will also be removed at the end.
+
+        return ok;
+      }
+    }
+    else
+    {
+      Smb4KError::error( ERROR_FILE_NOT_FOUND, canonical_path );
+
+      emit failed();
+      emit finished();
+
+      removeLockFile();
+
+      return ok; // false
+    }
+  }
+  else
+  {
+    // The error message has already been shown by
+    // Smb4KFileIO::createLockFile()
+    emit failed();
+    emit finished();
+
+    // We need not remove the lock file here.
+
+    return ok; // false
+  }
+
+  return ok;
+}
+
+
+bool Smb4KFileIO::createLockFile( const TQString &filename )
+{
+  bool ok = false;
+
+  // Determine the directory where to write the lock file. First, try
+  // /var/lock and than /var/tmp. If that does not work either, fall
+  // back to /tmp.
+  if ( m_lock_file.isEmpty() )
+  {
+    TQValueList<TQCString> dirs;
+    dirs << "/var/lock" << "/var/tmp" << "/tmp";
+
+    struct stat buf;
+
+    for ( TQValueList<TQCString>::ConstIterator it = dirs.begin(); it != dirs.end(); ++it )
+    {
+      // First check if the directory is available and writable
+      if ( lstat( *it, &buf ) == -1 )
+      {
+        int error_number = errno;
+
+        if ( error_number != EACCES && error_number != ENOENT )
+        {
+          Smb4KError::error( ERROR_GETTING_PERMISSIONS, *it, strerror( error_number ) );
+
+          return ok; // false
+        }
+      }
+      else
+      {
+        // Look for the groups the user is in:
+        long ngroups_max;
+        ngroups_max = sysconf(_SC_NGROUPS_MAX);
+
+        gid_t list[ngroups_max];
+
+        if ( getgroups( ngroups_max, list ) == -1 )
+        {
+          int error_number = errno;
+
+          Smb4KError::error( ERROR_GETTING_GIDS, TQString(), strerror( error_number ) );
+
+          return ok; // false
+        }
+
+        gid_t sup_gid = 65534; // set this to gid 'nobody' for initialization
+        bool found_gid = false;
+        int i = 0;
+
+        while ( list[i] )
+        {
+          if ( list[i] == buf.st_gid )
+          {
+            sup_gid = list[i];
+            found_gid = true;
+          }
+
+          i++;
+        }
+
+        // Check whether we are stat'ing a directory and that the
+        // user has read/write permissions.
+        if ( S_ISDIR( buf.st_mode ) /* is directory */ &&
+            (buf.st_uid == getuid() && (buf.st_mode & 00600) == (S_IWUSR | S_IRUSR)) /* user */ ||
+            (found_gid && buf.st_gid == sup_gid && (buf.st_mode & 00060) == (S_IWGRP | S_IRGRP)) /* group */ ||
+            ((buf.st_mode & 00006) == (S_IWOTH | S_IROTH)) /* others */ )
+        {
+          m_lock_file = *it+"/smb4k.lock";
+
+          break;
+        }
+        else
+        {
+          continue;
+        }
+      }
+    }
+  }
+
+  int file_descriptor;
+
+  // Create the lock file if necessary and open it:
+  if ( (file_descriptor = open( m_lock_file, O_RDWR|O_CREAT, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH )) == -1 )
+  {
+    // Error out if the opening failed:
+    int error_number = errno;
+
+    Smb4KError::error( ERROR_OPENING_FILE, m_lock_file, strerror( error_number ) );
+
+    return ok; // false
+  }
+  else
+  {
+    // Check what we actually opened:
+
+    struct stat file_stat;
+
+    if ( fstat( file_descriptor, &file_stat ) == -1 )
+    {
+      // Error out if we could not get the information about the file:
+      int error_number = errno;
+
+      // FIXME for >= 0.8.x: Change error code to ERROR_GETTING_STAT
+      Smb4KError::error( ERROR_GETTING_PERMISSIONS, TQString(), strerror( error_number ) );
+
+      return ok;
+    }
+
+    if ( !S_ISREG( file_stat.st_mode ) || S_ISFIFO( file_stat.st_mode ) || S_ISLNK( file_stat.st_mode ) )
+    {
+      // Close the file and error out, if we have opened an
+      // "irregular" file (i.e. a symlink, a fifo, etc.).
+
+      Smb4KError::error( ERROR_FILE_IS_IRREGULAR, m_lock_file );
+
+      if ( close( file_descriptor ) == -1 )
+      {
+        int error_number = errno;
+
+        Smb4KError::error( ERROR_CLOSING_FILE, m_lock_file, strerror( error_number ) );
+      }
+
+      return ok; // false
+    }
+    else
+    {
+      // Continue if the file is regular.
+
+      char buffer[1000];
+      ssize_t size;
+
+      if ( (size = read( file_descriptor, buffer, 1000 )) == -1 )
+      {
+        int error_number = errno;
+
+        Smb4KError::error( ERROR_READING_FILE, m_lock_file, strerror( error_number ) );
+
+        return ok; // false
+      }
+
+      if ( size >= 1000 )
+      {
+        // FIXME for >= 0.8.x: Change error code to ERROR_BUFFER_EXCEEDED
+        Smb4KError::error( ERROR_UNKNOWN, TQString(), i18n( "Buffer size exceeded" ) );
+
+        return ok; // false
+      }
+
+      TQStringList contents = TQStringList::split( '\n', TQString::fromLocal8Bit( buffer, size ), false );
+      TQString test_string = ":"+filename;
+      TQString entry = contents.grep( test_string, true ).join( "\n" ).stripWhiteSpace();
+
+      if ( !entry.isEmpty() )
+      {
+        Smb4KError::error( ERROR_LOCKED, entry );
+
+        return ok; // false
+      }
+      else
+      {
+        contents << TQString( "%1:%2" ).arg( getpwuid( getuid() )->pw_name ).arg( filename );
+        TQCString out = contents.join( "\n" ).local8Bit();
+
+        if ( write( file_descriptor, out, out.length() ) == -1 )
+        {
+          int error_number = errno;
+
+          Smb4KError::error( ERROR_WRITING_FILE, m_lock_file, strerror( error_number ) );
+
+          return ok; // false
+        }
+
+        if ( close( file_descriptor ) == -1 )
+        {
+          int error_number = errno;
+
+          Smb4KError::error( ERROR_CLOSING_FILE, m_lock_file, strerror( error_number ) );
+
+          return ok; // false
+        }
+
+        ok = true;
+      }
+    }
+  }
+
+  return ok;
+}
+
+
+bool Smb4KFileIO::removeLockFile( const bool error_message )
+{
+  // We already have the name and location of the lock
+  // file, so we do not need to define it here.
+
+  int file_descriptor;
+  bool ok = false;
+
+  // Open the lock file:
+  if ( (file_descriptor = open( m_lock_file, O_RDWR )) == -1 )
+  {
+    // Error out if the opening failed:
+    int error_number = errno;
+
+    if ( error_message && error_number != ENOENT )
+    {
+      Smb4KError::error( ERROR_OPENING_FILE, m_lock_file, strerror( error_number ) );
+    }
+
+    return ok; // false
+  }
+  else
+  {
+    // Check what we actually opened:
+
+    struct stat file_stat;
+
+    if ( fstat( file_descriptor, &file_stat ) == -1 )
+    {
+      // Error out if we could not get the information about the file:
+      int error_number = errno;
+
+      if ( error_message )
+      {
+        // FIXME for >= 0.8.x: Change error code to ERROR_GETTING_STAT
+        Smb4KError::error( ERROR_GETTING_PERMISSIONS, TQString(), strerror( error_number ) );
+      }
+
+      return ok;
+    }
+
+    if ( !S_ISREG( file_stat.st_mode ) || S_ISFIFO( file_stat.st_mode ) || S_ISLNK( file_stat.st_mode ) )
+    {
+      // Close the file and error out, if we have opened an
+      // "irregular" file (i.e. a symlink, a fifo, etc.).
+
+      if ( error_message )
+      {
+        Smb4KError::error( ERROR_FILE_IS_IRREGULAR, m_lock_file );
+      }
+
+      if ( close( file_descriptor ) == -1 )
+      {
+        int error_number = errno;
+
+        if ( error_message )
+        {
+          Smb4KError::error( ERROR_CLOSING_FILE, m_lock_file, strerror( error_number ) );
+        }
+      }
+
+      return ok; // false
+    }
+    else
+    {
+      // Continue if the file is regular.
+
+      char buffer[1000];
+      ssize_t size;
+
+      if ( (size = read( file_descriptor, buffer, 1000 )) == -1 )
+      {
+        int error_number = errno;
+
+        if ( error_message )
+        {
+          Smb4KError::error( ERROR_READING_FILE, m_lock_file, strerror( error_number ) );
+        }
+
+        return ok; // false
+      }
+
+      if ( size >= 1000 )
+      {
+        if ( error_message )
+        {
+          // FIXME for >= 0.8.x: Change error code to ERROR_BUFFER_EXCEEDED
+          Smb4KError::error( ERROR_UNKNOWN, TQString(), i18n( "Buffer size exceeded" ) );
+        }
+
+        return ok; // false
+      }
+
+      TQStringList contents = TQStringList::split( '\n', TQString::fromLocal8Bit( buffer, size ), false );
+
+      // Prepare the contents of the file and write it to the disk.
+      // It it should be empty, remove the lock file.
+      for ( TQStringList::Iterator it = contents.begin(); it != contents.end(); it++ )
+      {
+        if ( (*it).startsWith( TQString( getpwuid( getuid() )->pw_name )+":" ) )
+        {
+          *it = TQString();
+
+          continue;
+        }
+        else
+        {
+          continue;
+        }
+      }
+
+      contents.remove( TQString() );
+
+      if ( !contents.isEmpty() )
+      {
+        // Write the remaining contents to the lock file:
+
+        TQCString out = contents.join( "\n" ).local8Bit();
+
+        if ( write( file_descriptor, out, out.length() ) == -1 )
+        {
+          int error_number = errno;
+
+          if ( error_message )
+          {
+            Smb4KError::error( ERROR_WRITING_FILE, m_lock_file, strerror( error_number ) );
+          }
+
+          return ok; // false
+        }
+
+        if ( close( file_descriptor ) == -1 )
+        {
+          int error_number = errno;
+
+          if ( error_message )
+          {
+            Smb4KError::error( ERROR_CLOSING_FILE, m_lock_file, strerror( error_number ) );
+          }
+
+          return ok; // false
+        }
+
+        ok = true;
+      }
+      else
+      {
+        // Close and remove the lock file:
+
+        if ( close( file_descriptor ) == -1 )
+        {
+          int error_number = errno;
+
+          if ( error_message )
+          {
+            Smb4KError::error( ERROR_CLOSING_FILE, m_lock_file, strerror( error_number ) );
+          }
+
+          return ok; // false
+        }
+
+        if ( unlink( m_lock_file ) == -1 )
+        {
+          int error_number = errno;
+
+          if ( error_message )
+          {
+            // FIXME for > 0.8.x: Replace error code with ERROR_REMOVING_FILE
+            Smb4KError::error( ERROR_UNKNOWN, m_lock_file, strerror( error_number ) );
+          }
+
+          return ok; // false
+        }
+
+        ok = true;
+      }
+    }
+  }
+
+  return ok;
+}
+
+
+const TQCString Smb4KFileIO::findFile( const TQString &filename )
+{
+  TQStringList paths;
+  paths << "/etc";
+  paths << "/etc/samba";
+  paths << "/usr/local/etc";
+  paths << "/usr/local/etc/samba";
+
+  TQString canonical_path = TQString();
+
+  for ( TQStringList::ConstIterator it = paths.begin(); it != paths.end(); it++ )
+  {
+    TQDir::setCurrent( *it );
+
+    if ( TQFile::exists( filename ) )
+    {
+      canonical_path = TQDir::current().canonicalPath()+"/"+filename;
+
+      break;
+    }
+    else
+    {
+      continue;
+    }
+  }
+
+  return canonical_path.local8Bit();
+}
+
+
+void Smb4KFileIO::processSudoers()
+{
+  // If the output buffer is empty, we stop, because
+  // that most likely means, the user cancelled the
+  // tdesu dialog.
+  if ( m_buffer.stripWhiteSpace().isEmpty() )
+  {
+    emit failed();
+    emit finished();
+
+    removeLockFile();
+
+    return;
+  }
+
+  TQStringList contents = TQStringList::split( "\n", m_buffer, true );
+  bool write = false;
+
+  switch ( m_operation )
+  {
+    case Insert:
+    {
+      size_t hostnamelen = 255;
+      char *hn = new char[hostnamelen];
+
+      if ( gethostname( hn, hostnamelen ) == -1 )
+      {
+        int error_number = errno;
+        Smb4KError::error( ERROR_GETTING_HOSTNAME, TQString(), strerror( error_number ) );
+
+        emit failed();
+        emit finished();
+
+        removeLockFile();
+      }
+
+      TQString hostname( hn );
+
+      delete [] hn;
+
+      if ( contents.grep( "# Entries for Smb4K users." ).count() == 0 )
+      {
+        contents.append( "# Entries for Smb4K users." );
+        contents.append( "# Generated by Smb4K. Please do not modify!" );
+        contents.append( "User_Alias\tSMB4KUSERS = "+TQString( "%1" ).arg( getpwuid( getuid() )->pw_name ) );
+        contents.append( "Defaults:SMB4KUSERS\tenv_keep += \"PASSWD USER\"" );
+        contents.append( "SMB4KUSERS\t"+hostname+" = NOPASSWD: "+Smb4KSettings::smb4k_kill() );
+        contents.append( "SMB4KUSERS\t"+hostname+" = NOPASSWD: "+Smb4KSettings::smb4k_umount() );
+        contents.append( "SMB4KUSERS\t"+hostname+" = NOPASSWD: "+Smb4KSettings::smb4k_mount() );
+        contents.append( "# End of Smb4K user entries." );
+
+        write = true;
+      }
+      else
+      {
+        // Find the beginning and the end of the entries in
+        // the sudoers file:
+        TQStringList::Iterator begin = contents.find( "# Entries for Smb4K users." );
+        TQStringList::Iterator end = contents.find( "# End of Smb4K user entries." );
+
+        for ( TQStringList::Iterator it = begin; it != end; ++it )
+        {
+          if ( (*it).startsWith( "User_Alias\tSMB4KUSERS" ) && (*it).contains( getpwuid( getuid() )->pw_name, true ) == 0 )
+          {
+            (*it).append( ","+TQString( getpwuid( getuid() )->pw_name ) );
+
+            write = true;
+
+            break;
+          }
+          else
+          {
+            continue;
+          }
+        }
+      }
+
+      break;
+    }
+    case Remove:
+    {
+      // Find the beginning and the end of the entries in
+      // the sudoers file:
+      TQStringList::Iterator begin = contents.find( "# Entries for Smb4K users." );
+      TQStringList::Iterator end = contents.find( "# End of Smb4K user entries." );
+
+      // Now, check if the user is in the list of users. If he is,
+      // remove him from there or remove all if he is the only one:
+      for ( TQStringList::Iterator it = begin; it != end; ++it )
+      {
+        if ( (*it).startsWith( "User_Alias\tSMB4KUSERS" ) )
+        {
+          TQString users = (*it).section( "=", 1, 1 ).stripWhiteSpace();
+
+          if ( users.contains( "," ) == 0 )
+          {
+            // In this case, there is only one user in the list. Check if
+            // it is the user who requested the removal:
+            if ( TQString::compare( users, getpwuid( getuid() )->pw_name ) == 0 )
+            {
+              // They are equal. Remove everything:
+              contents.erase( begin, end );
+              contents.remove( end );
+
+              write = true;
+
+              break;
+            }
+            else
+            {
+              // They are not equal: Do nothing.
+              break;
+            }
+          }
+          else
+          {
+            // In this case there is more than one user in the list.
+            // Remove the user who requested the removal:
+            TQStringList list = TQStringList::split( ",", users, false );
+            list.remove( getpwuid( getuid() )->pw_name );
+
+            (*it).replace( users, list.join( "," ) );
+
+            write = true;
+
+            break;
+          }
+        }
+        else
+        {
+          continue;
+        }
+      }
+
+      break;
+    }
+    default:
+    {
+      emit failed();
+      emit finished();
+
+      removeLockFile();
+
+      return;
+    }
+  }
+
+  if ( write )
+  {
+    // Prepare the contents: remove empty lines from the end.
+    TQStringList::Iterator it = contents.end();
+
+    // Move the iterator to the last entry in the list:
+    --it;
+
+    while ( (*it).stripWhiteSpace().isEmpty() )
+    {
+      it = contents.remove( it );
+      --it;
+    }
+
+    // Create a temporary file and write the data to it:
+    TQCString template_string = tempDir().local8Bit()+"/XXXXXX";
+    char tmp[template_string.length()+1];
+    (void) tqstrncpy( tmp, template_string, template_string.length()+1 );
+
+    TQFile temp_file;
+    int file_descriptor;
+
+    if ( (file_descriptor = mkstemp( tmp )) == -1 )
+    {
+      int err = errno;
+
+      Smb4KError::error( ERROR_CREATING_TEMP_FILE, tmp, strerror( err ) );
+
+      emit failed();
+      emit finished();
+
+      removeLockFile();
+
+      return;
+    }
+
+    if ( temp_file.open( IO_WriteOnly, file_descriptor ) )
+    {
+      TQTextStream ts( &temp_file );
+      ts.setEncoding( TQTextStream::Locale );
+
+      ts << contents.join( "\n" ) << endl;
+
+      temp_file.close();
+    }
+    else
+    {
+      Smb4KError::error( ERROR_WRITING_FILE, temp_file.name() );
+
+      emit failed();
+      emit finished();
+
+      removeLockFile();
+
+      return;
+    }
+
+    // Now move the file to the right location. Preserve the permissions
+    // and the owner:
+    TQString canonical_path = findFile( "sudoers" );
+    struct stat file_stat;
+
+    if ( stat( canonical_path.local8Bit(), &file_stat ) == -1 )
+    {
+      int error_number = errno;
+
+      Smb4KError::error( ERROR_GETTING_PERMISSIONS, TQString(), strerror( error_number ) );
+
+      emit failed();
+      emit finished();
+
+      removeLockFile();
+
+      return;
+    }
+
+    TQString perms = TQString( "%1" ).arg( (int)file_stat.st_mode, 0, 8 );
+    perms = perms.right( 4 );
+    TQString owner = TQString( "%1" ).arg( (int)file_stat.st_uid );
+    TQString group = TQString( "%1" ).arg( (int)file_stat.st_gid );
+    TQString temp_file_name = TQString( tmp );
+
+    // Assemble the command.
+    TQString command;
+    command.append( "tdesu -n -c \"smb4k_mv "+owner+":"+group+" "+perms+" " );
+    command.append( temp_file_name+" " );
+    command.append( canonical_path+"\" ; " );
+    command.append( "rm -f "+temp_file_name );
+
+    m_state = WriteSudoers;
+
+    *m_proc << command;
+
+    m_proc->start( TDEProcess::NotifyOnExit, TDEProcess::AllOutput );
+  }
+  else
+  {
+    // Everything OK.
+    emit finished();
+
+    removeLockFile();
+  }
+}
+
+
+void Smb4KFileIO::processSuperTab()
+{
+  // If the output buffer is empty, we stop, because
+  // that most likely means, the user cancelled the
+  // tdesu dialog.
+  if ( m_buffer.stripWhiteSpace().isEmpty() )
+  {
+    emit failed();
+    emit finished();
+
+    removeLockFile();
+
+    return;
+  }
+
+  TQStringList contents = TQStringList::split( "\n", m_buffer, true );
+  bool write = false;
+
+  switch ( m_operation )
+  {
+    case Insert:
+    {
+      size_t hostnamelen = 255;
+      char *hn = new char[hostnamelen];
+
+      if ( gethostname( hn, hostnamelen ) == -1 )
+      {
+        int error_number = errno;
+        Smb4KError::error( ERROR_GETTING_HOSTNAME, TQString(), strerror( error_number ) );
+
+        emit failed();
+        emit finished();
+
+        removeLockFile();
+      }
+
+      TQString hostname( hn );
+
+      delete [] hn;
+
+      if ( contents.grep( "# Entries for Smb4K users." ).count() == 0 )
+      {
+        contents.append( "# Entries for Smb4K users." );
+        contents.append( "# Generated by Smb4K. Please do not modify!" );
+        contents.append( ":define Smb4KUsers "+TQString( "%1" ).arg( getpwuid( getuid() )->pw_name ) );
+#ifndef __FreeBSD__
+        contents.append( "smb4k_kill\t"+Smb4KSettings::smb4k_kill()+
+                         "\t$(Smb4KUsers)\tuid=root\tgid=root" );
+        contents.append( "smb4k_umount\t"+Smb4KSettings::smb4k_umount()+
+                         "\t$(Smb4KUsers)\tuid=root\tgid=root" );
+        contents.append( "smb4k_mount\t"+Smb4KSettings::smb4k_mount()+
+                         "\t$(Smb4KUsers)\tuid=root\tgid=root\tenv=PASSWD,USER" );
+#else
+        contents.append( "smb4k_kill\t"+Smb4KSettings::smb4k_kill()+
+                         "\t$(Smb4KUsers)\tuid=root\tgid=wheel" );
+        contents.append( "smb4k_umount\t"+Smb4KSettings::smb4k_umount()+
+                         "\t$(Smb4KUsers)\tuid=root\tgid=wheel" );
+        contents.append( "smb4k_mount\t"+Smb4KSettings::smb4k_mount()+
+                         "\t$(Smb4KUsers)\tuid=root\tgid=wheel\tsetenv=HOME=$CALLER_HOME\tenv=PASSWD,USER" );
+#endif
+        contents.append( "# End of Smb4K user entries." );
+
+        write = true;
+      }
+      else
+      {
+        // Find the beginning and the end of the entries in
+        // the super.tab file:
+        TQStringList::Iterator begin = contents.find( "# Entries for Smb4K users." );
+        TQStringList::Iterator end = contents.find( "# End of Smb4K user entries." );
+
+        for ( TQStringList::Iterator it = begin; it != end; ++it )
+        {
+          if ( (*it).startsWith( ":define Smb4KUsers" ) && (*it).contains( getpwuid( getuid() )->pw_name, true ) == 0 )
+          {
+            (*it).append( ","+TQString( getpwuid( getuid() )->pw_name ) );
+
+            write = true;
+
+            break;
+          }
+          else
+          {
+            continue;
+          }
+        }
+      }
+
+      break;
+    }
+    case Remove:
+    {
+      // Find the beginning and the end of the entries in
+      // the super.tab file:
+      TQStringList::Iterator begin = contents.find( "# Entries for Smb4K users." );
+      TQStringList::Iterator end = contents.find( "# End of Smb4K user entries." );
+
+      // Now, check if the user is in the list of users. If he is,
+      // remove him from there or remove all if he is the only one:
+      for ( TQStringList::Iterator it = begin; it != end; ++it )
+      {
+        if ( (*it).startsWith( ":define Smb4KUsers" ) )
+        {
+          TQString users = (*it).section( "Smb4KUsers", 1, 1 ).stripWhiteSpace();
+
+          if ( users.contains( "," ) == 0 )
+          {
+            // In this case, there is only one user in the list. Check if
+            // it is the user who requested the removal:
+            if ( TQString::compare( users, getpwuid( getuid() )->pw_name ) == 0 )
+            {
+              // They are equal. Remove everything:
+              contents.erase( begin, end );
+              contents.remove( end );
+
+              write = true;
+
+              break;
+            }
+            else
+            {
+              // They are not equal: Do nothing.
+              break;
+            }
+          }
+          else
+          {
+            // In this case there is more than one user in the list.
+            // Remove the user who requested the removal:
+            TQStringList list = TQStringList::split( ",", users, false );
+            list.remove( getpwuid( getuid() )->pw_name );
+
+            (*it).replace( users, list.join( "," ) );
+
+            write = true;
+
+            break;
+          }
+        }
+        else
+        {
+          continue;
+        }
+      }
+
+      break;
+    }
+    default:
+    {
+      emit failed();
+      emit finished();
+
+      removeLockFile();
+
+      return;
+    }
+  }
+
+  if ( write )
+  {
+    // Prepare the contents: remove empty lines from the end.
+    TQStringList::Iterator it = contents.end();
+
+    // Move the iterator to the last entry in the list:
+    --it;
+
+    while ( (*it).stripWhiteSpace().isEmpty() )
+    {
+      it = contents.remove( it );
+      --it;
+    }
+
+    // Create a temporary file and write the data to it:
+    TQCString template_string = tempDir().local8Bit()+"/XXXXXX";
+    char tmp[template_string.length()+1];
+    (void) tqstrncpy( tmp, template_string, template_string.length()+1 );
+
+    TQFile temp_file;
+    int file_descriptor;
+
+    if ( (file_descriptor = mkstemp( tmp )) == -1 )
+    {
+      int err = errno;
+
+      Smb4KError::error( ERROR_CREATING_TEMP_FILE, tmp, strerror( err ) );
+
+      emit failed();
+      emit finished();
+
+      removeLockFile();
+
+      return;
+    }
+
+    if ( temp_file.open( IO_WriteOnly, file_descriptor ) )
+    {
+      TQTextStream ts( &temp_file );
+      ts.setEncoding( TQTextStream::Locale );
+
+      ts << contents.join( "\n" ) << endl;
+
+      temp_file.close();
+    }
+    else
+    {
+      Smb4KError::error( ERROR_WRITING_FILE, temp_file.name() );
+
+      emit failed();
+      emit finished();
+
+      removeLockFile();
+
+      return;
+    }
+
+    // Now move the file to the right location. Preserve the permissions
+    // and the owner:
+    TQString canonical_path = findFile( "super.tab" );
+    struct stat file_stat;
+
+    if ( stat( canonical_path.local8Bit(), &file_stat ) == -1 )
+    {
+      int error_number = errno;
+
+      Smb4KError::error( ERROR_GETTING_PERMISSIONS, TQString(), strerror( error_number ) );
+
+      emit failed();
+      emit finished();
+
+      removeLockFile();
+
+      return;
+    }
+
+    TQString perms = TQString( "%1" ).arg( (int)file_stat.st_mode, 0, 8 );
+    perms = perms.right( 4 );
+    TQString owner = TQString( "%1" ).arg( (int)file_stat.st_uid );
+    TQString group = TQString( "%1" ).arg( (int)file_stat.st_gid );
+    TQString temp_file_name = TQString( tmp );
+
+    // Assemble the command.
+    TQString command;
+    command.append( "tdesu -n -c \"smb4k_mv "+owner+":"+group+" "+perms+" " );
+    command.append( temp_file_name+" " );
+    command.append( canonical_path+"\" ; " );
+    command.append( "rm -f "+temp_file_name );
+
+    m_state = WriteSuperTab;
+
+    *m_proc << command;
+
+    m_proc->start( TDEProcess::NotifyOnExit, TDEProcess::AllOutput );
+  }
+  else
+  {
+    // Everything OK.
+    emit finished();
+
+    removeLockFile();
+  }
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// TQT_SLOT IMPLEMENTATIONS
+/////////////////////////////////////////////////////////////////////////////
+
+void Smb4KFileIO::slotShutdown()
+{
+  removeLockFile( false );
+}
+
+
+void Smb4KFileIO::slotReceivedStderr( TDEProcess *, char *buf, int len )
+{
+  TQString error_output = TQString::fromLocal8Bit( buf, len );
+
+  if ( error_output.contains( "smb4k_mv" ) != 0 )
+  {
+    m_error_occurred = true;
+
+    TQString canonical_path = findFile( (m_state == WriteSudoers ? "sudoers" : "super.tab") );
+
+    Smb4KError::error( ERROR_WRITING_FILE, canonical_path, m_buffer );
+
+    emit failed();
+    emit finished();
+
+    removeLockFile();
+  }
+  else if ( error_output.contains( "smb4k_cat" ) != 0 )
+  {
+    m_error_occurred = true;
+
+    TQString canonical_path = findFile( (m_state == ReadSudoers ? "sudoers" : "super.tab") );
+
+    Smb4KError::error( ERROR_READING_FILE, canonical_path, m_buffer );
+
+    emit failed();
+    emit finished();
+
+    removeLockFile();
+  }
+}
+
+
+void Smb4KFileIO::slotReceivedStdout( TDEProcess *, char *buf, int len )
+{
+  m_buffer.append( TQString::fromLocal8Bit( buf, len ) );
+}
+
+
+void Smb4KFileIO::slotProcessExited( TDEProcess * )
+{
+  m_proc->clearArguments();
+
+  if ( !m_error_occurred )
+  {
+    switch ( m_state )
+    {
+      case ReadSudoers:
+      {
+        processSudoers();
+
+        break;
+      }
+      case WriteSudoers:
+      {
+        emit finished();
+
+        removeLockFile();
+
+        break;
+      }
+      case ReadSuperTab:
+      {
+        processSuperTab();
+
+        break;
+      }
+      default:
+      {
+        emit finished();
+
+        removeLockFile();
+
+        break;
+      }
+    }
+  }
+  else
+  {
+    // Smb4KFileIO::slotReceivedStderr() has already done the
+    // necessary things.
+  }
+
+  m_buffer = TQString();
+  m_state = Idle;
+  m_error_occurred = false;
+}
+
+#include "smb4tdefileio.moc"
diff --git a/smb4k/core/smb4tdefileio.h b/smb4k/core/smb4tdefileio.h
new file mode 100644
index 0000000..9da6aae
--- /dev/null
+++ b/smb4k/core/smb4tdefileio.h
@@ -0,0 +1,247 @@
+/***************************************************************************
+    smb4tdefileio  -  Does file IO operations for Smb4K
+                             -------------------
+    begin                : Do Jan 1 2004
+    copyright            : (C) 2004-2007 by Alexander Reinholdt
+    email                : dustpuppy@users.berlios.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 SMB4KFILEIO_H
+#define SMB4KFILEIO_H
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+// TQt includes
+#include <tqobject.h>
+#include <tqstring.h>
+#include <tqcstring.h>
+
+// KDE include
+#include <kprocess.h>
+
+
+/**
+ * This class belongs to the core classes of Smb4K. It handles IO
+ * operations that are performed on system configuration files.
+ *
+ * @author Alexander Reinholdt <dustpuppy@mail.berlios.de>
+ */
+
+class Smb4KFileIO : public TQObject
+{
+  Q_OBJECT
+  
+
+  public:
+    /**
+     * The constructor
+     *
+     * @param parent      The parent object of this class
+     *
+     * @param name        The name of this class
+     */
+    Smb4KFileIO( TQObject *parent = 0, const char *name = 0 );
+
+    /**
+     * The destructor
+     */
+    ~Smb4KFileIO();
+
+    /**
+     * Enumeration that determines for which super user program we perform
+     * the current action.
+     */
+    enum Operation { Insert, Remove, NoOperation };
+
+    /**
+     * This function writes changes to the sudoers configuration file.
+     *
+     * @param operation   Defines whether entries should be inserted or if
+     *                    they should be removed. With Smb4KFileIO::NoOperation
+     *                    the function exits immediately and returns TRUE.
+     *
+     * @returns TRUE if the write process was successfully initiate and FALSE
+     * otherwise.
+     *
+     * @note You need to connect to the finished() and failed() signals to find
+     * out if the the write process finished successfully.
+     *
+     */
+    bool writeSudoers( Smb4KFileIO::Operation operation );
+
+    /**
+     * This function writes changes to the super.tab configuration file.
+     *
+     * @param operation   Defines whether entries should be inserted or if
+     *                    they should be removed. With Smb4KFileIO::NoOperation
+     *                    the function exits immediately and returns TRUE.
+     *
+     * @returns TRUE if the write process was successfully initiate and FALSE
+     * otherwise.
+     *
+     * @note You need to connect to the finished() and failed() signals to find
+     * out if the the write process finished successfully.
+     *
+     */
+    bool writeSuperTab( Smb4KFileIO::Operation operation );
+
+  signals:
+    /**
+     * This signal is emitted when somthing went wrong with the writing to
+     * the system configuration files.
+     */
+    void failed();
+
+    /**
+     * This signal is emitted when the writing to the system configuration
+     * files has finished. It is emitted in case the writing was successful
+     * as well as in case it wasn't.
+     */
+    void finished();
+
+  protected slots:
+    /**
+     * This slot is invokes when the application is closed. It is connected
+     * to TDEApplication::shutDown().
+     */
+    void slotShutdown();
+
+    /**
+     * This slot receives shell program output from Stderr.
+     *
+     * @param proc            The TDEProcess object
+     *
+     * @param buf             The buffer that holds the error output
+     *
+     * @param len             The length of the buffer
+     */
+    void slotReceivedStderr( TDEProcess *proc, char *buf, int len );
+
+    /**
+     * This slot receives shell program output from Stdout.
+     *
+     * @param proc            The TDEProcess object
+     *
+     * @param buf             The buffer that holds the output
+     *
+     * @param len             The length of the buffer
+     */
+    void slotReceivedStdout( TDEProcess *proc, char *buf, int len );
+
+    /**
+     * This slot is called, when the process exited.
+     *
+     * @param proc            The TDEProcess object
+     */
+    void slotProcessExited( TDEProcess *proc );
+
+  private:
+    /**
+     * This function creates a lock file in /tmp if it does not
+     * exist already. If the user is not allowed to write to the
+     * desired file a the moment, the user will be shown an error
+     * dialog and the function will return FALSE.
+     *
+     * Checks are performed to make sure it is save to write to an
+     * existing lock file using the system call lstat().
+     *
+     * @param filename        The name of the file that is to be modified.
+     *
+     * @returns TRUE if the creation was successful and FALSE if
+     * something went wrong.
+     */
+    bool createLockFile( const TQString &filename );
+
+    /**
+     * This function removes the lock file or at least the
+     * entry within it.
+     *
+     * Checks are performed to make sure it is save to write to an
+     * existing lock file using the system call lstat().
+     *
+     * @param shutdown        Should be set to FALSE if you do not want to have
+     *                        any error message shown. Otherwise you should set it
+     *                        to TRUE.
+     *
+     * @returns TRUE if the removal was successful and FALSE if
+     * something went wrong.
+     */
+    bool removeLockFile( const bool error_message = true );
+
+    /**
+     * This function finds a file.
+     *
+     * @param filename        The name of the file
+     *
+     * @returns the canonical path of the file or an empty string if it could not be
+     *          found.
+     */
+    const TQCString findFile( const TQString &filename );
+
+    /**
+     * Enumeration that is used to tell the process what has to be done.
+     */
+    enum State { ReadSudoers, ReadSuperTab, WriteSudoers, WriteSuperTab, Idle };
+
+    /**
+     * This integer holds one of the entries of the enumeration above.
+     */
+    State m_state;
+
+    /**
+     * This buffer holds the output that was received at Stdout.
+     */
+    TQString m_buffer;
+
+    /**
+     * Process the sudoers file.
+     */
+    void processSudoers();
+
+    /**
+     * Process the sudoers file.
+     */
+    void processSuperTab();
+
+    /**
+     * This is the absolute path of the lock file.
+     */
+    TQCString m_lock_file;
+
+    /**
+     * Which operation should be performed
+     */
+    Operation m_operation;
+
+    /**
+     * The TDEProcess object
+     */
+    TDEProcess *m_proc;
+
+    /**
+     * Tell if an error occurred.
+     */
+    bool m_error_occurred;
+};
+
+
+#endif
diff --git a/smb4k/dialogs/smb4kbookmarkeditor.cpp b/smb4k/dialogs/smb4kbookmarkeditor.cpp
index f68882f..93b2713 100644
--- a/smb4k/dialogs/smb4kbookmarkeditor.cpp
+++ b/smb4k/dialogs/smb4kbookmarkeditor.cpp
@@ -33,7 +33,7 @@
 #include <kactionclasses.h>
 #include <kaccel.h>
 #include <kiconloader.h>
-#include <kconfig.h>
+#include <tdeconfig.h>
 #include <kmessagebox.h>
 #include <kapplication.h>
 #include <kpopupmenu.h>
diff --git a/smb4k/iconview/smb4ksharesiconview.cpp b/smb4k/iconview/smb4ksharesiconview.cpp
index bc486b1..c61d550 100644
--- a/smb4k/iconview/smb4ksharesiconview.cpp
+++ b/smb4k/iconview/smb4ksharesiconview.cpp
@@ -26,7 +26,7 @@
 // KDE includes
 #include <kdebug.h>
 #include <kurl.h>
-#include <kio/job.h>
+#include <tdeio/job.h>
 #include <tdeversion.h>
 
 // application specific includes
diff --git a/smb4k/listview/smb4kshareslistview.cpp b/smb4k/listview/smb4kshareslistview.cpp
index 1f52edc..2d01084 100644
--- a/smb4k/listview/smb4kshareslistview.cpp
+++ b/smb4k/listview/smb4kshareslistview.cpp
@@ -29,7 +29,7 @@
 // KDE includes
 #include <klocale.h>
 #include <kurl.h>
-#include <kio/job.h>
+#include <tdeio/job.h>
 #include <tdeversion.h>
 #include <kdebug.h>
 
diff --git a/smb4k/main.cpp b/smb4k/main.cpp
index 1936f63..1b225f5 100644
--- a/smb4k/main.cpp
+++ b/smb4k/main.cpp
@@ -33,7 +33,7 @@
 #include <klocale.h>
 #include <kiconloader.h>
 #include <dcopclient.h>
-#include <kconfig.h>
+#include <tdeconfig.h>
 #include <kuniqueapplication.h>
 #include <kmessagebox.h>
 #include <kstandarddirs.h>
diff --git a/smb4k/smb4k.cpp b/smb4k/smb4k.cpp
index de2ade8..bdb3c77 100644
--- a/smb4k/smb4k.cpp
+++ b/smb4k/smb4k.cpp
@@ -37,7 +37,7 @@
 #include <kactionclasses.h>
 #include <klocale.h>
 #include <kprogress.h>
-#include <kconfigdialog.h>
+#include <tdeconfigdialog.h>
 #include <kaccel.h>
 
 // application specific includes
@@ -567,7 +567,7 @@ void Smb4KApp::slotConfigDialog()
   }
 
   // Load the factory of the config dialog:
-  KLibFactory *config_factory = KLibLoader::self()->factory( "libsmb4kconfigdialog" );
+  KLibFactory *config_factory = KLibLoader::self()->factory( "libsmb4tdeconfigdialog" );
 
   if ( config_factory )
   {
diff --git a/smb4k/smb4ksystemtray.cpp b/smb4k/smb4ksystemtray.cpp
index 9dd160b..aeef93e 100644
--- a/smb4k/smb4ksystemtray.cpp
+++ b/smb4k/smb4ksystemtray.cpp
@@ -37,7 +37,7 @@
 #include <kaction.h>
 #include <klibloader.h>
 #include <kmessagebox.h>
-#include <kconfigdialog.h>
+#include <tdeconfigdialog.h>
 #include <kiconeffect.h>
 
 // application specific includes
@@ -188,7 +188,7 @@ void Smb4KSystemTray::slotConfigDialog()
   }
 
   // Load the factory of the config dialog:
-  KLibFactory *config_factory = KLibLoader::self()->factory( "libsmb4kconfigdialog" );
+  KLibFactory *config_factory = KLibLoader::self()->factory( "libsmb4tdeconfigdialog" );
 
   if ( config_factory )
   {
-- 
cgit v1.2.3

