diff options
| author | Michele Calgaro <michele.calgaro@yahoo.it> | 2023-04-28 22:39:50 +0900 |
|---|---|---|
| committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2023-04-28 22:39:50 +0900 |
| commit | fdd2249496404cafd72fa862c49d6920fd8d7927 (patch) | |
| tree | 47e86c702ba7d2ee73d827604fe79151290d00b2 /kmrml/kmrml/lib/mrml_utils.cpp | |
| parent | a9f6e5c5b26c07d5e96cd5e84e1dd95c973cd3ab (diff) | |
| download | tdegraphics-fdd22494.tar.gz tdegraphics-fdd22494.zip | |
Drop deprecated kmrml code
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'kmrml/kmrml/lib/mrml_utils.cpp')
| -rw-r--r-- | kmrml/kmrml/lib/mrml_utils.cpp | 89 |
1 files changed, 0 insertions, 89 deletions
diff --git a/kmrml/kmrml/lib/mrml_utils.cpp b/kmrml/kmrml/lib/mrml_utils.cpp deleted file mode 100644 index 314bbc7b..00000000 --- a/kmrml/kmrml/lib/mrml_utils.cpp +++ /dev/null @@ -1,89 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2002 Carsten Pfeiffer <pfeiffer@kde.org> - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public - License as published by the Free Software Foundation, version 2. - - 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; see the file COPYING. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include <dcopclient.h> -#include <tdeapplication.h> -#include <kprocess.h> -#include <kstaticdeleter.h> - -#include "watcher_stub.h" - -#include "mrml_utils.h" - -// after 100 of no use, terminate the mrmld -#define TIMEOUT 100 -// how often to restart the mrmld in case of failure -#define NUM_RESTARTS 5 - -using namespace KMrml; - -KStaticDeleter<Util> utils_sd; - -Util *Util::s_self = 0L; - -Util::Util() -{ - // we need our own dcopclient, when used in tdeio_mrml - if ( !DCOPClient::mainClient() ) - { - DCOPClient::setMainClient( new DCOPClient() ); - if ( !DCOPClient::mainClient()->attach() ) - tqWarning( "tdeio_mrml: Can't attach to DCOP Server."); - } -} - -Util::~Util() -{ - if ( this == s_self ) - s_self = 0L; -} - -Util *Util::self() -{ - if ( !s_self ) - s_self = utils_sd.setObject( new Util() ); - return s_self; -} - -bool Util::requiresLocalServerFor( const KURL& url ) -{ - return url.host().isEmpty() || url.host() == "localhost"; -} - -bool Util::startLocalServer( const Config& config ) -{ - if ( config.serverStartedIndividually() ) - return true; - - DCOPClient *client = DCOPClient::mainClient(); - - // ### check if it's already running (add dcop method to Watcher) - Watcher_stub watcher( client, "kded", "daemonwatcher"); - return ( watcher.requireDaemon( client->appId(), - "mrmld", config.mrmldCommandline(), - TIMEOUT, NUM_RESTARTS ) - && watcher.ok() ); -} - -void Util::unrequireLocalServer() -{ - DCOPClient *client = DCOPClient::mainClient(); - - Watcher_stub watcher( client, "kded", "daemonwatcher"); - watcher.unrequireDaemon( client->appId(), "mrmld" ); -} |
