Changeset View
Changeset View
Standalone View
Standalone View
libtaskmanager/tasktools.cpp
Show First 20 Lines • Show All 524 Lines • ▼ Show 20 Line(s) | 522 | { | |||
---|---|---|---|---|---|
525 | 525 | | |||
526 | if (!rulesConfig) { | 526 | if (!rulesConfig) { | ||
527 | return services; | 527 | return services; | ||
528 | } | 528 | } | ||
529 | 529 | | |||
530 | const int firstSpace = cmdLine.indexOf(' '); | 530 | const int firstSpace = cmdLine.indexOf(' '); | ||
531 | int slash = 0; | 531 | int slash = 0; | ||
532 | 532 | | |||
533 | services = KServiceTypeTrader::self()->query(QStringLiteral("Application"), QStringLiteral("exist Exec and ('%1' =~ Exec)").arg(cmdLine)); | 533 | services = KServiceTypeTrader::self()->query(QStringLiteral("Application"), QStringLiteral("exist Exec and ('%1' ~~ Exec)").arg(cmdLine)); | ||
534 | 534 | | |||
535 | if (services.isEmpty()) { | 535 | if (services.isEmpty()) { | ||
536 | // Could not find with complete command line, so strip out the path part ... | 536 | // Could not find with complete command line, so strip out the path part ... | ||
537 | slash = cmdLine.lastIndexOf('/', firstSpace); | 537 | slash = cmdLine.lastIndexOf('/', firstSpace); | ||
538 | 538 | | |||
539 | if (slash > 0) { | 539 | if (slash > 0) { | ||
540 | services = KServiceTypeTrader::self()->query(QStringLiteral("Application"), QStringLiteral("exist Exec and ('%1' =~ Exec)").arg(cmdLine.mid(slash + 1))); | 540 | services = KServiceTypeTrader::self()->query(QStringLiteral("Application"), QStringLiteral("exist Exec and ('%1' ~~ Exec)").arg(cmdLine.mid(slash + 1))); | ||
541 | } | 541 | } | ||
542 | } | 542 | } | ||
543 | 543 | | |||
544 | if (services.isEmpty() && firstSpace > 0) { | 544 | if (services.isEmpty() && firstSpace > 0) { | ||
545 | // Could not find with arguments, so try without ... | 545 | // Could not find with arguments, so try without ... | ||
546 | cmdLine = cmdLine.left(firstSpace); | 546 | cmdLine = cmdLine.left(firstSpace); | ||
547 | 547 | | |||
548 | services = KServiceTypeTrader::self()->query(QStringLiteral("Application"), QStringLiteral("exist Exec and ('%1' =~ Exec)").arg(cmdLine)); | 548 | services = KServiceTypeTrader::self()->query(QStringLiteral("Application"), QStringLiteral("exist Exec and ('%1' ~~ Exec)").arg(cmdLine)); | ||
549 | 549 | | |||
550 | if (services.isEmpty()) { | 550 | if (services.isEmpty()) { | ||
551 | slash = cmdLine.lastIndexOf('/'); | 551 | slash = cmdLine.lastIndexOf('/'); | ||
552 | 552 | | |||
553 | if (slash > 0) { | 553 | if (slash > 0) { | ||
554 | services = KServiceTypeTrader::self()->query(QStringLiteral("Application"), QStringLiteral("exist Exec and ('%1' =~ Exec)").arg(cmdLine.mid(slash + 1))); | 554 | services = KServiceTypeTrader::self()->query(QStringLiteral("Application"), QStringLiteral("exist Exec and ('%1' ~~ Exec)").arg(cmdLine.mid(slash + 1))); | ||
555 | } | 555 | } | ||
556 | } | 556 | } | ||
557 | } | 557 | } | ||
558 | 558 | | |||
559 | if (services.isEmpty()) { | 559 | if (services.isEmpty()) { | ||
560 | KConfigGroup set(rulesConfig, "Settings"); | 560 | KConfigGroup set(rulesConfig, "Settings"); | ||
561 | const QStringList &runtimes = set.readEntry("TryIgnoreRuntimes", QStringList()); | 561 | const QStringList &runtimes = set.readEntry("TryIgnoreRuntimes", QStringList()); | ||
562 | 562 | | |||
▲ Show 20 Lines • Show All 245 Lines • Show Last 20 Lines |