mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-24 02:42:48 +00:00
kinit: autostart optimizations
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
4fb8a1d674
commit
74ba680406
1 changed files with 9 additions and 6 deletions
|
@ -21,6 +21,7 @@
|
||||||
#include "kstandarddirs.h"
|
#include "kstandarddirs.h"
|
||||||
#include "kservice.h"
|
#include "kservice.h"
|
||||||
#include "kautostart.h"
|
#include "kautostart.h"
|
||||||
|
#include "kshell.h"
|
||||||
#include "kdebug.h"
|
#include "kdebug.h"
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
@ -83,6 +84,7 @@ KLauncherAdaptor::~KLauncherAdaptor()
|
||||||
void KLauncherAdaptor::autoStart(int phase)
|
void KLauncherAdaptor::autoStart(int phase)
|
||||||
{
|
{
|
||||||
if (m_autostart.isEmpty()) {
|
if (m_autostart.isEmpty()) {
|
||||||
|
kDebug() << "finding autostart desktop files" << phase;
|
||||||
m_autostart = KGlobal::dirs()->findAllResources(
|
m_autostart = KGlobal::dirs()->findAllResources(
|
||||||
"autostart",
|
"autostart",
|
||||||
QString::fromLatin1("*.desktop"),
|
QString::fromLatin1("*.desktop"),
|
||||||
|
@ -92,17 +94,18 @@ void KLauncherAdaptor::autoStart(int phase)
|
||||||
|
|
||||||
kDebug() << "autostart phase" << phase;
|
kDebug() << "autostart phase" << phase;
|
||||||
foreach(const QString &it, m_autostart) {
|
foreach(const QString &it, m_autostart) {
|
||||||
|
kDebug() << "checking autostart" << it;
|
||||||
KAutostart kautostart(it);
|
KAutostart kautostart(it);
|
||||||
if (!kautostart.autostarts(QString::fromLatin1("KDE"), KAutostart::CheckAll)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (kautostart.startPhase() != phase) {
|
if (kautostart.startPhase() != phase) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
KService kservice(it);
|
if (!kautostart.autostarts(QString::fromLatin1("KDE"), KAutostart::CheckAll)) {
|
||||||
QStringList programandargs = KRun::processDesktopExec(kservice, KUrl::List());
|
kDebug() << "not autostarting" << it;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
QStringList programandargs = KShell::splitArgs(kautostart.command());
|
||||||
if (programandargs.isEmpty()) {
|
if (programandargs.isEmpty()) {
|
||||||
kWarning() << "could not process service" << kservice.entryPath();
|
kWarning() << "could not process autostart" << it;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
const QString program = programandargs.takeFirst();
|
const QString program = programandargs.takeFirst();
|
||||||
|
|
Loading…
Add table
Reference in a new issue