GUI: Rename methods.
We don't need the 'type' postfix. We are handling applications, not application types.
This commit is contained in:
parent
e6e616e542
commit
166e5248db
|
@ -52,14 +52,14 @@ void ApplicationList::LoadSettings(QSettings *programSettings)
|
|||
// use as default for gnome environments
|
||||
if (QFileInfo("/usr/bin/gedit").isExecutable())
|
||||
{
|
||||
AddApplicationType("gedit", "/usr/bin/gedit +(line) (file)");
|
||||
AddApplication("gedit", "/usr/bin/gedit +(line) (file)");
|
||||
defapp = 0;
|
||||
break;
|
||||
}
|
||||
// use as default for kde environments
|
||||
if (QFileInfo("/usr/bin/kate").isExecutable())
|
||||
{
|
||||
AddApplicationType("kate", "/usr/bin/kate -l(line) (file)");
|
||||
AddApplication("kate", "/usr/bin/kate -l(line) (file)");
|
||||
defapp = 0;
|
||||
break;
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ void ApplicationList::LoadSettings(QSettings *programSettings)
|
|||
{
|
||||
for (int i = 0; i < names.size(); i++)
|
||||
{
|
||||
AddApplicationType(names[i], paths[i]);
|
||||
AddApplication(names[i], paths[i]);
|
||||
}
|
||||
mDefaultApplicationIndex = 1;
|
||||
}
|
||||
|
@ -126,7 +126,7 @@ QString ApplicationList::GetApplicationPath(const int index) const
|
|||
|
||||
}
|
||||
|
||||
void ApplicationList::SetApplicationType(const int index,
|
||||
void ApplicationList::SetApplication(const int index,
|
||||
const QString &name,
|
||||
const QString &path)
|
||||
{
|
||||
|
@ -137,7 +137,7 @@ void ApplicationList::SetApplicationType(const int index,
|
|||
}
|
||||
}
|
||||
|
||||
void ApplicationList::AddApplicationType(const QString &name, const QString &path)
|
||||
void ApplicationList::AddApplication(const QString &name, const QString &path)
|
||||
{
|
||||
if (name.isEmpty() || path.isEmpty())
|
||||
{
|
||||
|
@ -163,7 +163,7 @@ void ApplicationList::SetDefault(const int index)
|
|||
}
|
||||
}
|
||||
|
||||
void ApplicationList::Copy(ApplicationList *list)
|
||||
void ApplicationList::Copy(const ApplicationList *list)
|
||||
{
|
||||
if (!list)
|
||||
{
|
||||
|
@ -173,7 +173,7 @@ void ApplicationList::Copy(ApplicationList *list)
|
|||
Clear();
|
||||
for (int i = 0; i < list->GetApplicationCount(); i++)
|
||||
{
|
||||
AddApplicationType(list->GetApplicationName(i), list->GetApplicationPath(i));
|
||||
AddApplication(list->GetApplicationName(i), list->GetApplicationPath(i));
|
||||
}
|
||||
mDefaultApplicationIndex = list->GetDefaultApplication();
|
||||
}
|
||||
|
@ -190,7 +190,7 @@ bool ApplicationList::FindDefaultWindowsEditor()
|
|||
const QString notepadppPath = appPath + "\\Notepad++\\notepad++.exe";
|
||||
if (QFileInfo(notepadppPath).isExecutable())
|
||||
{
|
||||
AddApplicationType("Notepad++", "\"" + notepadppPath + "\" -n(line) (file)");
|
||||
AddApplication("Notepad++", "\"" + notepadppPath + "\" -n(line) (file)");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -198,7 +198,7 @@ bool ApplicationList::FindDefaultWindowsEditor()
|
|||
const QString notepadPath = windowsPath + "\\system32\\notepad.exe";
|
||||
if (QFileInfo(notepadPath).isExecutable())
|
||||
{
|
||||
AddApplicationType("Notepad", notepadPath + " (file)");
|
||||
AddApplication("Notepad", notepadPath + " (file)");
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -122,8 +122,7 @@ public:
|
|||
* @param name New name for the application
|
||||
* @param path New path for the application
|
||||
*/
|
||||
void SetApplicationType(const int index,
|
||||
const QString &name,
|
||||
void SetApplication(const int index, const QString &name,
|
||||
const QString &path);
|
||||
|
||||
/**
|
||||
|
@ -132,7 +131,7 @@ public:
|
|||
* @param name Name of the application
|
||||
* @param path Path to the application
|
||||
*/
|
||||
void AddApplicationType(const QString &name, const QString &path);
|
||||
void AddApplication(const QString &name, const QString &path);
|
||||
|
||||
/**
|
||||
* @brief Remove an application from the list
|
||||
|
@ -152,7 +151,7 @@ public:
|
|||
* list given as a parameter.
|
||||
* @param list Copying source
|
||||
*/
|
||||
void Copy(ApplicationList *list);
|
||||
void Copy(const ApplicationList *list);
|
||||
|
||||
protected:
|
||||
|
||||
|
|
|
@ -202,7 +202,7 @@ void SettingsDialog::AddApplication()
|
|||
|
||||
if (dialog.exec() == QDialog::Accepted)
|
||||
{
|
||||
mTempApplications->AddApplicationType(dialog.GetName(), dialog.GetPath());
|
||||
mTempApplications->AddApplication(dialog.GetName(), dialog.GetPath());
|
||||
mUI.mListWidget->addItem(dialog.GetName());
|
||||
}
|
||||
}
|
||||
|
@ -240,7 +240,7 @@ void SettingsDialog::EditApplication()
|
|||
|
||||
if (dialog.exec() == QDialog::Accepted)
|
||||
{
|
||||
mTempApplications->SetApplicationType(row, dialog.GetName(), dialog.GetPath());
|
||||
mTempApplications->SetApplication(row, dialog.GetName(), dialog.GetPath());
|
||||
item->setText(dialog.GetName());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue