From 6aacff55319651f3664749849d70ca8b815fe997 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Wed, 13 Apr 2022 19:54:59 +0300 Subject: [PATCH] kio: remove unused source files Signed-off-by: Ivailo Monev --- kio/tests/kacltest.cpp | 1 - kio/tests/kdcopcheck.cpp | 129 ------------------------------- kio/tests/kdcopcheck.h | 27 ------- kio/tests/ksycocatest.cpp | 1 - kio/tests/kurlcompletiontest.cpp | 1 - 5 files changed, 159 deletions(-) delete mode 100644 kio/tests/kdcopcheck.cpp delete mode 100644 kio/tests/kdcopcheck.h diff --git a/kio/tests/kacltest.cpp b/kio/tests/kacltest.cpp index ea9d11aa..14461e91 100644 --- a/kio/tests/kacltest.cpp +++ b/kio/tests/kacltest.cpp @@ -67,7 +67,6 @@ static bool check(const QString& txt, T a, T b) int main(int argc, char *argv[]) { - //KApplication::disableAutoDcopRegistration(); KCmdLineArgs::init(argc,argv, "kacltest", 0, ki18n("kacltest"), 0); KApplication app; diff --git a/kio/tests/kdcopcheck.cpp b/kio/tests/kdcopcheck.cpp deleted file mode 100644 index 06dacaf5..00000000 --- a/kio/tests/kdcopcheck.cpp +++ /dev/null @@ -1,129 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "kdcopcheck.h" -#include - -#include - -#include -#include - -void debug(QString txt) -{ - fprintf(stderr, "%s\n", txt.toLatin1().constData()); -} - -void debug(const char *txt) -{ - fprintf(stderr, "%s\n", txt); -} -void debug(const char *format, const char *txt) -{ - fprintf(stderr, format, txt); - fprintf(stderr, "\n"); -} - -TestService::TestService(const QString &exec) -{ - m_exec = exec; - - proc.start(exec); - - connect(KApplication::dcopClient(), SIGNAL(applicationRegistered(QByteArray)), - this, SLOT(newApp(QByteArray))); - connect(KApplication::dcopClient(), SIGNAL(applicationRemoved(QByteArray)), - this, SLOT(endApp(QByteArray))); - connect(&proc, SIGNAL(finished(int,QProcess::ExitStatus)), - this, SLOT(appExit())); - - QTimer::singleShot(20*1000, this, SLOT(stop())); - result = KService::DCOP_None; -} - -void TestService::newApp(const QByteArray &appId) -{ - QString id = appId; - if (id == m_exec) - { - result = KService::DCOP_Unique; - stop(); - } - else if (id.startsWith(m_exec)) - { - result = KService::DCOP_Multi; - stop(); - } - qWarning("Register %s", appId.data()); -} - -void TestService::endApp(const QByteArray &appId) -{ - qWarning("Unegister %s", appId.data()); -} - -void TestService::appExit() -{ - qWarning("Exit"); -} - -void TestService::stop() -{ - qApp->exit_loop(); -} - -int TestService::exec() -{ - qApp->enter_loop(); - return result; -} - -int main(int argc, char *argv[]) -{ - putenv("IGNORE_SYCOCA_VERSION=true"); - KCmdLineArgs::init( argc,argv, "whatever", 0, ki18n("whatever"), 0); - KApplication k( false/*noGUI*/ );// KMessageBox needs KApp for makeStdCaption - - k.dcopClient()->setNotifications(true); - - KService::List list = KService::allServices(); - - qWarning("I found %d services.", list.count()); - int i = 0; - for(KService::List::ConstIterator it = list.begin(); it != list.end(); ++it) - { - if (((*it)->DCOPServiceType() == KService::DCOP_None) && - !(*it)->entryPath().startsWith("SuSE") && - (*it)->hasServiceType("Application")) - { - if ((*it)->exec().startsWith((*it)->desktopEntryName())) - { - i++; - - TestService *test = new TestService((*it)->desktopEntryName()); - int n = test->exec(); - delete test; - - QString result; - if (n == KService::DCOP_None) - result = "None"; - else if (n == KService::DCOP_Unique) - result = "Unique"; - else if (n == KService::DCOP_Multi) - result = "Multi"; - - qWarning("%s %s", (*it)->entryPath().toLatin1().constData(), - result.toLatin1().constData()); - } - } - } - qWarning("%d left after filtering.", i); -} - -#include "moc_kdcopcheck.cpp" diff --git a/kio/tests/kdcopcheck.h b/kio/tests/kdcopcheck.h deleted file mode 100644 index ffe9c5c1..00000000 --- a/kio/tests/kdcopcheck.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef _BLA_H_ -#define _BLA_H_ - -#include -#include - -class TestService : public QObject -{ - Q_OBJECT -public: - TestService(const QString &exec); - - int exec(); - -public Q_SLOTS: - void newApp(const QByteArray &appId); - void endApp(const QByteArray &appId); - void appExit(); - void stop(); - -protected: - int result; - QString m_exec; - QProcess proc; -}; - -#endif diff --git a/kio/tests/ksycocatest.cpp b/kio/tests/ksycocatest.cpp index 7a37510c..c667def3 100644 --- a/kio/tests/ksycocatest.cpp +++ b/kio/tests/ksycocatest.cpp @@ -41,7 +41,6 @@ // int main(int argc, char *argv[]) { - //KApplication::disableAutoDcopRegistration(); KCmdLineArgs::init(argc,argv, "ksycocatest", 0, ki18n("ksycocatest"), 0); KApplication k;//(argc,argv,"whatever",false/*noGUI*/); // KMessageBox needs KApp for makeStdCaption diff --git a/kio/tests/kurlcompletiontest.cpp b/kio/tests/kurlcompletiontest.cpp index 0c88cbc2..c732afcc 100644 --- a/kio/tests/kurlcompletiontest.cpp +++ b/kio/tests/kurlcompletiontest.cpp @@ -197,7 +197,6 @@ void KUrlCompletionTest::testEmptyCwd() int main( int argc, char **argv ) { - //KApplication::disableAutoDcopRegistration(); KCmdLineArgs::init(argc,argv, "kurlcompletiontest", 0, ki18n("kurlcompletiontest"), 0); KApplication app;