File indexing completed on 2024-04-28 04:00:49

0001 /*
0002     SPDX-FileCopyrightText: 2014 Alejandro Fiestas Olivares <afiestas@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005 */
0006 
0007 #include "logindinhibitionargument.h"
0008 
0009 #include <QStringList>
0010 
0011 using namespace Solid;
0012 
0013 QString LogindInhibitionArgument::fromPowerState(Power::InhibitionTypes states)
0014 {
0015     QStringList args;
0016     if (states | Power::Sleep) {
0017         args << QStringLiteral("sleep");
0018     }
0019     if (states | Power::Shutdown) {
0020         args << QStringLiteral("shutdown");
0021     }
0022     return args.join(QChar(':'));
0023 }