diff --git a/dataengines/weather/ions/data/noaa_i18n.dat b/dataengines/weather/ions/data/noaa_i18n.dat index c56303795..2a6d18241 100644 --- a/dataengines/weather/ions/data/noaa_i18n.dat +++ b/dataengines/weather/ions/data/noaa_i18n.dat @@ -1,355 +1,356 @@ weather condition|A Few Clouds weather condition|A Few Clouds and Breezy weather condition|A Few Clouds and Windy weather condition|A Few Clouds with Haze weather condition|Blowing Dust weather condition|Blowing Sand weather condition|Blowing Snow weather condition|Blowing Snow in Vicinity weather condition|Breezy weather condition|Clear weather condition|Clear and Breezy weather condition|Clear with Haze weather condition|Drizzle weather condition|Drizzle Fog weather condition|Drizzle Fog/Mist weather condition|Drizzle Ice Pellets weather condition|Drizzle Snow weather condition|Dust weather condition|Dust/Sand Whirls weather condition|Dust/Sand Whirls in Vicinity weather condition|Dust Storm weather condition|Dust Storm in Vicinity weather condition|Fair weather condition|Fair and Breezy weather condition|Fair and Windy weather condition|Fair with Haze weather condition|Fog weather condition|Fog in Vicinity weather condition|Fog/Mist weather condition|Freezing Drizzle weather condition|Freezing Drizzle in Vicinity weather condition|Freezing Drizzle Rain weather condition|Freezing Drizzle Snow weather condition|Freezing Fog weather condition|Freezing Fog in Vicinity weather condition|Freezing Rain weather condition|Freezing Rain in Vicinity weather condition|Freezing Rain Rain weather condition|Freezing Rain Snow weather condition|Funnel Cloud weather condition|Funnel Cloud in Vicinity weather condition|Hail weather condition|Hail Showers weather condition|Haze weather condition|Heavy Blowing Snow weather condition|Heavy Drizzle weather condition|Heavy Drizzle Fog weather condition|Heavy Drizzle Fog/Mist weather condition|Heavy Drizzle Ice Pellets weather condition|Heavy Drizzle Snow weather condition|Heavy Dust Storm weather condition|Heavy Freezing Drizzle weather condition|Heavy Freezing Drizzle Rain weather condition|Heavy Freezing Drizzle Snow weather condition|Heavy Freezing Fog weather condition|Heavy Freezing Rain weather condition|Heavy Freezing Rain Rain weather condition|Heavy Freezing Rain Snow weather condition|Heavy Ice Pellets weather condition|Heavy Ice Pellets Drizzle weather condition|Heavy Ice Pellets Rain weather condition|Heavy Rain weather condition|Heavy Rain Fog weather condition|Heavy Rain Fog/Mist weather condition|Heavy Rain Freezing Drizzle weather condition|Heavy Rain Freezing Rain weather condition|Heavy Rain Ice Pellets weather condition|Heavy Rain Showers weather condition|Heavy Rain Showers Fog/Mist weather condition|Heavy Rain Snow weather condition|Heavy Sand Storm weather condition|Heavy Showers Rain weather condition|Heavy Showers Rain Fog/Mist weather condition|Heavy Showers Snow weather condition|Heavy Showers Snow Fog weather condition|Heavy Showers Snow Fog/Mist weather condition|Heavy small Hail/Snow Pellets weather condition|Heavy Snow weather condition|Heavy Snow Blowing Snow weather condition|Heavy Snow Fog weather condition|Heavy Snow Fog/Mist weather condition|Heavy Snow Freezing Drizzle weather condition|Heavy Snow Freezing Rain weather condition|Heavy Snow Grains weather condition|Heavy Snow Low Drifting Snow weather condition|Heavy Snow Rain weather condition|Heavy Snow Showers weather condition|Heavy Snow Showers Fog weather condition|Heavy Snow Showers Fog/Mist weather condition|Heavy Thunderstorm Rain weather condition|Heavy Thunderstorm Rain Fog weather condition|Heavy Thunderstorm Rain Fog and Windy weather condition|Heavy Thunderstorm Rain Fog/Mist weather condition|Heavy Thunderstorm Rain Hail weather condition|Heavy Thunderstorm Rain Hail Fog weather condition|Heavy Thunderstorm Rain Hail Fog/Hail weather condition|Heavy Thunderstorm Rain Hail Haze weather condition|Heavy Thunderstorm Rain Haze weather condition|Heavy Thunderstorm Rain Small Hail/Snow Pellets weather condition|Heavy Thunderstorm Snow weather condition|Ice Crystals weather condition|Ice Pellets weather condition|Ice Pellets Drizzle weather condition|Ice Pellets in Vicinity weather condition|Ice Pellets Rain weather condition|Light Drizzle weather condition|Light Drizzle Fog weather condition|Light Drizzle Fog/Mist weather condition|Light Drizzle Ice Pellets weather condition|Light Drizzle Snow weather condition|Light Freezing Drizzle weather condition|Light Freezing Drizzle Rain weather condition|Light Freezing Drizzle Snow weather condition|Light Freezing Fog weather condition|Light Freezing Rain weather condition|Light Freezing Rain Rain weather condition|Light Freezing Rain Snow weather condition|Light Ice Pellets weather condition|Light Ice Pellets Drizzle weather condition|Light Ice Pellets Rain weather condition|Light Rain weather condition|Light Rain and Breezy weather condition|Light Rain Fog weather condition|Light Rain Fog/Mist weather condition|Light Rain Freezing Drizzle weather condition|Light Rain Freezing Rain weather condition|Light Rain Ice Pellets weather condition|Light Rain Showers weather condition|Light Rain Showers Fog/Mist weather condition|Light Rain Snow weather condition|Light Showers Rain weather condition|Light Showers Rain Fog/Mist weather condition|Light Showers Snow weather condition|Light Showers Snow Fog weather condition|Light Showers Snow Fog/Mist weather condition|Light Small Hail/Snow Pellets weather condition|Light Snow weather condition|Light Snow Blowing Snow weather condition|Light Snow Blowing Snow Fog/Mist weather condition|Light Snow Drizzle weather condition|Light Snow Fog weather condition|Light Snow Fog/Mist weather condition|Light Snow Freezing Drizzle weather condition|Light Snow Freezing Rain weather condition|Light Snow Grains weather condition|Light Snow Low Drifting Snow weather condition|Light Snow Rain weather condition|Light Snow Showers weather condition|Light Snow Showers Fog weather condition|Light Snow Showers Fog/Mist weather condition|Light Thunderstorm Rain weather condition|Light Thunderstorm Rain Fog weather condition|Light Thunderstorm Rain Fog/Mist weather condition|Light Thunderstorm Rain Hail weather condition|Light Thunderstorm Rain Hail Fog weather condition|Light Thunderstorm Rain Hail Fog/Mist weather condition|Light Thunderstorm Rain Hail Haze weather condition|Light Thunderstorm Rain Haze weather condition|Light Thunderstorm Rain Small Hail/Snow Pellets weather condition|Light Thunderstorm Snow weather condition|Low Drifting Dust weather condition|Low Drifting Sand weather condition|Low Drifting Snow weather condition|Mostly Cloudy weather condition|Mostly Cloudy and Breezy weather condition|Mostly Cloudy and Windy weather condition|Mostly Cloudy with Haze weather condition|Overcast weather condition|Overcast and Breezy weather condition|Overcast and Windy weather condition|Overcast with Haze weather condition|Partial Fog weather condition|Partial Fog in Vicinity weather condition|Partly Cloudy weather condition|Partly Cloudy and Breezy weather condition|Partly Cloudy and Windy weather condition|Partly Cloudy with Haze weather condition|Patchy Freezing Fog weather condition|Patches of Fog weather condition|Patches of Fog in Vicinity weather condition|Rain Fog weather condition|Rain Fog/Mist weather condition|Rain Freezing Drizzle weather condition|Rain Freezing Rain weather condition|Rain Ice Pellets weather condition|Rain Showers weather condition|Rain Showers Fog/Mist weather condition|Rain Showers in Vicinity weather condition|Rain Showers in Vicinity Fog/Mist weather condition|Rain Snow weather condition|Sand weather condition|Sand Storm weather condition|Sand Storm in Vicinity weather condition|Shallow Fog weather condition|Shallow Fog in Vicinity weather condition|Showers Hail weather condition|Showers Ice Pellets weather condition|Showers in Vicinity Fog weather condition|Showers in Vicinity Snow weather condition|Showers Rain weather condition|Showers Rain Fog/Mist weather condition|Showers Rain in Vicinity weather condition|Showers Rain in Vicinity Fog/Mist weather condition|Showers Snow weather condition|Showers Snow Fog weather condition|Showers Snow Fog/Mist weather condition|Small Hail/Snow Pellets weather condition|Smoke weather condition|Snow weather condition|Snow Blowing Snow weather condition|Snow Drizzle weather condition|Snow Fog weather condition|Snow Fog/Mist weather condition|Snow Freezing Drizzle weather condition|Snow Freezing Rain weather condition|Snow Grains weather condition|Snow Low Drifting Snow weather condition|Snow Rain weather condition|Snow Showers weather condition|Snow Showers Fog weather condition|Snow Showers Fog/Mist weather condition|Snow Showers in Vicinity weather condition|Snow Showers in Vicinity Fog weather condition|Snow Showers in Vicinity Fog/Mist weather condition|Thunderstorm weather condition|Thunderstorm Fog weather condition|Thunderstorm Hail weather condition|Thunderstorm Hail Fog weather condition|Thunderstorm Haze in Vicinity weather condition|Thunderstorm Haze in Vicinity Hail weather condition|Thunderstorm Heavy Rain weather condition|Thunderstorm Heavy Rain Fog weather condition|Thunderstorm Heavy Rain Fog/Mist weather condition|Thunderstorm Heavy Rain Hail weather condition|Thunderstorm Heavy Rain Hail Fog weather condition|Thunderstorm Heavy Rain Hail Fog/Mist weather condition|Thunderstorm Heavy Rain Hail Haze weather condition|Thunderstorm Heavy Rain Haze weather condition|Thunderstorm Ice Pellets weather condition|Thunderstorm in Vicinity weather condition|Thunderstorm in Vicinity Fog weather condition|Thunderstorm in Vicinity Fog/Mist weather condition|Thunderstorm in Vicinity Hail weather condition|Thunderstorm in Vicinity Hail Haze weather condition|Thunderstorm in Vicinity Haze weather condition|Thunderstorm Light Rain weather condition|Thunderstorm Light Rain Fog weather condition|Thunderstorm Light Rain Fog/Mist weather condition|Thunderstorm Light Rain Hail weather condition|Thunderstorm Light Rain Hail Fog weather condition|Thunderstorm Light Rain Hail Fog/Mist weather condition|Thunderstorm Light Rain Hail Haze weather condition|Thunderstorm Light Rain Haze weather condition|Thunderstorm Rain weather condition|Thunderstorm Rain Fog/Mist weather condition|Thunderstorm Rain Hail Fog/Mist weather condition|Thunderstorm Rain Small Hail/Snow Pellets weather condition|Thunderstorm Showers in Vicinity weather condition|Thunderstorm Showers in Vicinity Hail weather condition|Thunderstorm Small Hail/Snow Pellets weather condition|Thunderstorm Snow weather condition|Tornado/Water Spout weather condition|Windy weather condition|N/A weather forecast|Ice Crystals weather forecast|Volcanic Ash weather forecast|Water Spout weather forecast|Freezing Spray weather forecast|Frost weather forecast|Slight Chance Thunderstorms weather forecast|Chance Thunderstorms weather forecast|Thunderstorms Likely weather forecast|Thunderstorms weather forecast|Severe Tstms weather forecast|Slight Chance Snow/Sleet weather forecast|Chance Snow/Sleet weather forecast|Snow/Sleet Likely weather forecast|Snow/Sleet weather forecast|Slight Chance Rain/Sleet weather forecast|Chance Rain/Sleet weather forecast|Rain/Sleet Likely weather forecast|Rain/Sleet weather forecast|Slight Chance Rain/Freezing Rain weather forecast|Chance Rain/Freezing Rain weather forecast|Rain/Freezing Rain Likely weather forecast|Rain/Freezing Rain +weather forecast|Wintry Mix Likely weather forecast|Wintry Mix weather forecast|Slight Chance Freezing Drizzle weather forecast|Chance Freezing Drizzle weather forecast|Freezing Drizzle Likely weather forecast|Freezing Drizzle weather forecast|Slight Chance Freezing Rain weather forecast|Chance Freezing Rain weather forecast|Freezing Rain Likely weather forecast|Freezing Rain weather forecast|Slight Chance Rain/Snow weather forecast|Chance Rain/Snow weather forecast|Rain/Snow Likely weather forecast|Rain/Snow weather forecast|Slight Chance Snow weather forecast|Chance Snow weather forecast|Snow Likely weather forecast|Snow weather forecast|Heavy Snow weather forecast|Slight Chance Flurries weather forecast|Chance Flurries weather forecast|Flurries Likely weather forecast|Flurries weather forecast|Slight Chance Snow Showers weather forecast|Chance Snow Showers weather forecast|Snow Showers Likely weather forecast|Snow Showers weather forecast|Slight Chance Drizzle weather forecast|Chance Drizzle weather forecast|Drizzle Likely weather forecast|Drizzle weather forecast|Slight Chance Rain weather forecast|Chance Rain weather forecast|Rain Likely weather forecast|Rain weather forecast|Heavy Rain weather forecast|Slight Chance Rain Showers weather forecast|Chance Rain Showers weather forecast|Rain Showers Likely weather forecast|Rain Showers weather forecast|Sleet weather forecast|Smoke weather forecast|Freezing Fog weather forecast|Ice Fog weather forecast|Haze weather forecast|Blowing Sand weather forecast|Blowing Dust weather forecast|Blowing Snow weather forecast|Dense Fog weather forecast|Fog weather forecast|Windy weather forecast|Blustery weather forecast|Breezy weather forecast|Cold weather forecast|Hot weather forecast|Cloudy weather forecast|Mostly Cloudy weather forecast|Partly Cloudy weather forecast|Mostly Sunny weather forecast|Partly Sunny weather forecast|Sunny weather forecast|Increasing Clouds weather forecast|Becoming Cloudy weather forecast|Clearing weather forecast|Gradual Clearing weather forecast|Clearing Late weather forecast|Decreasing Clouds weather forecast|Becoming Sunny weather forecast|Clear weather forecast|Mostly Clear diff --git a/kioslave/applications/kio_applications.cpp b/kioslave/applications/kio_applications.cpp index 849f39f51..b24948e3e 100644 --- a/kioslave/applications/kio_applications.cpp +++ b/kioslave/applications/kio_applications.cpp @@ -1,198 +1,197 @@ /* This file is part of the KDE project Copyright (C) 2003 Joseph Wenninger This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 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 #include #include #include class ApplicationsProtocol : public KIO::SlaveBase { public: enum RunMode { ProgramsMode, ApplicationsMode }; ApplicationsProtocol(const QByteArray &protocol, const QByteArray &pool, const QByteArray &app); ~ApplicationsProtocol() override; void get( const QUrl& url ) override; void stat(const QUrl& url) override; void listDir(const QUrl& url) override; private: RunMode m_runMode; }; extern "C" { Q_DECL_EXPORT int kdemain( int argc, char **argv ) { QCoreApplication app(argc, argv); app.setApplicationName( "kio_applications" ); ApplicationsProtocol slave(argv[1], argv[2], argv[3]); slave.dispatchLoop(); return 0; } } static void createFileEntry(KIO::UDSEntry& entry, const KService::Ptr& service, const QUrl& parentUrl) { entry.clear(); entry.insert(KIO::UDSEntry::UDS_NAME, KIO::encodeFileName(service->name())); entry.insert(KIO::UDSEntry::UDS_FILE_TYPE, S_IFREG); const QString fileUrl = parentUrl.url() + '/' + service->desktopEntryName(); entry.insert(KIO::UDSEntry::UDS_URL, fileUrl); entry.insert(KIO::UDSEntry::UDS_ACCESS, 0500); entry.insert(KIO::UDSEntry::UDS_MIME_TYPE, QStringLiteral("application/x-desktop")); entry.insert(KIO::UDSEntry::UDS_SIZE, 0); const QString localPath = QStandardPaths::locate(QStandardPaths::ApplicationsLocation, QStringLiteral("%1.desktop").arg(service->desktopEntryName())); entry.insert(KIO::UDSEntry::UDS_LOCAL_PATH, localPath); entry.insert(KIO::UDSEntry::UDS_MODIFICATION_TIME, time(nullptr)); entry.insert(KIO::UDSEntry::UDS_ICON_NAME, service->icon()); } static void createDirEntry(KIO::UDSEntry& entry, const QString& name, const QString& url, const QString& mime, const QString& iconName) { entry.clear(); entry.insert( KIO::UDSEntry::UDS_NAME, name ); entry.insert( KIO::UDSEntry::UDS_FILE_TYPE, S_IFDIR ); entry.insert( KIO::UDSEntry::UDS_ACCESS, 0500 ); entry.insert( KIO::UDSEntry::UDS_MIME_TYPE, mime ); if (!url.isEmpty()) entry.insert( KIO::UDSEntry::UDS_URL, url ); entry.insert( KIO::UDSEntry::UDS_ICON_NAME, iconName ); } ApplicationsProtocol::ApplicationsProtocol( const QByteArray &protocol, const QByteArray &pool, const QByteArray &app) : SlaveBase( protocol, pool, app ) { // Adjusts which part of the K Menu to virtualize. if ( protocol == "programs" ) m_runMode = ProgramsMode; else // if (protocol == "applications") m_runMode = ApplicationsMode; } ApplicationsProtocol::~ApplicationsProtocol() { } void ApplicationsProtocol::get( const QUrl & url ) { KService::Ptr service = KService::serviceByDesktopName(url.fileName()); if (service && service->isValid()) { const QString localPath = QStandardPaths::locate(QStandardPaths::ApplicationsLocation, QStringLiteral("%1.desktop").arg(service->desktopEntryName())); QUrl redirUrl(QUrl::fromLocalFile(localPath)); redirection(redirUrl); finished(); } else { error( KIO::ERR_IS_DIRECTORY, url.toDisplayString() ); } } void ApplicationsProtocol::stat(const QUrl& url) { KIO::UDSEntry entry; QString servicePath( url.path() ); if(!servicePath.endsWith('/')) servicePath.append('/'); servicePath.remove(0, 1); // remove starting '/' KServiceGroup::Ptr grp = KServiceGroup::group(servicePath); if (grp && grp->isValid()) { createDirEntry(entry, ((m_runMode==ApplicationsMode) ? i18n("Applications") : i18n("Programs")), url.url(), QStringLiteral("inode/directory"), grp->icon() ); } else { KService::Ptr service = KService::serviceByDesktopName( url.fileName() ); if (service && service->isValid()) { createFileEntry(entry, service, url ); } else { error(KIO::ERR_SLAVE_DEFINED, i18n("Unknown application folder")); return; } } statEntry(entry); finished(); } void ApplicationsProtocol::listDir(const QUrl& url) { QString groupPath = url.path(); if(!groupPath.endsWith('/')) groupPath.append('/'); groupPath.remove(0, 1); // remove starting '/' KServiceGroup::Ptr grp = KServiceGroup::group(groupPath); if (!grp || !grp->isValid()) { error(KIO::ERR_DOES_NOT_EXIST, groupPath); return; } unsigned int count = 0; KIO::UDSEntry entry; foreach (const KSycocaEntry::Ptr &e, grp->entries(true, true)) { if (e->isType(KST_KServiceGroup)) { KServiceGroup::Ptr g(static_cast(e.data())); //qDebug() << "ADDING SERVICE GROUP WITH PATH " << g->relPath(); // Avoid adding empty groups. KServiceGroup::Ptr subMenuRoot = KServiceGroup::group(g->relPath()); if (subMenuRoot->childCount() == 0) continue; // Ignore dotfiles. if (g->name().startsWith('.')) continue; QString relPath = g->relPath(); QUrl dirUrl = url; // preserve protocol, whether that's programs:/ or applications:/ dirUrl.setPath('/' + relPath); dirUrl = dirUrl.adjusted(QUrl::StripTrailingSlash); //qDebug() << "ApplicationsProtocol: adding entry" << dirUrl; createDirEntry(entry, g->caption(), dirUrl.url(), QStringLiteral("inode/directory"), g->icon()); } else { KService::Ptr service(static_cast(e.data())); //qDebug() << "the entry name is" << service->desktopEntryName() // << "with path" << service->entryPath(); if (!service->isApplication()) // how could this happen? continue; createFileEntry(entry, service, url); } listEntry(entry); count++; } totalSize(count); - listEntry(entry); finished(); }