Fix TestXdgShellClient::testDesktopFileName
Summary: Allows AbstractClient::m_desktopFileName be an absolute path, which is used by tests. Test Plan: Test passes, other things still work, including telegram. Reviewers: #kwin, zzag Reviewed By: #kwin, zzag Subscribers: kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D29758
This commit is contained in:
parent
d6e119f49e
commit
5b5a9957a5
1 changed files with 11 additions and 2 deletions
|
@ -43,6 +43,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
|
||||
#include <KDesktopFile>
|
||||
|
||||
#include <QDir>
|
||||
#include <QMouseEvent>
|
||||
#include <QStyleHints>
|
||||
|
||||
|
@ -2545,8 +2546,16 @@ void AbstractClient::setDesktopFileName(QByteArray name)
|
|||
QString AbstractClient::iconFromDesktopFile() const
|
||||
{
|
||||
const QString desktopFileName = QString::fromUtf8(m_desktopFileName);
|
||||
QString desktopFilePath = QStandardPaths::locate(QStandardPaths::ApplicationsLocation,
|
||||
desktopFileName);
|
||||
QString desktopFilePath;
|
||||
|
||||
if (QDir::isAbsolutePath(desktopFileName)) {
|
||||
desktopFilePath = desktopFileName;
|
||||
}
|
||||
|
||||
if (desktopFilePath.isEmpty()) {
|
||||
desktopFilePath = QStandardPaths::locate(QStandardPaths::ApplicationsLocation,
|
||||
desktopFileName);
|
||||
}
|
||||
if (desktopFilePath.isEmpty()) {
|
||||
desktopFilePath = QStandardPaths::locate(QStandardPaths::ApplicationsLocation,
|
||||
desktopFileName + QLatin1String(".desktop"));
|
||||
|
|
Loading…
Reference in a new issue