mirror of
https://github.com/tnodir/fort
synced 2024-11-15 05:57:57 +00:00
UI: Programs: Improve name of wildcard paths
This commit is contained in:
parent
89ee96ba1f
commit
f200563ee4
@ -196,19 +196,13 @@ void ConfAppManager::updateAppEndTimer()
|
||||
|
||||
bool ConfAppManager::addAppPathBlocked(App &app)
|
||||
{
|
||||
// app.blocked
|
||||
// app.alerted
|
||||
// app.groupIndex
|
||||
// app.appOriginPath
|
||||
// app.scheduleAction
|
||||
|
||||
app.appId = appIdByPath(app.appOriginPath, app.appPath);
|
||||
|
||||
if (app.appId > 0)
|
||||
return false; // already added by user
|
||||
return false; // already exists
|
||||
|
||||
app.isWildcard = ConfUtil::matchWildcard(app.appPath).hasMatch();
|
||||
app.appName = IoC<AppInfoCache>()->appName(app.appPath);
|
||||
app.appName = app.isWildcard ? app.appOriginPath : IoC<AppInfoCache>()->appName(app.appPath);
|
||||
|
||||
const bool ok = addOrUpdateApp(app);
|
||||
if (ok) {
|
||||
|
@ -708,16 +708,16 @@ QLayout *ProgramEditDialog::setupButtonsLayout()
|
||||
|
||||
void ProgramEditDialog::fillEditName()
|
||||
{
|
||||
auto appPath = getEditText();
|
||||
const QString appPath = getEditText();
|
||||
if (appPath.isEmpty())
|
||||
return;
|
||||
|
||||
QString appName;
|
||||
if (isWildcard()) {
|
||||
appName = appPath.left(64).replace('\n', ' ');
|
||||
appName = StringUtil::firstLine(appPath);
|
||||
} else {
|
||||
appPath = FileUtil::normalizePath(appPath);
|
||||
appName = IoC<AppInfoCache>()->appName(appPath);
|
||||
const QString normPath = FileUtil::normalizePath(appPath);
|
||||
appName = IoC<AppInfoCache>()->appName(normPath);
|
||||
}
|
||||
|
||||
m_editName->setStartText(appName);
|
||||
|
Loading…
Reference in New Issue
Block a user