diff --git a/src/services/kservice.h b/src/services/kservice.h --- a/src/services/kservice.h +++ b/src/services/kservice.h @@ -188,11 +188,20 @@ DBusStartupType dbusStartupType() const; /** - * Returns the working directory to run the program in. * @return the working directory to run the program in, * or QString() if not set + * @deprecated since 5.63, use workingDirectory() instead */ - QString path() const; +#ifndef KSERVICE_NO_DEPRECATED + KSERVICE_DEPRECATED QString path() const; // TODO KF6: rename to workingDirectory(). Confusing otherwise. +#endif + + /** + * @return the working directory to run the program in, + * or QString() if not set + * @since 5.63 + */ + QString workingDirectory() const; /** * Returns the descriptive comment for the service, if there is one. diff --git a/src/services/kservice.cpp b/src/services/kservice.cpp --- a/src/services/kservice.cpp +++ b/src/services/kservice.cpp @@ -159,7 +159,7 @@ entryMap.remove(QStringLiteral("Terminal")); m_strTerminalOptions = desktopGroup.readEntry("TerminalOptions"); // should be a property IMHO entryMap.remove(QStringLiteral("TerminalOptions")); - m_strPath = config->readPath(); + m_strWorkingDirectory = config->readPath(); entryMap.remove(QStringLiteral("Path")); m_strComment = config->readComment(); entryMap.remove(QStringLiteral("Comment")); @@ -317,7 +317,7 @@ // number in ksycoca.cpp s >> m_strType >> m_strName >> m_strExec >> m_strIcon >> term >> m_strTerminalOptions - >> m_strPath >> m_strComment >> def >> m_mapProps + >> m_strWorkingDirectory >> m_strComment >> def >> m_mapProps >> m_strLibrary >> dst >> m_strDesktopEntryName @@ -347,7 +347,7 @@ // number in ksycoca.cpp s << m_strType << m_strName << m_strExec << m_strIcon << term << m_strTerminalOptions - << m_strPath << m_strComment << def << m_mapProps + << m_strWorkingDirectory << m_strComment << def << m_mapProps << m_strLibrary << dst << m_strDesktopEntryName @@ -509,7 +509,7 @@ } else if (_name == QLatin1String("TerminalOptions")) { return makeStringVariant(m_strTerminalOptions); } else if (_name == QLatin1String("Path")) { - return makeStringVariant(m_strPath); + return makeStringVariant(m_strWorkingDirectory); } else if (_name == QLatin1String("Comment")) { return makeStringVariant(m_strComment); } else if (_name == QLatin1String("GenericName")) { @@ -913,9 +913,17 @@ QString KService::path() const { Q_D(const KService); - return d->m_strPath; + return d->m_strWorkingDirectory; } +#ifndef KSERVICE_NO_DEPRECATED +QString KService::workingDirectory() const +{ + Q_D(const KService); + return d->m_strWorkingDirectory; +} +#endif + QString KService::comment() const { Q_D(const KService); diff --git a/src/services/kservice_p.h b/src/services/kservice_p.h --- a/src/services/kservice_p.h +++ b/src/services/kservice_p.h @@ -80,7 +80,7 @@ QString m_strExec; QString m_strIcon; QString m_strTerminalOptions; - QString m_strPath; + QString m_strWorkingDirectory; QString m_strComment; QString m_strLibrary;