libtaskmanager: Match "new" at the beginning and "window" at the end in canLauchNewInstance

Actions like "new-empty-window" can be matched properly.
wilder-5.24
Fushan Wen 4 years ago committed by Nate Graham
parent 43d50c6c42
commit a410f3399c
  1. 6
      libtaskmanager/tasktools.cpp

@ -794,11 +794,7 @@ bool canLauchNewInstance(const AppData &appData)
// Hide our own action if there's already a "New Window" action
const auto actions = service->actions();
for (const KServiceAction &action : actions) {
if (action.name() == QLatin1String("NewWindow")) {
return false;
}
if (action.name() == QLatin1String("new-window")) {
if (action.name().startsWith("new", Qt::CaseInsensitive) && action.name().endsWith("window", Qt::CaseInsensitive)) {
return false;
}

Loading…
Cancel
Save