From 5bca2e3e42d02f8fed9ffc399ea14f8a05694cb0 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sat, 19 Jan 2013 18:46:45 -0600 Subject: Rename KCmdLineArgs to TDECmdLineArgs to avoid conflicts with KDE4 --- kded/kbuildsycoca.cpp | 6 +++--- kded/kde-menu.cpp | 10 +++++----- kded/kded.cpp | 6 +++--- kded/khostname.cpp | 6 +++--- 4 files changed, 14 insertions(+), 14 deletions(-) (limited to 'kded') diff --git a/kded/kbuildsycoca.cpp b/kded/kbuildsycoca.cpp index f111b3762..ec5139d86 100644 --- a/kded/kbuildsycoca.cpp +++ b/kded/kbuildsycoca.cpp @@ -724,9 +724,9 @@ extern "C" KDE_EXPORT int kdemain(int argc, char **argv) d.addAuthor("David Faure", I18N_NOOP("Author"), "faure@kde.org"); d.addAuthor("Waldo Bastian", I18N_NOOP("Author"), "bastian@kde.org"); - KCmdLineArgs::init(argc, argv, &d); - KCmdLineArgs::addCmdLineOptions(options); - KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); + TDECmdLineArgs::init(argc, argv, &d); + TDECmdLineArgs::addCmdLineOptions(options); + TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs(); bGlobalDatabase = args->isSet("global"); bMenuTest = args->isSet("menutest"); diff --git a/kded/kde-menu.cpp b/kded/kde-menu.cpp index 0362e10e9..81887a695 100644 --- a/kded/kde-menu.cpp +++ b/kded/kde-menu.cpp @@ -118,8 +118,8 @@ int main(int argc, char **argv) KAboutData::License_GPL, "(c) 2003 Waldo Bastian"); d.addAuthor("Waldo Bastian", I18N_NOOP("Author"), "bastian@kde.org"); - KCmdLineArgs::init(argc, argv, &d); - KCmdLineArgs::addCmdLineOptions(options); + TDECmdLineArgs::init(argc, argv, &d); + TDECmdLineArgs::addCmdLineOptions(options); // KApplication k(false, false); KApplication k(false); @@ -128,9 +128,9 @@ int main(int argc, char **argv) // this program is in tdelibs so it uses tdelibs as catalog KLocale::setMainCatalogue("tdelibs"); - KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); + TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs(); if (args->count() != 1) - KCmdLineArgs::usage(i18n("You must specify an application-id such as 'tde-konsole.desktop'")); + TDECmdLineArgs::usage(i18n("You must specify an application-id such as 'tde-konsole.desktop'")); utf8 = args->isSet("utf8"); @@ -139,7 +139,7 @@ int main(int argc, char **argv) bHighlight = args->isSet("highlight"); if (!bPrintMenuId && !bPrintMenuName && !bHighlight) - KCmdLineArgs::usage(i18n("You must specify at least one of --print-menu-id, --print-menu-name or --highlight")); + TDECmdLineArgs::usage(i18n("You must specify at least one of --print-menu-id, --print-menu-name or --highlight")); if (args->isSet("cache-update")) { diff --git a/kded/kded.cpp b/kded/kded.cpp index 4b891d48a..40e1983f7 100644 --- a/kded/kded.cpp +++ b/kded/kded.cpp @@ -878,11 +878,11 @@ extern "C" KDE_EXPORT int kdemain(int argc, char *argv[]) KApplication::installSigpipeHandler(); - KCmdLineArgs::init(argc, argv, &aboutData); + TDECmdLineArgs::init(argc, argv, &aboutData); KUniqueApplication::addCmdLineOptions(); - KCmdLineArgs::addCmdLineOptions( options ); + TDECmdLineArgs::addCmdLineOptions( options ); // this program is in tdelibs so it uses tdelibs as catalog KLocale::setMainCatalogue("tdelibs"); @@ -891,7 +891,7 @@ extern "C" KDE_EXPORT int kdemain(int argc, char *argv[]) putenv(strdup("SESSION_MANAGER=")); // Parse command line before checking DCOP - KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); + TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs(); // Check DCOP communication. { diff --git a/kded/khostname.cpp b/kded/khostname.cpp index d8c568869..60c7ba8f5 100644 --- a/kded/khostname.cpp +++ b/kded/khostname.cpp @@ -65,7 +65,7 @@ protected: KHostName::KHostName() { - KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); + TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs(); if (args->count() != 2) args->usage(); oldName = args->arg(0); @@ -371,8 +371,8 @@ int main(int argc, char **argv) KAboutData::License_GPL, "(c) 2001 Waldo Bastian"); d.addAuthor("Waldo Bastian", I18N_NOOP("Author"), "bastian@kde.org"); - KCmdLineArgs::init(argc, argv, &d); - KCmdLineArgs::addCmdLineOptions(options); + TDECmdLineArgs::init(argc, argv, &d); + TDECmdLineArgs::addCmdLineOptions(options); KInstance k(&d); -- cgit v1.2.1 From 8e7816b2f9f62a2df094c5b2a7aa5abb6bc1226a Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sun, 20 Jan 2013 00:21:02 -0600 Subject: Rename KApplication to TDEApplication to avoid conflicts with KDE4 --- kded/kbuildsycoca.cpp | 6 +++--- kded/kde-menu.cpp | 6 +++--- kded/kded.cpp | 10 +++++----- kded/khostname.cpp | 2 +- kded/kmimelist.cpp | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) (limited to 'kded') diff --git a/kded/kbuildsycoca.cpp b/kded/kbuildsycoca.cpp index ec5139d86..483578c72 100644 --- a/kded/kbuildsycoca.cpp +++ b/kded/kbuildsycoca.cpp @@ -736,11 +736,11 @@ extern "C" KDE_EXPORT int kdemain(int argc, char **argv) setenv("TDEROOTHOME", "-", 1); } - KApplication::disableAutoDcopRegistration(); + TDEApplication::disableAutoDcopRegistration(); #ifdef KBUILDSYCOCA_GUI - KApplication k; + TDEApplication k; #else - KApplication k(false, false); + TDEApplication k(false, false); #endif k.disableSessionManagement(); diff --git a/kded/kde-menu.cpp b/kded/kde-menu.cpp index 81887a695..7148a1e6b 100644 --- a/kded/kde-menu.cpp +++ b/kded/kde-menu.cpp @@ -121,8 +121,8 @@ int main(int argc, char **argv) TDECmdLineArgs::init(argc, argv, &d); TDECmdLineArgs::addCmdLineOptions(options); -// KApplication k(false, false); - KApplication k(false); +// TDEApplication k(false, false); + TDEApplication k(false); k.disableSessionManagement(); // this program is in tdelibs so it uses tdelibs as catalog @@ -147,7 +147,7 @@ int main(int argc, char **argv) args.append("--incremental"); args.append("--checkstamps"); TQString command = "kbuildsycoca"; - TQCString _launcher = KApplication::launcher(); + TQCString _launcher = TDEApplication::launcher(); if (!DCOPRef(_launcher, _launcher).call("tdeinit_exec_wait", command, args).isValid()) { tqWarning("Can't talk to klauncher!"); diff --git a/kded/kded.cpp b/kded/kded.cpp index 40e1983f7..538cfff09 100644 --- a/kded/kded.cpp +++ b/kded/kded.cpp @@ -73,19 +73,19 @@ static void runBuildSycoca(TQObject *callBackObj=0, const char *callBackSlot=0) TQByteArray data; TQDataStream dataStream( data, IO_WriteOnly ); dataStream << TQString("kbuildsycoca") << args; - TQCString _launcher = KApplication::launcher(); + TQCString _launcher = TDEApplication::launcher(); kapp->dcopClient()->callAsync(_launcher, _launcher, "tdeinit_exec_wait(TQString,TQStringList)", data, callBackObj, callBackSlot); } else { - KApplication::tdeinitExecWait( "kbuildsycoca", args ); + TDEApplication::tdeinitExecWait( "kbuildsycoca", args ); } } static void runKonfUpdate() { - KApplication::tdeinitExecWait( "kconf_update", TQStringList(), 0, 0, "0" /*no startup notification*/ ); + TDEApplication::tdeinitExecWait( "kconf_update", TQStringList(), 0, 0, "0" /*no startup notification*/ ); } static void runDontChangeHostname(const TQCString &oldName, const TQCString &newName) @@ -93,7 +93,7 @@ static void runDontChangeHostname(const TQCString &oldName, const TQCString &new TQStringList args; args.append(TQFile::decodeName(oldName)); args.append(TQFile::decodeName(newName)); - KApplication::tdeinitExecWait( "kdontchangethehostname", args ); + TDEApplication::tdeinitExecWait( "kdontchangethehostname", args ); } Kded::Kded(bool checkUpdates, bool new_startup) @@ -876,7 +876,7 @@ extern "C" KDE_EXPORT int kdemain(int argc, char *argv[]) "$Id$", I18N_NOOP("TDE Daemon - triggers Sycoca database updates when needed")); - KApplication::installSigpipeHandler(); + TDEApplication::installSigpipeHandler(); TDECmdLineArgs::init(argc, argv, &aboutData); diff --git a/kded/khostname.cpp b/kded/khostname.cpp index 60c7ba8f5..0c1dd1b18 100644 --- a/kded/khostname.cpp +++ b/kded/khostname.cpp @@ -358,7 +358,7 @@ void KHostName::changeSessionManager() delete client; return; } - TQCString launcher = KApplication::launcher(); + TQCString launcher = TDEApplication::launcher(); client->send(launcher, launcher, "setLaunchEnv(TQCString,TQCString)", params); delete client; } diff --git a/kded/kmimelist.cpp b/kded/kmimelist.cpp index fff626cac..c82f6d9f7 100644 --- a/kded/kmimelist.cpp +++ b/kded/kmimelist.cpp @@ -14,7 +14,7 @@ int main(int argc, char *argv[]) { - KApplication k(argc,argv,"blurb",false); + TDEApplication k(argc,argv,"blurb",false); KMimeType::List mtl = KMimeType::allMimeTypes( ); assert( mtl.count() ); -- cgit v1.2.1 From b19ddece21e102b8e4b292037ca7578f60b128fe Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Tue, 22 Jan 2013 20:20:05 -0600 Subject: Rename KInstance and KAboutData to avoid conflicts with KDE4 --- kded/kbuildsycoca.cpp | 4 ++-- kded/kde-menu.cpp | 4 ++-- kded/kded.cpp | 4 ++-- kded/khostname.cpp | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) (limited to 'kded') diff --git a/kded/kbuildsycoca.cpp b/kded/kbuildsycoca.cpp index 483578c72..958f38303 100644 --- a/kded/kbuildsycoca.cpp +++ b/kded/kbuildsycoca.cpp @@ -718,9 +718,9 @@ public: extern "C" KDE_EXPORT int kdemain(int argc, char **argv) { KLocale::setMainCatalogue("tdelibs"); - KAboutData d(appName, I18N_NOOP("KBuildSycoca"), appVersion, + TDEAboutData d(appName, I18N_NOOP("KBuildSycoca"), appVersion, I18N_NOOP("Rebuilds the system configuration cache."), - KAboutData::License_GPL, "(c) 1999-2002 KDE Developers"); + TDEAboutData::License_GPL, "(c) 1999-2002 KDE Developers"); d.addAuthor("David Faure", I18N_NOOP("Author"), "faure@kde.org"); d.addAuthor("Waldo Bastian", I18N_NOOP("Author"), "bastian@kde.org"); diff --git a/kded/kde-menu.cpp b/kded/kde-menu.cpp index 7148a1e6b..7c73fb226 100644 --- a/kded/kde-menu.cpp +++ b/kded/kde-menu.cpp @@ -113,9 +113,9 @@ int main(int argc, char **argv) "The --highlight option can be used to visually indicate to the user where\n" "in the TDE menu a specific application is located."); - KAboutData d(appName, I18N_NOOP("kde-menu"), appVersion, + TDEAboutData d(appName, I18N_NOOP("kde-menu"), appVersion, description, - KAboutData::License_GPL, "(c) 2003 Waldo Bastian"); + TDEAboutData::License_GPL, "(c) 2003 Waldo Bastian"); d.addAuthor("Waldo Bastian", I18N_NOOP("Author"), "bastian@kde.org"); TDECmdLineArgs::init(argc, argv, &d); diff --git a/kded/kded.cpp b/kded/kded.cpp index 538cfff09..84db43b46 100644 --- a/kded/kded.cpp +++ b/kded/kded.cpp @@ -872,7 +872,7 @@ public: extern "C" KDE_EXPORT int kdemain(int argc, char *argv[]) { - KAboutData aboutData( "kded", I18N_NOOP("TDE Daemon"), + TDEAboutData aboutData( "kded", I18N_NOOP("TDE Daemon"), "$Id$", I18N_NOOP("TDE Daemon - triggers Sycoca database updates when needed")); @@ -904,7 +904,7 @@ extern "C" KDE_EXPORT int kdemain(int argc, char *argv[]) } } - KInstance *instance = new KInstance(&aboutData); + TDEInstance *instance = new TDEInstance(&aboutData); KConfig *config = instance->config(); // Enable translations. if (args->isSet("check")) diff --git a/kded/khostname.cpp b/kded/khostname.cpp index 0c1dd1b18..bd0980a2b 100644 --- a/kded/khostname.cpp +++ b/kded/khostname.cpp @@ -366,15 +366,15 @@ void KHostName::changeSessionManager() int main(int argc, char **argv) { KLocale::setMainCatalogue("tdelibs"); - KAboutData d(appName, I18N_NOOP("KDontChangeTheHostName"), appVersion, + TDEAboutData d(appName, I18N_NOOP("KDontChangeTheHostName"), appVersion, I18N_NOOP("Informs TDE about a change in hostname"), - KAboutData::License_GPL, "(c) 2001 Waldo Bastian"); + TDEAboutData::License_GPL, "(c) 2001 Waldo Bastian"); d.addAuthor("Waldo Bastian", I18N_NOOP("Author"), "bastian@kde.org"); TDECmdLineArgs::init(argc, argv, &d); TDECmdLineArgs::addCmdLineOptions(options); - KInstance k(&d); + TDEInstance k(&d); KHostName hn; -- cgit v1.2.1 From 28edc0aa2ab09297288186f5bc15765eb7be58c0 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Thu, 24 Jan 2013 13:47:22 -0600 Subject: Rename KGlobal, KProcess, and KClipboard to avoid conflicts with KDE4 --- kded/kbuildsycoca.cpp | 32 ++++++++++++++++---------------- kded/kde-menu.cpp | 2 +- kded/kded.cpp | 4 ++-- kded/khostname.cpp | 24 ++++++++++++------------ kded/vfolder_menu.cpp | 26 +++++++++++++------------- 5 files changed, 44 insertions(+), 44 deletions(-) (limited to 'kded') diff --git a/kded/kbuildsycoca.cpp b/kded/kbuildsycoca.cpp index 958f38303..59ff8bc18 100644 --- a/kded/kbuildsycoca.cpp +++ b/kded/kbuildsycoca.cpp @@ -104,13 +104,13 @@ static TQString sycocaPath() if (bGlobalDatabase) { - path = KGlobal::dirs()->saveLocation("services")+"ksycoca"; + path = TDEGlobal::dirs()->saveLocation("services")+"ksycoca"; } else { TQCString ksycoca_env = getenv("TDESYCOCA"); if (ksycoca_env.isEmpty()) - path = KGlobal::dirs()->saveLocation("cache")+"ksycoca"; + path = TDEGlobal::dirs()->saveLocation("cache")+"ksycoca"; else path = TQFile::decodeName(ksycoca_env); } @@ -122,7 +122,7 @@ static TQString oldSycocaPath() { TQCString ksycoca_env = getenv("TDESYCOCA"); if (ksycoca_env.isEmpty()) - return KGlobal::dirs()->saveLocation("tmp")+"ksycoca"; + return TDEGlobal::dirs()->saveLocation("tmp")+"ksycoca"; return TQString::null; } @@ -189,7 +189,7 @@ KSycocaEntry *KBuildSycoca::createEntry(const TQString &file, bool addToFactory) TQ_UINT32 timeStamp = g_ctimeInfo->ctime(file); if (!timeStamp) { - timeStamp = KGlobal::dirs()->calcResourceHash( g_resource, file, true); + timeStamp = TDEGlobal::dirs()->calcResourceHash( g_resource, file, true); } KSycocaEntry* entry = 0; if (g_allEntries) @@ -317,7 +317,7 @@ bool KBuildSycoca::build() TQStringList relFiles; - (void) KGlobal::dirs()->findAllResources( g_resource, + (void) TDEGlobal::dirs()->findAllResources( g_resource, TQString::null, true, // Recursive! true, // uniq @@ -417,7 +417,7 @@ void KBuildSycoca::createMenu(TQString caption, TQString name, VFolderMenu::SubM TQ_UINT32 timeStamp = g_ctimeInfo->ctime(directoryFile); if (!timeStamp) { - timeStamp = KGlobal::dirs()->calcResourceHash( g_resource, directoryFile, true); + timeStamp = TDEGlobal::dirs()->calcResourceHash( g_resource, directoryFile, true); } KServiceGroup* entry = 0; @@ -563,10 +563,10 @@ void KBuildSycoca::save() } (*m_str) << (TQ_INT32) 0; // No more factories. // Write TDEDIRS - (*m_str) << KGlobal::dirs()->kfsstnd_prefixes(); + (*m_str) << TDEGlobal::dirs()->kfsstnd_prefixes(); (*m_str) << newTimestamp; - (*m_str) << KGlobal::locale()->language(); - (*m_str) << KGlobal::dirs()->calcResourceHash("services", "update_ksycoca", true); + (*m_str) << TDEGlobal::locale()->language(); + (*m_str) << TDEGlobal::dirs()->calcResourceHash("services", "update_ksycoca", true); (*m_str) << (*g_allResourceDirs); // Write factory data.... @@ -673,7 +673,7 @@ TQStringList KBuildSycoca::existingResourceDirs() while( !resources.empty()) { TQString res = resources.front(); - *dirs += KGlobal::dirs()->resourceDirs( res.latin1()); + *dirs += TDEGlobal::dirs()->resourceDirs( res.latin1()); resources.remove( res ); // remove this 'res' and all its duplicates } @@ -767,8 +767,8 @@ extern "C" KDE_EXPORT int kdemain(int argc, char **argv) KLocale::setMainCatalogue("tdelibs"); // force generating of KLocale object. if not, the database will get // be translated - KGlobal::locale(); - KGlobal::dirs()->addResourceType("app-reg", "share/application-registry" ); + TDEGlobal::locale(); + TDEGlobal::dirs()->addResourceType("app-reg", "share/application-registry" ); DCOPClient *dcopClient = new DCOPClient(); @@ -804,9 +804,9 @@ extern "C" KDE_EXPORT int kdemain(int argc, char **argv) if (incremental || !checkfiles) { KSycoca::self()->disableAutoRebuild(); // Prevent deadlock - TQString current_language = KGlobal::locale()->language(); + TQString current_language = TDEGlobal::locale()->language(); TQString ksycoca_language = KSycoca::self()->language(); - TQ_UINT32 current_update_sig = KGlobal::dirs()->calcResourceHash("services", "update_ksycoca", true); + TQ_UINT32 current_update_sig = TDEGlobal::dirs()->calcResourceHash("services", "update_ksycoca", true); TQ_UINT32 ksycoca_update_sig = KSycoca::self()->updateSignature(); if ((current_update_sig != ksycoca_update_sig) || @@ -914,9 +914,9 @@ extern "C" KDE_EXPORT int kdemain(int argc, char **argv) { // These directories may have been created with 0700 permission // better delete them if they are empty - TQString applnkDir = KGlobal::dirs()->saveLocation("apps", TQString::null, false); + TQString applnkDir = TDEGlobal::dirs()->saveLocation("apps", TQString::null, false); ::rmdir(TQFile::encodeName(applnkDir)); - TQString servicetypesDir = KGlobal::dirs()->saveLocation("servicetypes", TQString::null, false); + TQString servicetypesDir = TDEGlobal::dirs()->saveLocation("servicetypes", TQString::null, false); ::rmdir(TQFile::encodeName(servicetypesDir)); } } diff --git a/kded/kde-menu.cpp b/kded/kde-menu.cpp index 7c73fb226..5c1a38b4d 100644 --- a/kded/kde-menu.cpp +++ b/kded/kde-menu.cpp @@ -151,7 +151,7 @@ int main(int argc, char **argv) if (!DCOPRef(_launcher, _launcher).call("tdeinit_exec_wait", command, args).isValid()) { tqWarning("Can't talk to klauncher!"); - command = KGlobal::dirs()->findExe(command); + command = TDEGlobal::dirs()->findExe(command); command += " " + args.join(" "); system(command.local8Bit()); } diff --git a/kded/kded.cpp b/kded/kded.cpp index 84db43b46..efbde0011 100644 --- a/kded/kded.cpp +++ b/kded/kded.cpp @@ -106,7 +106,7 @@ Kded::Kded(bool checkUpdates, bool new_startup) TQCString cPath; TQCString ksycoca_env = getenv("TDESYCOCA"); if (ksycoca_env.isEmpty()) - cPath = TQFile::encodeName(KGlobal::dirs()->saveLocation("tmp")+"ksycoca"); + cPath = TQFile::encodeName(TDEGlobal::dirs()->saveLocation("tmp")+"ksycoca"); else cPath = ksycoca_env; m_pTimer = new TQTimer(this); @@ -665,7 +665,7 @@ KUpdateD::KUpdateD() TQObject::connect( m_pDirWatch, TQT_SIGNAL(dirty(const TQString&)), this, TQT_SLOT(slotNewUpdateFile())); - TQStringList dirs = KGlobal::dirs()->findDirs("data", "kconf_update"); + TQStringList dirs = TDEGlobal::dirs()->findDirs("data", "kconf_update"); for( TQStringList::ConstIterator it = dirs.begin(); it != dirs.end(); ++it ) diff --git a/kded/khostname.cpp b/kded/khostname.cpp index bd0980a2b..7e080378b 100644 --- a/kded/khostname.cpp +++ b/kded/khostname.cpp @@ -166,15 +166,15 @@ void KHostName::changeX() // don't nuke the xauth when XAUTHLOCALHOSTNAME points to it if (!xauthlocalhostname || oldNetId != xauthlocalhostname) { - cmd = "xauth -n remove "+KProcess::quote(netId); + cmd = "xauth -n remove "+TDEProcess::quote(netId); system(TQFile::encodeName(cmd)); } cmd = "xauth -n add "; - cmd += KProcess::quote(newNetId); + cmd += TDEProcess::quote(newNetId); cmd += " "; - cmd += KProcess::quote(authName); + cmd += TDEProcess::quote(authName); cmd += " "; - cmd += KProcess::quote(authKey); + cmd += TDEProcess::quote(authKey); system(TQFile::encodeName(cmd)); } } @@ -236,7 +236,7 @@ void KHostName::changeDcop() ::symlink(fname.data(), compatLink.data()); // Compatibility link // Update .ICEauthority - TQString cmd = "iceauth list "+KProcess::quote("netid="+oldNetId); + TQString cmd = "iceauth list "+TDEProcess::quote("netid="+oldNetId); FILE *iceFile = popen(TQFile::encodeName(cmd), "r"); if (!iceFile) { @@ -272,13 +272,13 @@ void KHostName::changeDcop() continue; cmd = "iceauth add "; - cmd += KProcess::quote(protName); + cmd += TDEProcess::quote(protName); cmd += " '' "; - cmd += KProcess::quote(newNetId); + cmd += TDEProcess::quote(newNetId); cmd += " "; - cmd += KProcess::quote(authName); + cmd += TDEProcess::quote(authName); cmd += " "; - cmd += KProcess::quote(authKey); + cmd += TDEProcess::quote(authKey); system(TQFile::encodeName(cmd)); } } @@ -288,7 +288,7 @@ void KHostName::changeDcop() char* xauthlocalhostname = getenv("XAUTHLOCALHOSTNAME"); if (!xauthlocalhostname || !oldNetId.contains(xauthlocalhostname)) { - TQString cmd = "iceauth remove "+KProcess::quote("netid="+oldNetId); + TQString cmd = "iceauth remove "+TDEProcess::quote("netid="+oldNetId); system(TQFile::encodeName(cmd)); unlink(origFName.data()); origFName = DCOPClient::dcopServerFileOld(oldName); // Compatibility link @@ -299,8 +299,8 @@ void KHostName::changeDcop() void KHostName::changeStdDirs(const TQCString &type) { // We make links to the old dirs cause we can't delete the old dirs. - TQCString oldDir = TQFile::encodeName(TQString("%1%2-%3").arg(KGlobal::dirs()->localtdedir()).arg(type.data()).arg(oldName.data())); - TQCString newDir = TQFile::encodeName(TQString("%1%2-%3").arg(KGlobal::dirs()->localtdedir()).arg(type.data()).arg(newName.data())); + TQCString oldDir = TQFile::encodeName(TQString("%1%2-%3").arg(TDEGlobal::dirs()->localtdedir()).arg(type.data()).arg(oldName.data())); + TQCString newDir = TQFile::encodeName(TQString("%1%2-%3").arg(TDEGlobal::dirs()->localtdedir()).arg(type.data()).arg(newName.data())); KDE_struct_stat st_buf; diff --git a/kded/vfolder_menu.cpp b/kded/vfolder_menu.cpp index e147dcfaf..b00b3553d 100644 --- a/kded/vfolder_menu.cpp +++ b/kded/vfolder_menu.cpp @@ -441,10 +441,10 @@ VFolderMenu::absoluteDir(const TQString &_dir, const TQString &baseDir, bool kee if (TQDir::isRelativePath(dir) && !keepRelativeToCfg) { - dir = KGlobal::dirs()->findResource("xdgconf-menu", dir); + dir = TDEGlobal::dirs()->findResource("xdgconf-menu", dir); } - dir = KGlobal::dirs()->realPath(dir); + dir = TDEGlobal::dirs()->realPath(dir); return dir; } @@ -642,7 +642,7 @@ VFolderMenu::mergeMenus(TQDomElement &docElem, TQString &name) else if( e.tagName() == "MergeDir") { TQString dir = absoluteDir(e.text(), e.attribute("__BaseDir"), true); - TQStringList dirs = KGlobal::dirs()->findDirs("xdgconf-menu", dir); + TQStringList dirs = TDEGlobal::dirs()->findDirs("xdgconf-menu", dir); for(TQStringList::ConstIterator it=dirs.begin(); it != dirs.end(); ++it) { @@ -653,12 +653,12 @@ VFolderMenu::mergeMenus(TQDomElement &docElem, TQString &name) if (!TQDir::isRelativePath(dir)) { // Absolute - fileList = KGlobal::dirs()->findAllResources("xdgconf-menu", dir+"*.menu", false, false); + fileList = TDEGlobal::dirs()->findAllResources("xdgconf-menu", dir+"*.menu", false, false); } else { // Relative - (void) KGlobal::dirs()->findAllResources("xdgconf-menu", dir+"*.menu", false, true, fileList); + (void) TDEGlobal::dirs()->findAllResources("xdgconf-menu", dir+"*.menu", false, true, fileList); } for(TQStringList::ConstIterator it=fileList.begin(); @@ -699,7 +699,7 @@ VFolderMenu::pushDocInfo(const TQString &fileName, const TQString &baseDir) if (!baseDir.isEmpty()) { if (!TQDir::isRelativePath(baseDir)) - m_docInfo.baseDir = KGlobal::dirs()->relativeLocation("xdgconf-menu", baseDir); + m_docInfo.baseDir = TDEGlobal::dirs()->relativeLocation("xdgconf-menu", baseDir); else m_docInfo.baseDir = baseDir; } @@ -743,7 +743,7 @@ VFolderMenu::pushDocInfoParent(const TQString &basePath, const TQString &baseDir m_docInfo.baseName = fileName.left( fileName.length() - 5 ); TQString baseName = TQDir::cleanDirPath(m_docInfo.baseDir + fileName); - TQStringList result = KGlobal::dirs()->findAllResources("xdgconf-menu", baseName); + TQStringList result = TDEGlobal::dirs()->findAllResources("xdgconf-menu", baseName); while( !result.isEmpty() && (result[0] != basePath)) result.remove(result.begin()); @@ -830,13 +830,13 @@ VFolderMenu::locateDirectoryFile(const TQString &fileName) void VFolderMenu::initDirs() { - m_defaultDataDirs = TQStringList::split(':', KGlobal::dirs()->kfsstnd_prefixes()); + m_defaultDataDirs = TQStringList::split(':', TDEGlobal::dirs()->kfsstnd_prefixes()); TQString localDir = m_defaultDataDirs.first(); m_defaultDataDirs.remove(localDir); // Remove local dir - m_defaultAppDirs = KGlobal::dirs()->findDirs("xdgdata-apps", TQString::null); - m_defaultDirectoryDirs = KGlobal::dirs()->findDirs("xdgdata-dirs", TQString::null); - m_defaultLegacyDirs = KGlobal::dirs()->resourceDirs("apps"); + m_defaultAppDirs = TDEGlobal::dirs()->findDirs("xdgdata-apps", TQString::null); + m_defaultDirectoryDirs = TDEGlobal::dirs()->findDirs("xdgdata-dirs", TQString::null); + m_defaultLegacyDirs = TDEGlobal::dirs()->resourceDirs("apps"); } void @@ -1038,7 +1038,7 @@ kdDebug(7021) << "processKDELegacyDirs()" << endl; TQRegExp files("\\.(desktop|kdelnk)$"); TQRegExp dirs("\\.directory$"); - (void) KGlobal::dirs()->findAllResources( "apps", + (void) TDEGlobal::dirs()->findAllResources( "apps", TQString::null, true, // Recursive! true, // uniq @@ -1629,7 +1629,7 @@ VFolderMenu::parseMenu(const TQString &file, bool forceLegacyLoad) m_legacyLoaded = false; m_appsInfo = 0; - TQStringList dirs = KGlobal::dirs()->resourceDirs("xdgconf-menu"); + TQStringList dirs = TDEGlobal::dirs()->resourceDirs("xdgconf-menu"); for(TQStringList::ConstIterator it=dirs.begin(); it != dirs.end(); ++it) { -- cgit v1.2.1 From 703fb0c89c2eee56a1e613e67a446db9d4287929 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Fri, 25 Jan 2013 00:35:07 -0600 Subject: Rename KCModule, KConfig, KIO, KServer, and KSocket to avoid conflicts with KDE4 --- kded/kded.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'kded') diff --git a/kded/kded.cpp b/kded/kded.cpp index efbde0011..d06c44c38 100644 --- a/kded/kded.cpp +++ b/kded/kded.cpp @@ -155,7 +155,7 @@ bool Kded::process(const TQCString &obj, const TQCString &fun, void Kded::initModules() { m_dontLoad.clear(); - KConfig *config = kapp->config(); + TDEConfig *config = kapp->config(); bool kde_running = !( getenv( "TDE_FULL_SESSION" ) == NULL || getenv( "TDE_FULL_SESSION" )[ 0 ] == '\0' ); // not the same user like the one running the session (most likely we're run via sudo or something) if( getenv( "TDE_SESSION_UID" ) != NULL && uid_t( atoi( getenv( "TDE_SESSION_UID" ))) != getuid()) @@ -225,7 +225,7 @@ void Kded::initModules() void Kded::loadSecondPhase() { kdDebug(7020) << "Loading second phase autoload" << endl; - KConfig *config = kapp->config(); + TDEConfig *config = kapp->config(); KService::List kdedModules = KServiceType::offers("KDEDModule"); for(KService::List::ConstIterator it = kdedModules.begin(); it != kdedModules.end(); ++it) { @@ -905,7 +905,7 @@ extern "C" KDE_EXPORT int kdemain(int argc, char *argv[]) } TDEInstance *instance = new TDEInstance(&aboutData); - KConfig *config = instance->config(); // Enable translations. + TDEConfig *config = instance->config(); // Enable translations. if (args->isSet("check")) { -- cgit v1.2.1 From dfe289850f068f19ba4a83ab4e7e22a7e09c13c9 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sat, 26 Jan 2013 13:17:21 -0600 Subject: Rename a number of libraries and executables to avoid conflicts with KDE4 --- kded/DESIGN | 4 +-- kded/Makefile.am | 6 ++-- kded/README.kded | 12 ++++---- kded/kbuildimageiofactory.cpp | 4 +-- kded/kbuildimageiofactory.h | 2 +- kded/kbuildprotocolinfofactory.cpp | 4 +-- kded/kbuildprotocolinfofactory.h | 2 +- kded/kbuildservicefactory.cpp | 4 +-- kded/kbuildservicefactory.h | 2 +- kded/kbuildservicegroupfactory.cpp | 4 +-- kded/kbuildservicegroupfactory.h | 2 +- kded/kbuildservicetypefactory.cpp | 4 +-- kded/kbuildservicetypefactory.h | 2 +- kded/kbuildsycoca.cpp | 56 +++++++++++++++++++------------------- kded/kbuildsycoca.h | 8 +++--- kded/kctimefactory.cpp | 4 +-- kded/kctimefactory.h | 4 +-- kded/kded.cpp | 14 +++++----- kded/kded.h | 4 +-- 19 files changed, 71 insertions(+), 71 deletions(-) (limited to 'kded') diff --git a/kded/DESIGN b/kded/DESIGN index 702fca853..e6653807b 100644 --- a/kded/DESIGN +++ b/kded/DESIGN @@ -12,9 +12,9 @@ kbuildsycoca recreates the sycoca file by: * parsing all .desktop files, replacing global ones by local ones (at any level of the hierarchy) * creating all objects in memory -* saving everything in the sycoca file (see below for ksycoca internals) +* saving everything in the sycoca file (see below for tdesycoca internals) * clearing all memory -* notifying the applications that use ksycoca by a DCOP call to the ksycoca +* notifying the applications that use tdesycoca by a DCOP call to the tdesycoca object (KSycoca::notifyDatabaseChanged()). Format of the sycoca database file diff --git a/kded/Makefile.am b/kded/Makefile.am index ba49c2c8f..1baf30e4f 100644 --- a/kded/Makefile.am +++ b/kded/Makefile.am @@ -38,15 +38,15 @@ kbuildsycoca_la_SOURCES = kbuildsycoca.cpp kbuildservicetypefactory.cpp \ bin_PROGRAMS = kdontchangethehostname kde-menu kmimelist -kdontchangethehostname_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor +kdontchangethehostname_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor kdontchangethehostname_LDADD = $(LIB_TDECORE) kdontchangethehostname_SOURCES = khostname.cpp -kmimelist_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor +kmimelist_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor kmimelist_LDADD = ../kio/libkio.la kmimelist_SOURCES = kmimelist.cpp -kde_menu_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor +kde_menu_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor kde_menu_LDADD = $(LIB_KIO) kde_menu_SOURCES = kde-menu.cpp diff --git a/kded/README.kded b/kded/README.kded index f0ff64d41..1cf382279 100644 --- a/kded/README.kded +++ b/kded/README.kded @@ -6,10 +6,10 @@ Some of these tasks are built in, others are started on demand. Built in tasks ============== -*) Checking for newly installed software and updating ksycoca when new -software is detected. Updating of ksycoca is done by the program kbuildsycoca +*) Checking for newly installed software and updating tdesycoca when new +software is detected. Updating of tdesycoca is done by the program kbuildsycoca which gets started by kded. When kded is first started it always runs -kbuildsycoca to ensure that ksycoca is up to date. +kbuildsycoca to ensure that tdesycoca is up to date. *) Checking for newly installed update files. Applications can install *.upd update files. These *.upd files are used to update configuration files @@ -40,9 +40,9 @@ the hostname is checked for changes. The time is specified in milliseconds and has a default of 5000 (5 seconds). CheckSycoca: This option can be used to disable checking for new software. -ksycoca will still be built when kded starts up and when applications -explicitly request a rebuild of the ksycoca database. The user can -also manually rebuild ksycoca by running the kbuildsycoca program. +tdesycoca will still be built when kded starts up and when applications +explicitly request a rebuild of the tdesycoca database. The user can +also manually rebuild tdesycoca by running the kbuildsycoca program. The default value of this option is "true". Checking can be disabled by setting this option to "false". diff --git a/kded/kbuildimageiofactory.cpp b/kded/kbuildimageiofactory.cpp index a0a3ce76e..267af31f6 100644 --- a/kded/kbuildimageiofactory.cpp +++ b/kded/kbuildimageiofactory.cpp @@ -16,8 +16,8 @@ * Boston, MA 02110-1301, USA. **/ -#include "ksycoca.h" -#include "ksycocadict.h" +#include "tdesycoca.h" +#include "tdesycocadict.h" #include "kresourcelist.h" #include diff --git a/kded/kbuildimageiofactory.h b/kded/kbuildimageiofactory.h index 65197e17f..4a1caa81f 100644 --- a/kded/kbuildimageiofactory.h +++ b/kded/kbuildimageiofactory.h @@ -23,7 +23,7 @@ #include /** - * Service group factory for building ksycoca + * Service group factory for building tdesycoca * @internal */ class KBuildImageIOFactory : public KImageIOFactory diff --git a/kded/kbuildprotocolinfofactory.cpp b/kded/kbuildprotocolinfofactory.cpp index c17b1e772..f3fe698d4 100644 --- a/kded/kbuildprotocolinfofactory.cpp +++ b/kded/kbuildprotocolinfofactory.cpp @@ -17,8 +17,8 @@ **/ #include "kbuildprotocolinfofactory.h" -#include "ksycoca.h" -#include "ksycocadict.h" +#include "tdesycoca.h" +#include "tdesycocadict.h" #include "kresourcelist.h" #include diff --git a/kded/kbuildprotocolinfofactory.h b/kded/kbuildprotocolinfofactory.h index e4ddcf6b8..4230670f4 100644 --- a/kded/kbuildprotocolinfofactory.h +++ b/kded/kbuildprotocolinfofactory.h @@ -24,7 +24,7 @@ #include /** - * Protocol Info factory for building ksycoca + * Protocol Info factory for building tdesycoca * @internal */ class KBuildProtocolInfoFactory : public KProtocolInfoFactory diff --git a/kded/kbuildservicefactory.cpp b/kded/kbuildservicefactory.cpp index 8cc2e9462..7d9406d36 100644 --- a/kded/kbuildservicefactory.cpp +++ b/kded/kbuildservicefactory.cpp @@ -18,8 +18,8 @@ **/ #include "kbuildservicefactory.h" -#include "ksycoca.h" -#include "ksycocadict.h" +#include "tdesycoca.h" +#include "tdesycocadict.h" #include "kresourcelist.h" #include "kmimetype.h" diff --git a/kded/kbuildservicefactory.h b/kded/kbuildservicefactory.h index eca439c5d..e0497bb9e 100644 --- a/kded/kbuildservicefactory.h +++ b/kded/kbuildservicefactory.h @@ -29,7 +29,7 @@ #include /** - * Service factory for building ksycoca + * Service factory for building tdesycoca * @internal */ class KBuildServiceFactory : public KServiceFactory diff --git a/kded/kbuildservicegroupfactory.cpp b/kded/kbuildservicegroupfactory.cpp index e231cd5da..76f27ba57 100644 --- a/kded/kbuildservicegroupfactory.cpp +++ b/kded/kbuildservicegroupfactory.cpp @@ -17,8 +17,8 @@ **/ #include "kbuildservicegroupfactory.h" -#include "ksycoca.h" -#include "ksycocadict.h" +#include "tdesycoca.h" +#include "tdesycocadict.h" #include "kresourcelist.h" #include diff --git a/kded/kbuildservicegroupfactory.h b/kded/kbuildservicegroupfactory.h index 23666fd0f..23b484cdb 100644 --- a/kded/kbuildservicegroupfactory.h +++ b/kded/kbuildservicegroupfactory.h @@ -24,7 +24,7 @@ #include /** - * Service group factory for building ksycoca + * Service group factory for building tdesycoca * @internal */ class KBuildServiceGroupFactory : public KServiceGroupFactory diff --git a/kded/kbuildservicetypefactory.cpp b/kded/kbuildservicetypefactory.cpp index c017a91e1..351b7847a 100644 --- a/kded/kbuildservicetypefactory.cpp +++ b/kded/kbuildservicetypefactory.cpp @@ -17,8 +17,8 @@ **/ #include "kbuildservicetypefactory.h" -#include "ksycoca.h" -#include "ksycocadict.h" +#include "tdesycoca.h" +#include "tdesycocadict.h" #include "kresourcelist.h" #include diff --git a/kded/kbuildservicetypefactory.h b/kded/kbuildservicetypefactory.h index a68b8851b..68fb6c8fb 100644 --- a/kded/kbuildservicetypefactory.h +++ b/kded/kbuildservicetypefactory.h @@ -24,7 +24,7 @@ #include /** - * Service-type factory for building ksycoca + * Service-type factory for building tdesycoca * @internal */ class KBuildServiceTypeFactory : public KServiceTypeFactory diff --git a/kded/kbuildsycoca.cpp b/kded/kbuildsycoca.cpp index 59ff8bc18..13a645395 100644 --- a/kded/kbuildsycoca.cpp +++ b/kded/kbuildsycoca.cpp @@ -104,15 +104,15 @@ static TQString sycocaPath() if (bGlobalDatabase) { - path = TDEGlobal::dirs()->saveLocation("services")+"ksycoca"; + path = TDEGlobal::dirs()->saveLocation("services")+"tdesycoca"; } else { - TQCString ksycoca_env = getenv("TDESYCOCA"); - if (ksycoca_env.isEmpty()) - path = TDEGlobal::dirs()->saveLocation("cache")+"ksycoca"; + TQCString tdesycoca_env = getenv("TDESYCOCA"); + if (tdesycoca_env.isEmpty()) + path = TDEGlobal::dirs()->saveLocation("cache")+"tdesycoca"; else - path = TQFile::decodeName(ksycoca_env); + path = TQFile::decodeName(tdesycoca_env); } return path; @@ -120,9 +120,9 @@ static TQString sycocaPath() static TQString oldSycocaPath() { - TQCString ksycoca_env = getenv("TDESYCOCA"); - if (ksycoca_env.isEmpty()) - return TDEGlobal::dirs()->saveLocation("tmp")+"ksycoca"; + TQCString tdesycoca_env = getenv("TDESYCOCA"); + if (tdesycoca_env.isEmpty()) + return TDEGlobal::dirs()->saveLocation("tmp")+"tdesycoca"; return TQString::null; } @@ -487,7 +487,7 @@ bool KBuildSycoca::recreate() m_str = database->dataStream(); - kdDebug(7021) << "Recreating ksycoca file (" << path << ", version " << KSycoca::version() << ")" << endl; + kdDebug(7021) << "Recreating tdesycoca file (" << path << ", version " << KSycoca::version() << ")" << endl; // It is very important to build the servicetype one first // Both are registered in KSycoca, no need to keep the pointers @@ -527,9 +527,9 @@ bool KBuildSycoca::recreate() { // update the timestamp file TQString stamppath = path + "stamp"; - TQFile ksycocastamp(stamppath); - ksycocastamp.open( IO_WriteOnly ); - TQDataStream str( &ksycocastamp ); + TQFile tdesycocastamp(stamppath); + tdesycocastamp.open( IO_WriteOnly ); + TQDataStream str( &tdesycocastamp ); str << newTimestamp; str << existingResourceDirs(); if (g_vfolder) @@ -566,7 +566,7 @@ void KBuildSycoca::save() (*m_str) << TDEGlobal::dirs()->kfsstnd_prefixes(); (*m_str) << newTimestamp; (*m_str) << TDEGlobal::locale()->language(); - (*m_str) << TDEGlobal::dirs()->calcResourceHash("services", "update_ksycoca", true); + (*m_str) << TDEGlobal::dirs()->calcResourceHash("services", "update_tdesycoca", true); (*m_str) << (*g_allResourceDirs); // Write factory data.... @@ -636,10 +636,10 @@ bool KBuildSycoca::checkDirTimestamps( const TQString& dirname, const TQDateTime return true; } -// check times of last modification of all files on which ksycoca depens, +// check times of last modification of all files on which tdesycoca depens, // and also their directories -// if all of them all older than the timestamp in file ksycocastamp, this -// means that there's no need to rebuild ksycoca +// if all of them all older than the timestamp in file tdesycocastamp, this +// means that there's no need to rebuild tdesycoca bool KBuildSycoca::checkTimestamps( TQ_UINT32 timestamp, const TQStringList &dirs ) { kdDebug( 7021 ) << "checking file timestamps" << endl; @@ -663,7 +663,7 @@ TQStringList KBuildSycoca::existingResourceDirs() return *dirs; dirs = new TQStringList; g_allResourceDirs = new TQStringList; - // these are all resources cached by ksycoca + // these are all resources cached by tdesycoca TQStringList resources; resources += KBuildServiceTypeFactory::resourceTypes(); resources += KBuildServiceGroupFactory::resourceTypes(); @@ -805,12 +805,12 @@ extern "C" KDE_EXPORT int kdemain(int argc, char **argv) { KSycoca::self()->disableAutoRebuild(); // Prevent deadlock TQString current_language = TDEGlobal::locale()->language(); - TQString ksycoca_language = KSycoca::self()->language(); - TQ_UINT32 current_update_sig = TDEGlobal::dirs()->calcResourceHash("services", "update_ksycoca", true); - TQ_UINT32 ksycoca_update_sig = KSycoca::self()->updateSignature(); + TQString tdesycoca_language = KSycoca::self()->language(); + TQ_UINT32 current_update_sig = TDEGlobal::dirs()->calcResourceHash("services", "update_tdesycoca", true); + TQ_UINT32 tdesycoca_update_sig = KSycoca::self()->updateSignature(); - if ((current_update_sig != ksycoca_update_sig) || - (current_language != ksycoca_language) || + if ((current_update_sig != tdesycoca_update_sig) || + (current_language != tdesycoca_language) || (KSycoca::self()->timeStamp() == 0)) { incremental = false; @@ -829,10 +829,10 @@ extern "C" KDE_EXPORT int kdemain(int argc, char **argv) TQString path = sycocaPath()+"stamp"; TQCString qPath = TQFile::encodeName(path); cSycocaPath = qPath.data(); // Delete timestamps on crash - TQFile ksycocastamp(path); - if( ksycocastamp.open( IO_ReadOnly )) + TQFile tdesycocastamp(path); + if( tdesycocastamp.open( IO_ReadOnly )) { - TQDataStream str( &ksycocastamp ); + TQDataStream str( &tdesycocastamp ); if (!str.atEnd()) str >> filestamp; if (!str.atEnd()) @@ -870,7 +870,7 @@ extern "C" KDE_EXPORT int kdemain(int argc, char **argv) g_ctimeDict = 0; if (incremental) { - tqWarning("[kbuildsycoca] Reusing existing ksycoca."); + tqWarning("[kbuildsycoca] Reusing existing tdesycoca."); KSycoca *oldSycoca = KSycoca::self(); KSycocaFactoryList *factories = new KSycocaFactoryList; g_allEntries = new KSycocaEntryListList; @@ -940,11 +940,11 @@ extern "C" KDE_EXPORT int kdemain(int argc, char **argv) if (args->isSet("signal")) { - // Notify ALL applications that have a ksycoca object, using a broadcast + // Notify ALL applications that have a tdesycoca object, using a broadcast TQByteArray data; TQDataStream stream(data, IO_WriteOnly); stream << *g_changeList; - dcopClient->send( "*", "ksycoca", "notifyDatabaseChanged(TQStringList)", data ); + dcopClient->send( "*", "tdesycoca", "notifyDatabaseChanged(TQStringList)", data ); } #ifdef KBUILDSYCOCA_GUI diff --git a/kded/kbuildsycoca.h b/kded/kbuildsycoca.h index f98001781..443f5b120 100644 --- a/kded/kbuildsycoca.h +++ b/kded/kbuildsycoca.h @@ -25,9 +25,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include #include "vfolder_menu.h" @@ -80,7 +80,7 @@ protected: bool build(); /** - * Save the ksycoca file + * Save the tdesycoca file */ void save(); diff --git a/kded/kctimefactory.cpp b/kded/kctimefactory.cpp index 966966a48..f6fd68859 100644 --- a/kded/kctimefactory.cpp +++ b/kded/kctimefactory.cpp @@ -17,8 +17,8 @@ **/ #include "kctimefactory.h" -#include "ksycoca.h" -#include "ksycocatype.h" +#include "tdesycoca.h" +#include "tdesycocatype.h" #include diff --git a/kded/kctimefactory.h b/kded/kctimefactory.h index 64cfe6c19..d415545b1 100644 --- a/kded/kctimefactory.h +++ b/kded/kctimefactory.h @@ -19,11 +19,11 @@ #ifndef __k_ctime_factory_h__ #define __k_ctime_factory_h__ -#include +#include #include /** - * Service group factory for building ksycoca + * Service group factory for building tdesycoca * @internal */ class KCTimeInfo : public KSycocaFactory diff --git a/kded/kded.cpp b/kded/kded.cpp index d06c44c38..11c46e064 100644 --- a/kded/kded.cpp +++ b/kded/kded.cpp @@ -104,11 +104,11 @@ Kded::Kded(bool checkUpdates, bool new_startup) { _self = this; TQCString cPath; - TQCString ksycoca_env = getenv("TDESYCOCA"); - if (ksycoca_env.isEmpty()) - cPath = TQFile::encodeName(TDEGlobal::dirs()->saveLocation("tmp")+"ksycoca"); + TQCString tdesycoca_env = getenv("TDESYCOCA"); + if (tdesycoca_env.isEmpty()) + cPath = TQFile::encodeName(TDEGlobal::dirs()->saveLocation("tmp")+"tdesycoca"); else - cPath = ksycoca_env; + cPath = tdesycoca_env; m_pTimer = new TQTimer(this); connect(m_pTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(recreate())); @@ -139,7 +139,7 @@ bool Kded::process(const TQCString &obj, const TQCString &fun, const TQByteArray &data, TQCString &replyType, TQByteArray &replyData) { - if (obj == "ksycoca") return false; // Ignore this one. + if (obj == "tdesycoca") return false; // Ignore this one. if (m_dontLoad[obj]) return false; @@ -484,7 +484,7 @@ void Kded::recreate(bool initial) recreateDone(); if(delayedCheck) { - // do a proper ksycoca check after a delay + // do a proper tdesycoca check after a delay TQTimer::singleShot( 60000, this, TQT_SLOT( runDelayedCheck())); m_needDelayedCheck = true; delayedCheck = false; @@ -961,7 +961,7 @@ extern "C" KDE_EXPORT int kdemain(int argc, char *argv[]) // anyway, because it was too early, so let's send this signal // unconditionnally (David) TQByteArray data; - client->send( "*", "ksycoca", "notifyDatabaseChanged()", data ); + client->send( "*", "tdesycoca", "notifyDatabaseChanged()", data ); client->send( "ksplash", "", "upAndRunning(TQString)", TQString("kded")); #ifdef Q_WS_X11 XEvent e; diff --git a/kded/kded.h b/kded/kded.h index b30549083..93aac0ab6 100644 --- a/kded/kded.h +++ b/kded/kded.h @@ -29,8 +29,8 @@ #include #include -#include -#include +#include +#include #include #include -- cgit v1.2.1 From 5159cd2beb2e87806a5b54e9991b7895285c9d3e Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sun, 27 Jan 2013 01:04:16 -0600 Subject: Rename a number of libraries and executables to avoid conflicts with KDE4 --- kded/CMakeLists.txt | 30 +- kded/DESIGN | 4 +- kded/Makefile.am | 22 +- kded/README.kded | 16 +- kded/kbuildsycoca.cpp | 959 ------------------------------------------------ kded/kbuildsycoca.h | 104 ------ kded/kde-menu.cpp | 171 --------- kded/kded.cpp | 16 +- kded/kded.h | 2 +- kded/kdedmodule.cpp | 2 +- kded/kmimelist.cpp | 54 --- kded/tde-menu.cpp | 171 +++++++++ kded/tdebuildsycoca.cpp | 959 ++++++++++++++++++++++++++++++++++++++++++++++++ kded/tdebuildsycoca.h | 104 ++++++ kded/tdemimelist.cpp | 54 +++ 15 files changed, 1334 insertions(+), 1334 deletions(-) delete mode 100644 kded/kbuildsycoca.cpp delete mode 100644 kded/kbuildsycoca.h delete mode 100644 kded/kde-menu.cpp delete mode 100644 kded/kmimelist.cpp create mode 100644 kded/tde-menu.cpp create mode 100644 kded/tdebuildsycoca.cpp create mode 100644 kded/tdebuildsycoca.h create mode 100644 kded/tdemimelist.cpp (limited to 'kded') diff --git a/kded/CMakeLists.txt b/kded/CMakeLists.txt index 903126ca8..ee693fb4a 100644 --- a/kded/CMakeLists.txt +++ b/kded/CMakeLists.txt @@ -18,8 +18,8 @@ include_directories( ${CMAKE_SOURCE_DIR}/dcop ${CMAKE_SOURCE_DIR}/tdecore ${CMAKE_SOURCE_DIR}/tdeui - ${CMAKE_SOURCE_DIR}/kio - ${CMAKE_SOURCE_DIR}/kio/kio + ${CMAKE_SOURCE_DIR}/tdeio + ${CMAKE_SOURCE_DIR}/tdeio/tdeio ) link_directories( @@ -51,16 +51,16 @@ set( ${target}_SRCS # modules need this library tde_add_tdeinit_executable( ${target} AUTOMOC EXPORT SOURCES ${${target}_SRCS} - LINK kio-shared + LINK tdeio-shared ) -#### kbuildsycoca ############################### +#### tdebuildsycoca ############################### -set( target kbuildsycoca ) +set( target tdebuildsycoca ) set( ${target}_SRCS - kbuildsycoca.cpp kbuildservicetypefactory.cpp + tdebuildsycoca.cpp kbuildservicetypefactory.cpp kbuildservicefactory.cpp kbuildservicegroupfactory.cpp kbuildimageiofactory.cpp kbuildprotocolinfofactory.cpp kctimefactory.cpp vfolder_menu.cpp @@ -68,7 +68,7 @@ set( ${target}_SRCS tde_add_tdeinit_executable( ${target} AUTOMOC SOURCES ${${target}_SRCS} - LINK kio-shared + LINK tdeio-shared ) @@ -87,31 +87,31 @@ tde_add_executable( ${target} ) -#### kde-menu ################################### +#### tde-menu ################################### -set( target kde-menu ) +set( target tde-menu ) set( ${target}_SRCS - kde-menu.cpp + tde-menu.cpp ) tde_add_executable( ${target} SOURCES ${${target}_SRCS} - LINK kio-shared + LINK tdeio-shared DESTINATION ${BIN_INSTALL_DIR} ) -#### kmimelist ################################## +#### tdemimelist ################################## -set( target kmimelist ) +set( target tdemimelist ) set( ${target}_SRCS - kmimelist.cpp + tdemimelist.cpp ) tde_add_executable( ${target} SOURCES ${${target}_SRCS} - LINK kio-shared + LINK tdeio-shared DESTINATION ${BIN_INSTALL_DIR} ) diff --git a/kded/DESIGN b/kded/DESIGN index e6653807b..0fffb0456 100644 --- a/kded/DESIGN +++ b/kded/DESIGN @@ -6,9 +6,9 @@ cache of servicetypes, mimetypes and services, for a particular user. It uses KDirWatch to monitor the directories contain the .desktop files. When a file is added/removed, it waits 5 seconds (in case of series of -updates), and then launches kbuildsycoca. +updates), and then launches tdebuildsycoca. -kbuildsycoca recreates the sycoca file by: +tdebuildsycoca recreates the sycoca file by: * parsing all .desktop files, replacing global ones by local ones (at any level of the hierarchy) * creating all objects in memory diff --git a/kded/Makefile.am b/kded/Makefile.am index 1baf30e4f..093b5db0e 100644 --- a/kded/Makefile.am +++ b/kded/Makefile.am @@ -20,15 +20,15 @@ INCLUDES= -I$(srcdir)/.. -I$(top_srcdir) $(all_includes) lib_LTLIBRARIES = -tdeinit_LTLIBRARIES = kded.la kbuildsycoca.la +tdeinit_LTLIBRARIES = kded.la tdebuildsycoca.la kded_la_LDFLAGS = $(all_libraries) -module -avoid-version kded_la_LIBADD = $(LIB_KIO) $(LIB_QT) $(LIB_TDECORE) $(top_builddir)/dcop/libDCOP.la $(LIB_X11) kded_la_SOURCES = kded.cpp kdedmodule.cpp -kbuildsycoca_la_LDFLAGS = $(all_libraries) -module -avoid-version -kbuildsycoca_la_LIBADD = $(LIB_KIO) $(LIB_QT) $(top_builddir)/dcop/libDCOP.la $(LIB_TDECORE) -kbuildsycoca_la_SOURCES = kbuildsycoca.cpp kbuildservicetypefactory.cpp \ +tdebuildsycoca_la_LDFLAGS = $(all_libraries) -module -avoid-version +tdebuildsycoca_la_LIBADD = $(LIB_KIO) $(LIB_QT) $(top_builddir)/dcop/libDCOP.la $(LIB_TDECORE) +tdebuildsycoca_la_SOURCES = tdebuildsycoca.cpp kbuildservicetypefactory.cpp \ kbuildservicefactory.cpp \ kbuildservicegroupfactory.cpp \ kbuildimageiofactory.cpp \ @@ -36,25 +36,25 @@ kbuildsycoca_la_SOURCES = kbuildsycoca.cpp kbuildservicetypefactory.cpp \ kctimefactory.cpp \ vfolder_menu.cpp -bin_PROGRAMS = kdontchangethehostname kde-menu kmimelist +bin_PROGRAMS = kdontchangethehostname tde-menu tdemimelist kdontchangethehostname_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor kdontchangethehostname_LDADD = $(LIB_TDECORE) kdontchangethehostname_SOURCES = khostname.cpp -kmimelist_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -kmimelist_LDADD = ../kio/libkio.la -kmimelist_SOURCES = kmimelist.cpp +tdemimelist_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor +tdemimelist_LDADD = ../tdeio/libtdeio.la +tdemimelist_SOURCES = tdemimelist.cpp kde_menu_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor kde_menu_LDADD = $(LIB_KIO) -kde_menu_SOURCES = kde-menu.cpp +kde_menu_SOURCES = tde-menu.cpp METASOURCES = AUTO include_HEADERS = kdedmodule.h -noinst_HEADERS = kbuildsycoca.h kbuildservicetypefactory.h \ +noinst_HEADERS = tdebuildsycoca.h kbuildservicetypefactory.h \ kbuildservicefactory.h kbuildservicegroupfactory.h \ kbuildimageiofactory.h kresourcelist.h \ kbuildprotocolinfofactory.h @@ -65,7 +65,7 @@ servicetypedir = $(kde_servicetypesdir) xdg_menu_DATA = applications.menu applications.menu-no-kde update_DATA = kded.upd -updatedir = $(kde_datadir)/kconf_update +updatedir = $(kde_datadir)/tdeconf_update include $(top_srcdir)/admin/Doxyfile.am diff --git a/kded/README.kded b/kded/README.kded index 1cf382279..7265a1084 100644 --- a/kded/README.kded +++ b/kded/README.kded @@ -7,19 +7,19 @@ Some of these tasks are built in, others are started on demand. Built in tasks ============== *) Checking for newly installed software and updating tdesycoca when new -software is detected. Updating of tdesycoca is done by the program kbuildsycoca +software is detected. Updating of tdesycoca is done by the program tdebuildsycoca which gets started by kded. When kded is first started it always runs -kbuildsycoca to ensure that tdesycoca is up to date. +tdebuildsycoca to ensure that tdesycoca is up to date. *) Checking for newly installed update files. Applications can install *.upd update files. These *.upd files are used to update configuration files of users, primarily when new versions of applications are installed with (slightly) different configuration file formats. Updating of configuration -files is done by kconf_update. kded starts kconf_update when it detects a -new update file. When kded is first started it always runs kconf_update to -ensure that it has not missed any update files. kconf_update keeps track +files is done by tdeconf_update. kded starts tdeconf_update when it detects a +new update file. When kded is first started it always runs tdeconf_update to +ensure that it has not missed any update files. tdeconf_update keeps track of which update files have been processed already in the config-file -kconf_updaterc. It only performs a certain update once. +tdeconf_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 @@ -42,12 +42,12 @@ and has a default of 5000 (5 seconds). CheckSycoca: This option can be used to disable checking for new software. tdesycoca will still be built when kded starts up and when applications explicitly request a rebuild of the tdesycoca database. The user can -also manually rebuild tdesycoca by running the kbuildsycoca program. +also manually rebuild tdesycoca by running the tdebuildsycoca program. The default value of this option is "true". Checking can be disabled by setting this option to "false". CheckUpdates: This option can be used to disable checking for update files. -kconf_update will still be run when kded starts up. +tdeconf_update will still be run when kded starts up. The default value of this option is "true". Checking can be disabled by setting this option to "false". diff --git a/kded/kbuildsycoca.cpp b/kded/kbuildsycoca.cpp deleted file mode 100644 index 13a645395..000000000 --- a/kded/kbuildsycoca.cpp +++ /dev/null @@ -1,959 +0,0 @@ -/* This file is part of the KDE libraries - * Copyright (C) 1999 David Faure - * Copyright (C) 2002-2003 Waldo Bastian - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License version 2 as published by the Free Software Foundation; - * - * This library 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - **/ - -#include -#include -#include - -#include "kbuildsycoca.h" -#include "kresourcelist.h" -#include "vfolder_menu.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef KBUILDSYCOCA_GUI // KBUILDSYCOCA_GUI is used on win32 to build - // GUI version of kbuildsycoca, so-called "kbuildsycocaw". -# include -# include - bool silent; - bool showprogress; -#endif - -#include -#include -#include -#include // auto_ptr - -typedef TQDict KBSEntryDict; -typedef TQValueList KSycocaEntryListList; - -static TQ_UINT32 newTimestamp = 0; - -static KBuildServiceFactory *g_bsf = 0; -static KBuildServiceGroupFactory *g_bsgf = 0; -static KSycocaFactory *g_factory = 0; -static KCTimeInfo *g_ctimeInfo = 0; -static TQDict *g_ctimeDict = 0; -static const char *g_resource = 0; -static KBSEntryDict *g_entryDict = 0; -static KBSEntryDict *g_serviceGroupEntryDict = 0; -static KSycocaEntryListList *g_allEntries = 0; -static TQStringList *g_changeList = 0; -static TQStringList *g_allResourceDirs = 0; -static bool g_changed = false; -static KSycocaEntry::List g_tempStorage; -static VFolderMenu *g_vfolder = 0; - -static const char *cSycocaPath = 0; - -static bool bGlobalDatabase = false; -static bool bMenuTest = false; - -void crashHandler(int) -{ - // If we crash while reading sycoca, we delete the database - // in an attempt to recover. - if (cSycocaPath) - unlink(cSycocaPath); -} - -static TQString sycocaPath() -{ - TQString path; - - if (bGlobalDatabase) - { - path = TDEGlobal::dirs()->saveLocation("services")+"tdesycoca"; - } - else - { - TQCString tdesycoca_env = getenv("TDESYCOCA"); - if (tdesycoca_env.isEmpty()) - path = TDEGlobal::dirs()->saveLocation("cache")+"tdesycoca"; - else - path = TQFile::decodeName(tdesycoca_env); - } - - return path; -} - -static TQString oldSycocaPath() -{ - TQCString tdesycoca_env = getenv("TDESYCOCA"); - if (tdesycoca_env.isEmpty()) - return TDEGlobal::dirs()->saveLocation("tmp")+"tdesycoca"; - - return TQString::null; -} - -KBuildSycoca::KBuildSycoca() - : KSycoca( true ) -{ -} - -KBuildSycoca::~KBuildSycoca() -{ - -} - -void KBuildSycoca::processGnomeVfs() -{ - TQString file = locate("app-reg", "gnome-vfs.applications"); - if (file.isEmpty()) - { -// kdDebug(7021) << "gnome-vfs.applications not found." << endl; - return; - } - - TQString app; - - char line[1024*64]; - - FILE *f = fopen(TQFile::encodeName(file), "r"); - while (!feof(f)) - { - if (!fgets(line, sizeof(line)-1, f)) - { - break; - } - - if (line[0] != '\t') - { - app = TQString::fromLatin1(line); - app.truncate(app.length()-1); - } - else if (strncmp(line+1, "mime_types=", 11) == 0) - { - TQString mimetypes = TQString::fromLatin1(line+12); - mimetypes.truncate(mimetypes.length()-1); - mimetypes.replace(TQRegExp("\\*"), "all"); - KService *s = g_bsf->findServiceByName(app); - if (!s) - continue; - - TQStringList &serviceTypes = s->accessServiceTypes(); - if (serviceTypes.count() <= 1) - { - serviceTypes += TQStringList::split(',', mimetypes); -// kdDebug(7021) << "Adding gnome mimetypes for '" << app << "'.\n"; -// kdDebug(7021) << "ServiceTypes=" << s->serviceTypes().join(":") << endl; - } - } - } - fclose( f ); -} - -KSycocaEntry *KBuildSycoca::createEntry(const TQString &file, bool addToFactory) -{ - TQ_UINT32 timeStamp = g_ctimeInfo->ctime(file); - if (!timeStamp) - { - timeStamp = TDEGlobal::dirs()->calcResourceHash( g_resource, file, true); - } - KSycocaEntry* entry = 0; - if (g_allEntries) - { - assert(g_ctimeDict); - TQ_UINT32 *timeP = (*g_ctimeDict)[file]; - TQ_UINT32 oldTimestamp = timeP ? *timeP : 0; - - if (timeStamp && (timeStamp == oldTimestamp)) - { - // Re-use old entry - if (g_factory == g_bsgf) // Strip .directory from service-group entries - { - entry = g_entryDict->find(file.left(file.length()-10)); - } - else if (g_factory == g_bsf) - { - entry = g_entryDict->find(file); - } - else - { - entry = g_entryDict->find(file); - } - // remove from g_ctimeDict; if g_ctimeDict is not empty - // after all files have been processed, it means - // some files were removed since last time - g_ctimeDict->remove( file ); - } - else if (oldTimestamp) - { - g_changed = true; - kdDebug(7021) << "modified: " << file << endl; - } - else - { - g_changed = true; - kdDebug(7021) << "new: " << file << endl; - } - } - g_ctimeInfo->addCTime(file, timeStamp ); - if (!entry) - { - // Create a new entry - entry = g_factory->createEntry( file, g_resource ); - } - if ( entry && entry->isValid() ) - { - if (addToFactory) - g_factory->addEntry( entry, g_resource ); - else - g_tempStorage.append(entry); - return entry; - } - return 0; -} - -void KBuildSycoca::slotCreateEntry(const TQString &file, KService **service) -{ - KSycocaEntry *entry = createEntry(file, false); - *service = dynamic_cast(entry); -} - -// returns false if the database is up to date -bool KBuildSycoca::build() -{ - typedef TQPtrList KBSEntryDictList; - KBSEntryDictList *entryDictList = 0; - KBSEntryDict *serviceEntryDict = 0; - - entryDictList = new KBSEntryDictList(); - // Convert for each factory the entryList to a Dict. - int i = 0; - // For each factory - for (KSycocaFactory *factory = m_lstFactories->first(); - factory; - factory = m_lstFactories->next() ) - { - KBSEntryDict *entryDict = new KBSEntryDict(); - if (g_allEntries) - { - KSycocaEntry::List list = (*g_allEntries)[i++]; - for( KSycocaEntry::List::Iterator it = list.begin(); - it != list.end(); - ++it) - { - entryDict->insert( (*it)->entryPath(), static_cast(*it)); - } - } - if (factory == g_bsf) - serviceEntryDict = entryDict; - else if (factory == g_bsgf) - g_serviceGroupEntryDict = entryDict; - entryDictList->append(entryDict); - } - - TQStringList allResources; - // For each factory - for (KSycocaFactory *factory = m_lstFactories->first(); - factory; - factory = m_lstFactories->next() ) - { - // For each resource the factory deals with - const KSycocaResourceList *list = factory->resourceList(); - if (!list) continue; - - for( KSycocaResourceList::ConstIterator it1 = list->begin(); - it1 != list->end(); - ++it1 ) - { - KSycocaResource res = (*it1); - if (!allResources.contains(res.resource)) - allResources.append(res.resource); - } - } - - g_ctimeInfo = new KCTimeInfo(); // This is a build factory too, don't delete!! - bool uptodate = true; - // For all resources - for( TQStringList::ConstIterator it1 = allResources.begin(); - it1 != allResources.end(); - ++it1 ) - { - g_changed = false; - g_resource = (*it1).ascii(); - - TQStringList relFiles; - - (void) TDEGlobal::dirs()->findAllResources( g_resource, - TQString::null, - true, // Recursive! - true, // uniq - relFiles); - - - // Now find all factories that use this resource.... - // For each factory - g_entryDict = entryDictList->first(); - for (g_factory = m_lstFactories->first(); - g_factory; - g_factory = m_lstFactories->next(), - g_entryDict = entryDictList->next() ) - { - // For each resource the factory deals with - const KSycocaResourceList *list = g_factory->resourceList(); - if (!list) continue; - - for( KSycocaResourceList::ConstIterator it2 = list->begin(); - it2 != list->end(); - ++it2 ) - { - KSycocaResource res = (*it2); - if (res.resource != (*it1)) continue; - - // For each file in the resource - for( TQStringList::ConstIterator it3 = relFiles.begin(); - it3 != relFiles.end(); - ++it3 ) - { - // Check if file matches filter - if ((*it3).endsWith(res.extension)) - createEntry(*it3, true); - } - } - if ((g_factory == g_bsf) && (strcmp(g_resource, "services") == 0)) - processGnomeVfs(); - } - if (g_changed || !g_allEntries) - { - uptodate = false; - g_changeList->append(g_resource); - } - } - - bool result = !uptodate || !g_ctimeDict->isEmpty(); - - if (result || bMenuTest) - { - g_resource = "apps"; - g_factory = g_bsf; - g_entryDict = serviceEntryDict; - g_changed = false; - - g_vfolder = new VFolderMenu; - if (!m_trackId.isEmpty()) - g_vfolder->setTrackId(m_trackId); - - connect(g_vfolder, TQT_SIGNAL(newService(const TQString &, KService **)), - this, TQT_SLOT(slotCreateEntry(const TQString &, KService **))); - - VFolderMenu::SubMenu *kdeMenu = g_vfolder->parseMenu("applications.menu", true); - - KServiceGroup *entry = g_bsgf->addNew("/", kdeMenu->directoryFile, 0, false); - entry->setLayoutInfo(kdeMenu->layoutList); - createMenu(TQString::null, TQString::null, kdeMenu); - - KServiceGroup::Ptr g(entry); - - (void) existingResourceDirs(); - *g_allResourceDirs += g_vfolder->allDirectories(); - - disconnect(g_vfolder, TQT_SIGNAL(newService(const TQString &, KService **)), - this, TQT_SLOT(slotCreateEntry(const TQString &, KService **))); - - if (g_changed || !g_allEntries) - { - uptodate = false; - g_changeList->append(g_resource); - } - if (bMenuTest) - return false; - } - - return result; -} - -void KBuildSycoca::createMenu(TQString caption, TQString name, VFolderMenu::SubMenu *menu) -{ - for(VFolderMenu::SubMenu *subMenu = menu->subMenus.first(); subMenu; subMenu = menu->subMenus.next()) - { - TQString subName = name+subMenu->name+"/"; - - TQString directoryFile = subMenu->directoryFile; - if (directoryFile.isEmpty()) - directoryFile = subName+".directory"; - TQ_UINT32 timeStamp = g_ctimeInfo->ctime(directoryFile); - if (!timeStamp) - { - timeStamp = TDEGlobal::dirs()->calcResourceHash( g_resource, directoryFile, true); - } - - KServiceGroup* entry = 0; - if (g_allEntries) - { - TQ_UINT32 *timeP = (*g_ctimeDict)[directoryFile]; - TQ_UINT32 oldTimestamp = timeP ? *timeP : 0; - - if (timeStamp && (timeStamp == oldTimestamp)) - { - entry = dynamic_cast (g_serviceGroupEntryDict->find(subName)); - if (entry && (entry->directoryEntryPath() != directoryFile)) - entry = 0; // Can't reuse this one! - } - } - g_ctimeInfo->addCTime(directoryFile, timeStamp); - - entry = g_bsgf->addNew(subName, subMenu->directoryFile, entry, subMenu->isDeleted); - entry->setLayoutInfo(subMenu->layoutList); - if (! (bMenuTest && entry->noDisplay()) ) - createMenu(caption + entry->caption() + "/", subName, subMenu); - } - if (caption.isEmpty()) - caption += "/"; - if (name.isEmpty()) - name += "/"; - for(TQDictIterator it(menu->items); it.current(); ++it) - { - if (bMenuTest) - { - if (!menu->isDeleted && !it.current()->noDisplay()) - printf("%s\t%s\t%s\n", caption.local8Bit().data(), it.current()->menuId().local8Bit().data(), locate("apps", it.current()->desktopEntryPath()).local8Bit().data()); - } - else - { - g_bsf->addEntry( it.current(), g_resource ); - g_bsgf->addNewEntryTo(name, it.current()); - } - } -} - -bool KBuildSycoca::recreate() -{ - TQString path(sycocaPath()); -#ifdef Q_WS_WIN - printf("kbuildsycoca: path='%s'\n", (const char*)path); -#endif - - // KSaveFile first writes to a temp file. - // Upon close() it moves the stuff to the right place. - std::auto_ptr database( new KSaveFile(path) ); - if (database->status() == EACCES && TQFile::exists(path)) - { - TQFile::remove( path ); - database.reset( new KSaveFile(path) ); // try again - } - if (database->status() != 0) - { - fprintf(stderr, "[kbuildsycoca] ERROR creating database '%s'! %s\n", path.local8Bit().data(),strerror(database->status())); -#ifdef KBUILDSYCOCA_GUI // KBUILDSYCOCA_GUI is used on win32 to build - // GUI version of kbuildsycoca, so-called "kbuildsycocaw". - if (!silent) - KMessageBox::error(0, i18n("Error creating database '%1'.\nCheck that the permissions are correct on the directory and the disk is not full.\n").arg(path.local8Bit().data()), i18n("KBuildSycoca")); -#endif - return false; - } - - m_str = database->dataStream(); - - kdDebug(7021) << "Recreating tdesycoca file (" << path << ", version " << KSycoca::version() << ")" << endl; - - // It is very important to build the servicetype one first - // Both are registered in KSycoca, no need to keep the pointers - KSycocaFactory *stf = new KBuildServiceTypeFactory; - g_bsgf = new KBuildServiceGroupFactory(); - g_bsf = new KBuildServiceFactory(stf, g_bsgf); - (void) new KBuildImageIOFactory(); - (void) new KBuildProtocolInfoFactory(); - - if( build()) // Parse dirs - { - save(); // Save database - if (m_str->device()->status()) - database->abort(); // Error - m_str = 0L; - if (!database->close()) - { - fprintf(stderr, "[kbuildsycoca] ERROR writing database '%s'!\n", database->name().local8Bit().data()); - fprintf(stderr, "[kbuildsycoca] Disk full?\n"); -#ifdef KBUILDSYCOCA_GUI - if (!silent) - KMessageBox::error(0, i18n("[kbuildsycoca] Error writing database '%1'.\nCheck that the permissions are correct on the directory and the disk is not full.\n").arg(path.local8Bit().data()), i18n("KBuildSycoca")); -#endif - return false; - } - } - else - { - m_str = 0L; - database->abort(); - if (bMenuTest) - return true; - kdDebug(7021) << "Database is up to date" << endl; - } - - if (!bGlobalDatabase) - { - // update the timestamp file - TQString stamppath = path + "stamp"; - TQFile tdesycocastamp(stamppath); - tdesycocastamp.open( IO_WriteOnly ); - TQDataStream str( &tdesycocastamp ); - str << newTimestamp; - str << existingResourceDirs(); - if (g_vfolder) - str << g_vfolder->allDirectories(); // Extra resource dirs - } - return true; -} - -void KBuildSycoca::save() -{ - // Write header (#pass 1) - m_str->device()->at(0); - - (*m_str) << (TQ_INT32) KSycoca::version(); - KSycocaFactory * servicetypeFactory = 0L; - KSycocaFactory * serviceFactory = 0L; - for(KSycocaFactory *factory = m_lstFactories->first(); - factory; - factory = m_lstFactories->next()) - { - TQ_INT32 aId; - TQ_INT32 aOffset; - aId = factory->factoryId(); - if ( aId == KST_KServiceTypeFactory ) - servicetypeFactory = factory; - else if ( aId == KST_KServiceFactory ) - serviceFactory = factory; - aOffset = factory->offset(); - (*m_str) << aId; - (*m_str) << aOffset; - } - (*m_str) << (TQ_INT32) 0; // No more factories. - // Write TDEDIRS - (*m_str) << TDEGlobal::dirs()->kfsstnd_prefixes(); - (*m_str) << newTimestamp; - (*m_str) << TDEGlobal::locale()->language(); - (*m_str) << TDEGlobal::dirs()->calcResourceHash("services", "update_tdesycoca", true); - (*m_str) << (*g_allResourceDirs); - - // Write factory data.... - for(KSycocaFactory *factory = m_lstFactories->first(); - factory; - factory = m_lstFactories->next()) - { - factory->save(*m_str); - if (m_str->device()->status()) - return; // error - } - - int endOfData = m_str->device()->at(); - - // Write header (#pass 2) - m_str->device()->at(0); - - (*m_str) << (TQ_INT32) KSycoca::version(); - for(KSycocaFactory *factory = m_lstFactories->first(); - factory; - factory = m_lstFactories->next()) - { - TQ_INT32 aId; - TQ_INT32 aOffset; - aId = factory->factoryId(); - aOffset = factory->offset(); - (*m_str) << aId; - (*m_str) << aOffset; - } - (*m_str) << (TQ_INT32) 0; // No more factories. - - // Jump to end of database - m_str->device()->at(endOfData); -} - -bool KBuildSycoca::checkDirTimestamps( const TQString& dirname, const TQDateTime& stamp, bool top ) -{ - if( top ) - { - TQFileInfo inf( dirname ); - if( inf.lastModified() > stamp ) - { - kdDebug( 7021 ) << "timestamp changed:" << dirname << endl; - return false; - } - } - TQDir dir( dirname ); - const TQFileInfoList *list = dir.entryInfoList( TQDir::DefaultFilter, TQDir::Unsorted ); - if (!list) - return true; - - for( TQFileInfoListIterator it( *list ); - it.current() != NULL; - ++it ) - { - TQFileInfo* fi = it.current(); - if( fi->fileName() == "." || fi->fileName() == ".." ) - continue; - if( fi->lastModified() > stamp ) - { - kdDebug( 7201 ) << "timestamp changed:" << fi->filePath() << endl; - return false; - } - if( fi->isDir() && !checkDirTimestamps( fi->filePath(), stamp, false )) - return false; - } - return true; -} - -// check times of last modification of all files on which tdesycoca depens, -// and also their directories -// if all of them all older than the timestamp in file tdesycocastamp, this -// means that there's no need to rebuild tdesycoca -bool KBuildSycoca::checkTimestamps( TQ_UINT32 timestamp, const TQStringList &dirs ) -{ - kdDebug( 7021 ) << "checking file timestamps" << endl; - TQDateTime stamp; - stamp.setTime_t( timestamp ); - for( TQStringList::ConstIterator it = dirs.begin(); - it != dirs.end(); - ++it ) - { - if( !checkDirTimestamps( *it, stamp, true )) - return false; - } - kdDebug( 7021 ) << "timestamps check ok" << endl; - return true; -} - -TQStringList KBuildSycoca::existingResourceDirs() -{ - static TQStringList* dirs = NULL; - if( dirs != NULL ) - return *dirs; - dirs = new TQStringList; - g_allResourceDirs = new TQStringList; - // these are all resources cached by tdesycoca - TQStringList resources; - resources += KBuildServiceTypeFactory::resourceTypes(); - resources += KBuildServiceGroupFactory::resourceTypes(); - resources += KBuildServiceFactory::resourceTypes(); - resources += KBuildImageIOFactory::resourceTypes(); - resources += KBuildProtocolInfoFactory::resourceTypes(); - while( !resources.empty()) - { - TQString res = resources.front(); - *dirs += TDEGlobal::dirs()->resourceDirs( res.latin1()); - resources.remove( res ); // remove this 'res' and all its duplicates - } - - *g_allResourceDirs = *dirs; - - for( TQStringList::Iterator it = dirs->begin(); - it != dirs->end(); ) - { - TQFileInfo inf( *it ); - if( !inf.exists() || !inf.isReadable() ) - it = dirs->remove( it ); - else - ++it; - } - return *dirs; -} - -static KCmdLineOptions options[] = { - { "nosignal", I18N_NOOP("Do not signal applications to update"), 0 }, - { "noincremental", I18N_NOOP("Disable incremental update, re-read everything"), 0 }, - { "checkstamps", I18N_NOOP("Check file timestamps"), 0 }, - { "nocheckfiles", I18N_NOOP("Disable checking files (dangerous)"), 0 }, - { "global", I18N_NOOP("Create global database"), 0 }, - { "menutest", I18N_NOOP("Perform menu generation test run only"), 0 }, - { "track ", I18N_NOOP("Track menu id for debug purposes"), 0 }, -#ifdef KBUILDSYCOCA_GUI - { "silent", I18N_NOOP("Silent - work without windows and stderr"), 0 }, - { "showprogress", I18N_NOOP("Show progress information (even if 'silent' mode is on)"), 0 }, -#endif - KCmdLineLastOption -}; - -static const char appName[] = "kbuildsycoca"; -static const char appVersion[] = "1.1"; - -class WaitForSignal : public QObject -{ -public: - ~WaitForSignal() { kapp->eventLoop()->exitLoop(); } -}; - -extern "C" KDE_EXPORT int kdemain(int argc, char **argv) -{ - KLocale::setMainCatalogue("tdelibs"); - TDEAboutData d(appName, I18N_NOOP("KBuildSycoca"), appVersion, - I18N_NOOP("Rebuilds the system configuration cache."), - TDEAboutData::License_GPL, "(c) 1999-2002 KDE Developers"); - d.addAuthor("David Faure", I18N_NOOP("Author"), "faure@kde.org"); - d.addAuthor("Waldo Bastian", I18N_NOOP("Author"), "bastian@kde.org"); - - TDECmdLineArgs::init(argc, argv, &d); - TDECmdLineArgs::addCmdLineOptions(options); - TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs(); - bGlobalDatabase = args->isSet("global"); - bMenuTest = args->isSet("menutest"); - - if (bGlobalDatabase) - { - setenv("TDEHOME", "-", 1); - setenv("TDEROOTHOME", "-", 1); - } - - TDEApplication::disableAutoDcopRegistration(); -#ifdef KBUILDSYCOCA_GUI - TDEApplication k; -#else - TDEApplication k(false, false); -#endif - k.disableSessionManagement(); - -#ifdef KBUILDSYCOCA_GUI - silent = args->isSet("silent"); - showprogress = args->isSet("showprogress"); - TQLabel progress( TQString("


%1
").arg( i18n("Reloading TDE configuration, please wait...") ), 0, "", Qt::WType_Dialog | Qt::WStyle_DialogBorder | Qt::WStyle_Customize| Qt::WStyle_Title ); - TQString capt = i18n("TDE Configuration Manager"); - if (!silent) { - if (KMessageBox::No == KMessageBox::questionYesNo(0, i18n("Do you want to reload TDE configuration?"), capt, i18n("Reload"), i18n("Do Not Reload"))) - return 0; - } - if (!silent || showprogress) { - progress.setCaption( capt ); - progress.show(); - } -#endif - - KCrash::setCrashHandler(KCrash::defaultCrashHandler); - KCrash::setEmergencySaveFunction(crashHandler); - KCrash::setApplicationName(TQString(appName)); - - // this program is in tdelibs so it uses tdelibs as catalog - KLocale::setMainCatalogue("tdelibs"); - // force generating of KLocale object. if not, the database will get - // be translated - TDEGlobal::locale(); - TDEGlobal::dirs()->addResourceType("app-reg", "share/application-registry" ); - - DCOPClient *dcopClient = new DCOPClient(); - - while(true) - { - TQCString registeredName = dcopClient->registerAs(appName, false); - if (registeredName.isEmpty()) - { - fprintf(stderr, "[kbuildsycoca] Warning: %s is unable to register with DCOP.\n", appName); - break; - } - else if (registeredName == appName) - { - break; // Go - } - fprintf(stderr, "[kbuildsycoca] Waiting for already running %s to finish.\n", appName); - - dcopClient->setNotifications( true ); - while (dcopClient->isApplicationRegistered(appName)) - { - WaitForSignal *obj = new WaitForSignal; - obj->connect(dcopClient, TQT_SIGNAL(applicationRemoved(const TQCString &)), - TQT_SLOT(deleteLater())); - kapp->eventLoop()->enterLoop(); - } - dcopClient->setNotifications( false ); - } - fprintf(stderr, "[kbuildsycoca] %s running...\n", appName); - - bool checkfiles = bGlobalDatabase || args->isSet("checkfiles"); - - bool incremental = !bGlobalDatabase && args->isSet("incremental") && checkfiles; - if (incremental || !checkfiles) - { - KSycoca::self()->disableAutoRebuild(); // Prevent deadlock - TQString current_language = TDEGlobal::locale()->language(); - TQString tdesycoca_language = KSycoca::self()->language(); - TQ_UINT32 current_update_sig = TDEGlobal::dirs()->calcResourceHash("services", "update_tdesycoca", true); - TQ_UINT32 tdesycoca_update_sig = KSycoca::self()->updateSignature(); - - if ((current_update_sig != tdesycoca_update_sig) || - (current_language != tdesycoca_language) || - (KSycoca::self()->timeStamp() == 0)) - { - incremental = false; - checkfiles = true; - delete KSycoca::self(); - } - } - - g_changeList = new TQStringList; - - bool checkstamps = incremental && args->isSet("checkstamps") && checkfiles; - TQ_UINT32 filestamp = 0; - TQStringList oldresourcedirs; - if( checkstamps && incremental ) - { - TQString path = sycocaPath()+"stamp"; - TQCString qPath = TQFile::encodeName(path); - cSycocaPath = qPath.data(); // Delete timestamps on crash - TQFile tdesycocastamp(path); - if( tdesycocastamp.open( IO_ReadOnly )) - { - TQDataStream str( &tdesycocastamp ); - if (!str.atEnd()) - str >> filestamp; - if (!str.atEnd()) - { - str >> oldresourcedirs; - if( oldresourcedirs != KBuildSycoca::existingResourceDirs()) - checkstamps = false; - } - else - { - checkstamps = false; - } - if (!str.atEnd()) - { - TQStringList extraResourceDirs; - str >> extraResourceDirs; - oldresourcedirs += extraResourceDirs; - } - } - else - { - checkstamps = false; - } - cSycocaPath = 0; - } - - newTimestamp = (TQ_UINT32) time(0); - - if( checkfiles && ( !checkstamps || !KBuildSycoca::checkTimestamps( filestamp, oldresourcedirs ))) - { - TQCString qSycocaPath = TQFile::encodeName(sycocaPath()); - cSycocaPath = qSycocaPath.data(); - - g_allEntries = 0; - g_ctimeDict = 0; - if (incremental) - { - tqWarning("[kbuildsycoca] Reusing existing tdesycoca."); - KSycoca *oldSycoca = KSycoca::self(); - KSycocaFactoryList *factories = new KSycocaFactoryList; - g_allEntries = new KSycocaEntryListList; - g_ctimeDict = new TQDict(523); - - // Must be in same order as in KBuildSycoca::recreate()! - factories->append( new KServiceTypeFactory ); - factories->append( new KServiceGroupFactory ); - factories->append( new KServiceFactory ); - factories->append( new KImageIOFactory ); - factories->append( new KProtocolInfoFactory ); - - // For each factory - for (KSycocaFactory *factory = factories->first(); - factory; - factory = factories->next() ) - { - KSycocaEntry::List list; - list = factory->allEntries(); - g_allEntries->append( list ); - } - delete factories; factories = 0; - KCTimeInfo *ctimeInfo = new KCTimeInfo; - ctimeInfo->fillCTimeDict(*g_ctimeDict); - delete oldSycoca; - } - cSycocaPath = 0; - - KBuildSycoca *sycoca= new KBuildSycoca; // Build data base - if (args->isSet("track")) - sycoca->setTrackId(TQString::fromLocal8Bit(args->getOption("track"))); - if (!sycoca->recreate()) { -#ifdef KBUILDSYCOCA_GUI - if (!silent || showprogress) - progress.close(); -#endif - return -1; - } - - if (bGlobalDatabase) - { - // These directories may have been created with 0700 permission - // better delete them if they are empty - TQString applnkDir = TDEGlobal::dirs()->saveLocation("apps", TQString::null, false); - ::rmdir(TQFile::encodeName(applnkDir)); - TQString servicetypesDir = TDEGlobal::dirs()->saveLocation("servicetypes", TQString::null, false); - ::rmdir(TQFile::encodeName(servicetypesDir)); - } - } - - if (!bGlobalDatabase) - { - // Recreate compatibility symlink - TQString oldPath = oldSycocaPath(); - if (!oldPath.isEmpty()) - { - KTempFile tmp; - if (tmp.status() == 0) - { - TQString tmpFile = tmp.name(); - tmp.unlink(); - symlink(TQFile::encodeName(sycocaPath()), TQFile::encodeName(tmpFile)); - rename(TQFile::encodeName(tmpFile), TQFile::encodeName(oldPath)); - } - } - } - - if (args->isSet("signal")) - { - // Notify ALL applications that have a tdesycoca object, using a broadcast - TQByteArray data; - TQDataStream stream(data, IO_WriteOnly); - stream << *g_changeList; - dcopClient->send( "*", "tdesycoca", "notifyDatabaseChanged(TQStringList)", data ); - } - -#ifdef KBUILDSYCOCA_GUI - if (!silent) { - progress.close(); - KMessageBox::information(0, i18n("[kbuildsycoca] Configuration information reloaded successfully."), capt); - } -#endif - return 0; -} - -#include "kbuildsycoca.moc" diff --git a/kded/kbuildsycoca.h b/kded/kbuildsycoca.h deleted file mode 100644 index 443f5b120..000000000 --- a/kded/kbuildsycoca.h +++ /dev/null @@ -1,104 +0,0 @@ -/* This file is part of the KDE libraries - * Copyright (C) 1999 David Faure - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License version 2 as published by the Free Software Foundation; - * - * This library 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - **/ -#ifndef __kbuildsycoca_h__ -#define __kbuildsycoca_h__ - -#include - -#include -#include -#include - -#include -#include -#include -#include -#include - -#include "vfolder_menu.h" - -class TQDataStream; - -// No need for this in libkio - apps only get readonly access -class KBuildSycoca : public KSycoca -{ - Q_OBJECT -public: - KBuildSycoca(); - virtual ~KBuildSycoca(); - - /** - * Recreate the database file - */ - bool recreate(); - - static bool checkTimestamps( TQ_UINT32 timestamp, const TQStringList &dirs ); - - static TQStringList existingResourceDirs(); - - void setTrackId(const TQString &id) { m_trackId = id; } - -protected slots: - void slotCreateEntry(const TQString &file, KService **entry); - -protected: - - /** - * Look up gnome mimetypes. - */ - void processGnomeVfs(); - - /** - * Add single entry to the sycoca database. - * Either from a previous database or regenerated from file. - */ - KSycocaEntry *createEntry(const TQString &file, bool addToFactory); - - /** - * Convert a VFolderMenu::SubMenu to KServiceGroups. - */ - void createMenu(TQString caption, TQString name, VFolderMenu::SubMenu *menu); - - /** - * Build the whole system cache, from .desktop files - */ - bool build(); - - /** - * Save the tdesycoca file - */ - void save(); - - /** - * Clear the factories - */ - void clear(); - - static bool checkDirTimestamps( const TQString& dir, const TQDateTime& stamp, bool top ); - - /** - * @internal - * @return true if building (i.e. if a KBuildSycoca); - */ - virtual bool isBuilding() { return true; } - - TQStringList m_allResourceDirs; - TQString m_trackId; -}; - -#endif diff --git a/kded/kde-menu.cpp b/kded/kde-menu.cpp deleted file mode 100644 index 5c1a38b4d..000000000 --- a/kded/kde-menu.cpp +++ /dev/null @@ -1,171 +0,0 @@ -/* This file is part of the KDE libraries - * Copyright (C) 2003 Waldo Bastian - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License version 2 as published by the Free Software Foundation; - * - * This library 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - **/ - -#include - -#include - -#include -#include - -#include "kaboutdata.h" -#include "kapplication.h" -#include "kcmdlineargs.h" -#include "kglobal.h" -#include "klocale.h" -#include "kservice.h" -#include "kservicegroup.h" -#include "kstandarddirs.h" - -static KCmdLineOptions options[] = { - { "utf8", I18N_NOOP("Output data in UTF-8 instead of local encoding"), 0 }, - { "print-menu-id", I18N_NOOP("Print menu-id of the menu that contains\nthe application"), 0 }, - { "print-menu-name", I18N_NOOP("Print menu name (caption) of the menu that\ncontains the application"), 0 }, - { "highlight", I18N_NOOP("Highlight the entry in the menu"), 0 }, - { "nocache-update", I18N_NOOP("Do not check if sycoca database is up to date"), 0 }, - { "+", I18N_NOOP("The id of the menu entry to locate"), 0 }, - KCmdLineLastOption -}; - -static const char appName[] = "kde-menu"; -static const char appVersion[] = "1.0"; -static bool utf8; - -static bool bPrintMenuId; -static bool bPrintMenuName; -static bool bHighlight; - -static void result(const TQString &txt) -{ - if (utf8) - puts( txt.utf8() ); - else - puts( txt.local8Bit() ); -} - -static void error(int exitCode, const TQString &txt) -{ - tqWarning("kde-menu: %s", txt.local8Bit().data()); - exit(exitCode); -} - -static void findMenuEntry(KServiceGroup::Ptr parent, const TQString &name, const TQString &menuId) -{ - KServiceGroup::List list = parent->entries(true, true, false); - KServiceGroup::List::ConstIterator it = list.begin(); - for (; it != list.end(); ++it) - { - KSycocaEntry * e = *it; - - if (e->isType(KST_KServiceGroup)) - { - KServiceGroup::Ptr g(static_cast(e)); - - findMenuEntry(g, name.isEmpty() ? g->caption() : name+"/"+g->caption(), menuId); - } - else if (e->isType(KST_KService)) - { - KService::Ptr s(static_cast(e)); - if (s->menuId() == menuId) - { - if (bPrintMenuId) - { - result(parent->relPath()); - } - if (bPrintMenuName) - { - result(name); - } - if (bHighlight) - { - DCOPRef kicker( "kicker", "kicker" ); - bool result = kicker.call( "highlightMenuItem", menuId ); - if (!result) - error(3, TQString(i18n("Menu item '%1' could not be highlighted.").arg(menuId)).local8Bit()); - } - exit(0); - } - } - } -} - - -int main(int argc, char **argv) -{ - KLocale::setMainCatalogue("tdelibs"); - const char *description = I18N_NOOP("TDE Menu query tool.\n" - "This tool can be used to find in which menu a specific application is shown.\n" - "The --highlight option can be used to visually indicate to the user where\n" - "in the TDE menu a specific application is located."); - - TDEAboutData d(appName, I18N_NOOP("kde-menu"), appVersion, - description, - TDEAboutData::License_GPL, "(c) 2003 Waldo Bastian"); - d.addAuthor("Waldo Bastian", I18N_NOOP("Author"), "bastian@kde.org"); - - TDECmdLineArgs::init(argc, argv, &d); - TDECmdLineArgs::addCmdLineOptions(options); - -// TDEApplication k(false, false); - TDEApplication k(false); - k.disableSessionManagement(); - - // this program is in tdelibs so it uses tdelibs as catalog - KLocale::setMainCatalogue("tdelibs"); - - TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs(); - if (args->count() != 1) - TDECmdLineArgs::usage(i18n("You must specify an application-id such as 'tde-konsole.desktop'")); - - utf8 = args->isSet("utf8"); - - bPrintMenuId = args->isSet("print-menu-id"); - bPrintMenuName = args->isSet("print-menu-name"); - bHighlight = args->isSet("highlight"); - - if (!bPrintMenuId && !bPrintMenuName && !bHighlight) - TDECmdLineArgs::usage(i18n("You must specify at least one of --print-menu-id, --print-menu-name or --highlight")); - - if (args->isSet("cache-update")) - { - TQStringList args; - args.append("--incremental"); - args.append("--checkstamps"); - TQString command = "kbuildsycoca"; - TQCString _launcher = TDEApplication::launcher(); - if (!DCOPRef(_launcher, _launcher).call("tdeinit_exec_wait", command, args).isValid()) - { - tqWarning("Can't talk to klauncher!"); - command = TDEGlobal::dirs()->findExe(command); - command += " " + args.join(" "); - system(command.local8Bit()); - } - } - - TQString menuId = TQFile::decodeName(args->arg(0)); - KService::Ptr s = KService::serviceByMenuId(menuId); - - if (!s) - error(1, i18n("No menu item '%1'.").arg(menuId)); - - findMenuEntry(KServiceGroup::root(), "", menuId); - - error(2, i18n("Menu item '%1' not found in menu.").arg(menuId)); - return 2; -} - diff --git a/kded/kded.cpp b/kded/kded.cpp index 11c46e064..b769fa508 100644 --- a/kded/kded.cpp +++ b/kded/kded.cpp @@ -45,7 +45,7 @@ #include #include #include -#include +#include #include #ifdef Q_WS_X11 @@ -65,27 +65,27 @@ static void runBuildSycoca(TQObject *callBackObj=0, const char *callBackSlot=0) if(checkStamps) args.append("--checkstamps"); if(delayedCheck) - args.append("--nocheckfiles"); + args.append("--nochectdefiles"); else checkStamps = false; // useful only during kded startup if (callBackObj) { TQByteArray data; TQDataStream dataStream( data, IO_WriteOnly ); - dataStream << TQString("kbuildsycoca") << args; + dataStream << TQString("tdebuildsycoca") << args; TQCString _launcher = TDEApplication::launcher(); kapp->dcopClient()->callAsync(_launcher, _launcher, "tdeinit_exec_wait(TQString,TQStringList)", data, callBackObj, callBackSlot); } else { - TDEApplication::tdeinitExecWait( "kbuildsycoca", args ); + TDEApplication::tdeinitExecWait( "tdebuildsycoca", args ); } } static void runKonfUpdate() { - TDEApplication::tdeinitExecWait( "kconf_update", TQStringList(), 0, 0, "0" /*no startup notification*/ ); + TDEApplication::tdeinitExecWait( "tdeconf_update", TQStringList(), 0, 0, "0" /*no startup notification*/ ); } static void runDontChangeHostname(const TQCString &oldName, const TQCString &newName) @@ -97,7 +97,7 @@ static void runDontChangeHostname(const TQCString &oldName, const TQCString &new } Kded::Kded(bool checkUpdates, bool new_startup) - : DCOPObject("kbuildsycoca"), DCOPObjectProxy(), + : DCOPObject("tdebuildsycoca"), DCOPObjectProxy(), b_checkUpdates(checkUpdates), m_needDelayedCheck(false), m_newStartup( new_startup ) @@ -665,7 +665,7 @@ KUpdateD::KUpdateD() TQObject::connect( m_pDirWatch, TQT_SIGNAL(dirty(const TQString&)), this, TQT_SLOT(slotNewUpdateFile())); - TQStringList dirs = TDEGlobal::dirs()->findDirs("data", "kconf_update"); + TQStringList dirs = TDEGlobal::dirs()->findDirs("data", "tdeconf_update"); for( TQStringList::ConstIterator it = dirs.begin(); it != dirs.end(); ++it ) @@ -957,7 +957,7 @@ extern "C" KDE_EXPORT int kdemain(int argc, char *argv[]) // During startup kdesktop waits for KDED to finish. // Send a notifyDatabaseChanged signal even if the database hasn't // changed. - // If the database changed, kbuildsycoca's signal didn't go anywhere + // If the database changed, tdebuildsycoca's signal didn't go anywhere // anyway, because it was too early, so let's send this signal // unconditionnally (David) TQByteArray data; diff --git a/kded/kded.h b/kded/kded.h index 93aac0ab6..a4968624a 100644 --- a/kded/kded.h +++ b/kded/kded.h @@ -37,7 +37,7 @@ class KDirWatch; class KService; -// No need for this in libkio - apps only get readonly access +// No need for this in libtdeio - apps only get readonly access class Kded : public TQObject, public DCOPObject, public DCOPObjectProxy { Q_OBJECT diff --git a/kded/kdedmodule.cpp b/kded/kdedmodule.cpp index ca28a5c62..6371b2534 100644 --- a/kded/kdedmodule.cpp +++ b/kded/kdedmodule.cpp @@ -24,7 +24,7 @@ #include "kded.h" #include "kdedmodule.h" -#include "kconfigdata.h" +#include "tdeconfigdata.h" typedef TQMap > KDEDObjectMap; diff --git a/kded/kmimelist.cpp b/kded/kmimelist.cpp deleted file mode 100644 index c82f6d9f7..000000000 --- a/kded/kmimelist.cpp +++ /dev/null @@ -1,54 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include - -int main(int argc, char *argv[]) -{ - TDEApplication k(argc,argv,"blurb",false); - - KMimeType::List mtl = KMimeType::allMimeTypes( ); - assert( mtl.count() ); - tqDebug( "Found %d mime types.", mtl.count() ); - TQValueListIterator it(mtl.begin()); - KServiceTypeProfile::OfferList ol; - - for (; it != mtl.end(); ++it) - { - { - // Application - printf( "APP:%s:", (*it)->name().latin1() ); - ol = KServiceTypeProfile::offers((*it)->name(), "Application"); - TQValueListIterator it2(ol.begin()); - for (; it2 != ol.end(); ++it2) { - if ((*it2).allowAsDefault()) - printf( " %s", (*it2).service()->desktopEntryPath().ascii() ); - - } - printf( "\n" ); - } - - { - // Embedded - printf( "PART:%s:", (*it)->name().latin1() ); - ol = KServiceTypeProfile::offers((*it)->name(), "KParts/ReadOnlyPart"); - TQValueListIterator it2(ol.begin()); - for (; it2 != ol.end(); ++it2) { - if ((*it2).allowAsDefault()) - printf( " %s", (*it2).service()->desktopEntryPath().ascii() ); - - } - printf( "\n" ); - } - } -} - diff --git a/kded/tde-menu.cpp b/kded/tde-menu.cpp new file mode 100644 index 000000000..6a8721915 --- /dev/null +++ b/kded/tde-menu.cpp @@ -0,0 +1,171 @@ +/* This file is part of the KDE libraries + * Copyright (C) 2003 Waldo Bastian + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License version 2 as published by the Free Software Foundation; + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + **/ + +#include + +#include + +#include +#include + +#include "kaboutdata.h" +#include "kapplication.h" +#include "kcmdlineargs.h" +#include "kglobal.h" +#include "klocale.h" +#include "kservice.h" +#include "kservicegroup.h" +#include "kstandarddirs.h" + +static KCmdLineOptions options[] = { + { "utf8", I18N_NOOP("Output data in UTF-8 instead of local encoding"), 0 }, + { "print-menu-id", I18N_NOOP("Print menu-id of the menu that contains\nthe application"), 0 }, + { "print-menu-name", I18N_NOOP("Print menu name (caption) of the menu that\ncontains the application"), 0 }, + { "highlight", I18N_NOOP("Highlight the entry in the menu"), 0 }, + { "nocache-update", I18N_NOOP("Do not check if sycoca database is up to date"), 0 }, + { "+", I18N_NOOP("The id of the menu entry to locate"), 0 }, + KCmdLineLastOption +}; + +static const char appName[] = "tde-menu"; +static const char appVersion[] = "1.0"; +static bool utf8; + +static bool bPrintMenuId; +static bool bPrintMenuName; +static bool bHighlight; + +static void result(const TQString &txt) +{ + if (utf8) + puts( txt.utf8() ); + else + puts( txt.local8Bit() ); +} + +static void error(int exitCode, const TQString &txt) +{ + tqWarning("tde-menu: %s", txt.local8Bit().data()); + exit(exitCode); +} + +static void findMenuEntry(KServiceGroup::Ptr parent, const TQString &name, const TQString &menuId) +{ + KServiceGroup::List list = parent->entries(true, true, false); + KServiceGroup::List::ConstIterator it = list.begin(); + for (; it != list.end(); ++it) + { + KSycocaEntry * e = *it; + + if (e->isType(KST_KServiceGroup)) + { + KServiceGroup::Ptr g(static_cast(e)); + + findMenuEntry(g, name.isEmpty() ? g->caption() : name+"/"+g->caption(), menuId); + } + else if (e->isType(KST_KService)) + { + KService::Ptr s(static_cast(e)); + if (s->menuId() == menuId) + { + if (bPrintMenuId) + { + result(parent->relPath()); + } + if (bPrintMenuName) + { + result(name); + } + if (bHighlight) + { + DCOPRef kicker( "kicker", "kicker" ); + bool result = kicker.call( "highlightMenuItem", menuId ); + if (!result) + error(3, TQString(i18n("Menu item '%1' could not be highlighted.").arg(menuId)).local8Bit()); + } + exit(0); + } + } + } +} + + +int main(int argc, char **argv) +{ + KLocale::setMainCatalogue("tdelibs"); + const char *description = I18N_NOOP("TDE Menu query tool.\n" + "This tool can be used to find in which menu a specific application is shown.\n" + "The --highlight option can be used to visually indicate to the user where\n" + "in the TDE menu a specific application is located."); + + TDEAboutData d(appName, I18N_NOOP("tde-menu"), appVersion, + description, + TDEAboutData::License_GPL, "(c) 2003 Waldo Bastian"); + d.addAuthor("Waldo Bastian", I18N_NOOP("Author"), "bastian@kde.org"); + + TDECmdLineArgs::init(argc, argv, &d); + TDECmdLineArgs::addCmdLineOptions(options); + +// TDEApplication k(false, false); + TDEApplication k(false); + k.disableSessionManagement(); + + // this program is in tdelibs so it uses tdelibs as catalog + KLocale::setMainCatalogue("tdelibs"); + + TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs(); + if (args->count() != 1) + TDECmdLineArgs::usage(i18n("You must specify an application-id such as 'tde-konsole.desktop'")); + + utf8 = args->isSet("utf8"); + + bPrintMenuId = args->isSet("print-menu-id"); + bPrintMenuName = args->isSet("print-menu-name"); + bHighlight = args->isSet("highlight"); + + if (!bPrintMenuId && !bPrintMenuName && !bHighlight) + TDECmdLineArgs::usage(i18n("You must specify at least one of --print-menu-id, --print-menu-name or --highlight")); + + if (args->isSet("cache-update")) + { + TQStringList args; + args.append("--incremental"); + args.append("--checkstamps"); + TQString command = "tdebuildsycoca"; + TQCString _launcher = TDEApplication::launcher(); + if (!DCOPRef(_launcher, _launcher).call("tdeinit_exec_wait", command, args).isValid()) + { + tqWarning("Can't talk to tdelauncher!"); + command = TDEGlobal::dirs()->findExe(command); + command += " " + args.join(" "); + system(command.local8Bit()); + } + } + + TQString menuId = TQFile::decodeName(args->arg(0)); + KService::Ptr s = KService::serviceByMenuId(menuId); + + if (!s) + error(1, i18n("No menu item '%1'.").arg(menuId)); + + findMenuEntry(KServiceGroup::root(), "", menuId); + + error(2, i18n("Menu item '%1' not found in menu.").arg(menuId)); + return 2; +} + diff --git a/kded/tdebuildsycoca.cpp b/kded/tdebuildsycoca.cpp new file mode 100644 index 000000000..47b7a9bf4 --- /dev/null +++ b/kded/tdebuildsycoca.cpp @@ -0,0 +1,959 @@ +/* This file is part of the KDE libraries + * Copyright (C) 1999 David Faure + * Copyright (C) 2002-2003 Waldo Bastian + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License version 2 as published by the Free Software Foundation; + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + **/ + +#include +#include +#include + +#include "tdebuildsycoca.h" +#include "kresourcelist.h" +#include "vfolder_menu.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef KBUILDSYCOCA_GUI // KBUILDSYCOCA_GUI is used on win32 to build + // GUI version of tdebuildsycoca, so-called "tdebuildsycocaw". +# include +# include + bool silent; + bool showprogress; +#endif + +#include +#include +#include +#include // auto_ptr + +typedef TQDict KBSEntryDict; +typedef TQValueList KSycocaEntryListList; + +static TQ_UINT32 newTimestamp = 0; + +static KBuildServiceFactory *g_bsf = 0; +static KBuildServiceGroupFactory *g_bsgf = 0; +static KSycocaFactory *g_factory = 0; +static KCTimeInfo *g_ctimeInfo = 0; +static TQDict *g_ctimeDict = 0; +static const char *g_resource = 0; +static KBSEntryDict *g_entryDict = 0; +static KBSEntryDict *g_serviceGroupEntryDict = 0; +static KSycocaEntryListList *g_allEntries = 0; +static TQStringList *g_changeList = 0; +static TQStringList *g_allResourceDirs = 0; +static bool g_changed = false; +static KSycocaEntry::List g_tempStorage; +static VFolderMenu *g_vfolder = 0; + +static const char *cSycocaPath = 0; + +static bool bGlobalDatabase = false; +static bool bMenuTest = false; + +void crashHandler(int) +{ + // If we crash while reading sycoca, we delete the database + // in an attempt to recover. + if (cSycocaPath) + unlink(cSycocaPath); +} + +static TQString sycocaPath() +{ + TQString path; + + if (bGlobalDatabase) + { + path = TDEGlobal::dirs()->saveLocation("services")+"tdesycoca"; + } + else + { + TQCString tdesycoca_env = getenv("TDESYCOCA"); + if (tdesycoca_env.isEmpty()) + path = TDEGlobal::dirs()->saveLocation("cache")+"tdesycoca"; + else + path = TQFile::decodeName(tdesycoca_env); + } + + return path; +} + +static TQString oldSycocaPath() +{ + TQCString tdesycoca_env = getenv("TDESYCOCA"); + if (tdesycoca_env.isEmpty()) + return TDEGlobal::dirs()->saveLocation("tmp")+"tdesycoca"; + + return TQString::null; +} + +KBuildSycoca::KBuildSycoca() + : KSycoca( true ) +{ +} + +KBuildSycoca::~KBuildSycoca() +{ + +} + +void KBuildSycoca::processGnomeVfs() +{ + TQString file = locate("app-reg", "gnome-vfs.applications"); + if (file.isEmpty()) + { +// kdDebug(7021) << "gnome-vfs.applications not found." << endl; + return; + } + + TQString app; + + char line[1024*64]; + + FILE *f = fopen(TQFile::encodeName(file), "r"); + while (!feof(f)) + { + if (!fgets(line, sizeof(line)-1, f)) + { + break; + } + + if (line[0] != '\t') + { + app = TQString::fromLatin1(line); + app.truncate(app.length()-1); + } + else if (strncmp(line+1, "mime_types=", 11) == 0) + { + TQString mimetypes = TQString::fromLatin1(line+12); + mimetypes.truncate(mimetypes.length()-1); + mimetypes.replace(TQRegExp("\\*"), "all"); + KService *s = g_bsf->findServiceByName(app); + if (!s) + continue; + + TQStringList &serviceTypes = s->accessServiceTypes(); + if (serviceTypes.count() <= 1) + { + serviceTypes += TQStringList::split(',', mimetypes); +// kdDebug(7021) << "Adding gnome mimetypes for '" << app << "'.\n"; +// kdDebug(7021) << "ServiceTypes=" << s->serviceTypes().join(":") << endl; + } + } + } + fclose( f ); +} + +KSycocaEntry *KBuildSycoca::createEntry(const TQString &file, bool addToFactory) +{ + TQ_UINT32 timeStamp = g_ctimeInfo->ctime(file); + if (!timeStamp) + { + timeStamp = TDEGlobal::dirs()->calcResourceHash( g_resource, file, true); + } + KSycocaEntry* entry = 0; + if (g_allEntries) + { + assert(g_ctimeDict); + TQ_UINT32 *timeP = (*g_ctimeDict)[file]; + TQ_UINT32 oldTimestamp = timeP ? *timeP : 0; + + if (timeStamp && (timeStamp == oldTimestamp)) + { + // Re-use old entry + if (g_factory == g_bsgf) // Strip .directory from service-group entries + { + entry = g_entryDict->find(file.left(file.length()-10)); + } + else if (g_factory == g_bsf) + { + entry = g_entryDict->find(file); + } + else + { + entry = g_entryDict->find(file); + } + // remove from g_ctimeDict; if g_ctimeDict is not empty + // after all files have been processed, it means + // some files were removed since last time + g_ctimeDict->remove( file ); + } + else if (oldTimestamp) + { + g_changed = true; + kdDebug(7021) << "modified: " << file << endl; + } + else + { + g_changed = true; + kdDebug(7021) << "new: " << file << endl; + } + } + g_ctimeInfo->addCTime(file, timeStamp ); + if (!entry) + { + // Create a new entry + entry = g_factory->createEntry( file, g_resource ); + } + if ( entry && entry->isValid() ) + { + if (addToFactory) + g_factory->addEntry( entry, g_resource ); + else + g_tempStorage.append(entry); + return entry; + } + return 0; +} + +void KBuildSycoca::slotCreateEntry(const TQString &file, KService **service) +{ + KSycocaEntry *entry = createEntry(file, false); + *service = dynamic_cast(entry); +} + +// returns false if the database is up to date +bool KBuildSycoca::build() +{ + typedef TQPtrList KBSEntryDictList; + KBSEntryDictList *entryDictList = 0; + KBSEntryDict *serviceEntryDict = 0; + + entryDictList = new KBSEntryDictList(); + // Convert for each factory the entryList to a Dict. + int i = 0; + // For each factory + for (KSycocaFactory *factory = m_lstFactories->first(); + factory; + factory = m_lstFactories->next() ) + { + KBSEntryDict *entryDict = new KBSEntryDict(); + if (g_allEntries) + { + KSycocaEntry::List list = (*g_allEntries)[i++]; + for( KSycocaEntry::List::Iterator it = list.begin(); + it != list.end(); + ++it) + { + entryDict->insert( (*it)->entryPath(), static_cast(*it)); + } + } + if (factory == g_bsf) + serviceEntryDict = entryDict; + else if (factory == g_bsgf) + g_serviceGroupEntryDict = entryDict; + entryDictList->append(entryDict); + } + + TQStringList allResources; + // For each factory + for (KSycocaFactory *factory = m_lstFactories->first(); + factory; + factory = m_lstFactories->next() ) + { + // For each resource the factory deals with + const KSycocaResourceList *list = factory->resourceList(); + if (!list) continue; + + for( KSycocaResourceList::ConstIterator it1 = list->begin(); + it1 != list->end(); + ++it1 ) + { + KSycocaResource res = (*it1); + if (!allResources.contains(res.resource)) + allResources.append(res.resource); + } + } + + g_ctimeInfo = new KCTimeInfo(); // This is a build factory too, don't delete!! + bool uptodate = true; + // For all resources + for( TQStringList::ConstIterator it1 = allResources.begin(); + it1 != allResources.end(); + ++it1 ) + { + g_changed = false; + g_resource = (*it1).ascii(); + + TQStringList relFiles; + + (void) TDEGlobal::dirs()->findAllResources( g_resource, + TQString::null, + true, // Recursive! + true, // uniq + relFiles); + + + // Now find all factories that use this resource.... + // For each factory + g_entryDict = entryDictList->first(); + for (g_factory = m_lstFactories->first(); + g_factory; + g_factory = m_lstFactories->next(), + g_entryDict = entryDictList->next() ) + { + // For each resource the factory deals with + const KSycocaResourceList *list = g_factory->resourceList(); + if (!list) continue; + + for( KSycocaResourceList::ConstIterator it2 = list->begin(); + it2 != list->end(); + ++it2 ) + { + KSycocaResource res = (*it2); + if (res.resource != (*it1)) continue; + + // For each file in the resource + for( TQStringList::ConstIterator it3 = relFiles.begin(); + it3 != relFiles.end(); + ++it3 ) + { + // Check if file matches filter + if ((*it3).endsWith(res.extension)) + createEntry(*it3, true); + } + } + if ((g_factory == g_bsf) && (strcmp(g_resource, "services") == 0)) + processGnomeVfs(); + } + if (g_changed || !g_allEntries) + { + uptodate = false; + g_changeList->append(g_resource); + } + } + + bool result = !uptodate || !g_ctimeDict->isEmpty(); + + if (result || bMenuTest) + { + g_resource = "apps"; + g_factory = g_bsf; + g_entryDict = serviceEntryDict; + g_changed = false; + + g_vfolder = new VFolderMenu; + if (!m_trackId.isEmpty()) + g_vfolder->setTrackId(m_trackId); + + connect(g_vfolder, TQT_SIGNAL(newService(const TQString &, KService **)), + this, TQT_SLOT(slotCreateEntry(const TQString &, KService **))); + + VFolderMenu::SubMenu *kdeMenu = g_vfolder->parseMenu("applications.menu", true); + + KServiceGroup *entry = g_bsgf->addNew("/", kdeMenu->directoryFile, 0, false); + entry->setLayoutInfo(kdeMenu->layoutList); + createMenu(TQString::null, TQString::null, kdeMenu); + + KServiceGroup::Ptr g(entry); + + (void) existingResourceDirs(); + *g_allResourceDirs += g_vfolder->allDirectories(); + + disconnect(g_vfolder, TQT_SIGNAL(newService(const TQString &, KService **)), + this, TQT_SLOT(slotCreateEntry(const TQString &, KService **))); + + if (g_changed || !g_allEntries) + { + uptodate = false; + g_changeList->append(g_resource); + } + if (bMenuTest) + return false; + } + + return result; +} + +void KBuildSycoca::createMenu(TQString caption, TQString name, VFolderMenu::SubMenu *menu) +{ + for(VFolderMenu::SubMenu *subMenu = menu->subMenus.first(); subMenu; subMenu = menu->subMenus.next()) + { + TQString subName = name+subMenu->name+"/"; + + TQString directoryFile = subMenu->directoryFile; + if (directoryFile.isEmpty()) + directoryFile = subName+".directory"; + TQ_UINT32 timeStamp = g_ctimeInfo->ctime(directoryFile); + if (!timeStamp) + { + timeStamp = TDEGlobal::dirs()->calcResourceHash( g_resource, directoryFile, true); + } + + KServiceGroup* entry = 0; + if (g_allEntries) + { + TQ_UINT32 *timeP = (*g_ctimeDict)[directoryFile]; + TQ_UINT32 oldTimestamp = timeP ? *timeP : 0; + + if (timeStamp && (timeStamp == oldTimestamp)) + { + entry = dynamic_cast (g_serviceGroupEntryDict->find(subName)); + if (entry && (entry->directoryEntryPath() != directoryFile)) + entry = 0; // Can't reuse this one! + } + } + g_ctimeInfo->addCTime(directoryFile, timeStamp); + + entry = g_bsgf->addNew(subName, subMenu->directoryFile, entry, subMenu->isDeleted); + entry->setLayoutInfo(subMenu->layoutList); + if (! (bMenuTest && entry->noDisplay()) ) + createMenu(caption + entry->caption() + "/", subName, subMenu); + } + if (caption.isEmpty()) + caption += "/"; + if (name.isEmpty()) + name += "/"; + for(TQDictIterator it(menu->items); it.current(); ++it) + { + if (bMenuTest) + { + if (!menu->isDeleted && !it.current()->noDisplay()) + printf("%s\t%s\t%s\n", caption.local8Bit().data(), it.current()->menuId().local8Bit().data(), locate("apps", it.current()->desktopEntryPath()).local8Bit().data()); + } + else + { + g_bsf->addEntry( it.current(), g_resource ); + g_bsgf->addNewEntryTo(name, it.current()); + } + } +} + +bool KBuildSycoca::recreate() +{ + TQString path(sycocaPath()); +#ifdef Q_WS_WIN + printf("tdebuildsycoca: path='%s'\n", (const char*)path); +#endif + + // KSaveFile first writes to a temp file. + // Upon close() it moves the stuff to the right place. + std::auto_ptr database( new KSaveFile(path) ); + if (database->status() == EACCES && TQFile::exists(path)) + { + TQFile::remove( path ); + database.reset( new KSaveFile(path) ); // try again + } + if (database->status() != 0) + { + fprintf(stderr, "[tdebuildsycoca] ERROR creating database '%s'! %s\n", path.local8Bit().data(),strerror(database->status())); +#ifdef KBUILDSYCOCA_GUI // KBUILDSYCOCA_GUI is used on win32 to build + // GUI version of tdebuildsycoca, so-called "tdebuildsycocaw". + if (!silent) + KMessageBox::error(0, i18n("Error creating database '%1'.\nCheck that the permissions are correct on the directory and the disk is not full.\n").arg(path.local8Bit().data()), i18n("KBuildSycoca")); +#endif + return false; + } + + m_str = database->dataStream(); + + kdDebug(7021) << "Recreating tdesycoca file (" << path << ", version " << KSycoca::version() << ")" << endl; + + // It is very important to build the servicetype one first + // Both are registered in KSycoca, no need to keep the pointers + KSycocaFactory *stf = new KBuildServiceTypeFactory; + g_bsgf = new KBuildServiceGroupFactory(); + g_bsf = new KBuildServiceFactory(stf, g_bsgf); + (void) new KBuildImageIOFactory(); + (void) new KBuildProtocolInfoFactory(); + + if( build()) // Parse dirs + { + save(); // Save database + if (m_str->device()->status()) + database->abort(); // Error + m_str = 0L; + if (!database->close()) + { + fprintf(stderr, "[tdebuildsycoca] ERROR writing database '%s'!\n", database->name().local8Bit().data()); + fprintf(stderr, "[tdebuildsycoca] Disk full?\n"); +#ifdef KBUILDSYCOCA_GUI + if (!silent) + KMessageBox::error(0, i18n("[tdebuildsycoca] Error writing database '%1'.\nCheck that the permissions are correct on the directory and the disk is not full.\n").arg(path.local8Bit().data()), i18n("KBuildSycoca")); +#endif + return false; + } + } + else + { + m_str = 0L; + database->abort(); + if (bMenuTest) + return true; + kdDebug(7021) << "Database is up to date" << endl; + } + + if (!bGlobalDatabase) + { + // update the timestamp file + TQString stamppath = path + "stamp"; + TQFile tdesycocastamp(stamppath); + tdesycocastamp.open( IO_WriteOnly ); + TQDataStream str( &tdesycocastamp ); + str << newTimestamp; + str << existingResourceDirs(); + if (g_vfolder) + str << g_vfolder->allDirectories(); // Extra resource dirs + } + return true; +} + +void KBuildSycoca::save() +{ + // Write header (#pass 1) + m_str->device()->at(0); + + (*m_str) << (TQ_INT32) KSycoca::version(); + KSycocaFactory * servicetypeFactory = 0L; + KSycocaFactory * serviceFactory = 0L; + for(KSycocaFactory *factory = m_lstFactories->first(); + factory; + factory = m_lstFactories->next()) + { + TQ_INT32 aId; + TQ_INT32 aOffset; + aId = factory->factoryId(); + if ( aId == KST_KServiceTypeFactory ) + servicetypeFactory = factory; + else if ( aId == KST_KServiceFactory ) + serviceFactory = factory; + aOffset = factory->offset(); + (*m_str) << aId; + (*m_str) << aOffset; + } + (*m_str) << (TQ_INT32) 0; // No more factories. + // Write TDEDIRS + (*m_str) << TDEGlobal::dirs()->kfsstnd_prefixes(); + (*m_str) << newTimestamp; + (*m_str) << TDEGlobal::locale()->language(); + (*m_str) << TDEGlobal::dirs()->calcResourceHash("services", "update_tdesycoca", true); + (*m_str) << (*g_allResourceDirs); + + // Write factory data.... + for(KSycocaFactory *factory = m_lstFactories->first(); + factory; + factory = m_lstFactories->next()) + { + factory->save(*m_str); + if (m_str->device()->status()) + return; // error + } + + int endOfData = m_str->device()->at(); + + // Write header (#pass 2) + m_str->device()->at(0); + + (*m_str) << (TQ_INT32) KSycoca::version(); + for(KSycocaFactory *factory = m_lstFactories->first(); + factory; + factory = m_lstFactories->next()) + { + TQ_INT32 aId; + TQ_INT32 aOffset; + aId = factory->factoryId(); + aOffset = factory->offset(); + (*m_str) << aId; + (*m_str) << aOffset; + } + (*m_str) << (TQ_INT32) 0; // No more factories. + + // Jump to end of database + m_str->device()->at(endOfData); +} + +bool KBuildSycoca::checkDirTimestamps( const TQString& dirname, const TQDateTime& stamp, bool top ) +{ + if( top ) + { + TQFileInfo inf( dirname ); + if( inf.lastModified() > stamp ) + { + kdDebug( 7021 ) << "timestamp changed:" << dirname << endl; + return false; + } + } + TQDir dir( dirname ); + const TQFileInfoList *list = dir.entryInfoList( TQDir::DefaultFilter, TQDir::Unsorted ); + if (!list) + return true; + + for( TQFileInfoListIterator it( *list ); + it.current() != NULL; + ++it ) + { + TQFileInfo* fi = it.current(); + if( fi->fileName() == "." || fi->fileName() == ".." ) + continue; + if( fi->lastModified() > stamp ) + { + kdDebug( 7201 ) << "timestamp changed:" << fi->filePath() << endl; + return false; + } + if( fi->isDir() && !checkDirTimestamps( fi->filePath(), stamp, false )) + return false; + } + return true; +} + +// check times of last modification of all files on which tdesycoca depens, +// and also their directories +// if all of them all older than the timestamp in file tdesycocastamp, this +// means that there's no need to rebuild tdesycoca +bool KBuildSycoca::checkTimestamps( TQ_UINT32 timestamp, const TQStringList &dirs ) +{ + kdDebug( 7021 ) << "checking file timestamps" << endl; + TQDateTime stamp; + stamp.setTime_t( timestamp ); + for( TQStringList::ConstIterator it = dirs.begin(); + it != dirs.end(); + ++it ) + { + if( !checkDirTimestamps( *it, stamp, true )) + return false; + } + kdDebug( 7021 ) << "timestamps check ok" << endl; + return true; +} + +TQStringList KBuildSycoca::existingResourceDirs() +{ + static TQStringList* dirs = NULL; + if( dirs != NULL ) + return *dirs; + dirs = new TQStringList; + g_allResourceDirs = new TQStringList; + // these are all resources cached by tdesycoca + TQStringList resources; + resources += KBuildServiceTypeFactory::resourceTypes(); + resources += KBuildServiceGroupFactory::resourceTypes(); + resources += KBuildServiceFactory::resourceTypes(); + resources += KBuildImageIOFactory::resourceTypes(); + resources += KBuildProtocolInfoFactory::resourceTypes(); + while( !resources.empty()) + { + TQString res = resources.front(); + *dirs += TDEGlobal::dirs()->resourceDirs( res.latin1()); + resources.remove( res ); // remove this 'res' and all its duplicates + } + + *g_allResourceDirs = *dirs; + + for( TQStringList::Iterator it = dirs->begin(); + it != dirs->end(); ) + { + TQFileInfo inf( *it ); + if( !inf.exists() || !inf.isReadable() ) + it = dirs->remove( it ); + else + ++it; + } + return *dirs; +} + +static KCmdLineOptions options[] = { + { "nosignal", I18N_NOOP("Do not signal applications to update"), 0 }, + { "noincremental", I18N_NOOP("Disable incremental update, re-read everything"), 0 }, + { "checkstamps", I18N_NOOP("Check file timestamps"), 0 }, + { "nochectdefiles", I18N_NOOP("Disable checking files (dangerous)"), 0 }, + { "global", I18N_NOOP("Create global database"), 0 }, + { "menutest", I18N_NOOP("Perform menu generation test run only"), 0 }, + { "track ", I18N_NOOP("Track menu id for debug purposes"), 0 }, +#ifdef KBUILDSYCOCA_GUI + { "silent", I18N_NOOP("Silent - work without windows and stderr"), 0 }, + { "showprogress", I18N_NOOP("Show progress information (even if 'silent' mode is on)"), 0 }, +#endif + KCmdLineLastOption +}; + +static const char appName[] = "tdebuildsycoca"; +static const char appVersion[] = "1.1"; + +class WaitForSignal : public QObject +{ +public: + ~WaitForSignal() { kapp->eventLoop()->exitLoop(); } +}; + +extern "C" KDE_EXPORT int kdemain(int argc, char **argv) +{ + KLocale::setMainCatalogue("tdelibs"); + TDEAboutData d(appName, I18N_NOOP("KBuildSycoca"), appVersion, + I18N_NOOP("Rebuilds the system configuration cache."), + TDEAboutData::License_GPL, "(c) 1999-2002 KDE Developers"); + d.addAuthor("David Faure", I18N_NOOP("Author"), "faure@kde.org"); + d.addAuthor("Waldo Bastian", I18N_NOOP("Author"), "bastian@kde.org"); + + TDECmdLineArgs::init(argc, argv, &d); + TDECmdLineArgs::addCmdLineOptions(options); + TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs(); + bGlobalDatabase = args->isSet("global"); + bMenuTest = args->isSet("menutest"); + + if (bGlobalDatabase) + { + setenv("TDEHOME", "-", 1); + setenv("TDEROOTHOME", "-", 1); + } + + TDEApplication::disableAutoDcopRegistration(); +#ifdef KBUILDSYCOCA_GUI + TDEApplication k; +#else + TDEApplication k(false, false); +#endif + k.disableSessionManagement(); + +#ifdef KBUILDSYCOCA_GUI + silent = args->isSet("silent"); + showprogress = args->isSet("showprogress"); + TQLabel progress( TQString("


%1
").arg( i18n("Reloading TDE configuration, please wait...") ), 0, "", Qt::WType_Dialog | Qt::WStyle_DialogBorder | Qt::WStyle_Customize| Qt::WStyle_Title ); + TQString capt = i18n("TDE Configuration Manager"); + if (!silent) { + if (KMessageBox::No == KMessageBox::questionYesNo(0, i18n("Do you want to reload TDE configuration?"), capt, i18n("Reload"), i18n("Do Not Reload"))) + return 0; + } + if (!silent || showprogress) { + progress.setCaption( capt ); + progress.show(); + } +#endif + + KCrash::setCrashHandler(KCrash::defaultCrashHandler); + KCrash::setEmergencySaveFunction(crashHandler); + KCrash::setApplicationName(TQString(appName)); + + // this program is in tdelibs so it uses tdelibs as catalog + KLocale::setMainCatalogue("tdelibs"); + // force generating of KLocale object. if not, the database will get + // be translated + TDEGlobal::locale(); + TDEGlobal::dirs()->addResourceType("app-reg", "share/application-registry" ); + + DCOPClient *dcopClient = new DCOPClient(); + + while(true) + { + TQCString registeredName = dcopClient->registerAs(appName, false); + if (registeredName.isEmpty()) + { + fprintf(stderr, "[tdebuildsycoca] Warning: %s is unable to register with DCOP.\n", appName); + break; + } + else if (registeredName == appName) + { + break; // Go + } + fprintf(stderr, "[tdebuildsycoca] Waiting for already running %s to finish.\n", appName); + + dcopClient->setNotifications( true ); + while (dcopClient->isApplicationRegistered(appName)) + { + WaitForSignal *obj = new WaitForSignal; + obj->connect(dcopClient, TQT_SIGNAL(applicationRemoved(const TQCString &)), + TQT_SLOT(deleteLater())); + kapp->eventLoop()->enterLoop(); + } + dcopClient->setNotifications( false ); + } + fprintf(stderr, "[tdebuildsycoca] %s running...\n", appName); + + bool chectdefiles = bGlobalDatabase || args->isSet("chectdefiles"); + + bool incremental = !bGlobalDatabase && args->isSet("incremental") && chectdefiles; + if (incremental || !chectdefiles) + { + KSycoca::self()->disableAutoRebuild(); // Prevent deadlock + TQString current_language = TDEGlobal::locale()->language(); + TQString tdesycoca_language = KSycoca::self()->language(); + TQ_UINT32 current_update_sig = TDEGlobal::dirs()->calcResourceHash("services", "update_tdesycoca", true); + TQ_UINT32 tdesycoca_update_sig = KSycoca::self()->updateSignature(); + + if ((current_update_sig != tdesycoca_update_sig) || + (current_language != tdesycoca_language) || + (KSycoca::self()->timeStamp() == 0)) + { + incremental = false; + chectdefiles = true; + delete KSycoca::self(); + } + } + + g_changeList = new TQStringList; + + bool checkstamps = incremental && args->isSet("checkstamps") && chectdefiles; + TQ_UINT32 filestamp = 0; + TQStringList oldresourcedirs; + if( checkstamps && incremental ) + { + TQString path = sycocaPath()+"stamp"; + TQCString qPath = TQFile::encodeName(path); + cSycocaPath = qPath.data(); // Delete timestamps on crash + TQFile tdesycocastamp(path); + if( tdesycocastamp.open( IO_ReadOnly )) + { + TQDataStream str( &tdesycocastamp ); + if (!str.atEnd()) + str >> filestamp; + if (!str.atEnd()) + { + str >> oldresourcedirs; + if( oldresourcedirs != KBuildSycoca::existingResourceDirs()) + checkstamps = false; + } + else + { + checkstamps = false; + } + if (!str.atEnd()) + { + TQStringList extraResourceDirs; + str >> extraResourceDirs; + oldresourcedirs += extraResourceDirs; + } + } + else + { + checkstamps = false; + } + cSycocaPath = 0; + } + + newTimestamp = (TQ_UINT32) time(0); + + if( chectdefiles && ( !checkstamps || !KBuildSycoca::checkTimestamps( filestamp, oldresourcedirs ))) + { + TQCString qSycocaPath = TQFile::encodeName(sycocaPath()); + cSycocaPath = qSycocaPath.data(); + + g_allEntries = 0; + g_ctimeDict = 0; + if (incremental) + { + tqWarning("[tdebuildsycoca] Reusing existing tdesycoca."); + KSycoca *oldSycoca = KSycoca::self(); + KSycocaFactoryList *factories = new KSycocaFactoryList; + g_allEntries = new KSycocaEntryListList; + g_ctimeDict = new TQDict(523); + + // Must be in same order as in KBuildSycoca::recreate()! + factories->append( new KServiceTypeFactory ); + factories->append( new KServiceGroupFactory ); + factories->append( new KServiceFactory ); + factories->append( new KImageIOFactory ); + factories->append( new KProtocolInfoFactory ); + + // For each factory + for (KSycocaFactory *factory = factories->first(); + factory; + factory = factories->next() ) + { + KSycocaEntry::List list; + list = factory->allEntries(); + g_allEntries->append( list ); + } + delete factories; factories = 0; + KCTimeInfo *ctimeInfo = new KCTimeInfo; + ctimeInfo->fillCTimeDict(*g_ctimeDict); + delete oldSycoca; + } + cSycocaPath = 0; + + KBuildSycoca *sycoca= new KBuildSycoca; // Build data base + if (args->isSet("track")) + sycoca->setTrackId(TQString::fromLocal8Bit(args->getOption("track"))); + if (!sycoca->recreate()) { +#ifdef KBUILDSYCOCA_GUI + if (!silent || showprogress) + progress.close(); +#endif + return -1; + } + + if (bGlobalDatabase) + { + // These directories may have been created with 0700 permission + // better delete them if they are empty + TQString applnkDir = TDEGlobal::dirs()->saveLocation("apps", TQString::null, false); + ::rmdir(TQFile::encodeName(applnkDir)); + TQString servicetypesDir = TDEGlobal::dirs()->saveLocation("servicetypes", TQString::null, false); + ::rmdir(TQFile::encodeName(servicetypesDir)); + } + } + + if (!bGlobalDatabase) + { + // Recreate compatibility symlink + TQString oldPath = oldSycocaPath(); + if (!oldPath.isEmpty()) + { + KTempFile tmp; + if (tmp.status() == 0) + { + TQString tmpFile = tmp.name(); + tmp.unlink(); + symlink(TQFile::encodeName(sycocaPath()), TQFile::encodeName(tmpFile)); + rename(TQFile::encodeName(tmpFile), TQFile::encodeName(oldPath)); + } + } + } + + if (args->isSet("signal")) + { + // Notify ALL applications that have a tdesycoca object, using a broadcast + TQByteArray data; + TQDataStream stream(data, IO_WriteOnly); + stream << *g_changeList; + dcopClient->send( "*", "tdesycoca", "notifyDatabaseChanged(TQStringList)", data ); + } + +#ifdef KBUILDSYCOCA_GUI + if (!silent) { + progress.close(); + KMessageBox::information(0, i18n("[tdebuildsycoca] Configuration information reloaded successfully."), capt); + } +#endif + return 0; +} + +#include "tdebuildsycoca.moc" diff --git a/kded/tdebuildsycoca.h b/kded/tdebuildsycoca.h new file mode 100644 index 000000000..51e7af337 --- /dev/null +++ b/kded/tdebuildsycoca.h @@ -0,0 +1,104 @@ +/* This file is part of the KDE libraries + * Copyright (C) 1999 David Faure + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License version 2 as published by the Free Software Foundation; + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + **/ +#ifndef __tdebuildsycoca_h__ +#define __tdebuildsycoca_h__ + +#include + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "vfolder_menu.h" + +class TQDataStream; + +// No need for this in libtdeio - apps only get readonly access +class KBuildSycoca : public KSycoca +{ + Q_OBJECT +public: + KBuildSycoca(); + virtual ~KBuildSycoca(); + + /** + * Recreate the database file + */ + bool recreate(); + + static bool checkTimestamps( TQ_UINT32 timestamp, const TQStringList &dirs ); + + static TQStringList existingResourceDirs(); + + void setTrackId(const TQString &id) { m_trackId = id; } + +protected slots: + void slotCreateEntry(const TQString &file, KService **entry); + +protected: + + /** + * Look up gnome mimetypes. + */ + void processGnomeVfs(); + + /** + * Add single entry to the sycoca database. + * Either from a previous database or regenerated from file. + */ + KSycocaEntry *createEntry(const TQString &file, bool addToFactory); + + /** + * Convert a VFolderMenu::SubMenu to KServiceGroups. + */ + void createMenu(TQString caption, TQString name, VFolderMenu::SubMenu *menu); + + /** + * Build the whole system cache, from .desktop files + */ + bool build(); + + /** + * Save the tdesycoca file + */ + void save(); + + /** + * Clear the factories + */ + void clear(); + + static bool checkDirTimestamps( const TQString& dir, const TQDateTime& stamp, bool top ); + + /** + * @internal + * @return true if building (i.e. if a KBuildSycoca); + */ + virtual bool isBuilding() { return true; } + + TQStringList m_allResourceDirs; + TQString m_trackId; +}; + +#endif diff --git a/kded/tdemimelist.cpp b/kded/tdemimelist.cpp new file mode 100644 index 000000000..c82f6d9f7 --- /dev/null +++ b/kded/tdemimelist.cpp @@ -0,0 +1,54 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +int main(int argc, char *argv[]) +{ + TDEApplication k(argc,argv,"blurb",false); + + KMimeType::List mtl = KMimeType::allMimeTypes( ); + assert( mtl.count() ); + tqDebug( "Found %d mime types.", mtl.count() ); + TQValueListIterator it(mtl.begin()); + KServiceTypeProfile::OfferList ol; + + for (; it != mtl.end(); ++it) + { + { + // Application + printf( "APP:%s:", (*it)->name().latin1() ); + ol = KServiceTypeProfile::offers((*it)->name(), "Application"); + TQValueListIterator it2(ol.begin()); + for (; it2 != ol.end(); ++it2) { + if ((*it2).allowAsDefault()) + printf( " %s", (*it2).service()->desktopEntryPath().ascii() ); + + } + printf( "\n" ); + } + + { + // Embedded + printf( "PART:%s:", (*it)->name().latin1() ); + ol = KServiceTypeProfile::offers((*it)->name(), "KParts/ReadOnlyPart"); + TQValueListIterator it2(ol.begin()); + for (; it2 != ol.end(); ++it2) { + if ((*it2).allowAsDefault()) + printf( " %s", (*it2).service()->desktopEntryPath().ascii() ); + + } + printf( "\n" ); + } + } +} + -- cgit v1.2.1 From 12f3d421cd2991c0e3f96994efb836ce244172ff Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Thu, 31 Jan 2013 00:36:34 -0600 Subject: Rename KShared --- kded/kdedmodule.cpp | 8 ++++---- kded/kdedmodule.h | 4 ++-- kded/test/test.cpp | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'kded') diff --git a/kded/kdedmodule.cpp b/kded/kdedmodule.cpp index 6371b2534..61da755b3 100644 --- a/kded/kdedmodule.cpp +++ b/kded/kdedmodule.cpp @@ -26,7 +26,7 @@ #include "kdedmodule.h" #include "tdeconfigdata.h" -typedef TQMap > KDEDObjectMap; +typedef TQMap > KDEDObjectMap; class KDEDModulePrivate { @@ -62,7 +62,7 @@ void KDEDModule::resetIdle() d->timer.start(d->timeout, true); } -void KDEDModule::insert(const TQCString &app, const TQCString &key, KShared *obj) +void KDEDModule::insert(const TQCString &app, const TQCString &key, TDEShared *obj) { if (!d->objMap) d->objMap = new KDEDObjectMap; @@ -74,13 +74,13 @@ void KDEDModule::insert(const TQCString &app, const TQCString &key, KShared *obj KEntryKey indexKey(app, key); // Prevent deletion in case the same object is inserted again. - KSharedPtr _obj = obj; + TDESharedPtr _obj = obj; d->objMap->replace(indexKey, _obj); resetIdle(); } -KShared * KDEDModule::find(const TQCString &app, const TQCString &key) +TDEShared * KDEDModule::find(const TQCString &app, const TQCString &key) { if (!d->objMap) return 0; diff --git a/kded/kdedmodule.h b/kded/kdedmodule.h index 855a02824..f3954e842 100644 --- a/kded/kdedmodule.h +++ b/kded/kdedmodule.h @@ -91,12 +91,12 @@ public: * Any previous object inserted with the same values for @p app * and @p key will be removed. */ - void insert(const TQCString &app, const TQCString &key, KShared *obj); + void insert(const TQCString &app, const TQCString &key, TDEShared *obj); /** * Lookup object indexed with @p app and @p key */ - KShared *find(const TQCString &app, const TQCString &key); + TDEShared *find(const TQCString &app, const TQCString &key); /** * remove object indexed with @p app and @p key. diff --git a/kded/test/test.cpp b/kded/test/test.cpp index e99eb1421..8d2aa91b9 100644 --- a/kded/test/test.cpp +++ b/kded/test/test.cpp @@ -1,6 +1,6 @@ #include "test.h" -class TestObject : public KShared +class TestObject : public TDEShared { public: TestObject(const TQCString &_app) : app(_app) -- cgit v1.2.1 From d3afa6baf98ef5ac191996cc9b909ff9074c168c Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Thu, 31 Jan 2013 13:28:26 -0600 Subject: Rename KStandard for enhanced compatibility with KDE4 --- kded/vfolder_menu.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'kded') diff --git a/kded/vfolder_menu.cpp b/kded/vfolder_menu.cpp index b00b3553d..e2dc603ba 100644 --- a/kded/vfolder_menu.cpp +++ b/kded/vfolder_menu.cpp @@ -767,7 +767,7 @@ VFolderMenu::locateMenuFile(const TQString &fileName) { if (!TQDir::isRelativePath(fileName)) { - if (KStandardDirs::exists(fileName)) + if (TDEStandardDirs::exists(fileName)) return fileName; return TQString::null; } @@ -808,7 +808,7 @@ VFolderMenu::locateDirectoryFile(const TQString &fileName) if (!TQDir::isRelativePath(fileName)) { - if (KStandardDirs::exists(fileName)) + if (TDEStandardDirs::exists(fileName)) return fileName; return TQString::null; } @@ -820,7 +820,7 @@ VFolderMenu::locateDirectoryFile(const TQString &fileName) ++it) { tmp = (*it)+fileName; - if (KStandardDirs::exists(tmp)) + if (TDEStandardDirs::exists(tmp)) return tmp; } -- cgit v1.2.1 From 59d153016be1e09cb31cdb18bef0a649acfc6292 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Fri, 1 Feb 2013 08:17:52 -0600 Subject: Rename KLocale to enhance compatibility with KDE4 --- kded/kded.cpp | 2 +- kded/khostname.cpp | 2 +- kded/tde-menu.cpp | 4 ++-- kded/tdebuildsycoca.cpp | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) (limited to 'kded') diff --git a/kded/kded.cpp b/kded/kded.cpp index b769fa508..704dd9fbf 100644 --- a/kded/kded.cpp +++ b/kded/kded.cpp @@ -885,7 +885,7 @@ extern "C" KDE_EXPORT int kdemain(int argc, char *argv[]) TDECmdLineArgs::addCmdLineOptions( options ); // this program is in tdelibs so it uses tdelibs as catalog - KLocale::setMainCatalogue("tdelibs"); + TDELocale::setMainCatalogue("tdelibs"); // WABA: Make sure not to enable session management. putenv(strdup("SESSION_MANAGER=")); diff --git a/kded/khostname.cpp b/kded/khostname.cpp index 7e080378b..7bdc12858 100644 --- a/kded/khostname.cpp +++ b/kded/khostname.cpp @@ -365,7 +365,7 @@ void KHostName::changeSessionManager() int main(int argc, char **argv) { - KLocale::setMainCatalogue("tdelibs"); + TDELocale::setMainCatalogue("tdelibs"); TDEAboutData d(appName, I18N_NOOP("KDontChangeTheHostName"), appVersion, I18N_NOOP("Informs TDE about a change in hostname"), TDEAboutData::License_GPL, "(c) 2001 Waldo Bastian"); diff --git a/kded/tde-menu.cpp b/kded/tde-menu.cpp index 6a8721915..e1f79f77c 100644 --- a/kded/tde-menu.cpp +++ b/kded/tde-menu.cpp @@ -107,7 +107,7 @@ static void findMenuEntry(KServiceGroup::Ptr parent, const TQString &name, const int main(int argc, char **argv) { - KLocale::setMainCatalogue("tdelibs"); + TDELocale::setMainCatalogue("tdelibs"); const char *description = I18N_NOOP("TDE Menu query tool.\n" "This tool can be used to find in which menu a specific application is shown.\n" "The --highlight option can be used to visually indicate to the user where\n" @@ -126,7 +126,7 @@ int main(int argc, char **argv) k.disableSessionManagement(); // this program is in tdelibs so it uses tdelibs as catalog - KLocale::setMainCatalogue("tdelibs"); + TDELocale::setMainCatalogue("tdelibs"); TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs(); if (args->count() != 1) diff --git a/kded/tdebuildsycoca.cpp b/kded/tdebuildsycoca.cpp index 47b7a9bf4..f9b0238c7 100644 --- a/kded/tdebuildsycoca.cpp +++ b/kded/tdebuildsycoca.cpp @@ -717,7 +717,7 @@ public: extern "C" KDE_EXPORT int kdemain(int argc, char **argv) { - KLocale::setMainCatalogue("tdelibs"); + TDELocale::setMainCatalogue("tdelibs"); TDEAboutData d(appName, I18N_NOOP("KBuildSycoca"), appVersion, I18N_NOOP("Rebuilds the system configuration cache."), TDEAboutData::License_GPL, "(c) 1999-2002 KDE Developers"); @@ -764,8 +764,8 @@ extern "C" KDE_EXPORT int kdemain(int argc, char **argv) KCrash::setApplicationName(TQString(appName)); // this program is in tdelibs so it uses tdelibs as catalog - KLocale::setMainCatalogue("tdelibs"); - // force generating of KLocale object. if not, the database will get + TDELocale::setMainCatalogue("tdelibs"); + // force generating of TDELocale object. if not, the database will get // be translated TDEGlobal::locale(); TDEGlobal::dirs()->addResourceType("app-reg", "share/application-registry" ); -- cgit v1.2.1 From deac2ca49faed824fe83066080714eb6d653615b Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Fri, 1 Feb 2013 15:13:01 -0600 Subject: Rename a number of classes to enhance compatibility with KDE4 --- kded/kded.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'kded') diff --git a/kded/kded.cpp b/kded/kded.cpp index 704dd9fbf..ed002b530 100644 --- a/kded/kded.cpp +++ b/kded/kded.cpp @@ -468,7 +468,7 @@ void Kded::runDelayedCheck() void Kded::recreate(bool initial) { m_recreateBusy = true; - // Using KLauncher here is difficult since we might not have a + // Using TDELauncher here is difficult since we might not have a // database if (!initial) -- cgit v1.2.1 From d1e0cc99a202cef3306b90b8839a6726e89f201e Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Fri, 1 Feb 2013 23:21:04 -0600 Subject: Rename many classes and header files to avoid conflicts with KDE4 --- kded/kded.cpp | 2 +- kded/tdebuildsycoca.cpp | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'kded') diff --git a/kded/kded.cpp b/kded/kded.cpp index ed002b530..1cd64b3e7 100644 --- a/kded/kded.cpp +++ b/kded/kded.cpp @@ -65,7 +65,7 @@ static void runBuildSycoca(TQObject *callBackObj=0, const char *callBackSlot=0) if(checkStamps) args.append("--checkstamps"); if(delayedCheck) - args.append("--nochectdefiles"); + args.append("--nocheckfiles"); else checkStamps = false; // useful only during kded startup if (callBackObj) diff --git a/kded/tdebuildsycoca.cpp b/kded/tdebuildsycoca.cpp index f9b0238c7..81bff9613 100644 --- a/kded/tdebuildsycoca.cpp +++ b/kded/tdebuildsycoca.cpp @@ -695,7 +695,7 @@ static KCmdLineOptions options[] = { { "nosignal", I18N_NOOP("Do not signal applications to update"), 0 }, { "noincremental", I18N_NOOP("Disable incremental update, re-read everything"), 0 }, { "checkstamps", I18N_NOOP("Check file timestamps"), 0 }, - { "nochectdefiles", I18N_NOOP("Disable checking files (dangerous)"), 0 }, + { "nocheckfiles", I18N_NOOP("Disable checking files (dangerous)"), 0 }, { "global", I18N_NOOP("Create global database"), 0 }, { "menutest", I18N_NOOP("Perform menu generation test run only"), 0 }, { "track ", I18N_NOOP("Track menu id for debug purposes"), 0 }, @@ -798,10 +798,10 @@ extern "C" KDE_EXPORT int kdemain(int argc, char **argv) } fprintf(stderr, "[tdebuildsycoca] %s running...\n", appName); - bool chectdefiles = bGlobalDatabase || args->isSet("chectdefiles"); + bool checkfiles = bGlobalDatabase || args->isSet("checkfiles"); - bool incremental = !bGlobalDatabase && args->isSet("incremental") && chectdefiles; - if (incremental || !chectdefiles) + bool incremental = !bGlobalDatabase && args->isSet("incremental") && checkfiles; + if (incremental || !checkfiles) { KSycoca::self()->disableAutoRebuild(); // Prevent deadlock TQString current_language = TDEGlobal::locale()->language(); @@ -814,14 +814,14 @@ extern "C" KDE_EXPORT int kdemain(int argc, char **argv) (KSycoca::self()->timeStamp() == 0)) { incremental = false; - chectdefiles = true; + checkfiles = true; delete KSycoca::self(); } } g_changeList = new TQStringList; - bool checkstamps = incremental && args->isSet("checkstamps") && chectdefiles; + bool checkstamps = incremental && args->isSet("checkstamps") && checkfiles; TQ_UINT32 filestamp = 0; TQStringList oldresourcedirs; if( checkstamps && incremental ) @@ -861,7 +861,7 @@ extern "C" KDE_EXPORT int kdemain(int argc, char **argv) newTimestamp = (TQ_UINT32) time(0); - if( chectdefiles && ( !checkstamps || !KBuildSycoca::checkTimestamps( filestamp, oldresourcedirs ))) + if( checkfiles && ( !checkstamps || !KBuildSycoca::checkTimestamps( filestamp, oldresourcedirs ))) { TQCString qSycocaPath = TQFile::encodeName(sycocaPath()); cSycocaPath = qSycocaPath.data(); -- cgit v1.2.1 From 4b3606f910373fb4b9d653049b6c08a809aebf47 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Tue, 5 Feb 2013 18:38:23 -0600 Subject: Rename KCrash to avoid conflicts with KDE4 --- kded/kded.cpp | 2 +- kded/tdebuildsycoca.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'kded') diff --git a/kded/kded.cpp b/kded/kded.cpp index 1cd64b3e7..f54c4730c 100644 --- a/kded/kded.cpp +++ b/kded/kded.cpp @@ -450,7 +450,7 @@ tqWarning("Last DCOP call before KDED crash was from application '%s'\n" void Kded::installCrashHandler() { - KCrash::setEmergencySaveFunction(crashHandler); + TDECrash::setEmergencySaveFunction(crashHandler); } void Kded::recreate() diff --git a/kded/tdebuildsycoca.cpp b/kded/tdebuildsycoca.cpp index 81bff9613..87fdc0ba7 100644 --- a/kded/tdebuildsycoca.cpp +++ b/kded/tdebuildsycoca.cpp @@ -759,9 +759,9 @@ extern "C" KDE_EXPORT int kdemain(int argc, char **argv) } #endif - KCrash::setCrashHandler(KCrash::defaultCrashHandler); - KCrash::setEmergencySaveFunction(crashHandler); - KCrash::setApplicationName(TQString(appName)); + TDECrash::setCrashHandler(TDECrash::defaultCrashHandler); + TDECrash::setEmergencySaveFunction(crashHandler); + TDECrash::setApplicationName(TQString(appName)); // this program is in tdelibs so it uses tdelibs as catalog TDELocale::setMainCatalogue("tdelibs"); -- cgit v1.2.1 From 5466d52073af147d100482cbf633087bb9fb631b Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Wed, 6 Feb 2013 19:46:01 -0600 Subject: Rename KCmd to avoid conflicts with KDE4 --- kded/kded.cpp | 4 ++-- kded/khostname.cpp | 4 ++-- kded/tde-menu.cpp | 4 ++-- kded/tdebuildsycoca.cpp | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) (limited to 'kded') diff --git a/kded/kded.cpp b/kded/kded.cpp index f54c4730c..774712e0e 100644 --- a/kded/kded.cpp +++ b/kded/kded.cpp @@ -730,11 +730,11 @@ void KHostnameD::checkHostname() } -static KCmdLineOptions options[] = +static TDECmdLineOptions options[] = { { "check", I18N_NOOP("Check Sycoca database only once"), 0 }, { "new-startup", "Internal", 0 }, - KCmdLineLastOption + TDECmdLineLastOption }; class KDEDQtDCOPObject : public DCOPObject diff --git a/kded/khostname.cpp b/kded/khostname.cpp index 7bdc12858..227106eea 100644 --- a/kded/khostname.cpp +++ b/kded/khostname.cpp @@ -37,10 +37,10 @@ #include #include -static KCmdLineOptions options[] = { +static TDECmdLineOptions options[] = { { "+old", I18N_NOOP("Old hostname"), 0 }, { "+new", I18N_NOOP("New hostname"), 0 }, - KCmdLineLastOption + TDECmdLineLastOption }; static const char appName[] = "kdontchangethehostname"; diff --git a/kded/tde-menu.cpp b/kded/tde-menu.cpp index e1f79f77c..fa2d220af 100644 --- a/kded/tde-menu.cpp +++ b/kded/tde-menu.cpp @@ -32,14 +32,14 @@ #include "kservicegroup.h" #include "kstandarddirs.h" -static KCmdLineOptions options[] = { +static TDECmdLineOptions options[] = { { "utf8", I18N_NOOP("Output data in UTF-8 instead of local encoding"), 0 }, { "print-menu-id", I18N_NOOP("Print menu-id of the menu that contains\nthe application"), 0 }, { "print-menu-name", I18N_NOOP("Print menu name (caption) of the menu that\ncontains the application"), 0 }, { "highlight", I18N_NOOP("Highlight the entry in the menu"), 0 }, { "nocache-update", I18N_NOOP("Do not check if sycoca database is up to date"), 0 }, { "+", I18N_NOOP("The id of the menu entry to locate"), 0 }, - KCmdLineLastOption + TDECmdLineLastOption }; static const char appName[] = "tde-menu"; diff --git a/kded/tdebuildsycoca.cpp b/kded/tdebuildsycoca.cpp index 87fdc0ba7..74eba4a1b 100644 --- a/kded/tdebuildsycoca.cpp +++ b/kded/tdebuildsycoca.cpp @@ -691,7 +691,7 @@ TQStringList KBuildSycoca::existingResourceDirs() return *dirs; } -static KCmdLineOptions options[] = { +static TDECmdLineOptions options[] = { { "nosignal", I18N_NOOP("Do not signal applications to update"), 0 }, { "noincremental", I18N_NOOP("Disable incremental update, re-read everything"), 0 }, { "checkstamps", I18N_NOOP("Check file timestamps"), 0 }, @@ -703,7 +703,7 @@ static KCmdLineOptions options[] = { { "silent", I18N_NOOP("Silent - work without windows and stderr"), 0 }, { "showprogress", I18N_NOOP("Show progress information (even if 'silent' mode is on)"), 0 }, #endif - KCmdLineLastOption + TDECmdLineLastOption }; static const char appName[] = "tdebuildsycoca"; -- cgit v1.2.1 From 8bd62a3b0d3b362b783a273e2460811392485bbd Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Thu, 14 Feb 2013 17:17:18 -0600 Subject: Rename common header files for consistency with class renaming --- kded/kded.cpp | 4 ++-- kded/khostname.cpp | 6 +++--- kded/tde-menu.cpp | 6 +++--- kded/tdebuildsycoca.cpp | 6 +++--- kded/tdemimelist.cpp | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) (limited to 'kded') diff --git a/kded/kded.cpp b/kded/kded.cpp index 774712e0e..b6e6b523f 100644 --- a/kded/kded.cpp +++ b/kded/kded.cpp @@ -36,8 +36,8 @@ #include #include -#include -#include +#include +#include #include #include #include diff --git a/kded/khostname.cpp b/kded/khostname.cpp index 227106eea..7585e0ad0 100644 --- a/kded/khostname.cpp +++ b/kded/khostname.cpp @@ -28,10 +28,10 @@ #include -#include -#include +#include +#include #include -#include +#include #include #include #include diff --git a/kded/tde-menu.cpp b/kded/tde-menu.cpp index fa2d220af..4ad6bc3db 100644 --- a/kded/tde-menu.cpp +++ b/kded/tde-menu.cpp @@ -23,9 +23,9 @@ #include #include -#include "kaboutdata.h" -#include "kapplication.h" -#include "kcmdlineargs.h" +#include "tdeaboutdata.h" +#include "tdeapplication.h" +#include "tdecmdlineargs.h" #include "kglobal.h" #include "klocale.h" #include "kservice.h" diff --git a/kded/tdebuildsycoca.cpp b/kded/tdebuildsycoca.cpp index 74eba4a1b..aa03c2c94 100644 --- a/kded/tdebuildsycoca.cpp +++ b/kded/tdebuildsycoca.cpp @@ -40,7 +40,7 @@ #include #include -#include +#include #include #include #include @@ -48,8 +48,8 @@ #include #include #include -#include -#include +#include +#include #include #ifdef KBUILDSYCOCA_GUI // KBUILDSYCOCA_GUI is used on win32 to build diff --git a/kded/tdemimelist.cpp b/kded/tdemimelist.cpp index c82f6d9f7..673520e52 100644 --- a/kded/tdemimelist.cpp +++ b/kded/tdemimelist.cpp @@ -8,7 +8,7 @@ #include #include -#include +#include #include -- cgit v1.2.1 From ed99a30644c19b0a3cf0d2147243532df4daa16b Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Fri, 15 Feb 2013 21:57:54 -0600 Subject: Rename additional header files to avoid conflicts with KDE4 --- kded/kbuildimageiofactory.cpp | 4 ++-- kded/kbuildprotocolinfofactory.cpp | 4 ++-- kded/kbuildservicefactory.cpp | 4 ++-- kded/kbuildservicegroupfactory.cpp | 4 ++-- kded/kbuildservicetypefactory.cpp | 4 ++-- kded/kded.cpp | 4 ++-- kded/khostname.cpp | 4 ++-- kded/tde-menu.cpp | 4 ++-- kded/tdebuildsycoca.cpp | 6 +++--- kded/vfolder_menu.cpp | 2 +- 10 files changed, 20 insertions(+), 20 deletions(-) (limited to 'kded') diff --git a/kded/kbuildimageiofactory.cpp b/kded/kbuildimageiofactory.cpp index 267af31f6..b5873cad8 100644 --- a/kded/kbuildimageiofactory.cpp +++ b/kded/kbuildimageiofactory.cpp @@ -20,10 +20,10 @@ #include "tdesycocadict.h" #include "kresourcelist.h" -#include +#include #include #include -#include +#include #include #include diff --git a/kded/kbuildprotocolinfofactory.cpp b/kded/kbuildprotocolinfofactory.cpp index f3fe698d4..921e55ab9 100644 --- a/kded/kbuildprotocolinfofactory.cpp +++ b/kded/kbuildprotocolinfofactory.cpp @@ -21,11 +21,11 @@ #include "tdesycocadict.h" #include "kresourcelist.h" -#include +#include #include #include #include -#include +#include #include KBuildProtocolInfoFactory::KBuildProtocolInfoFactory() : diff --git a/kded/kbuildservicefactory.cpp b/kded/kbuildservicefactory.cpp index 7d9406d36..6f127caf2 100644 --- a/kded/kbuildservicefactory.cpp +++ b/kded/kbuildservicefactory.cpp @@ -23,10 +23,10 @@ #include "kresourcelist.h" #include "kmimetype.h" -#include +#include #include #include -#include +#include #include #include diff --git a/kded/kbuildservicegroupfactory.cpp b/kded/kbuildservicegroupfactory.cpp index 76f27ba57..3903a6b39 100644 --- a/kded/kbuildservicegroupfactory.cpp +++ b/kded/kbuildservicegroupfactory.cpp @@ -21,11 +21,11 @@ #include "tdesycocadict.h" #include "kresourcelist.h" -#include +#include #include #include #include -#include +#include #include KBuildServiceGroupFactory::KBuildServiceGroupFactory() : diff --git a/kded/kbuildservicetypefactory.cpp b/kded/kbuildservicetypefactory.cpp index 351b7847a..da2863347 100644 --- a/kded/kbuildservicetypefactory.cpp +++ b/kded/kbuildservicetypefactory.cpp @@ -21,11 +21,11 @@ #include "tdesycocadict.h" #include "kresourcelist.h" -#include +#include #include #include #include -#include +#include #include #include diff --git a/kded/kded.cpp b/kded/kded.cpp index b6e6b523f..947d3b816 100644 --- a/kded/kded.cpp +++ b/kded/kded.cpp @@ -38,8 +38,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/kded/khostname.cpp b/kded/khostname.cpp index 7585e0ad0..c78152b97 100644 --- a/kded/khostname.cpp +++ b/kded/khostname.cpp @@ -30,9 +30,9 @@ #include #include -#include +#include #include -#include +#include #include #include #include diff --git a/kded/tde-menu.cpp b/kded/tde-menu.cpp index 4ad6bc3db..4cf7a843e 100644 --- a/kded/tde-menu.cpp +++ b/kded/tde-menu.cpp @@ -26,8 +26,8 @@ #include "tdeaboutdata.h" #include "tdeapplication.h" #include "tdecmdlineargs.h" -#include "kglobal.h" -#include "klocale.h" +#include "tdeglobal.h" +#include "tdelocale.h" #include "kservice.h" #include "kservicegroup.h" #include "kstandarddirs.h" diff --git a/kded/tdebuildsycoca.cpp b/kded/tdebuildsycoca.cpp index aa03c2c94..4325162f7 100644 --- a/kded/tdebuildsycoca.cpp +++ b/kded/tdebuildsycoca.cpp @@ -42,12 +42,12 @@ #include #include #include -#include +#include #include #include #include #include -#include +#include #include #include #include @@ -55,7 +55,7 @@ #ifdef KBUILDSYCOCA_GUI // KBUILDSYCOCA_GUI is used on win32 to build // GUI version of tdebuildsycoca, so-called "tdebuildsycocaw". # include -# include +# include bool silent; bool showprogress; #endif diff --git a/kded/vfolder_menu.cpp b/kded/vfolder_menu.cpp index e2dc603ba..408c6af9a 100644 --- a/kded/vfolder_menu.cpp +++ b/kded/vfolder_menu.cpp @@ -23,7 +23,7 @@ #include // getenv #include -#include +#include #include #include #include -- cgit v1.2.1