[kde-doc-english] [kded] /: Remove KHostnameD, this is clearly not needed
Àlex Fiestas
afiestas at kde.org
Tue Mar 4 11:27:13 UTC 2014
Git commit 97a67d74264780b01ffb87b06dfaaf50b79065ef by Àlex Fiestas.
Committed on 04/03/2014 at 11:22.
Pushed by afiestas into branch 'master'.
Remove KHostnameD, this is clearly not needed
After disabling it a 2 versionsa go nobody has complain, nobody has
yelled at us which makes me believe even more that this is not needed.
So, for KF5 let's just delete it.
CCMAIL: dfaure at kde.org
M +0 -7 README.md
M +0 -2 docs/kded5/man-kded5.8.docbook
M +0 -50 src/kded.cpp
M +0 -18 src/kded.h
http://commits.kde.org/kded/97a67d74264780b01ffb87b06dfaaf50b79065ef
diff --git a/README.md b/README.md
index ef43e1a..f731625 100644
--- a/README.md
+++ b/README.md
@@ -25,13 +25,6 @@ Some of these tasks are built in, others are started on demand.
of which update files have been processed already in the config-file
kconf\_updaterc. It only performs a certain update once.
-* Checking for hostname changes. It is a really bad idea to change the
- hostname of a running system and it usually only happens with incorrectly
- configured dial-up connections. Never the less, kded will check for hostname
- changes and if it detects one it will make the necassery changes to the
- KDE environemnt and X-server to allow continued proper operation. The
- program kdontchangethehostname is executed to make the actual changes.
-
### Configuration of built in tasks.
The built in tasks have some configuration options that can be changed by
diff --git a/docs/kded5/man-kded5.8.docbook b/docs/kded5/man-kded5.8.docbook
index 1186209..44f5c69 100644
--- a/docs/kded5/man-kded5.8.docbook
+++ b/docs/kded5/man-kded5.8.docbook
@@ -61,8 +61,6 @@
</para>
<para>It checks newly installed update files, i.e. the *.upd files used to update configuration files of users when the configuration file formats changes. <command>kconf_update</command> is launched to do the updates.
</para>
-<para>When the hostname changes, it will make the necessary changes to the KDE environment and X-server to allow continued proper operation, launching <command>kdontchangethehostname</command> to do the changes.
-</para>
<para>Those tasks are also performed always at kded5 start to ensure that the user configuration is up to date.
</para>
<para>It is also responsible for launching the on-demand kded5 modules and init enabled kded5 modules like:
diff --git a/src/kded.cpp b/src/kded.cpp
index 1d47970..1a98a93 100644
--- a/src/kded.cpp
+++ b/src/kded.cpp
@@ -53,10 +53,8 @@ Kded *Kded::_self = 0;
static bool checkStamps = true;
static bool delayedCheck = false;
-static int HostnamePollInterval;
static bool bCheckSycoca;
static bool bCheckUpdates;
-static bool bCheckHostname;
#ifdef Q_DBUS_EXPORT
extern Q_DBUS_EXPORT void qDBusAddSpyHook(void (*)(const QDBusMessage &));
@@ -96,14 +94,6 @@ static void runKonfUpdate()
KToolInvocation::kdeinitExecWait("kconf_update", QStringList(), 0, 0, "0" /*no startup notification*/);
}
-static void runDontChangeHostname(const QByteArray &oldName, const QByteArray &newName)
-{
- QStringList args;
- args.append(QFile::decodeName(oldName));
- args.append(QFile::decodeName(newName));
- KToolInvocation::kdeinitExecWait("kdontchangethehostname", args);
-}
-
Kded::Kded()
: m_needDelayedCheck(false)
{
@@ -721,41 +711,6 @@ void KUpdateD::slotNewUpdateFile(const QString &dirty)
m_pTimer->start(500);
}
-KHostnameD::KHostnameD(int pollInterval)
-{
- m_Timer.start(pollInterval); // repetitive timer (not single-shot)
- connect(&m_Timer, SIGNAL(timeout()), this, SLOT(checkHostname()));
- checkHostname();
-}
-
-KHostnameD::~KHostnameD()
-{
- // Empty
-}
-
-void KHostnameD::checkHostname()
-{
- char buf[1024 + 1];
- if (gethostname(buf, 1024) != 0) {
- return;
- }
- buf[sizeof(buf) - 1] = '\0';
-
- if (m_hostname.isEmpty()) {
- m_hostname = buf;
- return;
- }
-
- if (m_hostname == buf) {
- return;
- }
-
- QByteArray newHostname = buf;
-
- runDontChangeHostname(m_hostname, newHostname);
- m_hostname = newHostname;
-}
-
KBuildsycocaAdaptor::KBuildsycocaAdaptor(QObject *parent)
: QDBusAbstractAdaptor(parent)
{
@@ -804,10 +759,8 @@ extern "C" Q_DECL_EXPORT int kdemain(int argc, char *argv[])
KDBusService service(KDBusService::Unique);
- HostnamePollInterval = cg.readEntry("HostnamePollInterval", 5000);
bCheckSycoca = cg.readEntry("CheckSycoca", true);
bCheckUpdates = cg.readEntry("CheckUpdates", true);
- bCheckHostname = cg.readEntry("CheckHostname", true);
checkStamps = cg.readEntry("CheckFileStamps", true);
delayedCheck = cg.readEntry("DelayedCheck", false);
@@ -848,9 +801,6 @@ extern "C" Q_DECL_EXPORT int kdemain(int argc, char *argv[])
QDBusConnection::sessionBus().asyncCall(ksplashProgressMessage);
#endif
- //if (bCheckHostname)
- // (void) new KHostnameD(HostnamePollInterval); // Watch for hostname changes
-
int result = app.exec(); // keep running
delete kded;
diff --git a/src/kded.h b/src/kded.h
index ee765f9..a91a94c 100644
--- a/src/kded.h
+++ b/src/kded.h
@@ -255,22 +255,4 @@ private:
QTimer *m_pTimer;
};
-class KHostnameD : public QObject
-{
- Q_OBJECT
-public:
- KHostnameD(int pollInterval);
- ~KHostnameD();
-
-public Q_SLOTS:
- void checkHostname();
-
-private:
- /**
- * Timer for interval hostname checking.
- */
- QTimer m_Timer;
- QByteArray m_hostname;
-};
-
#endif
More information about the kde-doc-english
mailing list